/* ════════════════════════════════════════════════════════════════
   Meridies — story sections below the intro stage.

   Colour carries the same meaning as the visualisation:
     GOLD  #ffb85c  a voice, a memory, the direction ahead
     COOL  #c7e6ff  the sensing sweep, the space being felt
   Gold marks the human half, cool the machine half. Same grammar
   as the shader, so the page reads as one piece.

   Typeface weights are limited to the ones index.html loads:
   Cormorant 500/600 + italic 400/500, Hanken Grotesk 400/500.
   ════════════════════════════════════════════════════════════════ */

:root{
  /* --gold, --gold-light, --cool* are declared in styles.css so the
     stage and the story share one palette. These are local to the page. */
  --gold-glow:rgba(255,184,92,.5);
  --pill:rgba(26,17,6,.66);
  --pill-cool:rgba(10,18,27,.7);
}

/* The stage locks the page with height:100% + overflow:hidden.
   Once the story exists the document has to be taller than that, so
   release it here. story.js adds .story-ready when the intro has
   handed over, or on its own if the intro never gets there. */
html{height:auto}
body.story-ready{
  height:auto;min-height:100%;
  overflow-y:auto;overflow-x:hidden;
  touch-action:auto;user-select:auto;-webkit-user-select:auto;
}
/* Before handover the page stays locked on the stage. */
body:not(.story-ready) #story,
body:not(.story-ready) #stage-spacer{display:none}

/* The fixed canvas shows through here. */
#stage-spacer{height:100svh;pointer-events:none}

/* Fade the intro chrome once the reader scrolls past the stage. */
body.scrolled #hud,
body.scrolled #skip,
body.scrolled #caption,
body.scrolled #mems{opacity:0!important;pointer-events:none!important}
body.scrolled #topbar{background:linear-gradient(to bottom,rgba(0,0,0,.92),rgba(0,0,0,0))}

#scrollCue{
  position:fixed;left:50%;transform:translateX(-50%);
  bottom:calc(env(safe-area-inset-bottom,0px) + 18px);
  z-index:8;opacity:0;pointer-events:none;transition:opacity .8s ease;
}
body.story-ready #scrollCue{opacity:.62;pointer-events:auto}
body.scrolled #scrollCue{opacity:0;pointer-events:none}

/* ── shell ──────────────────────────────────────────────────── */
#story{
  position:relative;z-index:9;
  background:var(--bg);
}
/* The stage bleeds into the text rather than cutting: a soft gold
   light above the fold, the same warmth the canvas leaves behind. */
#story::before{
  content:"";position:absolute;left:50%;top:0;translate:-50% -100%;
  width:min(1100px,150vw);height:340px;pointer-events:none;
  background:radial-gradient(60% 100% at 50% 100%,rgba(255,184,92,.14),transparent 72%);
}
.st{padding:clamp(72px,11vw,150px) 0;position:relative}
/* Dividers are a thread of light, brightest at the centre. */
.st+.st::before,.st-foot::before{
  content:"";position:absolute;left:50%;top:0;translate:-50% 0;
  width:min(1160px,calc(100% - clamp(32px,8vw,96px)));height:1px;
  background:linear-gradient(to right,transparent,var(--ink-4) 18%,var(--ink-4) 82%,transparent);
}
.st-in{
  width:min(1160px,calc(100% - clamp(32px,8vw,96px)));
  margin:0 auto;
  display:flex;flex-direction:column;gap:clamp(28px,4vw,46px);
}

.kick{
  margin:0;font:500 13px/1 var(--sans);
  letter-spacing:.2em;text-transform:uppercase;color:var(--gold);
}
#story h2{
  margin:0;max-width:17ch;
  font:500 clamp(32px,5.4vw,66px)/1.07 var(--serif);
  letter-spacing:.004em;color:var(--ink);text-wrap:balance;
}
#story h3{
  margin:0;font:600 clamp(19px,2vw,25px)/1.25 var(--serif);color:var(--ink);
}
.lede{
  margin:0;max-width:62ch;
  font:400 clamp(17px,1.8vw,22px)/1.55 var(--sans);color:var(--ink-2);
}
.src{margin:0;font:italic 400 15px/1.5 var(--serif);color:var(--ink-3)}

/* ── problem · the sensing half, so cool ────────────────────── */
.stats{display:grid;gap:clamp(20px,2.6vw,34px);grid-template-columns:repeat(auto-fit,minmax(248px,1fr))}
.stat{display:flex;flex-direction:column;gap:10px;padding-top:26px;border-top:1px solid var(--cool-4)}
.num{margin:0;font:500 clamp(48px,6.4vw,78px)/.92 var(--serif);color:var(--cool)}
.stat-h{margin:0;font:500 clamp(17px,1.7vw,20px)/1.3 var(--sans);color:var(--ink)}
.stat-b{margin:0;font:400 16px/1.55 var(--sans);color:var(--ink-3)}

