/* ══════════════════════════════════════════════════════════════════════════
   STOQ — trystoq.com
   Ported from docs/design/landing-redesign.html (approved 09/08/2026).
   Palette synced to app/src/theme/colors.ts. Shared by index, privacy, terms.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand — the Warm Market identity */
  --saffron:        #E8620A;
  --saffron-dark:   #C04E00;
  --saffron-light:  #FFF1E6;
  --green:          #2D6A4F;
  --green-light:    #E8F3EE;
  --amber:          #E0A800;
  --red:            #C73E1D;

  /* Surfaces */
  --cream:          #FBF6EE;
  --surface:        #FFFFFF;
  --warm-gray:      #F5EFE6;
  --border:         #EBE6DD;

  /* Ink — #5C5850 is warm AND hits 6.58:1 on cream. Do not revert to a
     neutral grey; the app itself corrected that value in P1. */
  --text:           #1A1A1A;
  --muted:          #5C5850;

  /* Dark scale — from the app's shipped dark palette */
  --d-bg:           #1C1712;
  --d-surface:      #2A231C;
  --d-surface-2:    #332B22;
  --d-text:         #F2EDE6;
  --d-muted:        #A89F93;
  --d-border:       #3A322A;
  --d-saffron:      #F0813A;

  /* Shadows tinted to the page's warmth — pure black reads grey and dirty
     on cream. */
  --sh-sm: 0 2px 8px rgba(120, 82, 40, 0.06);
  --sh-md: 0 8px 24px rgba(120, 82, 40, 0.09);
  --sh-lg: 0 24px 60px rgba(120, 82, 40, 0.14);
  --sh-saffron: 0 12px 32px rgba(232, 98, 10, 0.28);

  --radius:     20px;
  --radius-lg:  28px;
  --container:  1160px;

  --ease: cubic-bezier(0.22, 0.72, 0.24, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
p { text-wrap: pretty; }

a { color: var(--saffron); text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--saffron);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--text); color: #fff; padding: 12px 20px;
  border-radius: 0 0 12px 0; font-weight: 600;
}
.skip:focus { left: 0; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
/* The nav sits over the dark hero first, then over cream sections. It carries
   the dark palette until the hero is past, otherwise a light slab floats on
   top of the dark hero. Legal pages have no dark hero, so their markup ships
   the .solid class from the start. */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--d-bg) 70%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: background .35s var(--ease), border-color .35s var(--ease);
}
.nav .brand { color: var(--d-text); }
.nav .nav-links a { color: var(--d-muted); }
.nav .nav-links a:hover { color: var(--d-text); }
.nav .nav-cta { background: var(--d-saffron); }
.nav .nav-toggle span, .nav .nav-toggle span::before, .nav .nav-toggle span::after { background: var(--d-text); }
.nav .nav-toggle:hover { background: rgba(255,255,255,.08); }

.nav.solid { background: color-mix(in srgb, var(--cream) 82%, transparent); border-bottom-color: var(--border); }
.nav.solid .brand { color: var(--text); }
.nav.solid .nav-links a { color: var(--muted); }
.nav.solid .nav-links a:hover { color: var(--text); }
.nav.solid .nav-cta { background: var(--text); }
.nav.solid .nav-toggle span, .nav.solid .nav-toggle span::before, .nav.solid .nav-toggle span::after { background: var(--text); }
.nav.solid .nav-toggle:hover { background: var(--warm-gray); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 21px; color: var(--text); letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 15px; padding: 8px 2px; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--text); color: #fff !important; padding: 10px 20px;
  border-radius: 100px; font-size: 14px; font-weight: 600;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.nav-cta:hover { transform: translateY(-1px); }
/* Warm elevation shadow only over cream — on the dark hero it is an invisible
   brown glow, and a coloured blur on a dark ground is the AI-glow tell. */
