/* ───────────────────────────────────────────────────────────
   Trove — promotional site
   One committed look: ink-navy dark, amber-gold accent (the app
   icon's own palette), editorial serif display, filmic texture.
   ─────────────────────────────────────────────────────────── */

:root {
  --ink-0: oklch(0.11 0.018 265);   /* deepest background */
  --ink-1: oklch(0.145 0.02 265);   /* page background */
  --ink-2: oklch(0.19 0.02 265);    /* raised surface */
  --ink-3: oklch(0.25 0.02 265);    /* borders, dividers (solid) */
  --paper: oklch(0.955 0.012 85);   /* primary text, warm */
  --paper-2: oklch(0.80 0.015 80);  /* secondary text */
  --paper-3: oklch(0.62 0.015 265); /* muted text */
  --gold: oklch(0.82 0.155 82);     /* amber-gold accent */
  --gold-2: oklch(0.70 0.15 72);    /* deeper gold for hover/borders */
  --gold-ink: oklch(0.16 0.03 70);  /* text on gold */
  --line: color-mix(in oklab, var(--paper) 9%, transparent);
  --line-strong: color-mix(in oklab, var(--paper) 16%, transparent);

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 14px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--ink-1);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Film grain: one static turbulence layer over everything. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ── Typography ─────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.display em { font-style: italic; color: var(--gold); }
.h-hero { font-size: clamp(3rem, 8.5vw, 7.25rem); }
.h-section { font-size: clamp(2.25rem, 5vw, 4.25rem); }
.h-card { font-family: var(--font-body); font-weight: 600; font-size: 1.0625rem; letter-spacing: 0; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.lede { font-size: clamp(1.125rem, 1.6vw, 1.375rem); line-height: 1.5; color: var(--paper-2); max-width: 38rem; }
.muted { color: var(--paper-3); }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.02em; }

kbd {
  font-family: var(--font-mono);
  font-size: 0.75em;
  padding: 0.15em 0.45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--ink-2);
  color: var(--paper);
  white-space: nowrap;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.35rem;
  border-radius: 10px;
  font-weight: 600; font-size: 0.9375rem;
  line-height: 1;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-out), background 0.25s, border-color 0.25s, color 0.25s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-gold { background: var(--gold); color: var(--gold-ink); box-shadow: 0 10px 30px -10px color-mix(in oklab, var(--gold) 60%, transparent); }
.btn-gold:hover { background: oklch(0.86 0.15 85); color: var(--gold-ink); }
.btn-ghost { background: color-mix(in oklab, var(--paper) 4%, transparent); color: var(--paper); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: color-mix(in oklab, var(--paper) 30%, transparent); color: var(--paper); }

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 0.9rem 0;
  background: color-mix(in oklab, var(--ink-0) 35%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, padding 0.4s;
}
.nav.is-scrolled { background: color-mix(in oklab, var(--ink-0) 82%, transparent); border-bottom-color: var(--line); padding: 0.65rem 0; }
.nav-inner { display: flex; align-items: center; gap: 1.5rem; }
.nav .brand { margin-right: auto; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--paper); font-weight: 600; letter-spacing: -0.01em; font-size: 1.0625rem; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav-links { display: flex; gap: 1.75rem; margin-inline: auto; }
.nav .nav-links ~ .btn { margin-left: 0; }
.nav-links a { color: var(--paper-2); font-size: 0.9375rem; font-weight: 500; }
.nav-links a:hover { color: var(--paper); }
.nav .btn { padding: 0.6rem 1rem; font-size: 0.875rem; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(8rem, 16vw, 12rem) 0 0;
  overflow: clip;
  isolation: isolate;
}
.hero-glow {
  position: absolute; z-index: -1; inset: auto 0 auto 50%;
  top: -10vw;
  width: min(120vw, 1600px); aspect-ratio: 1.4;
  translate: -50% 0;
  background:
    radial-gradient(closest-side at 50% 35%, color-mix(in oklab, var(--gold) 22%, transparent), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  will-change: transform;
}
.hero-inner { text-align: center; display: grid; justify-items: center; gap: 1.5rem; }
.platform-row { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--paper-2);
  background: color-mix(in oklab, var(--ink-0) 50%, transparent);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.hero .lede { margin-inline: auto; }
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; margin-top: 0.5rem; }
.hero-meta { margin-top: 0.25rem; }

.hero-stage { position: relative; margin-top: clamp(3rem, 6vw, 5rem); }
.hero-stage::before {
  /* spotlight pool beneath the window */
  content: ""; position: absolute; inset: 10% -10% -20%; z-index: -1;
  background: radial-gradient(60% 50% at 50% 50%, color-mix(in oklab, var(--gold) 14%, transparent), transparent 70%);
  filter: blur(40px);
}
.letterbox { height: 10px; background: var(--ink-0); position: relative; }
.letterbox::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--gold) 55%, transparent), transparent); }

