/* NoteSpark Public Website — Material 3 "Firefly" Design System
   Seed: #9BBF2A, Material 3 Tonal Spot, Contrast 0.
   Source of truth: src/theme/theme.ts & docs/design/firefly-colors.md */

@font-face {
  font-family: 'Figtree';
  src: url('./fonts/Figtree-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('./fonts/Figtree-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('./fonts/Figtree-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Literata';
  src: url('./fonts/Literata-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Literata';
  src: url('./fonts/Literata-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Literata';
  src: url('./fonts/Literata-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Firefly Light Scheme (36 M3 Roles) */
  --primary: #546524;
  --on-primary: #ffffff;
  --primary-container: #d7eb9b;
  --on-primary-container: #3d4c0d;
  --inverse-primary: #bbcf82;
  --secondary: #5b6147;
  --on-secondary: #ffffff;
  --secondary-container: #dfe6c4;
  --on-secondary-container: #434931;
  --tertiary: #39665e;
  --on-tertiary: #ffffff;
  --tertiary-container: #bcece2;
  --on-tertiary-container: #204e47;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
  --background: #fbfaee;
  --on-background: #1b1c15;
  --surface: #fbfaee;
  --on-surface: #1b1c15;
  --surface-variant: #e3e4d3;
  --on-surface-variant: #46483c;
  --surface-dim: #dbdbcf;
  --surface-bright: #fbfaee;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f5f4e8;
  --surface-container: #efeee2;
  --surface-container-high: #e9e9dd;
  --surface-container-highest: #e3e3d7;
  --inverse-surface: #303129;
  --inverse-on-surface: #f2f1e5;
  --outline: #76786b;
  --outline-variant: #c6c8b8;
  --shadow: #000000;
  --scrim: #000000;
  --surface-disabled: rgba(27, 28, 21, 0.12);
  --on-surface-disabled: rgba(27, 28, 21, 0.38);
  --backdrop: rgba(48, 49, 41, 0.4);

  /* FAB shadow (light mode subtle elevation) */
  --fab-shadow: 0 4px 12px rgba(27, 28, 21, 0.16), 0 1px 3px rgba(27, 28, 21, 0.1);

  /* Shape tokens (src/theme/theme.ts — no pills) */
  --shape-xs: 4px;       /* inline code */
  --shape-sm: 8px;       /* chips, small labels, images, code blocks */
  --shape-segment: 4px;  /* inner corners of a grouped list */
  --shape-group: 20px;   /* outer corners of a grouped list */
  --shape-fab: 16px;     /* FABs (the one bold element) */
  --shape-xl: 28px;      /* dialogs, sheets, tiles */
  --shape-control: 12px; /* search bar, buttons, segmented buttons */
  --shape-full: 999px;   /* progress bars only */

  /* Spacing tokens (4dp grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-xxxl: 48px;

  /* Reading width (src/theme/theme.ts) */
  --reading-width: 680px;
  --page-width: 1120px;

  /* Font families */
  --font-ui: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-note: 'Literata', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  /* Firefly Dark Scheme (36 M3 Roles) */
  --primary: #bbcf82;
  --on-primary: #283500;
  --primary-container: #3d4c0d;
  --on-primary-container: #d7eb9b;
  --inverse-primary: #546524;
  --secondary: #c3caa9;
  --on-secondary: #2d331c;
  --secondary-container: #434931;
  --on-secondary-container: #dfe6c4;
  --tertiary: #a1d0c6;
  --on-tertiary: #033731;
  --tertiary-container: #204e47;
  --on-tertiary-container: #bcece2;
  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;
  --background: #12140d;
  --on-background: #e3e3d7;
  --surface: #12140d;
  --on-surface: #e3e3d7;
  --surface-variant: #46483c;
  --on-surface-variant: #c6c8b8;
  --surface-dim: #12140d;
  --surface-bright: #393a32;
  --surface-container-lowest: #0d0f08;
  --surface-container-low: #1b1c15;
  --surface-container: #1f2019;
  --surface-container-high: #292b23;
  --surface-container-highest: #34362d;
  --inverse-surface: #e3e3d7;
  --inverse-on-surface: #303129;
  --outline: #909284;
  --outline-variant: #46483c;
  --shadow: #000000;
  --scrim: #000000;
  --surface-disabled: rgba(227, 227, 215, 0.12);
  --on-surface-disabled: rgba(227, 227, 215, 0.38);
  --backdrop: rgba(48, 49, 41, 0.4);

  /* Signature Firefly glow in dark mode (docs/design/design-system.md) */
  --fab-shadow: 0 0 22px rgba(187, 207, 130, 0.28), 0 4px 12px rgba(0, 0, 0, 0.45);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--background);
  color: var(--on-surface);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: var(--shape-sm); }
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-container-high);
  border-radius: var(--shape-xs);
  padding: 1px 5px;
}
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary-container); color: var(--on-primary-container); padding: 8px 12px; border-radius: var(--shape-control); z-index: 10; }
.skip-link:focus { left: 16px; }

