/* ============================================================
   FOR THE PEOPLE OF 6230 — art direction prototype
   Paper & ink. One signal colour, borrowed from the Marlston
   Hill lighthouse: red on white, and only ever used to mean
   "counted".
   Single committed visual world — deliberately not theme-reactive.
   ============================================================ */

:root{
  --paper:#FFFFFF;
  --ink:#0C0C0D;
  --ink-80:rgba(12,12,13,.80);
  --ink-45:rgba(12,12,13,.45);
  --ink-14:rgba(12,12,13,.14);
  --paper-70:rgba(255,255,255,.70);
  --paper-38:rgba(255,255,255,.38);
  --paper-14:rgba(255,255,255,.14);
  --signal:#D42A20;      /* lighthouse red */
  --signal-dim:#8E1C15;

  --gutter:clamp(16px,3.4vw,46px);
  --rule:1px;

  --d1:clamp(2.9rem,10.6vw,9.6rem);
  --d2:clamp(2.1rem,6.8vw,5.6rem);
  --d3:clamp(1.35rem,3.4vw,2.7rem);
  --serif:clamp(1.02rem,1.35vw,1.3rem);
  --mono:clamp(9.5px,.78vw,11px);

  --ff-display:"Archivo","Helvetica Neue",Helvetica,Arial,sans-serif;
  --ff-read:"Newsreader",Georgia,"Times New Roman",serif;
  --ff-data:"Fragment Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  --ease-snap:cubic-bezier(.16,1,.3,1);
}

*{box-sizing:border-box}
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--ff-display);
  font-variation-settings:"wdth" 100,"wght" 400;
  overflow-x:clip;
}
body.lenis-stopped{overflow:hidden}

/* ---------- primitives ---------- */
.mono{
  font-family:var(--ff-data);
  font-size:var(--mono);
  letter-spacing:.09em;
  text-transform:uppercase;
  font-variant-numeric:tabular-nums;
  line-height:1.4;
}
.disp{
  font-family:var(--ff-display);
  font-variation-settings:"wdth" 112,"wght" 760;
  letter-spacing:-.035em;
  line-height:.86;
  text-transform:uppercase;
  text-wrap:balance;
  margin:0;
}
.read{
  font-family:var(--ff-read);
  font-variation-settings:"opsz" 22,"wght" 380;
  font-size:var(--serif);
  line-height:1.5;
  letter-spacing:-.005em;
  max-width:34ch;
}
.rule{height:var(--rule);background:var(--ink-14);border:0;margin:0}
.on-ink .rule{background:var(--paper-14)}

/* masked line reveal helper (SplitText writes into these) */
.line-mask{overflow:hidden;display:block}

/* ---------- fixed chrome ---------- */
#grain{
  position:fixed; inset:-20%; z-index:60; pointer-events:none;
  opacity:.34; mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='220' height='220' filter='url(%23n)' opacity='.55'/></svg>");
}

#topbar{
  position:fixed; top:0; left:0; right:0; z-index:50;
  display:flex; justify-content:space-between; align-items:flex-start; gap:16px;
  padding:calc(14px + env(safe-area-inset-top,0px)) var(--gutter) 14px;
  mix-blend-mode:difference;
  pointer-events:none;
}
#topbar .mono{color:#fff}
#topbar nav{display:flex; gap:18px}

#spy{
  position:fixed; left:var(--gutter); z-index:50;
  bottom:calc(18px + env(safe-area-inset-bottom,0px));
  display:flex; flex-direction:column; gap:5px; align-items:flex-start;
  pointer-events:none;
}
.spy-item{position:relative; display:block; --p:0}
.spy-item .base{color:var(--ink-45)}
.on-ink-spy .spy-item .base{color:var(--paper-38)}
.spy-item .fill{
  position:absolute; inset:0; white-space:nowrap;
  background:var(--signal); color:var(--paper);
  padding:0 2px; margin:0 -2px;
  clip-path:inset(0 calc(100% - var(--p,0)*100%) 0 0);
}

#ledger{
  position:fixed; right:var(--gutter); z-index:50;
  bottom:calc(18px + env(safe-area-inset-bottom,0px));
  text-align:right; color:var(--ink-45); pointer-events:none;
}
.on-ink-spy #ledger{color:var(--paper-38)}
#ledger b{color:var(--signal); font-weight:inherit}

