/* Wellcast — design tokens mirrored from src/design-system/tokens */

:root {
  /* Warm neutrals (palette) */
  --cream: #FFF8F0;
  --linen: #FFF3E6;
  --parchment: #FAEBD7;
  --sand: #F5E6D3;
  --sand-dark: #E8D5C0;
  --warmGray100: #F0EBE6;
  --warmGray200: #E3DCD5;
  --warmGray300: #C9BFB5;
  --warmGray400: #A69888;
  --warmGray500: #8B7D6B;
  --warmGray600: #6B5D4D;
  --warmGray700: #4A3F33;
  --warmGray800: #352D24;
  --warmGray900: #231E18;

  /* Cozy pastels */
  --mint: #A8E6CF;
  --mint-dark: #7BC8A4;
  --mint-light: #D4F5E4;
  --peach: #FFB7B2;
  --peach-dark: #E8918B;
  --peach-light: #FFD9D6;
  --lavender: #C3B1E1;
  --lavender-dark: #9B85C4;
  --lavender-light: #E4D9F2;
  --butter: #FFE0A3;
  --butter-dark: #E6C47A;
  --butter-light: #FFF0D1;
  --sky: #A8D8EA;
  --sky-dark: #7BBCD0;
  --sky-light: #D4ECF5;
  --coral: #FF8B8B;
  --coral-dark: #E06666;
  --rose: #FFB6C1;
  --sage: #B2C9AB;
  --sage-dark: #8FAF85;
  --sage-light: #D8E8D4;

  /* Theme — light */
  --primary: #8B7EC8;
  --primary-light: #E4D9F2;
  --primary-dark: #6B5DA8;

  --bg: var(--cream);
  --surface: var(--linen);
  --card: #FFFFFF;

  --text: var(--warmGray800);
  --text-secondary: var(--warmGray500);
  --text-tertiary: var(--warmGray400);

  --border: var(--sand-dark);
  --border-light: var(--sand);

  /* Mood / energy gradient (10-point) */
  --mood-1: #E85D5D;
  --mood-2: #F07B4F;
  --mood-3: #F5A042;
  --mood-4: #F5C842;
  --mood-5: #E8D944;
  --mood-6: #C5D94A;
  --mood-7: #8ECC62;
  --mood-8: #5BBD6B;
  --mood-9: #3EB0A0;
  --mood-10: #36A3A3;

  --energy-1: #E85D5D;
  --energy-2: #F5A042;
  --energy-3: #E8D944;
  --energy-4: #5BBD6B;
  --energy-5: #36A3A3;

  /* Category colors */
  --cat-mood: var(--lavender);
  --cat-symptoms: var(--peach);
  --cat-habits: var(--mint);
  --cat-signals: #9B72CF;
  --cat-measurements: var(--sky);
  --cat-medications: var(--rose);
  --cat-gratitude: var(--butter);
  --cat-period: var(--rose);
  --cat-nutrition: var(--sage);
  --cat-sleep: #7C9CBF;

  /* Cozy shadows (port of shadows.cozy from spacing.ts) */
  --shadow-sm: 0 2px 4px rgba(74, 63, 51, 0.04);
  --shadow-md: 0 4px 8px rgba(74, 63, 51, 0.06);
  --shadow-lg: 0 6px 16px rgba(74, 63, 51, 0.08);
  --shadow-cozy: 0 8px 24px rgba(74, 63, 51, 0.05);

  /* Border radius (matches spacing.ts) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  --container: 1080px;
  --gap: 24px;

  /* Typography matches the app: system sans, no serif */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, "Helvetica Neue", Arial, sans-serif;
}

/*
 * Theme cascade:
 *   1. Default :root          -> light theme tokens
 *   2. :root[data-theme="dark"] -> dark theme (explicit JS toggle)
 *   3. :root[data-theme="light"] -> light theme (explicit JS toggle, inherits default)
 *   4. @media (prefers-color-scheme: dark) :root:not([data-theme])
 *      -> dark theme fallback when the user has NOT toggled and the OS prefers dark.
 *   The :not([data-theme]) guard ensures a JS toggle always wins over system pref.
 */