/* ── Screenshot frames ──────────────────────────────────── */
.shot {
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--paper) 12%, transparent);
  background: var(--ink-2);
  box-shadow:
    0 1px 0 color-mix(in oklab, var(--paper) 10%, transparent) inset,
    0 50px 120px -30px rgb(0 0 0 / 0.8),
    0 20px 40px -20px rgb(0 0 0 / 0.6);
}
.shot img { width: 100%; height: auto; }
.shot figcaption {
  position: absolute; left: 1rem; bottom: 1rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: color-mix(in oklab, var(--ink-0) 80%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--paper-2);
}
.hero-shot {
  opacity: 0;
  transform: perspective(1600px) rotateX(7deg) scale(0.965);
  transform-origin: 50% 0%;
  animation: rise 1.5s 0.25s var(--ease-out) forwards;
}
@keyframes rise {
  to { opacity: 1; transform: perspective(1600px) rotateX(0) scale(1); }
}

/* ── Ticker ─────────────────────────────────────────────── */
.ticker {
  margin-top: clamp(3rem, 6vw, 5rem);
  border-block: 1px solid var(--line);
  background: var(--ink-0);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track {
  display: flex; gap: 3rem; width: max-content;
  padding: 0.9rem 0;
  animation: ticker 70s linear infinite;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper-3);
}
.ticker-track span { display: inline-flex; align-items: center; gap: 3rem; white-space: nowrap; }
.ticker-track i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); display: inline-block; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ── Stats ──────────────────────────────────────────────── */
.stats { padding: clamp(3rem, 6vw, 5rem) 0 0; }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  background: color-mix(in oklab, var(--ink-2) 60%, transparent);
}
.stat { padding: 1.5rem 1.5rem 1.35rem; border-right: 1px solid var(--line); display: grid; gap: 0.35rem; }
.stat:last-child { border-right: 0; }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.25rem, 3.5vw, 3rem); line-height: 1; color: var(--paper); }
.stat b small { font-size: 0.5em; color: var(--gold); margin-left: 0.1em; }
.stat span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-3); }

/* ── Chapters ───────────────────────────────────────────── */
.chapter { padding: clamp(5rem, 11vw, 9.5rem) 0; position: relative; }
.chapter + .chapter { border-top: 1px solid var(--line); }
.chapter-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 5rem); align-items: center;
}
.chapter--flip .chapter-grid > .chapter-text { order: 2; }
.chapter-text { display: grid; gap: 1.25rem; position: relative; }
.numeral {
  font-family: var(--font-display); font-size: clamp(5rem, 9vw, 8rem); line-height: 0.8;
  color: color-mix(in oklab, var(--paper) 6%, transparent);
  position: absolute; top: -2.5rem; left: -0.5rem; z-index: -1; user-select: none;
}
.chapter-text .lede { font-size: 1.125rem; }
.bullets { display: grid; gap: 0.7rem; margin-top: 0.25rem; }
.bullets li { display: grid; grid-template-columns: 18px 1fr; gap: 0.75rem; align-items: start; color: var(--paper-2); font-size: 0.975rem; }
.bullets li svg { width: 18px; height: 18px; color: var(--gold); margin-top: 0.2rem; }
.bullets li strong { color: var(--paper); font-weight: 600; }
.chapter-shots { display: grid; gap: 1.25rem; }
.chapter-shots.two { grid-template-columns: 1fr 1fr; align-items: start; }
.chapter-shots.two .shot:nth-child(2) { margin-top: 2.5rem; }

/* ── Bento ──────────────────────────────────────────────── */
.bento { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 1rem; max-width: 44rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.bento-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.cell {
  grid-column: span 4;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--ink-2) 85%, transparent), color-mix(in oklab, var(--ink-1) 60%, transparent));
  display: grid; gap: 0.75rem; align-content: start;
  transition: border-color 0.35s, transform 0.35s var(--ease-out);
}
.cell:hover { border-color: color-mix(in oklab, var(--gold) 45%, transparent); transform: translateY(-2px); }
.cell.wide { grid-column: span 6; }
.cell .icon { width: 26px; height: 26px; color: var(--gold); }
.cell p { color: var(--paper-2); font-size: 0.95rem; }
.cell .chips { margin-top: 0.35rem; }

/* ── Formats / preview ──────────────────────────────────── */
.preview { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); background: var(--ink-0); }
.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem 2rem; margin-top: clamp(2rem, 4vw, 3rem); }
.format-group { display: grid; gap: 0.6rem; align-content: start; padding-top: 1rem; border-top: 1px solid var(--line); }
.format-group h3 { font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; display: flex; justify-content: space-between; align-items: baseline; }
.format-group h3 small { font-family: var(--font-mono); font-size: 0.7rem; color: var(--paper-3); letter-spacing: 0.06em; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 0.3rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--paper-2);
}
.chip.gold { border-color: color-mix(in oklab, var(--gold) 55%, transparent); color: var(--gold); }