/* Type: Literata is the note's voice (titles, reading text); Figtree is the UI. Sizes follow the app's scale. */
.headline-large { font-family: var(--font-note); font-weight: 600; font-size: clamp(40px, 6.2vw, 68px); line-height: 1.08; letter-spacing: -0.01em; margin: 0; }
.headline-medium { font-family: var(--font-note); font-weight: 600; font-size: clamp(28px, 3.6vw, 36px); line-height: 1.2; margin: 0; }
.headline-small { font-family: var(--font-note); font-weight: 600; font-size: 28px; line-height: 36px; margin: 0; }
.title-large { font-family: var(--font-ui); font-weight: 600; font-size: 22px; line-height: 28px; margin: 0; }
.title-medium { font-family: var(--font-ui); font-weight: 600; font-size: 16px; line-height: 24px; margin: 0; }
.title-small { font-family: var(--font-ui); font-weight: 500; font-size: 14px; line-height: 20px; margin: 0; color: var(--primary); }
.body-large { font-size: 16px; line-height: 24px; }
.body-medium { font-size: 14px; line-height: 20px; }
.body-small { font-size: 12px; line-height: 16px; }
.reading { font-family: var(--font-note); font-size: 19px; line-height: 31px; }
.muted { color: var(--on-surface-variant); }

