/* ============================================================================
   site.css — theme + post-world strip + legal/confirm pages.
   The scroll-world engine ships its own CSS in @layer sw; everything here is
   UNLAYERED, so these tokens + rules win cleanly (PRD §4 dark-theme note).
   ========================================================================== */

/* Eigenzeit tokens (brand 04 §4.2/4.15): Ink + Amber + Warm Paper.
   Amber is the ONE key-action color; sage marks rest/resolved states; no
   red/green punch-clock semantics anywhere. */
:root {
  --paper: #F7F4EE;            /* ez.paper  Warm Paper */
  --paper-2: #FCFAF5;          /* raised surface */
  --paper-dark: #171522;       /* ez.ink    Eigen Ink (finale dark flip) */
  --ink: #1B1A1F;              /* ez.text   Text Ink */
  --ink-soft: #5C5761;
  --ink-on-dark: #F7F4EE;
  --ink-soft-on-dark: #B9B3C2;
  --mist: #E8E2DA;             /* ez.mist — dividers, neutral fills */
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --accent: #4A3F74;           /* ez.violet Quiet Violet — secondary fields/links */
  --amber: #F3A55B;            /* ez.amber  Time Amber — primary action */
  --amber-text: #9A5B08;       /* Time Amber, AA-safe as text on Warm Paper */
  --apricot: #FFD1A6;          /* ez.apricot — highlight on dark surfaces */
  --sage: #54705F;             /* ez.sage (text-safe) — rest/resolved */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --maxw: 1080px;
  --radius: 18px;
}

/* Feed the brand tokens + fonts into the engine (overrides its @layer sw defaults). */
:root, .sw-root {
  --sw-bg: var(--paper);
  --sw-ink: var(--ink);
  --sw-ink-soft: var(--ink-soft);
  --sw-accent: var(--amber-text);
  --sw-font-display: var(--font-display);
  --sw-font-body: var(--font-body);
}

/* Finale dark flip (site.js toggles html.sw-dark near scene 7). Higher-specificity
   than the :root/.sw-root tokens so both the page and the engine follow. */