/* ---------- ingress ---------- */
#ingress{
  position:fixed; inset:0; z-index:80; background:var(--paper);
  display:flex; align-items:flex-end; justify-content:center;
  padding-bottom:calc(6vh + env(safe-area-inset-bottom,0px));
}
#ingress .mono{color:var(--ink); letter-spacing:.14em}

/* ---------- scene shell ---------- */
.scene{position:relative; width:100%; min-height:100svh; overflow:hidden}
.scene-inner{
  position:relative; width:100%; min-height:100svh;
  padding:clamp(64px,9vh,110px) var(--gutter) clamp(84px,12vh,130px);
  display:flex; flex-direction:column;
}
.on-ink{background:var(--ink); color:var(--paper)}
.on-ink .mono{color:var(--paper-70)}

/* ---------- 01 hero ---------- */
#hero .scene-inner{justify-content:center; align-items:center; text-align:center; gap:clamp(18px,3.4vh,40px)}
#markWrap{width:clamp(250px,36vw,520px); will-change:transform}
#markWrap svg{display:block; width:100%; height:auto; max-height:34svh}
#heroLine{font-size:var(--d1)}
#heroSub{color:var(--ink-45); max-width:none; text-align:center}
.hero-meta{
  position:absolute; left:var(--gutter); right:var(--gutter);
  bottom:clamp(84px,12vh,130px);
  display:flex; justify-content:space-between; gap:18px; color:var(--ink-45);
}

/* ---------- 02 coulda ---------- */
#coulda .scene-inner{justify-content:center; gap:clamp(4px,1.2vh,14px)}
.strike{position:relative; display:inline-block}
.strike i{
  position:absolute; left:-.03em; right:-.03em; top:52%; height:.055em;
  background:var(--signal); transform:scaleX(0); transform-origin:0 50%;
}
#coulda .disp{font-size:var(--d2)}
#didnt{
  font-family:var(--ff-read); font-style:italic;
  font-variation-settings:"opsz" 60,"wght" 300;
  font-size:var(--d3); text-transform:none; letter-spacing:-.02em;
  color:var(--paper-70); margin-top:.35em;
}

/* ---------- 03 the count ---------- */
#count .scene-inner{gap:clamp(20px,4vh,44px)}
#count h2{font-size:var(--d3); max-width:16ch}
.count-stage{
  flex:1; display:grid; gap:clamp(20px,4vw,64px);
  grid-template-columns:minmax(120px,auto) 1fr; align-items:start;
}
.count-col h3{margin:0 0 10px}
.field{display:grid; gap:3px}
#room{grid-template-columns:repeat(4,1fr); width:clamp(72px,9vw,110px)}
#home{grid-template-columns:repeat(22,1fr)}
.cell{aspect-ratio:1/1; border:1px solid var(--paper-14); background:transparent}
.cell.red{background:var(--signal); border-color:var(--signal)}
.cell.on{background:var(--paper); border-color:var(--paper)}
.count-foot{display:flex; justify-content:space-between; align-items:flex-end; gap:24px; flex-wrap:wrap}
#tally{
  font-family:var(--ff-display);
  font-variation-settings:"wdth" 118,"wght" 800;
  font-size:clamp(2.6rem,9vw,7.5rem); line-height:.82; letter-spacing:-.04em;
  font-variant-numeric:tabular-nums; color:var(--signal);
}
#count .read{color:var(--paper-70)}

/* ---------- 04 why this matters ---------- */
#why .scene-inner{
  display:grid; gap:clamp(20px,4vw,60px); align-content:center;
  grid-template-columns:minmax(0,1fr) minmax(200px,26vw) minmax(0,1fr);
}
#whyIndex{display:flex; flex-direction:column; gap:12px; align-self:center}
#whyIndex li{list-style:none; display:flex; gap:12px; color:var(--ink-45); transition:color .35s}
#whyIndex li.is-on{color:var(--ink)}
#whyIndex li.is-on em{color:var(--signal); font-style:normal}
#whyMark{align-self:center; justify-self:center; width:100%; max-width:420px}
#whyMark svg{display:block; width:100%; height:auto}
#whyChapters{position:relative; align-self:center; min-height:clamp(240px,34vh,320px)}
.chapter{position:absolute; inset:0; display:flex; flex-direction:column; gap:14px; justify-content:center}
.chapter h3{font-size:clamp(1.5rem,2.8vw,2.3rem); margin:0}
.chapter .read{max-width:36ch}