:root[data-theme="dark"] {
  --primary: #A898D8;
  --primary-light: #3D3555;
  --primary-dark: #C3B1E1;
  --bg: #1C1915;
  --surface: #252119;
  --card: #2E2A22;
  --text: #F0EBE6;
  --text-secondary: #A69888;
  --text-tertiary: #8B7D6B;
  --border: #3D362D;
  --border-light: #302A22;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.3);
  --shadow-cozy: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --primary: #A898D8;
    --primary-light: #3D3555;
    --primary-dark: #C3B1E1;
    --bg: #1C1915;
    --surface: #252119;
    --card: #2E2A22;
    --text: #F0EBE6;
    --text-secondary: #A69888;
    --text-tertiary: #8B7D6B;
    --border: #3D362D;
    --border-light: #302A22;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.3);
    --shadow-cozy: 0 8px 24px rgba(0, 0, 0, 0.25);
  }
  :root:not([data-theme]) .site-header { background: rgba(28, 25, 21, 0.88); }
  :root:not([data-theme]) .legal-page .callout { background: rgba(168, 152, 216, 0.12); }
  :root:not([data-theme]) .theme-toggle-sun { display: none; }
  :root:not([data-theme]) .theme-toggle-moon { display: inline-flex; }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; border: 0; background: 0; }

/* Type scale matches app: h1 30/700, h2 24/700, h3 20/600, body 16/400 */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(28px, 4.6vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}
p { margin: 0 0 1em; }

/* Layout */
.container {
  max-width: var(--container);
  padding: 0 24px;
  margin: 0 auto;
}
section { padding: clamp(56px, 8vw, 88px) 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 240, 0.88);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border-light);
}
:root[data-theme="dark"] .site-header { background: rgba(28, 25, 21, 0.88); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--lavender);
}
.lang-switch {
  display: flex; gap: 2px; align-items: center;
  font-size: 13px; color: var(--text-tertiary);
  font-weight: 600;
}
.lang-switch a {
  color: var(--text-tertiary);
  padding: 6px 10px; border-radius: var(--radius-sm);
  text-decoration: none;
}
.lang-switch a.active {
  color: var(--primary);
  background: var(--primary-light);
}
.lang-switch a:hover {
  color: var(--text);
  background: var(--surface);
}

/* Theme toggle (sits in the site-header where lang-switch used to live) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--card);
  border: 1px solid var(--border-light);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-size: 16px; line-height: 1;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
/* Light mode: show sun, hide moon. Dark mode: inverse. (System-pref fallback handled in the unified @media block above.) */
.theme-toggle-sun { display: inline-flex; }
.theme-toggle-moon { display: none; }
:root[data-theme="dark"] .theme-toggle-sun { display: none; }
:root[data-theme="dark"] .theme-toggle-moon { display: inline-flex; }

/* Buttons (mirror app's Button component) */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 16px;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.btn-secondary:hover { background: #d6c8ec; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--surface); }

/* Hero */
.hero {
  position: relative;
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(48px, 8vw, 96px);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(50% 50% at 80% 0%, rgba(195, 177, 225, 0.5), transparent 65%),
    radial-gradient(45% 45% at 0% 30%, rgba(168, 216, 234, 0.45), transparent 60%),
    radial-gradient(55% 55% at 100% 90%, rgba(168, 230, 207, 0.4), transparent 65%);
}
.hero .grid {
  display: grid; gap: clamp(32px, 6vw, 64px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 960px) {
  .hero .grid { grid-template-columns: 1.1fr 1fr; }
}
.hero h1 { margin-bottom: 18px; }
.hero .lede {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--text-secondary);
  max-width: 38ch;
  margin-bottom: 28px;
  line-height: 1.55;
}
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.hero .signal {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 6px 12px; border-radius: var(--radius-full);
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}
.hero .signal::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
}

/* Brand mark hero (large logo) */
.brand-art {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: var(--radius-2xl);
  background: var(--lavender);
  display: grid; place-items: center;
  box-shadow: var(--shadow-cozy);
  overflow: hidden;
}
.brand-art img { width: 78%; height: auto; }

/* Phone mockup */
.phone {
  --phone-w: 280px;
  width: var(--phone-w);
  aspect-ratio: 280 / 580;
  margin: 0 auto;
  background: var(--warmGray900);
  border-radius: 38px;
  padding: 12px;
  box-shadow: var(--shadow-cozy), 0 0 0 1px rgba(255,255,255,0.04) inset;
  position: relative;
}
.phone::before {
  content: "";
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 86px; height: 22px; background: #000; border-radius: 14px;
  z-index: 2;
}
.phone-screen {
  width: 100%; height: 100%;
  background: var(--bg);
  border-radius: 28px;
  padding: 44px 14px 14px;
  display: flex; flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
@media (min-width: 960px) { .phone { --phone-w: 320px; } }

.mockup-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text-secondary);
  padding: 5px 12px; border-radius: var(--radius-full); font-size: 12px;
  font-weight: 600;
  align-self: flex-start;
}
.mockup-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.mockup-card .head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.mockup-card .head .title { font-size: 13px; font-weight: 600; color: var(--text); }
.mockup-card .head .meta { font-size: 11px; font-weight: 500; color: var(--text-tertiary); }

