:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --glass: rgba(255, 255, 255, 0.75);
  --action: #0f172a;
  --action-text: #ffffff;
  --link: #0a58d8;
  --xp-blue: #0a58d8;
  --xp-blue-light: #3d8af7;
  --xp-green: #3c9b2e;
  --glow: rgba(61, 138, 247, 0.18);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.06), 0 16px 40px rgba(15, 23, 42, 0.12);
  --footer-link-border: rgba(148, 163, 184, 0.6);
  --divider: rgba(148, 163, 184, 0.8);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --surface: #0f172a;
    --surface-elevated: #111827;
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.25);
    --glass: rgba(15, 23, 42, 0.72);
    --action: #e2e8f0;
    --action-text: #0f172a;
    --link: #7fb8ff;
    --glow: rgba(61, 138, 247, 0.22);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
    --footer-link-border: rgba(148, 163, 184, 0.35);
    --divider: rgba(148, 163, 184, 0.55);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--surface), var(--bg)) fixed;
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
}

img {
  max-width: 100%;
  height: auto;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 16px;
  top: 12px;
  z-index: 50;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

/* Header */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

main {
  flex: 1 0 auto;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 760px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 36px;
  height: 36px;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--line);
}

@media (max-width: 420px) {
  .nav-links a {
    padding: 8px;
    font-size: 14px;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  background: var(--action);
  color: var(--action-text);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, color 0.3s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--xp-blue), var(--xp-blue-light), #7fb8ff, var(--xp-green), #7fb8ff, var(--xp-blue-light));
  background-size: 300% 300%;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn:hover {
  transform: scale(1.05);
  background: transparent;
  color: #ffffff;
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible,
.app-card:focus-within {
  outline: 2px solid var(--xp-blue-light);
  outline-offset: 3px;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-small {
  padding: 8px 14px;
  font-size: 14px;
}

.btn svg {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .btn, .btn::after, .app-card { transition: none; animation: none; }
  .btn:hover, .app-card:hover { transform: none; }
}

/* Sections */

section {
  padding: 40px 0;
}

@media (min-width: 1024px) {
  section {
    padding: 64px 0;
  }
}

h1 {
  font-size: clamp(2.2em, 6vw, 3.2em);
  margin: 0;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.section-heading {
  font-size: clamp(26px, 4vw, 32px);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.section-lead {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.lead {
  margin-top: 16px;
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 640px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(120deg, var(--xp-blue), var(--xp-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Home hero */

.home-hero {
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.icon-cloud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 380px;
  justify-self: center;
}

.icon-cloud a {
  display: block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-cloud a:nth-child(odd) {
  transform: translateY(10px);
}

.icon-cloud a:nth-child(n+17) {
  display: none;
}

.icon-cloud a:hover {
  transform: scale(1.08) rotate(-3deg);
}

.icon-cloud img {
  width: 100%;
  display: block;
}

@media (max-width: 899px) {
  .icon-cloud {
    grid-template-columns: repeat(6, 1fr);
    max-width: none;
    justify-self: stretch;
  }

  .icon-cloud a:nth-child(n+13) {
    display: none;
  }
}

/* App icon */

.app-icon {
  border-radius: 22.5%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px rgba(15, 23, 42, 0.12);
  background: var(--surface-elevated);
  aspect-ratio: 1;
  object-fit: cover;
}

/* App grid */

.app-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .app-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.app-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-card .app-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.app-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.app-card h3 a {
  color: inherit;
  text-decoration: none;
}

/* Whole card is clickable through the title link; buttons sit above it. */
.app-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card .card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

/* Support / callout */

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.callout h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.callout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.callout-stack {
  display: grid;
  gap: 20px;
}

@media (min-width: 900px) {
  .callout-stack {
    grid-template-columns: 1fr 1fr;
  }
}

/* App page hero */

.app-hero {
  display: grid;
  gap: 24px;
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .app-hero {
    grid-template-columns: auto 1fr;
    gap: 32px;
  }
}

.app-hero .app-icon {
  width: 128px;
  height: 128px;
}

@media (min-width: 640px) {
  .app-hero .app-icon {
    width: 160px;
    height: 160px;
  }
}

.app-hero h1 {
  font-size: clamp(2em, 5vw, 2.8em);
}

.app-hero .lead {
  margin-top: 12px;
}

.app-hero .cta-row {
  margin-top: 20px;
}

/* Long-form text: app descriptions, legal pages, blog posts */

.prose {
  line-height: 1.7;
  font-size: 17px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose strong {
  color: var(--ink);
}

.prose h2 {
  margin: 40px 0 12px;
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
}

.prose h3 {
  margin: 32px 0 10px;
  font-size: 19px;
  line-height: 1.35;
}

.prose h4 {
  margin: 24px 0 8px;
  font-size: 17px;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li {
  margin: 6px 0;
}

.prose li > p {
  margin: 0;
}

.prose li::marker {
  color: var(--xp-blue-light);
}

.prose figure {
  margin: 28px 0;
}

.prose img {
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.prose figcaption,
.prose figcaption p {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.prose blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--xp-blue-light);
}

.prose pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
}

.prose a {
  overflow-wrap: anywhere;
}

.card-surface {
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow);
}

.page-head {
  margin-bottom: 28px;
}

.page-head h1 {
  font-size: clamp(30px, 5vw, 42px);
}

.page-head .meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.back-link:hover {
  color: var(--ink);
}

.back-link img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

/* Blog */

.post-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.post-card .thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--line);
}

.post-card .thumb-fallback {
  aspect-ratio: 16 / 9;
  background: linear-gradient(120deg, var(--xp-blue), var(--xp-blue-light), var(--xp-green));
}

.post-card .body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-card time {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.post-card h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.post-card h2 a {
  color: inherit;
  text-decoration: none;
}

.post-card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.post-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer */

footer {
  border-top: 1px solid var(--line);
  padding: 32px 16px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 768px) {
  footer {
    flex-direction: column;
    gap: 10px;
  }

  footer > .footer-divider {
    display: none;
  }
}

footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--footer-link-border);
  padding-bottom: 2px;
}

footer a:hover,
footer a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.footer-divider {
  color: var(--divider);
  font-size: 18px;
  line-height: 1;
}

/* 404 */

.not-found {
  text-align: center;
  padding: 96px 0;
}

.not-found .cta-row {
  justify-content: center;
}