.nav.solid .nav-cta:hover { box-shadow: var(--sh-md); }
.nav-cta:active { transform: translateY(0) scale(.97); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: none; background: none;
  cursor: pointer; align-items: center; justify-content: center; border-radius: 12px;
}
.nav-toggle:hover { background: var(--warm-gray); }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; position: relative; transition: .25s var(--ease); }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px; transition: .25s var(--ease);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--d-bg); border-bottom: 1px solid var(--d-border);
    padding: 8px 24px 20px;
    clip-path: inset(0 0 100% 0); opacity: 0;
    transition: clip-path .32s var(--ease), opacity .2s;
  }
  .nav.solid .nav-links { background: var(--cream); border-bottom-color: var(--border); }
  .nav-links.open { clip-path: inset(0 0 0 0); opacity: 1; }
  .nav-links a { padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--d-border); }
  .nav.solid .nav-links a { border-bottom-color: var(--border); }
  .nav-cta { text-align: center; margin-top: 14px; border-bottom: none !important; }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 16px;
  padding: 15px 30px; border-radius: 100px; border: none; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn-primary { background: var(--saffron); color: #fff; box-shadow: var(--sh-saffron); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(232,98,10,.36); }
.btn-primary:active { transform: translateY(0) scale(.975); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none !important; }

/* ══ HERO — dark. The app's dark mode is its most striking asset, and the page
      performs the light/dark capability instead of describing it. ══ */
.hero {
  position: relative; background: var(--d-bg); color: var(--d-text);
  padding: 90px 0 0; overflow: hidden;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
.hero::before {
  content: ""; position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: min(1100px, 140%); height: 620px;
  background: radial-gradient(closest-side, rgba(240,129,58,.20), transparent 72%);
  pointer-events: none;
}
/* Subtle grain — the design is otherwise flat with zero texture. */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}
.hero .container { position: relative; z-index: 2; text-align: center; flex: 1; display: flex; flex-direction: column; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; align-self: center;
  background: rgba(240,129,58,.12); color: var(--d-saffron);
  border: 1px solid rgba(240,129,58,.28);
  font-weight: 600; font-size: 13.5px; padding: 8px 16px; border-radius: 100px;
  margin-bottom: 26px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--d-saffron); box-shadow: 0 0 0 0 rgba(240,129,58,.6); animation: pulse 2.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(240,129,58,0); } 100% { box-shadow: 0 0 0 0 rgba(240,129,58,0); } }

.hero h1 { font-size: clamp(40px, 6.6vw, 76px); max-width: 15ch; margin: 0 auto; }
.hero h1 .accent { color: var(--d-saffron); }
.hero .sub {
  font-size: clamp(17px, 2vw, 21px); color: var(--d-muted);
  max-width: 56ch; margin: 26px auto 34px;
}