/* ---------- 05 open now ---------- */
#open .scene-inner{gap:clamp(20px,4vh,40px)}
#open h2{font-size:var(--d3)}
.rows{display:flex; flex-direction:column; margin-top:clamp(8px,2vh,24px)}
.row{
  position:relative; isolation:isolate; display:grid; align-items:center; gap:clamp(10px,2vw,28px);
  grid-template-columns:3.2ch minmax(0,1.5fr) 7ch minmax(0,1fr) auto;
  padding:clamp(14px,2.2vh,22px) 4px;
  border-top:var(--rule) solid var(--ink-14);
  text-decoration:none; color:inherit;
}
.row:last-child{border-bottom:var(--rule) solid var(--ink-14)}
.row .title{
  font-variation-settings:"wdth" 104,"wght" 560;
  font-size:clamp(1.05rem,2.3vw,1.95rem); letter-spacing:-.03em; line-height:1.05;
}
.row .tally{color:var(--signal); font-variant-numeric:tabular-nums}
.row .chip{
  width:30px; height:30px; display:grid; place-items:center;
  border:var(--rule) solid var(--ink-14); border-radius:50%;
  transition:background .3s var(--ease-snap),border-color .3s,color .3s,transform .3s var(--ease-snap);
}
.row .swipe{
  position:absolute; inset:0; background:var(--ink); z-index:-1;
  transform:scaleY(0); transform-origin:50% 100%; transition:transform .42s var(--ease-snap);
}
.row:hover,.row:focus-visible{color:var(--paper); outline:none}
.row:hover .swipe,.row:focus-visible .swipe{transform:scaleY(1)}
.row:hover .chip,.row:focus-visible .chip{background:var(--signal); border-color:var(--signal); color:var(--paper); transform:rotate(-45deg)}
.row:hover .tally,.row:focus-visible .tally{color:var(--paper)}
.ticks{position:absolute; inset:0; pointer-events:none; opacity:0; transition:opacity .3s}
.row:hover .ticks,.row:focus-visible .ticks{opacity:1}
.ticks span{position:absolute; width:4px; height:4px; background:var(--signal)}
.ticks span:nth-child(1){top:-2px; left:-2px}
.ticks span:nth-child(2){top:-2px; right:-2px}
.ticks span:nth-child(3){bottom:-2px; left:-2px}
.ticks span:nth-child(4){bottom:-2px; right:-2px}

/* ---------- 06 join ---------- */
#join .scene-inner{justify-content:center; gap:clamp(18px,3.4vh,36px)}
#joinBig{
  font-family:var(--ff-display); font-variation-settings:"wdth" 120,"wght" 840;
  font-size:clamp(4rem,20vw,17rem); line-height:.78; letter-spacing:-.05em;
  font-variant-numeric:tabular-nums; color:var(--signal); margin:0;
}
.join-form{display:flex; flex-wrap:wrap; gap:14px 22px; align-items:flex-end; margin-top:8px}
.field-line{display:flex; flex-direction:column; gap:7px; flex:1 1 210px; min-width:0}
.field-line label{color:var(--paper-38)}
.field-line input{
  appearance:none; background:transparent; border:0;
  border-bottom:var(--rule) solid var(--paper-14);
  color:var(--paper); font-family:var(--ff-display); font-size:1.05rem;
  padding:6px 0; min-width:0;
}
.field-line input::placeholder{color:var(--paper-14)}
.field-line input:focus{outline:none; border-bottom-color:var(--signal)}
#joinBtn{
  font-family:var(--ff-data); font-size:var(--mono); letter-spacing:.14em; text-transform:uppercase;
  background:var(--signal); color:var(--paper); border:0; cursor:pointer;
  padding:14px 22px; display:inline-flex; gap:12px; align-items:center;
  transition:background .25s;
}
#joinBtn:hover,#joinBtn:focus-visible{background:var(--paper); color:var(--ink); outline:none}
#joinNote{color:var(--paper-38); max-width:46ch}