/* ── comparison ─────────────────────────────────────────────── */
.vs{display:grid;gap:clamp(18px,2.4vw,28px);grid-template-columns:repeat(auto-fit,minmax(286px,1fr))}
.vs-col{padding:clamp(26px,3vw,38px);border:1px solid var(--ink-4);border-radius:18px}
.vs-col h3{color:var(--ink-3);margin-bottom:6px}
/* The memory column glows like a memory marker on the stage. */
.vs-on{
  border-color:var(--gold-glow);background:var(--pill);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  box-shadow:0 0 70px -24px rgba(255,184,92,.4);
}
.vs-on h3{color:var(--gold-light);font-style:italic;font-weight:500}
.vs dl,.box dl{margin:0;display:flex;flex-direction:column;gap:20px}
.vs dt,.box dt{font:500 12px/1.2 var(--sans);letter-spacing:.16em;text-transform:uppercase;color:var(--ink-3)}
.vs dd{margin:5px 0 0;font:400 clamp(17px,1.7vw,21px)/1.35 var(--sans);color:var(--ink-2)}
.vs-on dd{color:var(--ink)}

/* ── why a voice · the human half ───────────────────────────── */
#voice .p-card{border-top-color:var(--gold-glow)}
#voice h3{font-style:italic;font-weight:500;color:var(--gold-light)}

/* ── gestures ───────────────────────────────────────────────── */
.gest{display:grid;gap:clamp(22px,3vw,36px);grid-template-columns:repeat(auto-fit,minmax(248px,1fr))}
.g{display:flex;flex-direction:column;gap:11px}
.g svg{width:46px;height:46px;overflow:visible}
.g-k{margin:4px 0 0;font:500 12px/1 var(--sans);letter-spacing:.18em;text-transform:uppercase;color:var(--gold)}
.g-b{margin:0;font:400 16px/1.55 var(--sans);color:var(--ink-3)}

.pull{padding:clamp(26px,3vw,38px);border-left:2px solid var(--gold-light)}
.pull p{margin:0;max-width:46ch;font:italic 500 clamp(21px,2.6vw,31px)/1.3 var(--serif);color:var(--ink)}

/* ── accessibility band · machine side, so cool ─────────────── */
.a11y{
  padding:clamp(26px,3vw,38px);
  border:1px solid var(--cool-4);border-radius:18px;
  background:var(--pill-cool);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  display:flex;flex-direction:column;gap:18px;
}
.a11y .kick{color:var(--cool-light)}
.a11y ul{
  margin:0;padding:0;list-style:none;
  display:grid;gap:12px clamp(22px,3vw,42px);
  grid-template-columns:repeat(auto-fit,minmax(272px,1fr));
}
.a11y li{position:relative;padding-left:22px;font:400 16px/1.55 var(--sans);color:var(--ink-2)}
.a11y li::before{
  content:"";position:absolute;left:0;top:.62em;
  width:7px;height:7px;border-radius:50%;background:var(--cool-light);
  box-shadow:0 0 10px rgba(199,230,255,.45);
}