/* ── Email capture (pre-launch state) ────────────────────────────────────── */
.capture { display: flex; gap: 10px; max-width: 470px; margin: 0 auto; width: 100%; }
.capture input {
  flex: 1; min-width: 0; height: 56px; padding: 0 22px; border-radius: 100px;
  border: 1px solid var(--d-border); background: var(--d-surface);
  color: var(--d-text); font-family: 'Outfit', sans-serif; font-size: 16px;
  transition: border-color .2s, background .2s;
}
.capture input::placeholder { color: var(--d-muted); }
.capture input:focus { outline: none; border-color: var(--d-saffron); background: var(--d-surface-2); }
.capture .btn { height: 56px; flex-shrink: 0; }
.capture-note { font-size: 13.5px; color: var(--d-muted); margin-top: 16px; }
.capture-error { color: #FF9A7A; font-size: 14px; margin-top: 10px; min-height: 20px; }
/* Success replaces the form in place. A class, not an inline style, so the
   CSP can keep style-src without 'unsafe-inline'. */
.capture-done { color: var(--d-text); font-size: 17px; padding: 16px 0; font-weight: 500; }
@media (max-width: 520px) { .capture { flex-direction: column; } .capture .btn { width: 100%; } }

/* ── Store row (post-launch state) ───────────────────────────────────────── */
/* Both states ship in the markup. body.launched swaps which one renders, so
   launch day is a one-line flag flip in app.js, not a rewrite. */
.store { display: none; }
body.launched .store { display: flex; }
body.launched .capture,
body.launched .capture-error,
body.launched .capture-note { display: none; }

.store {
  gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.store-badge img { display: block; height: 62px; width: auto; transition: transform .18s var(--ease); }
.store-badge:hover img { transform: translateY(-2px); }
.store-badge:active img { transform: translateY(0) scale(.98); }

.store-qr {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: 18px; padding: 12px 18px 12px 12px;
  box-shadow: var(--sh-lg);
}
.store-qr img { display: block; width: 84px; height: 84px; }
.store-qr .qr-label { text-align: left; font-size: 13.5px; color: var(--muted); line-height: 1.4; max-width: 14ch; }
.store-qr .qr-label b { display: block; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px; color: var(--text); }
/* You cannot scan a QR with the phone that is displaying it. */
@media (max-width: 760px) { .store-qr { display: none; } }

/* ── Phone frame — holds a REAL 1080x2400 screenshot ─────────────────────── */
.phone {
  position: relative; width: 292px; flex-shrink: 0;
  aspect-ratio: 1080 / 2400;           /* exact device ratio — no distortion */
  background: #0d0d0f; border-radius: 44px; padding: 9px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.07), var(--sh-lg);
}
.phone::after {
  content: ""; position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 22px; background: #000; border-radius: 14px; z-index: 4;
}
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: var(--d-bg); }
.phone .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

/* Hero stage — two phones overlapping, light behind / dark in front, so the
   page shows both themes at a glance. The crop is deliberate: the pair is
   staggered and rotated, so it reads as composition rather than a cut-off. */
.hero-stage {
  position: relative; margin-top: 54px; flex: 1;
  min-height: clamp(340px, 46vh, 490px);
  display: flex; justify-content: center;
}
.hero-stage .phone { position: absolute; top: 0; width: 246px; transition: transform .6s var(--ease); }
.phone-back {
  transform: translateX(-56%) rotate(-8deg) scale(.9);
  z-index: 1; filter: brightness(.9) saturate(.95);
}
.phone-front { transform: translateX(14%) rotate(4deg); z-index: 2; }
/* Fade the pair into the section edge so the crop is soft, not a hard slice. */
.hero-stage::after {
  content: ""; position: absolute; left: -20vw; right: -20vw; bottom: -1px; height: 120px;
  background: linear-gradient(to bottom, transparent, var(--d-bg) 82%);
  z-index: 3; pointer-events: none;
}
@media (hover: hover) {
  .hero-stage:hover .phone-back { transform: translateX(-60%) rotate(-10deg) scale(.9); }
  .hero-stage:hover .phone-front { transform: translateX(16%) rotate(5deg) translateY(-8px); }
}
/* One phone only on narrow screens — two would overflow. */
@media (max-width: 700px) {
  .phone-back { display: none; }
  .phone-front { transform: none; }
  .hero-stage .phone { width: 258px; }
}

/* ══ STORY — pinned phone, real screenshots cross-dissolving ══ */
.story { background: var(--cream); position: relative; padding: 40px 0 0; }
.story .container { display: grid; grid-template-columns: 1fr 380px; gap: 60px; align-items: start; }
.story-steps { padding: 10vh 0; }
.story-step { min-height: 76vh; display: flex; flex-direction: column; justify-content: center; opacity: .32; transition: opacity .45s var(--ease); }
.story-step.active { opacity: 1; }
.story-step .idx {
  display: inline-flex; width: 42px; height: 42px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--saffron); font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 17px;
  align-items: center; justify-content: center; margin-bottom: 20px; box-shadow: var(--sh-sm);
}
.story-step h2 { font-size: clamp(28px, 3.6vw, 44px); }
.story-step p { color: var(--muted); font-size: 17.5px; margin-top: 14px; max-width: 46ch; }

.story-sticky {
  position: sticky; top: 0; height: 100dvh;
  display: flex; align-items: center; justify-content: center;
}
/* No progress rail — it read as a disconnected line floating beside the phone.
   Progress is carried by the step numbers and the fade on inactive steps. */