/* ---------- 07 marquee / colophon ---------- */
#tail{background:var(--ink); color:var(--paper); padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}
.marquee{overflow:hidden; border-block:var(--rule) solid var(--paper-14); padding:clamp(14px,2.4vh,26px) 0}
.marquee-track{display:flex; width:max-content; will-change:transform}
.marquee-item{
  display:flex; align-items:center; gap:clamp(20px,3vw,44px); padding-right:clamp(20px,3vw,44px);
  font-variation-settings:"wdth" 108,"wght" 700;
  font-size:clamp(1.6rem,4.6vw,3.4rem); letter-spacing:-.03em; text-transform:uppercase; white-space:nowrap;
}
/* one square = one person counted. Same unit as the count field. */
.marquee-item .pip{width:.34em; height:.34em; background:var(--signal); flex:none; display:block}
.colophon{
  display:flex; justify-content:space-between; gap:18px; flex-wrap:wrap;
  padding:clamp(20px,4vh,40px) var(--gutter) 0; color:var(--paper-38);
}

@media (max-width:860px){
  #why .scene-inner{grid-template-columns:1fr; gap:26px}
  #whyMark{max-width:260px; order:-1}
  #whyIndex{flex-direction:row; flex-wrap:wrap; gap:8px 18px}
  #whyChapters{min-height:260px}
  #home{grid-template-columns:repeat(16,1fr)}
  .count-stage{grid-template-columns:1fr; gap:22px}
  #room{grid-template-columns:repeat(11,1fr); width:min(100%,200px)}
  .row{grid-template-columns:2.6ch minmax(0,1fr) auto; row-gap:6px}
  .row .status,.row .year{grid-column:2; color:var(--ink-45)}
  #spy{display:none}
}
@media (prefers-reduced-motion:reduce){
  #grain{display:none}
  .marquee-track{transform:none!important}
}

/* ══════════════════════════════════════════════════════════
   LIVE-SITE WIRING — everything above this line is the
   prototype's stylesheet, unchanged. These rules only make its
   elements work as real links and a real form.
   ══════════════════════════════════════════════════════════ */
/* the bar ignores the pointer so it never blocks the page beneath —
   but its links have to be clickable */
#topbar a{pointer-events:auto}
#topbar nav a{color:inherit;text-decoration:none}
#topbar nav a:hover,#topbar nav a:focus-visible{text-decoration:underline;text-underline-offset:4px}
#topbar > a{color:inherit;text-decoration:none}
.row:not([href]){cursor:default}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#joinBtn[aria-busy="true"]{opacity:.6;cursor:progress}

/* the fixed chrome steps aside when the footer arrives — otherwise
   the spy's section labels and the ledger sit on the footer's text */
#spy,#ledger{transition:opacity .35s var(--ease-snap),visibility .35s}
.tail-in #spy,.tail-in #ledger{opacity:0;visibility:hidden}

.colophon nav{display:flex;flex-wrap:wrap;gap:6px 22px}
.colophon a{color:var(--paper-70);text-decoration:none}
.colophon a:hover{color:var(--paper);text-decoration:underline;text-underline-offset:4px}

/* four links and the wordmark don't fit one line on a phone:
   the nav drops to its own line, and no link breaks mid-phrase */
#topbar nav a{white-space:nowrap}
@media (max-width:640px){
  #topbar{flex-direction:column;align-items:flex-start;gap:6px}
  #topbar nav{gap:16px}
}

/* thumb-sized hit areas without changing how the bar looks */
#topbar a{padding:15px 6px;margin:-15px -6px}

/* phones: 9.5px mono labels are a squint — an 11px floor */
@media (max-width:859px){:root{--mono:11px}}

/* LIVE: phones open on three things — the rider, the headline, one
   line. The coordinates and scroll cue compete with the dock. */
@media (max-width:859px){
  #hero .hero-meta{display:none}
  #heroSub{font-size:12px;letter-spacing:.12em}
}