/* ── demo ───────────────────────────────────────────────────── */
.vid{position:relative;aspect-ratio:16/9;border:1px solid var(--ink-4);border-radius:18px;overflow:hidden;background:#06060a}
.vid iframe,.vid video{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}
.vid-ph{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;
  background:radial-gradient(52% 62% at 50% 50%,rgba(255,184,92,.09),transparent 70%)}
.vid-ph svg{width:62px;height:62px}
.vid-ph p{margin:0;font:italic 400 17px/1 var(--serif);color:var(--ink-3)}

/* Buttons echo the memory pill on the stage. */
.links{display:flex;flex-wrap:wrap;gap:14px}
.btn-gold,.btn-ghost{
  display:inline-block;padding:15px 30px;border-radius:999px;
  font:500 16px/1 var(--sans);text-decoration:none;
  transition:border-color .3s,color .3s,box-shadow .3s;
}
.btn-gold{
  border:1px solid var(--gold-glow);background:var(--pill);color:var(--gold-light);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  box-shadow:0 0 44px -18px rgba(255,184,92,.6);
}
.btn-gold:hover{border-color:var(--gold-light);box-shadow:0 0 54px -14px rgba(255,184,92,.75)}
.btn-ghost{border:1px solid var(--ink-4);color:var(--ink-2)}
.btn-ghost:hover{border-color:var(--ink-3);color:var(--ink)}

/* ── built with · the data half, so cool ────────────────────── */
.two{display:grid;gap:clamp(18px,2.4vw,28px);grid-template-columns:repeat(auto-fit,minmax(304px,1fr))}
.box{padding:clamp(26px,3vw,38px);border:1px solid var(--cool-4);border-radius:18px;display:flex;flex-direction:column;gap:24px}
.two:has(.box:only-child) .box dl{display:grid;gap:24px clamp(24px,3vw,44px);grid-template-columns:repeat(auto-fit,minmax(268px,1fr))}
.box-dash{border-style:dashed;border-color:var(--ink-4)}
.box dd{margin:5px 0 0;font:400 16px/1.55 var(--sans);color:var(--ink-3)}

/* ── privacy · about people, so gold ────────────────────────── */
.three{display:grid;gap:clamp(20px,2.6vw,32px);grid-template-columns:repeat(auto-fit,minmax(252px,1fr))}
.p-card{display:flex;flex-direction:column;gap:11px;padding-top:24px;border-top:1px solid var(--ink-4)}
.p-card p{margin:0;font:400 16px/1.55 var(--sans);color:var(--ink-3)}
#privacy .p-card{border-top-color:var(--gold-glow)}
.rule{
  margin:0;max-width:52ch;padding-left:clamp(20px,2.6vw,32px);
  border-left:2px solid var(--gold-light);
  font:italic 400 clamp(19px,2.3vw,27px)/1.4 var(--serif);color:var(--ink-2);
}

/* ── team ───────────────────────────────────────────────────── */
.team{margin:0;padding:0;list-style:none;display:grid;gap:clamp(20px,2.6vw,32px);grid-template-columns:repeat(auto-fit,minmax(236px,1fr))}
.team li{display:flex;flex-direction:column;gap:7px;padding-top:24px;border-top:1px solid var(--ink-4)}
.t-n{margin:0;font:italic 500 clamp(21px,2.2vw,27px)/1.2 var(--serif);color:var(--ink)}
.t-r{margin:0;font:400 16px/1.45 var(--sans);color:var(--ink-3)}
.t-l{margin:4px 0 0;font:400 15px/1.4 var(--sans)}
.t-l a{color:var(--gold);text-decoration:none;text-decoration-color:var(--ink-4);text-underline-offset:5px}
.t-l a:hover{text-decoration:underline}

/* ── footer ─────────────────────────────────────────────────── */
.st-foot{position:relative;padding:38px 0 calc(env(safe-area-inset-bottom,0px) + 38px)}
.foot-row{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 28px;font:400 15px/1.4 var(--sans);color:var(--ink-3)}
.f-brand{font:italic 500 22px/1 var(--serif);color:var(--ink)}
.foot-row a{color:var(--gold);text-decoration:none}

/* ── reveal · same slow ease as the stage ───────────────────── */
.st-in>*{opacity:0;transform:translateY(18px);transition:opacity 1.2s ease,transform 1.2s ease}
.st.seen .st-in>*{opacity:1;transform:none}
.st.seen .st-in>*:nth-child(2){transition-delay:.09s}
.st.seen .st-in>*:nth-child(3){transition-delay:.18s}
.st.seen .st-in>*:nth-child(4){transition-delay:.27s}
.st.seen .st-in>*:nth-child(5){transition-delay:.36s}
.st-foot .st-in>*{opacity:1;transform:none}

@media (prefers-reduced-motion:reduce){
  .st-in>*{opacity:1!important;transform:none!important;transition:none!important}
}

#story :focus-visible{outline:2px solid var(--gold);outline-offset:3px;border-radius:4px}

/* ── figures ────────────────────────────────────────────────── */
.fig{margin:0;display:flex;flex-direction:column;gap:16px}
.fig svg{display:block;width:100%;height:auto;overflow:visible}
.fig figcaption{
  margin:0;max-width:64ch;
  font:italic 400 clamp(15px,1.5vw,18px)/1.5 var(--serif);
  color:var(--ink-3);
}
/* the paired comparison reads better with a little more room */
.fig-pair svg{max-width:960px;margin:0 auto}

.prod-grid{
  display:grid;gap:clamp(20px,3vw,40px);
  grid-template-columns:repeat(auto-fit,minmax(286px,1fr));
  align-items:center;
}
.prod-grid svg{width:100%;height:auto}

/* ── wordmark ───────────────────────────────────────────────── */
.h-mark{line-height:0}
.h-mark img{display:block;width:min(340px,62vw);height:auto}
.f-mark{display:block;width:150px;height:auto}