.story-sticky .screen img { position: absolute; inset: 0; opacity: 0; transform: scale(1.02); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.story-sticky .screen img.active { opacity: 1; transform: none; }

/* ══ PREDICTION SPOTLIGHT — the differentiator gets its own moment ══ */
.spotlight { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.spotlight .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
.spotlight h2 { font-size: clamp(30px, 4vw, 50px); }
.spotlight p { color: var(--muted); font-size: 18px; margin-top: 18px; max-width: 48ch; }
/* Was two inline style="" attributes in the prototype. Classed so the CSP
   never needs style-src 'unsafe-inline'. */
.spotlight-visual { display: flex; justify-content: center; }
.spotlight-visual .phone { width: 264px; }

.chips { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 100px; }
.chip .cd { width: 7px; height: 7px; border-radius: 50%; }
.chip.g { background: var(--green-light); color: var(--green); } .chip.g .cd { background: var(--green); }
.chip.a { background: #FFF5D6; color: #8A6A00; } .chip.a .cd { background: var(--amber); }
.chip.r { background: #FBEBE6; color: var(--red); } .chip.r .cd { background: var(--red); }

/* ══ FEATURES — bento, not an auto-fit equal-card grid ══ */
.features { background: var(--cream); }
.section-head { text-align: center; margin-bottom: 54px; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 46px); }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 18px; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.fcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--sh-sm);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s;
}
.fcard:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: #DDD5C8; }
.fcard.wide { grid-column: span 3; } .fcard.third { grid-column: span 2; }
.fcard .ic {
  width: 46px; height: 46px; border-radius: 14px; background: var(--saffron-light);
  display: grid; place-items: center; margin-bottom: 18px; color: var(--saffron);
}
/* Inline SVG, never emoji: emoji render differently on every OS — this project
   already hit that bug once, where one rendered blue on saffron and was
   mistaken for a brand-colour error. */
.fcard .ic svg { width: 23px; height: 23px; stroke-width: 1.9; }
.fcard h3 { font-size: 20px; margin-bottom: 8px; }
.fcard p { color: var(--muted); font-size: 15.5px; }

@media (max-width: 900px) { .bento { grid-template-columns: 1fr; } .fcard.wide, .fcard.third { grid-column: span 1; } }

/* ══ FAQ ══ */
.faq { background: var(--surface); }
.faq h2 { font-size: clamp(28px, 4vw, 44px); text-align: center; margin-bottom: 40px; }
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--cream); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 20px 24px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 16.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 24px; color: var(--saffron); font-weight: 700; transition: transform .25s var(--ease); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0; padding: 0 24px 20px; color: var(--muted); font-size: 15.5px; }

/* ══ CTA — returns to the hero's dark world so it reads as a deliberate
      bookend, rather than a lone dark slab dropped into a cream page. ══ */
.cta { background: var(--d-bg); color: var(--d-text); position: relative; overflow: hidden; }
.cta::before {
  content: ""; position: absolute; left: 50%; top: -140px; transform: translateX(-50%);
  width: 800px; height: 460px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(240,129,58,.22), transparent 70%);
}
.cta .container { position: relative; text-align: center; }
.cta h2 { font-size: clamp(30px, 4.4vw, 50px); }
.cta p { color: var(--d-muted); margin: 18px auto 32px; max-width: 46ch; font-size: 18px; }

/* ══ Footer ══ */
footer { background: var(--d-bg); color: var(--d-muted); border-top: 1px solid var(--d-border); padding: 44px 0; }
footer .container { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
footer .brand { color: var(--d-text); }
footer .links { display: flex; gap: 24px; flex-wrap: wrap; }
footer .links a { color: var(--d-muted); font-size: 14.5px; font-weight: 500; }
footer .links a:hover { color: var(--d-text); }
footer .copy { font-size: 13.5px; }

section { padding: 110px 0; }

/* ── Reveal ─────────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .75s var(--ease), transform .75s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .07s; } .d2 { transition-delay: .14s; } .d3 { transition-delay: .21s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .story-step { opacity: 1; }
  .pill .dot { animation: none; }
  .story-sticky { position: static; height: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 900px) {
  .story .container { grid-template-columns: 1fr; gap: 0; }
  .story-sticky { order: -1; height: auto; padding: 24px 0; top: 68px; background: var(--cream); }
  .story-step { min-height: auto; padding: 42px 0; opacity: 1; }
  .spotlight .container { grid-template-columns: 1fr; gap: 40px; }
  section { padding: 76px 0; }
}

/* ══ LEGAL PAGES — privacy.html, terms.html ══════════════════════════════ */
/* These have no dark hero, so their nav ships .solid in the markup and their
   footer needs the light treatment the landing page's dark footer overrides. */
.legal { max-width: 760px; margin: 0 auto; padding: 56px 24px 88px; }
.legal h1 { font-size: 36px; margin-bottom: 8px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-bottom: 34px; }
.legal h2 { font-size: 21px; margin: 34px 0 10px; }
.legal p, .legal li { color: var(--muted); font-size: 15.5px; margin-bottom: 11px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal ul { padding-left: 22px; margin-bottom: 14px; }
.legal .back { display: inline-block; margin-bottom: 26px; font-weight: 600; }
.legal-table { overflow-x: auto; margin: 18px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; }
.legal th { background: var(--warm-gray); font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--text); }
.legal td { background: var(--surface); }

body.page-legal footer { background: var(--cream); color: var(--muted); border-top-color: var(--border); }
body.page-legal footer .brand { color: var(--text); }
body.page-legal footer .links a { color: var(--muted); }
body.page-legal footer .links a:hover { color: var(--text); }