.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: var(--background);
  transition: background-color 200ms;
}
.site-header.is-scrolled { background: var(--surface-container); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-surface); text-decoration: none; margin-right: auto; }
.brand img { width: 36px; height: 36px; }
.brand span { font-weight: 600; font-size: 20px; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--on-surface-variant); text-decoration: none; font-weight: 500; font-size: 14px;
  padding: 10px 14px; border-radius: var(--shape-control); min-height: 40px; display: inline-flex; align-items: center;
}
.nav a:hover { background: var(--surface-container-high); color: var(--on-surface); }
.nav a[aria-current="page"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.theme-switch { display: flex; border: 1px solid var(--outline); border-radius: var(--shape-control); overflow: hidden; }
.theme-switch button {
  width: 44px; height: 40px; border: 0; background: transparent; color: var(--on-surface-variant);
  display: grid; place-items: center; cursor: pointer;
}
.theme-switch button + button { border-left: 1px solid var(--outline); }
.theme-switch button[aria-pressed="true"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.theme-switch svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .nav { display: none; } }

/* ---------- Buttons and chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--shape-control);
  font: 500 15px/20px var(--font-ui); text-decoration: none; border: 0; cursor: pointer;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.btn-tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn-tonal:hover { background: var(--surface-container-highest); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--shape-sm);
  background: var(--surface-container-high); color: var(--on-surface-variant); font: 500 12px/16px var(--font-ui);
}
.chip svg { width: 14px; height: 14px; }
.chip-tag { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.status { display: inline-flex; padding: 4px 10px; border-radius: var(--shape-sm); font: 500 12px/16px var(--font-ui); white-space: nowrap; }
.status-soon { background: var(--surface-container-highest); color: var(--on-surface-variant); }

/* ---------- Phone screenshots (light or dark, following the page) ---------- */
.phone {
  border-radius: 34px; padding: 8px; background: var(--surface-container-highest);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.12);
}
[data-theme="dark"] .phone { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.phone img { border-radius: 27px; width: 100%; height: auto; aspect-ratio: 9 / 20; }
.shot-dark { display: none; }
[data-theme="dark"] .shot-dark { display: block; }
[data-theme="dark"] .shot-light { display: none; }


/* ---------- Hero: set like a note in the app ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; padding: 40px 0 72px; }
.note-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.hero h1 { max-width: 12ch; }
.hero .reading { margin: 20px 0 0; max-width: 34em; color: var(--on-surface); }
.promises { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 4px; }
.promises li { display: flex; align-items: center; gap: 14px; min-height: 40px; font-family: var(--font-note); font-size: 18px; line-height: 28px; }
.promises svg { width: 22px; height: 22px; flex: none; color: var(--primary); }
.progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--on-surface-variant); font-size: 12px; }
.progress span { display: block; width: 96px; height: 4px; border-radius: var(--shape-full); background: var(--secondary); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
/* One laptop with a phone in front of its corner: the same notes on every device. */
.hero-devices { position: relative; width: 100%; max-width: 640px; aspect-ratio: 1 / 0.87; justify-self: end; }
.laptop { position: absolute; left: 0; top: 0; width: 93.6%; }
.laptop-screen {
  border-radius: 16px 16px 6px 6px; padding: 8px; background: var(--surface-container-highest);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.12);
}
.laptop-screen img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: 9px 9px 2px 2px; }
.laptop-base { height: 12px; margin: 0 -5%; border-radius: 2px 2px 14px 14px; background: var(--outline-variant); position: relative; }
.laptop-base::after { content: ""; position: absolute; left: 50%; top: 0; width: 18%; height: 5px; transform: translateX(-50%); border-radius: 0 0 8px 8px; background: var(--surface-container-highest); }
.hero-devices .phone { position: absolute; right: 0; bottom: 0; width: 26.6%; padding: 5px; border-radius: 22px; }
.hero-devices .phone img { border-radius: 17px; }
[data-theme="dark"] .laptop-screen { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 24px; }
  .hero-devices { justify-self: center; }
}

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head p { margin: 12px 0 0; }


/* What it does: M3 segmented lists, the way Settings groups its rows */
.groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
@media (max-width: 760px) { .groups { grid-template-columns: 1fr; } }
.group h3 { margin: 0 0 10px 4px; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rows li {
  display: flex; gap: 16px; align-items: flex-start; padding: 14px 16px;
  background: var(--surface-container-low); border-radius: var(--shape-segment);
}
.rows li:first-child { border-top-left-radius: var(--shape-group); border-top-right-radius: var(--shape-group); }
.rows li:last-child { border-bottom-left-radius: var(--shape-group); border-bottom-right-radius: var(--shape-group); }
.rows svg { width: 24px; height: 24px; flex: none; color: var(--on-surface-variant); margin-top: 2px; }
.rows .row-title { font-weight: 600; }
.rows .row-desc { color: var(--on-surface-variant); font-size: 14px; line-height: 20px; margin-top: 2px; }
.rows .row-end { margin-left: auto; align-self: center; padding-left: 12px; }
.rows .row-text { min-width: 0; }

/* Get NoteSpark */
.platforms .rows li { align-items: center; padding: 16px 20px; }
.platforms .row-end { display: flex; align-items: center; gap: 12px; }
@media (max-width: 600px) {
  .platforms .rows li { flex-wrap: wrap; }
  .platforms .row-end { margin-left: 40px; padding-left: 0; }
}

/* Privacy band */
.band { background: var(--surface-container); border-radius: var(--shape-xl); padding: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; }
.band p { margin: 12px 0 0; max-width: 40em; }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; padding: 28px 20px; } }