html.sw-dark, html.sw-dark .sw-root {
  --sw-bg: var(--paper-dark);
  --sw-ink: var(--ink-on-dark);
  --sw-ink-soft: var(--ink-soft-on-dark);
}
html.sw-dark body { background: var(--paper-dark); }
html.sw-dark .sw-nav { background: color-mix(in srgb, #fff 8%, transparent); }
html.sw-dark .sw-topcta { background: var(--ink-on-dark); color: var(--paper-dark); }
/* In dark mode --sw-ink flips light, so the engine's ink-filled primary button
   would be light-on-white. Repaint the finale CTA on Time Amber (ink text, 8.9:1). */
html.sw-dark .sw-btn--primary { background: var(--amber); color: var(--paper-dark); }
html.sw-dark .sw-btn--ghost { color: var(--ink-on-dark); border-color: color-mix(in srgb, var(--ink-on-dark) 32%, transparent); }
html.sw-dark .sw-nav__item.is-active { color: var(--paper-dark); }
/* Route rail label on the dark finale: engine sets text to --sw-ink (light in
   dark mode) on a near-white pill → unreadable. Force dark text on a solid pill. */
html.sw-dark .sw-route__label { color: var(--paper-dark); background: color-mix(in srgb, #fff 92%, transparent); }
/* Ease the flip: the injected scenes/scrim fade their colours over ~0.5s. */
.sw-sky__grad, .sw-sky__glow { transition: background .5s ease, opacity .5s ease; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* ---- Accessibility helpers --------------------------------------------- */
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 400;
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 999px; text-decoration: none; font-weight: 600;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.sr-only, .sr-story {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Reveal the text story when JS is off — the page head ships a <noscript>
   <style> that flips .sr-story back to static flow and hides the empty #world. */
.sr-story h1 { font-family: var(--font-display); font-weight: 600; }

/* ---- Post-world strip -------------------------------------------------
   Sits ABOVE the engine's fixed layers (topbar z50, scrollbar z60): relative +
   opaque background + high z-index, so as it scrolls up it fully occludes the
   flight chrome. It flows after the engine's .sw-track. */
.post-world {
  position: relative; z-index: 300;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 -40px 80px -40px rgba(16, 20, 24, .18);
}
.strip { max-width: var(--maxw); margin: 0 auto; padding: 0 6vw; }
.strip-section { padding: clamp(56px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.strip-section:first-child { border-top: 0; }
.eyebrow {
  font-family: var(--font-body); font-weight: 700; font-size: .78rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px;
}
.section-title {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem); line-height: 1.08; margin: 0 0 18px; color: var(--ink);
}
.section-lead { font-size: 1.12rem; color: color-mix(in srgb, var(--ink) 82%, var(--ink-soft)); max-width: 60ch; margin: 0 0 36px; }

/* Product proof */
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 860px) { .proof-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .proof-grid { grid-template-columns: 1fr 1fr; } }
.device {
  position: relative; aspect-ratio: 9 / 19.5; border-radius: 30px;
  background: linear-gradient(160deg, #23262d, #0d0f13);
  padding: 8px; box-shadow: 0 18px 40px -18px rgba(16,20,24,.5); overflow: hidden;
}
.device__screen {
  position: absolute; inset: 8px; border-radius: 24px; overflow: hidden;
  background: var(--paper-2); display: grid; place-items: center; text-align: center;
}
.device__screen img { width: 100%; height: 100%; object-fit: cover; }
.device__ph { padding: 16px; color: var(--ink-soft); font-size: .82rem; }
.device__ph b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.device__notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 34%; height: 20px; background: #0d0f13; border-radius: 0 0 12px 12px; z-index: 2; }
.proof-caption { margin-top: 12px; font-size: .84rem; color: var(--ink-soft); text-align: center; }
.proof-loop { margin-top: 32px; }
.proof-loop__frame {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--paper-2)), var(--paper-2));
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-soft);
}
.proof-loop__frame video { width: 100%; height: 100%; object-fit: cover; }
.note {
  margin-top: 14px; font-size: .82rem; color: var(--ink-soft);
  padding: 10px 14px; border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 0 8px 8px 0;
}

/* Privacy claims */
.claims { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 0 0 28px; padding: 0; list-style: none; }
@media (max-width: 720px) { .claims { grid-template-columns: 1fr; } }
.claim {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px;
}
.claim h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; margin: 0 0 8px;
  color: var(--ink); display: flex; gap: 10px; align-items: baseline;
}
.claim h3::before { content: "✓"; color: var(--amber-text); font-weight: 800; }
.claim p { margin: 0; color: color-mix(in srgb, var(--ink) 78%, var(--ink-soft)); font-size: .98rem; }
.inline-link { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.inline-link:hover { border-bottom-color: var(--accent); }

/* FAQ */
.faq-list { display: grid; gap: 0; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 22px 44px 22px 0; position: relative;
  font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; color: var(--accent); transition: transform .2s ease; font-weight: 400;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { margin: 0 0 22px; color: color-mix(in srgb, var(--ink) 80%, var(--ink-soft)); max-width: 68ch; }

/* Waitlist / store */
.waitlist-card {
  background: var(--ink); color: var(--ink-on-dark); border-radius: 28px;
  padding: clamp(32px, 5vw, 60px); position: relative; overflow: hidden;
}
.waitlist-card .eyebrow { color: var(--apricot); }
.waitlist-card .section-title, .waitlist-card p { color: var(--ink-on-dark); }
.waitlist-card p { color: color-mix(in srgb, var(--ink-on-dark) 82%, var(--ink-soft-on-dark)); }
.wl-form { margin-top: 28px; display: grid; gap: 14px; max-width: 460px; }
.wl-field { display: grid; gap: 6px; }
.wl-field label { font-size: .84rem; font-weight: 600; color: color-mix(in srgb, var(--ink-on-dark) 78%, transparent); }
.wl-input {
  font: inherit; padding: 15px 18px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, #fff 22%, transparent);
  background: color-mix(in srgb, #fff 8%, transparent); color: var(--ink-on-dark); width: 100%;
}
.wl-input::placeholder { color: color-mix(in srgb, var(--ink-on-dark) 45%, transparent); }
.wl-input:focus-visible { outline: 3px solid var(--apricot); outline-offset: 1px; border-color: transparent; }
.wl-consent { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: color-mix(in srgb, var(--ink-on-dark) 82%, transparent); }
.wl-consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--amber); flex: 0 0 auto; }
.wl-consent a { color: #fff; text-decoration: underline; }
.wl-submit {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 999px;
  padding: 15px 30px; background: var(--amber); color: var(--paper-dark); justify-self: start;
  transition: transform .18s ease, background .18s ease;
}
.wl-submit:hover:not(:disabled) { transform: translateY(-2px); }
.wl-submit:disabled { opacity: .6; cursor: default; }
.wl-msg { margin-top: 8px; font-size: .95rem; min-height: 1.2em; }
.wl-msg[data-kind="error"] { color: #FFB4A9; }
.wl-success {
  margin-top: 22px; padding: 20px 22px; border-radius: 16px;
  background: color-mix(in srgb, var(--sage) 26%, transparent);
  border: 1px solid color-mix(in srgb, var(--sage) 55%, transparent);
}
.wl-success h3 { margin: 0 0 8px; font-family: var(--font-display); color: #fff; }
.wl-success p { margin: 0; }
[hidden] { display: none !important; }
.store-badge { display: inline-flex; margin-top: 24px; }
.store-badge img { height: 56px; }

/* Footer */
.site-footer {
  position: relative; z-index: 300; background: var(--paper-2);
  border-top: 1px solid var(--line); padding: 44px 6vw;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.footer-tagline { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.footer-links a:hover { color: var(--ink); }
.lang-switch { display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.lang-switch a { padding: 5px 12px; border-radius: 999px; text-decoration: none; font-size: .85rem; color: var(--ink-soft); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }
.footer-note { flex-basis: 100%; font-size: .8rem; color: var(--ink-soft); margin-top: 8px; }

/* ---- Standalone document pages (legal, presse, confirm) ---------------- */
.doc-page { min-height: 100vh; background: var(--paper); }
.doc-header { border-bottom: 1px solid var(--line); }
.doc-header .strip { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.doc-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; display: inline-flex; gap: 10px; align-items: center; }
.doc-brand__mark { width: 22px; height: 26px; border-radius: 7px 7px 10px 10px; background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); }
.doc-main { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 88px) 6vw 120px; }
.doc-main h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 8px; letter-spacing: -.01em; }
.doc-main h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin: 40px 0 12px; }
.doc-main p, .doc-main li { color: color-mix(in srgb, var(--ink) 84%, var(--ink-soft)); }
.doc-main a { color: var(--accent); }
.doc-lead { font-size: 1.15rem; color: var(--ink-soft) !important; margin-bottom: 32px; }
.confirm-card { text-align: center; padding: clamp(48px, 8vw, 90px) 0; }
.confirm-card .icon { font-size: 3rem; }
.confirm-card h1 { margin-top: 16px; }
.btn-primary { display: inline-block; margin-top: 28px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; padding: 14px 28px; border-radius: 999px; }

/* Route rail: ensure it stays clear of the post-world strip stacking (engine z40 < strip z300) */
@media (prefers-reduced-motion: reduce) {
  .wl-submit:hover, .btn-primary:hover { transform: none; }
}
