/* ══════════════════════════════════════════════════════════════
   ZAM-VISION /next — editorial paper ground, live product inside.
   Tokens mirror the shipped landing (1088ac5) so the two read as
   one brand; this file adds the demo-surface and stage layers.
   ══════════════════════════════════════════════════════════════ */

:root {
  --paper:        #faf9f6;
  --paper-raised: #ffffff;
  --paper-deep:   #f2f0ea;
  --paper-ink:    #14130f;

  --ink:    #14130f;                /* 17.7:1 on paper */
  --ink-2:  rgba(20,19,15,0.72);    /*  7.2:1 */
  --ink-3:  rgba(20,19,15,0.60);    /*  4.7:1 — AA floor */
  --ink-4:  rgba(20,19,15,0.34);    /*  decorative only */

  --rule:      rgba(20,19,15,0.13);
  --rule-soft: rgba(20,19,15,0.07);

  --accent:      #c0271f;
  --accent-ink:  #9e1b15;
  --accent-tint: rgba(192,39,31,0.08);
  --accent-line: rgba(192,39,31,0.28);

  --lift-1: 0 1px 2px rgba(20,19,15,0.04), 0 2px 8px rgba(20,19,15,0.04);
  --lift-2: 0 2px 4px rgba(20,19,15,0.05), 0 12px 28px rgba(20,19,15,0.09);
  --lift-3: 0 4px 8px rgba(20,19,15,0.06), 0 24px 56px rgba(20,19,15,0.13);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1240px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400; line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
::selection { background: var(--accent); color: #fff; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Focus ring — one definition, visible on every interactive thing.
   :focus-visible only, so mouse users never see it. */
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Paper tooth — dark speckle under multiply. White grain is a no-op here. */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 140px 0; position: relative; }
section[id], header[id] { scroll-margin-top: 92px; }
@media (max-width: 720px) {
  section { padding: 88px 0; }
  section[id] { scroll-margin-top: 80px; }
}

/* ── Type scale ───────────────────────────────────────────── */
.eyebrow {
  font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 600; margin-bottom: 18px;
}
.h-display {
  font-family: var(--serif);
  font-size: clamp(54px, 9.5vw, 132px);
  font-weight: 700; font-variation-settings: 'opsz' 144, 'wght' 700;
  letter-spacing: -0.045em; line-height: 0.9;
}
.h-section {
  font-family: var(--serif);
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 700; font-variation-settings: 'opsz' 144, 'wght' 700;
  letter-spacing: -0.035em; line-height: 1.03;
  margin-bottom: 24px;
}
.h-display em, .h-section em {
  font-style: italic; font-weight: 400; color: var(--accent);
  font-variation-settings: 'opsz' 144;
  /* Fraunces' italic 'l' is a curled WONK alternate that nests with its
     neighbour by design — not a defect. It just needs air: the roman's
     display tracking (-0.035em) is too tight for it, and the exit stroke
     overhangs its advance width into the following word.
     wght is pinned only so the axis never depends on the file's default. */
  font-variation-settings: 'opsz' 144, 'wght' 400;
  letter-spacing: 0.02em;
  padding-right: .08em;
}
.lead {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--ink-2); max-width: 620px; line-height: 1.65;
}

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  padding: 16px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.nav.is-stuck {
  background: rgba(250,249,246,0.82);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--rule);
}
.nav-logo { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
.nav-logo span { color: var(--accent); }
.nav-spacer { flex: 1 1 auto; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.nav-links a:hover { background: var(--paper-deep); color: var(--ink); }
/* Below 900px the links collapse into ⌘K — the brand never leaves. */
@media (max-width: 900px) { .nav-links { display: none; } }

.kbd-hint {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper-raised);
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  transition: border-color .2s, color .2s;
}
.kbd-hint:hover { border-color: var(--ink-4); color: var(--ink); }
.kbd-hint kbd {
  font-family: var(--mono); font-size: 11px;
  padding: 1px 5px; border-radius: 4px;
  background: var(--paper-deep); border: 1px solid var(--rule);
  color: var(--ink-2);
}
@media (max-width: 560px) { .kbd-hint .kbd-label { display: none; } }

.lang-toggle { display: flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--paper-raised); }
.lang-toggle button {
  padding: 7px 11px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-3); transition: background .2s, color .2s;
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 120px var(--gutter) 72px;
  overflow: hidden;
  isolation: isolate;
}
#stage {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  /* The canvas is decoration; the headline carries the meaning. So the canvas
     simply isn't painted where the type lives — a slab can never fight the
     headline for the same pixels, and the fade reads as depth of field. */
  -webkit-mask-image: radial-gradient(ellipse 48% 44% at 50% 45%, transparent 40%, #000 92%);
  mask-image: radial-gradient(ellipse 48% 44% at 50% 45%, transparent 40%, #000 92%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(rgba(20,19,15,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,19,15,0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 78% 62% at 50% 45%, #000 28%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 45%, #000 28%, transparent 78%);
}
.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 900px; }
.hero-sub { font-size: clamp(16px, 2vw, 21px); color: var(--ink-2); max-width: 600px; margin: 28px auto 36px; }

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 30px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 6px rgba(192,39,31,.20), 0 10px 24px rgba(192,39,31,.16);
}
.btn-primary:hover { background: var(--accent-ink); transform: translateY(-2px); }
.btn-ghost { background: var(--paper-raised); color: var(--ink); border: 1px solid var(--rule); box-shadow: var(--lift-1); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--lift-2); }