/* Mood row uses real warm-to-cool gradient (mood-1..5 from app) */
.mood-row { display: flex; justify-content: space-between; gap: 4px; }
.mood-row span {
  flex: 1; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 16px;
  background: var(--surface);
  border: 1.5px solid transparent;
  color: var(--text);
  font-weight: 600;
}
.mood-row span.m1 { background: color-mix(in oklab, var(--mood-1) 30%, var(--surface)); }
.mood-row span.m3 { background: color-mix(in oklab, var(--mood-3) 30%, var(--surface)); }
.mood-row span.m5 { background: color-mix(in oklab, var(--mood-5) 30%, var(--surface)); }
.mood-row span.m7 { background: color-mix(in oklab, var(--mood-7) 30%, var(--surface)); }
.mood-row span.m10 { background: color-mix(in oklab, var(--mood-10) 30%, var(--surface)); }
.mood-row span.active {
  background: var(--mood-7);
  border-color: color-mix(in oklab, var(--mood-7) 60%, var(--text));
  transform: scale(1.1);
  color: #1F3A24;
  box-shadow: 0 4px 10px rgba(94, 188, 107, 0.3);
}

.bar {
  height: 6px; background: var(--surface); border-radius: var(--radius-full);
  overflow: hidden;
}
.bar > div { height: 100%; border-radius: var(--radius-full); }
.bar.sleep > div { background: linear-gradient(90deg, var(--cat-sleep), #5B7C9E); }
.bar.energy > div { background: linear-gradient(90deg, var(--energy-3), var(--energy-4)); }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  background: var(--mint); color: var(--warmGray800);
  padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px;
  font-weight: 600;
}
.tag.lavender { background: var(--lavender); }
.tag.peach { background: var(--peach); }
.tag.butter { background: var(--butter); }
.tag.sky { background: var(--sky); }
.tag.sage { background: var(--sage); }
.tag.rose { background: var(--rose); }

/* Echoes spotlight */
.spotlight {
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
}
.spotlight .grid {
  display: grid; gap: clamp(32px, 6vw, 56px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 960px) {
  .spotlight .grid { grid-template-columns: 1fr 1.1fr; }
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px;
  color: var(--primary); font-weight: 700;
  margin-bottom: 16px;
}

.echo-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-cozy);
  display: grid; gap: 12px;
}
.echo-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}
.echo-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 8px 12px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
}
.echo-row .label { font-weight: 700; font-size: 14px; color: var(--text); }
.echo-row .sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.echo-row .delta {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.echo-row .delta.positive { color: var(--mint-dark); }
.echo-row .delta.negative { color: var(--coral-dark); }
.echo-row .magnitude {
  grid-column: 1 / -1;
  height: 4px; background: rgba(74,63,51,0.08); border-radius: var(--radius-full);
  overflow: hidden;
}
.echo-row .magnitude > div { height: 100%; background: var(--mint-dark); }
.echo-row .magnitude > div.warm { background: var(--coral-dark); }
.echo-row .confidence {
  grid-column: 1 / -1;
  display: flex; gap: 6px; font-size: 11px; color: var(--text-secondary);
  align-items: center; font-weight: 600;
}
.echo-row .confidence::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint-dark);
}
.echo-row.warm-tint .confidence::before { background: var(--coral-dark); }

/* Feature grid — uses category colors from app */
.features-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }

.feature {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.feature .icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 4px;
}
.feature p {
  color: var(--text-secondary);
  margin: 0; font-size: 14px;
  line-height: 1.55;
}
.feature.mood    .icon { background: var(--cat-mood); }
.feature.habits  .icon { background: var(--cat-habits); }
.feature.symptoms .icon { background: var(--cat-symptoms); }
.feature.sleep   .icon { background: var(--cat-sleep); color: #fff; }
.feature.medications .icon { background: var(--cat-medications); }
.feature.nutrition .icon { background: var(--cat-nutrition); }
.feature.measurements .icon { background: var(--cat-measurements); }
.feature.gratitude .icon { background: var(--cat-gratitude); }
.feature.period  .icon { background: var(--cat-period); }
.feature.signals .icon { background: var(--cat-signals); color: #fff; }

/* Privacy promise */
.promise {
  background: var(--warmGray900);
  color: var(--warmGray100);
}
.promise h2 { color: #fff; }
.promise .container {
  display: grid; gap: 28px;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 768px) {
  .promise .container { grid-template-columns: 1.4fr 1fr; }
}
.promise p {
  color: rgba(240, 235, 230, 0.78);
  font-size: 17px; margin: 14px 0 22px;
  max-width: 50ch; line-height: 1.6;
}
.promise .badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.promise .badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-full);
  background: rgba(240, 235, 230, 0.06);
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(240, 235, 230, 0.12);
  color: rgba(240, 235, 230, 0.92);
}
.promise .btn-secondary {
  background: var(--lavender);
  color: var(--warmGray900);
}
.promise .btn-secondary:hover { background: var(--lavender-light); }

/* FAQ */
.faq-list {
  display: grid; gap: 10px;
  max-width: 720px; margin: 0 auto;
}
.faq-item {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 150ms ease;
}
.faq-item[open] { border-color: var(--primary-light); }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 18px 22px;
  font-weight: 600; font-size: 15px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 22px; color: var(--text-tertiary); font-weight: 400;
  transition: transform 200ms ease;
  line-height: 1;
}
.faq-item[open] summary::after { content: "−"; color: var(--primary); }
.faq-item .answer {
  padding: 0 22px 20px;
  color: var(--text-secondary);
  font-size: 14px; line-height: 1.65;
}

/* Final CTA section uses lavender */
.final-cta {
  background: linear-gradient(160deg, var(--lavender-light) 0%, var(--mint-light) 100%);
}
.final-cta .container { text-align: center; max-width: 580px; }
.final-cta h2 { margin-bottom: 14px; }
.final-cta p { color: var(--text-secondary); font-size: 17px; margin-bottom: 26px; }
.final-cta .cta-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* The pastel gradient above is built from --lavender-light / --mint-light,
   which stay light in dark mode while --text flips to near-white. Without
   these overrides the whole CTA reads as light-on-light. Keeps the lavender ->
   mint identity, just at dark-theme luminance. */
:root[data-theme="dark"] .final-cta {
  background: linear-gradient(160deg, #2C2540 0%, #1E2B26 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .final-cta {
    background: linear-gradient(160deg, #2C2540 0%, #1E2B26 100%);
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 48px 0 28px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text-secondary);
}
.site-footer .container {
  display: grid; gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .site-footer .container { grid-template-columns: 1.5fr 1fr 1fr; }
}
.site-footer h4 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text); margin-bottom: 12px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--text); }
.legal {
  border-top: 1px solid var(--border-light);
  margin-top: 32px; padding-top: 18px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 13px;
}

/* Legal pages */
.legal-page { padding: 56px 0 80px; }
.legal-page .container { max-width: 720px; }
.legal-page h1 { font-size: clamp(28px, 3.5vw, 36px); margin-bottom: 8px; }
.legal-page .meta { color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; }
.legal-page h2 {
  font-size: 18px; font-weight: 700;
  margin-top: 36px; margin-bottom: 12px;
}
.legal-page h3 {
  font-size: 15px; font-weight: 700;
  margin-top: 22px; margin-bottom: 8px;
}
.legal-page p, .legal-page li {
  color: var(--text); line-height: 1.7; font-size: 15px;
}
.legal-page ul { padding-left: 22px; }
.legal-page li { margin-bottom: 6px; }
.legal-page table {
  width: 100%; border-collapse: collapse; margin: 16px 0 24px;
  font-size: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.legal-page th, .legal-page td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.legal-page tr:last-child td { border-bottom: 0; }
.legal-page th {
  background: var(--surface); font-weight: 700; color: var(--text);
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em;
}
.legal-page .callout {
  border-left: 3px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
  color: var(--text);
}
:root[data-theme="dark"] .legal-page .callout { background: rgba(168, 152, 216, 0.12); }
.legal-page .toc {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 32px;
}
.legal-page .toc strong { display: block; margin-bottom: 6px; font-size: 13px; }
.legal-page .toc ol { margin: 0; padding-left: 22px; }
.legal-page .toc li { margin-bottom: 3px; font-size: 14px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