/* ── Who it's for ───────────────────────────────────────── */
.audience { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); }
.persona { gap: 1rem; }
.persona .kicker { color: var(--paper-3); }
.persona h3 { font-size: 1.9rem; line-height: 1.05; }
.persona > p { color: var(--paper-2); font-size: 0.975rem; }
.persona .bullets { margin-top: 0.25rem; }
.persona .bullets li { font-size: 0.925rem; }
.promises { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 2rem; border-top: 1px solid var(--line); display: grid; gap: 1rem; }
.promise-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.promise-row .pill { color: var(--paper); }

/* ── Platforms / download ───────────────────────────────── */
.download { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); background: var(--ink-0); }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-top: clamp(2rem, 4vw, 3rem); }
.platform {
  padding: 1.75rem; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--ink-2) 90%, transparent), transparent);
  display: grid; gap: 1rem; align-content: start;
}
.platform h3 { font-family: var(--font-display); font-size: 2rem; display: flex; align-items: center; gap: 0.75rem; }
.platform h3 svg { width: 30px; height: 30px; color: var(--gold); }
.platform .req { display: grid; gap: 0.4rem; color: var(--paper-2); font-size: 0.95rem; }
.platform .req li { display: flex; gap: 0.6rem; }
.platform .req li::before { content: "—"; color: var(--gold); }
.platform .btn { justify-self: start; margin-top: 0.5rem; }
.note { font-size: 0.9rem; color: var(--paper-3); margin-top: 1.5rem; max-width: 60rem; }
.note code { font-family: var(--font-mono); font-size: 0.85em; color: var(--paper-2); }

/* ── FAQ ────────────────────────────────────────────────── */
.faq { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); }
.faq-list { max-width: 52rem; border-top: 1px solid var(--line-strong); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.25rem 0; font-weight: 600; font-size: 1.0625rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; font-family: var(--font-display); font-size: 1.75rem; line-height: 1; color: var(--gold);
  transition: transform 0.3s var(--ease-out); flex: none;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list .answer { padding: 0 0 1.5rem; color: var(--paper-2); max-width: 44rem; }
.faq-list .answer p + p { margin-top: 0.75rem; }

/* ── Finale + footer ────────────────────────────────────── */
.finale { padding: clamp(6rem, 14vw, 12rem) 0; text-align: center; border-top: 1px solid var(--line); position: relative; overflow: clip; }
.finale::before {
  content: ""; position: absolute; inset: auto 0 -40% 50%; translate: -50% 0;
  width: min(100vw, 1200px); aspect-ratio: 2;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--gold) 18%, transparent), transparent 70%);
  filter: blur(30px); pointer-events: none;
}
.finale .h-hero { font-size: clamp(2.75rem, 7vw, 6rem); }
.finale .cta-row { margin-top: 2rem; }
.footer { border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; background: var(--ink-0); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; align-items: start; }
.footer h3 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-3); margin-bottom: 0.85rem; }
.footer ul { display: grid; gap: 0.5rem; }
.footer a { color: var(--paper-2); font-size: 0.95rem; }
.footer a:hover { color: var(--paper); }
.footer .brand { margin-bottom: 0.75rem; }
.footer p { color: var(--paper-3); font-size: 0.9rem; max-width: 30rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--paper-3); font-size: 0.85rem; }

/* ── Scroll reveal (rack-focus) ─────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(8px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), filter 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; filter: none; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter--flip .chapter-grid > .chapter-text { order: 0; }
  .cell, .cell.wide { grid-column: span 6; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .chapter-shots.two { grid-template-columns: 1fr; }
  .chapter-shots.two .shot:nth-child(2) { margin-top: 0; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .cell, .cell.wide { grid-column: span 12; }
  .footer-grid { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .shot figcaption { position: static; border-radius: 0; border: 0; border-top: 1px solid var(--line); background: var(--ink-0); }
  .nav .btn-ghost { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .hero-shot { opacity: 1; transform: none; animation: none; }
  .ticker-track { animation: none; }
  .btn, .cell { transition: none; }
}

/* Detail crops are shown near 1:1 so 2x captures stay crisp. */
.shot--detail { max-width: 520px; margin-inline: auto; }

/* Cropped figures carry their caption below the image, never over it. */
.shot--detail figcaption, .shot--form figcaption, .shot--dialog figcaption {
  position: static; border-radius: 0; border: 0; border-top: 1px solid var(--line);
  background: var(--ink-0); backdrop-filter: none;
}
.shot--form { max-width: 720px; margin-inline: auto; }