/* Live proof strip — real numbers, wired to stats.json */
.proof {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 44px;
}
.proof-item {
  display: flex; align-items: baseline; gap: 7px;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--rule);
  /* Near-opaque on purpose: a 3D tile can drift behind these, and a measured
     contrast ratio is only meaningful if the backdrop is actually known. */
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 12.5px; color: var(--ink-3); letter-spacing: .03em;
}
.proof-item b {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums;
}

/* ── Scroll cue ───────────────────────────────────────────── */
.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; translate: -50% 0; z-index: 2;
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  /* ink-4 is decorative-only (2.2:1) — this is real text, so it takes ink-3. */
  color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue i { display: block; width: 1px; height: 30px; background: linear-gradient(var(--ink-4), transparent); }

/* ── Reveal ───────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.stagger > * { opacity: 0; transform: translateY(18px); transition: opacity .65s cubic-bezier(.2,.8,.2,1), transform .65s cubic-bezier(.2,.8,.2,1); }
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1) { transition-delay: .04s }
.stagger.in > *:nth-child(2) { transition-delay: .10s }
.stagger.in > *:nth-child(3) { transition-delay: .16s }
.stagger.in > *:nth-child(4) { transition-delay: .22s }
.stagger.in > *:nth-child(5) { transition-delay: .28s }
.stagger.in > *:nth-child(6) { transition-delay: .34s }
.stagger.in > *:nth-child(7) { transition-delay: .40s }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; }
}

/* ── CSS tile cluster — the hero wherever WebGL doesn't run ──
   app.js sets .has-webgl on <html> once the 3D hero mounts; until and
   unless that happens these are the hero, so the page is never bare. */
.tiles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
html.has-webgl .tiles { display: none; }
.tile {
  position: absolute; left: var(--x); top: var(--y);
  width: clamp(46px, 13vw, 88px); aspect-ratio: 1;
  border-radius: 22%;
  background: var(--paper-raised);
  box-shadow: 0 1px 2px rgba(20,19,15,.06), 0 14px 30px rgba(20,19,15,.10);
  transform: rotate(var(--r));
  animation: tile-float 9s ease-in-out infinite alternate;
  animation-delay: var(--d);
  opacity: .92;
}
/* inset, not padding: percentage padding resolves against the CONTAINING
   BLOCK's width (here the full-bleed .tiles), which collapsed the icon to
   zero. inset on an absolute child resolves against this tile's own box. */
.tile img {
  position: absolute; inset: 12%;
  width: auto; height: auto;
  border-radius: 16%; object-fit: cover;
}
@keyframes tile-float {
  from { translate: 0 0; }
  to   { translate: 0 -14px; }
}
/* Keep the cluster out of the content's way, same idea as the canvas mask. */
.tiles {
  -webkit-mask-image: radial-gradient(ellipse 50% 42% at 50% 46%, transparent 44%, #000 92%);
          mask-image: radial-gradient(ellipse 50% 42% at 50% 46%, transparent 44%, #000 92%);
}
/* Phone: the hero column is narrow and tall, so the tiles have nowhere to go
   except over the type. They step back to being texture — quieter, smaller,
   and cleared from a much taller central band. */
@media (max-width: 640px) {
  .tiles {
    opacity: .5;
    -webkit-mask-image: radial-gradient(ellipse 72% 46% at 50% 47%, transparent 52%, #000 96%);
            mask-image: radial-gradient(ellipse 72% 46% at 50% 47%, transparent 52%, #000 96%);
  }
  .tile { width: clamp(40px, 11vw, 56px); box-shadow: 0 8px 20px rgba(20,19,15,.09); }
}
@media (prefers-reduced-motion: reduce) { .tile { animation: none; } }