/* ---------- Reading pages (privacy policy, changelog) ---------- */
.page-main { padding: 32px 0 64px; }
.reading-column { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .reading-column { padding: 0 16px; } }
.reading-column h1 { margin-bottom: 4px; }
.policy-lead { font-family: var(--font-note); font-size: 18px; line-height: 30px; margin: 20px 0 8px; }
.policy-text { color: var(--on-surface-variant); }
.policy-section { margin-top: 32px; }
.policy-section h2 { margin-bottom: 8px; }
.policy-bullets { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
.policy-bullet { display: flex; gap: 10px; }
.policy-bullet-dot { color: var(--primary); }
.info-pill { display: inline-flex; padding: 4px 10px; border-radius: var(--shape-sm); background: var(--surface-container-high); color: var(--on-surface-variant); font: 500 12px/16px var(--font-ui); }
.grouped-list { display: grid; gap: 2px; margin-top: 8px; }
.grouped-row { background: var(--surface-container-low); border-radius: var(--shape-segment); padding: 14px 16px; }
.grouped-row:first-child { border-top-left-radius: var(--shape-group); border-top-right-radius: var(--shape-group); }
.grouped-row:last-child { border-bottom-left-radius: var(--shape-group); border-bottom-right-radius: var(--shape-group); }
.grouped-row-desc { color: var(--on-surface-variant); font-size: 14px; line-height: 20px; margin-top: 2px; }
.policy-section .title-small { margin-top: 20px; margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 32px; padding: 32px 0 40px; border-top: 1px solid var(--outline-variant); color: var(--on-surface-variant); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { color: var(--on-surface-variant); }

/* Line icons drawn inline (no icon font, no network). */
.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-actions + p { margin: 16px 0 0; }

/* ---------- Redesign: download buttons, fireflies, tilt, reveal, download cards ---------- */
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 16px; border-radius: var(--shape-full); }
.btn-text { background: transparent; color: var(--primary); padding: 0 16px; }
.btn-text:hover { background: var(--surface-container-high); }
.hero-actions { align-items: center; }
.dl-note { margin: 16px 0 0; max-width: 34em; }

/* Pointer tilt: JS sets --rx and --ry in the range -1 to 1 */
.hero-devices { perspective: 1200px; }
.laptop { transform: rotateY(calc(var(--rx, 0) * 5deg)) rotateX(calc(var(--ry, 0) * -4deg)); transition: transform 200ms ease-out; }
.hero-devices .phone { transform: translate(calc(var(--rx, 0) * 10px), calc(var(--ry, 0) * 8px)) rotateY(calc(var(--rx, 0) * -7deg)); transition: transform 200ms ease-out; }

/* Reveal on scroll (only added by JS, so the page is complete without it) */
.will-reveal { opacity: 0; transform: translateY(24px); transition: opacity 500ms ease-out, transform 500ms ease-out; }
.will-reveal.is-in { opacity: 1; transform: none; }
.dl-foot { margin: 20px 4px 0; }

@media (prefers-reduced-motion: reduce) {
  .laptop, .hero-devices .phone { transform: none !important; transition: none; }
  .will-reveal { opacity: 1; transform: none; transition: none; }
}
.section[id] { scroll-margin-top: 80px; }
.hero-actions { margin-top: 28px; } .promises { margin-top: 32px; }
.laptop-screen .shot-dark { display: none; }
[data-theme="dark"] .laptop-screen .shot-dark { display: block; }
[data-theme="dark"] .laptop-screen .shot-light { display: none; }

/* Download hub: device tabs, then one segmented list of formats */
.hero h1 { font-size: clamp(32px, 4.4vw, 52px); max-width: 14ch; }
.dl-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.dl-tabs button {
  min-height: 48px; padding: 0 20px; border-radius: var(--shape-full); border: 1px solid var(--outline);
  background: transparent; color: var(--on-surface-variant); font: 500 14px/20px var(--font-ui); cursor: pointer;
}
.dl-tabs button:hover { background: var(--surface-container-high); }
.dl-tabs button[aria-selected="true"] { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent; }
.dl-panel .rows li { align-items: center; }
.dl-panel .row-text { flex: 1; min-width: 0; }
.dl-panel .row-end { flex: none; }
.cmd { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-top: 10px; padding: 6px 6px 6px 12px; background: var(--surface-container-highest); border-radius: var(--shape-control); max-width: 100%; }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: transparent; padding: 0; font-size: 13px; }
.copy { min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--shape-full); background: var(--primary-container); color: var(--on-primary-container); font: 500 13px/16px var(--font-ui); cursor: pointer; }
@media (max-width: 600px) { .dl-panel .rows li { flex-wrap: wrap; } }
.dl-panel .rows li.has-cmd { display: block; }
.cmd-line { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.cmd-line .cmd { flex: 1; margin-top: 0; }
.cmd-line .row-end { margin-left: 0; padding-left: 0; align-self: center; }
@media (max-width: 600px) { .cmd-line { flex-wrap: wrap; } .cmd-line .cmd { flex-basis: 100%; } }
.dl-panel .rows { grid-template-columns: minmax(0, 1fr); } .dl-panel .rows li, .cmd-line, .cmd { min-width: 0; }

/* ---------- Hero motion: write, find, sync, 15 s loop ---------- */
.hero-stage { justify-self: end; width: 100%; max-width: 640px; }
@media (max-width: 900px) { .hero-stage { justify-self: center; } }
.hero-stage .hero-devices { justify-self: auto; margin-top: 8px; }
.sync-badge {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 16px;
  border-radius: var(--shape-full); background: var(--tertiary-container); color: var(--on-tertiary-container);
  font: 500 14px/20px var(--font-ui); width: fit-content; margin: 0 auto; opacity: 0; animation: scene-1 24s infinite;
}
.sync-badge .i { width: 20px; height: 20px; }
.track { position: relative; width: 56px; height: 4px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--on-tertiary-container) 25%, transparent); }
.track i { position: absolute; top: 0; left: -8px; width: 8px; height: 4px; border-radius: 2px; background: var(--on-tertiary-container); animation: hop 1.2s linear infinite; }
.track i:nth-child(2) { animation-delay: -.4s; } .track i:nth-child(3) { animation-delay: -.8s; }
@keyframes hop { to { transform: translateX(72px); } }
.stage-caption { position: relative; height: 32px; margin-top: 16px; text-align: center; }
.stage-caption span { position: absolute; inset: 0; opacity: 0; font: 600 16px/24px var(--font-ui); color: var(--on-surface); }
.stage-caption span:nth-child(1) { animation: scene-1 24s infinite; }
.stage-caption span:nth-child(2) { animation: scene-2 24s infinite; }
.stage-caption span:nth-child(3) { animation: scene-3 24s infinite; }
.stage-caption span:nth-child(4) { animation: scene-4 24s infinite; }
.stage-pause { display: block; margin: 4px auto 0; min-height: 48px; padding: 0 16px; border: 0; background: transparent; color: var(--on-surface-variant); font: 500 13px/16px var(--font-ui); cursor: pointer; border-radius: var(--shape-full); }
.stage-pause:hover { background: var(--surface-container-high); }
/* One 24 s loop, four scenes of 6 s: write, tasks, find, sync. */
@keyframes scene-1 { 0% { opacity: 0; } 2%, 22% { opacity: 1; } 25%, 100% { opacity: 0; } }
@keyframes scene-2 { 0%, 25% { opacity: 0; } 27%, 47% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes scene-3 { 0%, 50% { opacity: 0; } 52%, 72% { opacity: 1; } 75%, 100% { opacity: 0; } }
@keyframes scene-4 { 0%, 75% { opacity: 0; } 77%, 97% { opacity: 1; } 100% { opacity: 0; } }

/* The phone slides in once; the search overlay plays on the laptop screen. */
.hero-devices .phone { animation: phone-in 900ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes phone-in { from { translate: 0 48px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
.laptop-screen { position: relative; }
.find { position: absolute; inset: 0; pointer-events: none; opacity: 0; animation: find-in 24s infinite; }
@keyframes find-in { 0%, 50% { opacity: 0; } 52%, 72% { opacity: 1; } 75%, 100% { opacity: 0; } }
.find-bar { position: absolute; left: 1.6%; right: 68.4%; top: 14.2%; height: 7%; display: flex; align-items: center; gap: 6px; padding: 0 3%; border-radius: var(--shape-full); background: var(--surface-container-highest); box-shadow: 0 0 0 2px var(--primary); color: var(--on-surface); font: 400 clamp(6px, .72vw, 9px)/12px var(--font-ui); }
.find-bar .i { width: 11px; height: 11px; flex: none; color: var(--on-surface-variant); }
.find-typed { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; border-right: 2px solid var(--primary); animation: type 24s steps(20) infinite; }
@keyframes type { 0%, 55% { width: 0; } 63%, 100% { width: 20ch; } }
.find-card { position: absolute; left: 1.6%; right: 68.4%; top: 23%; padding: 2% 2.4%; border-radius: var(--shape-group); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); background: var(--primary-container); color: var(--on-primary-container); opacity: 0; animation: card-in 24s infinite; }
.find-card strong { display: block; font: 600 clamp(7px, .85vw, 10px)/13px var(--font-ui); }
.find-card span { display: block; font: 400 clamp(6px, .7vw, 9px)/12px var(--font-ui); }
@keyframes card-in { 0%, 62% { opacity: 0; translate: 0 12px; } 65%, 72% { opacity: 1; translate: 0 0; } 75%, 100% { opacity: 0; } }

.is-paused, .is-paused * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .sync-badge, .stage-caption span:nth-child(4) { animation: none; opacity: 1; }
  .stage-caption span:nth-child(1), .stage-caption span:nth-child(2), .stage-caption span:nth-child(3), .ovl, .find, .track i, .hero-devices .phone, .find-typed, .find-card { animation: none; }
  .stage-pause { display: none; }
}
@media (max-width: 600px) { .sync-badge { border-radius: var(--shape-group); padding: 8px 16px; font-size: 13px; line-height: 18px; max-width: 100%; } .track { width: 32px; } @keyframes hop { to { transform: translateX(48px); } } }

/* ---------- A look inside: pinned devices, screens change as you scroll ---------- */
.show { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: start; }
.show-stage { position: sticky; top: 88px; }
.show-devices { margin: 0; max-width: none; justify-self: auto; }
.layers { display: grid; }
.layers > .layer { grid-area: 1 / 1; opacity: 0; transition: opacity 450ms ease; }
.layers > .layer.is-on { opacity: 1; }
.layers .layer img { width: 100%; height: auto; }
.laptop-screen.layers { display: grid; }
.phone.layers img { aspect-ratio: 9 / 20; }
.show-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .4; transition: opacity 300ms; padding: 24px 0; }
.step.is-on { opacity: 1; }
.step h3::before { counter-increment: s; content: counter(s) " of 5"; display: block; margin-bottom: 8px; font: 500 14px/20px var(--font-ui); color: var(--primary); }
.step p { margin: 12px 0 0; max-width: 26em; }
@media (max-width: 900px) {
  .show { grid-template-columns: 1fr; gap: 0; }
  .show-stage { top: 64px; z-index: 2; background: var(--background); padding: 8px 0 12px; }
  .step { min-height: 46vh; }
}
@media (prefers-reduced-motion: reduce) { .layers > .layer, .step { transition: none; } }
.watch video { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; border-radius: var(--shape-group); background: var(--surface-container-highest); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.12); }
[data-theme="dark"] .watch video { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.step { min-height: 70vh; }
.step .rows { margin-top: 16px; }
.step .rows li { padding: 12px 14px; }
.step h3::before { content: counter(s) " of 5"; }

/* Help page */
.help-toc ul { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.help-toc a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: var(--shape-full); background: var(--surface-container-high); color: var(--on-surface); text-decoration: none; font: 500 14px/20px var(--font-ui); }
.help-toc a:hover { background: var(--secondary-container); }
.help-steps { margin: 8px 0; padding-left: 24px; display: grid; gap: 10px; }
.help-steps li::marker { color: var(--primary); font-weight: 600; }
.policy-section[id] { scroll-margin-top: 80px; }

/* ---------- Text pages on wide screens: contents rail + centred reading column ---------- */
.doc-toc { display: none; }
.doc-layout .reading-column { padding: 0; }
.doc-toc .title-small { margin-bottom: 8px; padding-left: 12px; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-toc ul ul { margin: 2px 0 6px 12px; }
.doc-toc a { display: flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: var(--shape-control); color: var(--on-surface-variant); text-decoration: none; font: 500 14px/20px var(--font-ui); }
.doc-toc ul ul a { min-height: 36px; font-weight: 400; }
.doc-toc a:hover { background: var(--surface-container-high); color: var(--on-surface); }
.doc-layout h2[id], .doc-layout h3[id], .doc-layout section[id] { scroll-margin-top: 88px; }
@media (min-width: 1100px) {
  .doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 680px) minmax(0, 1fr); gap: 0 48px; align-items: start; }
  .doc-toc { display: block; position: sticky; top: 88px; grid-column: 1; max-width: 260px; max-height: calc(100vh - 112px); overflow-y: auto; }
  .doc-layout .reading-column { grid-column: 2; }
  .help-toc { display: none; }
}
@media (min-width: 1100px) and (max-width: 1299px) { .doc-layout { grid-template-columns: 220px minmax(0, 680px); justify-content: center; } }

/* Very wide screens: a wider shared container (header, pages, footer) and larger hero devices */
@media (min-width: 1800px) {
  .container { max-width: 1480px; }
  .hero { gap: 72px; }
  .hero-stage, .hero-devices { max-width: 760px; }
}


/* ---------- Hero: one 24 s loop, four 6 s scenes ----------
   1 Tick a task: the laptop, then the tablet, then the phone follow (the sync badge shows).
   2 Tasks: the Tasks screens wipe in from the right, one after another.
   3 Find: search types on the laptop; the tablet and phone wipe to their search and list screens.
   4 Light, dark, or your system: a circle of the other theme opens from the top right on each device, then closes. */
.ovl { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: var(--background); }
.laptop-screen .ovl { inset: 8px; border-radius: 9px 9px 2px 2px; overflow: hidden; }
.hero-devices .tablet .ovl { inset: 5px; border-radius: 11px; overflow: hidden; }
.hero-devices .phone .ovl { inset: 5px; border-radius: 17px; overflow: hidden; }
.ovl img { width: 100%; height: 100%; object-fit: cover; vertical-align: top; }
.o-flip .fl-light { display: none; }
[data-theme="dark"] .o-flip .fl-light { display: block; }
[data-theme="dark"] .o-flip .fl-dark { display: none; }
.hero-devices .tablet img.shot-light, .hero-devices .tablet img.shot-dark { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 11px; vertical-align: top; }
.hero-devices .tablet .ovl img { height: 100%; aspect-ratio: auto; border-radius: 0; }
.o-tick-L { animation: tick-L 24s infinite; } .o-tick-T { animation: tick-T 24s infinite; } .o-tick-P { animation: tick-P 24s infinite; }
.o-tasks-L { animation: tasks-L 24s infinite; } .o-tasks-T { animation: tasks-T 24s infinite; } .o-tasks-P { animation: tasks-P 24s infinite; }
.o-find-T { animation: find-T 24s infinite; } .o-find-P { animation: find-P 24s infinite; }
.o-flip-L { animation: flip-L 24s infinite; } .o-flip-T { animation: flip-T 24s infinite; } .o-flip-P { animation: flip-P 24s infinite; }
@keyframes tick-L { 0%, 8% { opacity: 0; } 9.5%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tasks-L { 0%, 25% { opacity: 1; clip-path: inset(0 0 0 100%); } 28.5%, 48% { opacity: 1; clip-path: inset(0); } 50%, 100% { opacity: 0; clip-path: inset(0); } }
@keyframes flip-L { 0%, 76% { opacity: 1; clip-path: circle(0% at 90% 8%); } 83%, 94% { opacity: 1; clip-path: circle(150% at 90% 8%); } 99%, 100% { opacity: 1; clip-path: circle(0% at 90% 8%); } }
@keyframes tick-T { 0%, 11% { opacity: 0; } 12.5%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tasks-T { 0%, 26.5% { opacity: 1; clip-path: inset(0 0 0 100%); } 30.0%, 48% { opacity: 1; clip-path: inset(0); } 50%, 100% { opacity: 0; clip-path: inset(0); } }
@keyframes flip-T { 0%, 77.5% { opacity: 1; clip-path: circle(0% at 90% 8%); } 84.5%, 94% { opacity: 1; clip-path: circle(150% at 90% 8%); } 99%, 100% { opacity: 1; clip-path: circle(0% at 90% 8%); } }
@keyframes find-T { 0%, 52% { opacity: 1; clip-path: inset(0 0 0 100%); } 55.5%, 73% { opacity: 1; clip-path: inset(0); } 75%, 100% { opacity: 0; clip-path: inset(0); } }
@keyframes tick-P { 0%, 14% { opacity: 0; } 15.5%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tasks-P { 0%, 28% { opacity: 1; clip-path: inset(0 0 0 100%); } 31.5%, 48% { opacity: 1; clip-path: inset(0); } 50%, 100% { opacity: 0; clip-path: inset(0); } }
@keyframes flip-P { 0%, 79% { opacity: 1; clip-path: circle(0% at 90% 8%); } 86%, 94% { opacity: 1; clip-path: circle(150% at 90% 8%); } 99%, 100% { opacity: 1; clip-path: circle(0% at 90% 8%); } }
@keyframes find-P { 0%, 53.5% { opacity: 1; clip-path: inset(0 0 0 100%); } 57.0%, 73% { opacity: 1; clip-path: inset(0); } 75%, 100% { opacity: 0; clip-path: inset(0); } }
@media (prefers-reduced-motion: reduce) { .ovl { animation: none; opacity: 0; } }

/* Showcase: a tablet in front of the laptop's lower left, between laptop and phone. */
.hero-devices .tablet { position: absolute; left: 23.9%; bottom: 0; width: 48.8%; padding: 5px; border-radius: 16px; background: var(--surface-container-highest); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.14); }
[data-theme="dark"] .hero-devices .tablet { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.tablet.layers img { aspect-ratio: 16 / 10; border-radius: 11px; }


/* ---------- Small screens: the main links in a menu (the desktop nav is hidden under 760 px) ---------- */
.nav-menu { display: none; position: relative; }
.nav-menu summary { list-style: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--shape-control); cursor: pointer; color: var(--on-surface); }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary:hover { background: var(--surface-container-high); }
.nav-menu[open] summary { background: var(--secondary-container); color: var(--on-secondary-container); }
.nav-menu summary svg { width: 24px; height: 24px; }
.nav-menu nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; min-width: 220px; display: grid; gap: 2px; padding: 8px; border-radius: var(--shape-group); background: var(--surface-container-high); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(0, 0, 0, 0.18); }
.nav-menu nav a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: var(--shape-control); color: var(--on-surface); text-decoration: none; font: 500 15px/20px var(--font-ui); }
.nav-menu nav a:hover { background: var(--surface-container-highest); }
.nav-menu nav a[aria-current="page"] { background: var(--secondary-container); color: var(--on-secondary-container); }
@media (max-width: 760px) { .nav-menu { display: block; } .header-inner { gap: 8px; } }
@media (max-width: 400px) { .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
