/* =============================================================================
   THE GREAT TRUE-UP: layout and the look of every state.
   Uses names from theme.css only. stage.js sets data-state on .stage and
   data-cam / aria-pressed on the controls; this file decides what each looks like.

   Phone (and any narrow, tall screen): the diagram is pinned under the bar and the
   chapter text scrolls beneath it. Desktop: the text scrolls on the left, the diagram
   stays in view on the right. Without JavaScript: the diagram sits at the top and every
   chapter reads in order.

   The picture: Courthouse Square drawn as flat shapes. The owner and the operator stand in the
   foreground; the clock tower is the owner's landmark. Everything is drawn once as shared
   symbols in index.html and re-lit by state here.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--gt-bg);
  color: var(--gt-ink);
  font-family: var(--gt-font-body);
  font-size: var(--gt-text-md);
  line-height: 1.55;
}
h1, h2, h3 { font-family: var(--gt-font-display); font-weight: 400; line-height: 1.1; letter-spacing: -0.012em; text-wrap: balance; margin: 0; color: var(--gt-head); }
h1 { font-size: var(--gt-text-xxl); }
h2 { font-size: var(--gt-text-xl); }
h3 { font-size: var(--gt-text-lg); }
h1 em, h2 em { font-style: italic; color: var(--gt-accent); }
p, ol, ul { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gt-focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--gt-space-2); top: -4rem; z-index: 50; background: var(--gt-surface); padding: var(--gt-space-2) var(--gt-space-3); border: 2px solid var(--gt-ink); }
.skip:focus { top: var(--gt-space-2); }

/* ── Bar ───────────────────────────────────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--gt-bar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-inline: max(var(--gt-gutter), env(safe-area-inset-left, 0px)) max(var(--gt-gutter), env(safe-area-inset-right, 0px));
  background: var(--gt-bg);
  border-top: 3px solid var(--gt-crimson);
  border-bottom: 1px solid var(--gt-line);
  display: flex; align-items: center; gap: var(--gt-space-4);
}
.back {
  display: inline-flex; align-items: center; gap: var(--gt-space-1);
  min-height: var(--gt-tap); min-width: var(--gt-tap); padding-inline: var(--gt-space-1) var(--gt-space-3);
  margin-left: calc(-1 * var(--gt-space-1));
  font-size: var(--gt-text-xs); font-weight: 600; letter-spacing: 0.04em; text-decoration: none; color: var(--gt-muted);
  white-space: nowrap;
}
.back svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; flex: none; }
.back:hover { color: var(--gt-accent); }
/* A reader's link has no back link (only an Admin preview does): the divider that separates the title from it goes too, so nothing stands alone at the edge. */
.back[hidden] + .mark { border-left: 0; padding-left: 0; }
.mark {
  display: inline-flex; align-items: center; min-height: var(--gt-tap); margin-right: auto;
  padding-left: var(--gt-space-4); border-left: 1px solid var(--gt-line);
  font-family: var(--gt-font-display); font-style: italic; font-size: var(--gt-text-md); color: var(--gt-head);
  text-decoration: none; white-space: nowrap;
}
/* The rail takes only the room the bar leaves (the preview's back link shares it on a phone) and the named chapter shortens before it can run into anything. */
.rail { min-width: 0; flex: 0 1 auto; }
.rail ol { list-style: none; padding: 0; display: flex; gap: 0; min-width: 0; }
.rail a {
  display: flex; align-items: center; justify-content: center; gap: var(--gt-space-2);
  min-height: var(--gt-tap); min-width: var(--gt-tap); padding-inline: var(--gt-space-2);
  font-size: var(--gt-text-xs); text-decoration: none; color: var(--gt-muted);
}
.rail a::before { content: ""; width: 0.5rem; height: 0.5rem; transform: rotate(45deg); border: 1.5px solid var(--gt-muted); background: transparent; flex: none; }
.rail a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rail a[aria-current="true"] { color: var(--gt-ink); font-weight: 600; }
.rail a[aria-current="true"]::before { background: var(--gt-accent); border-color: var(--gt-accent); }
.rail a:hover::before { border-color: var(--gt-accent); }
/* On a phone the five diamonds are identical, so the current chapter is named beside them (the others stay reachable by their labels). */
.rail a[aria-current="true"] span { position: static; width: auto; height: auto; overflow: visible; clip: auto; margin-inline-start: var(--gt-space-2); font-size: var(--gt-text-sm); max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1200px) {
  .rail a span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .rail a { padding-inline: var(--gt-space-3); }
  .rail a:hover { color: var(--gt-ink); }
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.layout {
  max-width: var(--gt-page-w); margin: 0 auto;
  padding-inline: max(var(--gt-gutter), env(safe-area-inset-left, 0px)) max(var(--gt-gutter), env(safe-area-inset-right, 0px));
  display: grid; grid-template-columns: minmax(0, var(--gt-copy-w)) minmax(0, 1fr); column-gap: var(--gt-space-7);
}
.copy { grid-column: 1; grid-row: 1; min-width: 0; counter-reset: ch; }

/* The illustrated plate. On a large screen it is a rounded card with a caption under it;
   on a phone it runs edge to edge under the bar. */
.stage {
  grid-column: 2; grid-row: 1; align-self: start; min-width: 0;
  position: sticky; top: calc(var(--gt-bar-h) + env(safe-area-inset-top, 0px));
  height: calc(100svh - var(--gt-bar-h) - env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; gap: var(--gt-space-3);
  padding-block: var(--gt-space-5);
}
/* The plate keeps the scene's own proportions (640 x 556) and sits in the middle of the sticky stage. */
.stage { --art-w: min(100%, calc((100svh - var(--gt-bar-h) - var(--gt-space-5) * 2 - var(--gt-cap-h) - var(--gt-space-3)) * 1.151)); justify-content: center; }
.art, .cap { width: var(--art-w); margin-inline: auto; }
.art { position: relative; flex: none; aspect-ratio: 640 / 556; overflow: hidden; border-radius: var(--gt-radius-art); border: 1px solid var(--gt-line); background: var(--gt-sky-a1); }
.art .dia { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dia--tall { display: none; }
.cap {
  flex: none; min-height: var(--gt-cap-h); padding: var(--gt-space-2) var(--gt-space-4);
  border-left: 4px solid var(--gt-accent); background: var(--gt-surface);
  font-family: var(--gt-font-display); font-style: italic; font-size: var(--gt-text-md); line-height: 1.4; color: var(--gt-head);
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Chapters ──────────────────────────────────────────────────────────── */
.chapter {
  counter-increment: ch;
  min-height: calc(100svh - var(--gt-bar-h));
  display: flex; flex-direction: column; justify-content: center; gap: var(--gt-space-5);
  padding-block: var(--gt-space-7);
  scroll-margin-top: var(--gt-bar-h);
}
.chapter > * { max-width: 36rem; }
#question { counter-increment: none; }
#question::before { display: none; }
.chapter::before {
  content: counter(ch, decimal-leading-zero);
  align-self: flex-start;
  font-family: var(--gt-font-mono); font-size: var(--gt-text-xs); letter-spacing: 0.14em; color: var(--gt-accent);
  padding-right: var(--gt-space-6); padding-bottom: var(--gt-space-2); border-bottom: 1px solid var(--gt-accent);
}
.eyebrow { font-family: var(--gt-font-mono); font-size: var(--gt-text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gt-muted); line-height: 1.5; }
.lede { font-size: var(--gt-text-lg); line-height: 1.4; color: var(--gt-ink); }
.note { font-size: var(--gt-text-sm); color: var(--gt-muted); }

/* The co-brand lockup: two marks as partners, on a light plate so neither is recoloured. */
.lockup { max-width: none; }
.lockup-plate {
  display: inline-flex; align-items: center; gap: var(--gt-space-4);
  padding: var(--gt-space-2) var(--gt-space-4);
  background: var(--gt-plate); border: 1px solid var(--gt-line); border-bottom: 3px solid var(--gt-crimson);
}
.lockup img { display: block; width: auto; }
.logo-stiles { height: var(--gt-logo-stiles); }
.logo-ib { height: var(--gt-logo-ib); }
.with {
  font-family: var(--gt-font-display); font-style: italic; font-size: var(--gt-text-sm); color: var(--gt-plate-ink);
  padding-inline: var(--gt-space-3); border-inline: 1px solid var(--gt-line); line-height: 1.8;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--gt-space-3); text-align: left; align-self: flex-start;
  min-height: var(--gt-tap); padding: var(--gt-space-3) var(--gt-space-5);
  background: var(--gt-accent-fill); color: var(--gt-on-fill); border: 2px solid var(--gt-accent-fill); border-radius: var(--gt-radius);
  font: inherit; font-weight: 600; font-size: var(--gt-text-sm); letter-spacing: 0.01em; line-height: 1.35; text-decoration: none; cursor: pointer;
}
.btn::after { content: "\2192"; font-size: var(--gt-text-md); flex: none; }
.btn:hover { filter: brightness(1.1); }
.btn--ghost { background: transparent; color: var(--gt-accent); border-color: var(--gt-accent); }
.btn--ghost:hover { background: var(--gt-accent-soft); filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: var(--gt-space-3); }

/* The plan: three steps, numbered in the display face */
.plan { list-style: none; padding: 0; counter-reset: step; border-top: 1px solid var(--gt-line); }
.plan li {
  counter-increment: step; display: grid; grid-template-columns: var(--gt-space-7) minmax(0, 1fr); align-items: baseline;
  padding-block: var(--gt-space-4); border-bottom: 1px solid var(--gt-line); font-size: var(--gt-text-md);
}
.plan li::before { content: counter(step); font-family: var(--gt-font-display); font-size: var(--gt-text-num); line-height: 1; color: var(--gt-accent); }

/* CAM: six steps, Today or Tomorrow */
.switch { display: none; border: 2px solid var(--gt-struct); border-radius: var(--gt-radius); align-self: flex-start; }
.js .switch { display: inline-flex; }
.js .switch button {
  min-height: var(--gt-tap); min-width: calc(var(--gt-tap) * 2.5); padding-inline: var(--gt-space-4);
  background: var(--gt-surface); color: var(--gt-ink); border: 0; font: inherit; font-weight: 600; font-size: var(--gt-text-sm); letter-spacing: 0.04em; cursor: pointer;
}
.js .switch button[data-cam-set="today"][aria-pressed="true"] { background: var(--gt-warn-fill); color: var(--gt-surface); }
.js .switch button[data-cam-set="tomorrow"][aria-pressed="true"] { background: var(--gt-accent-fill); color: var(--gt-on-fill); }
/* The TrueUp mark (the app's one animation): in the sky of the opening scene, so it is seen at once, and the Sound button beside the switch */
.art-mark { position: absolute; z-index: 2; left: var(--gt-space-6); top: var(--gt-space-5); width: 5.5rem; pointer-events: none; }
.cam-live { display: none; min-height: 2lh; }
.open-note { margin-top: var(--gt-space-3); font-size: var(--gt-text-xs); color: var(--gt-muted); }
.cam-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gt-space-3) var(--gt-space-4); }
.sound {
  display: inline-flex; align-items: center; gap: var(--gt-space-2); min-height: var(--gt-tap); padding-inline: var(--gt-space-4);
  background: var(--gt-surface); color: var(--gt-ink); border: 2px solid var(--gt-struct); border-radius: var(--gt-radius);
  font: inherit; font-weight: 600; font-size: var(--gt-text-sm); letter-spacing: 0.04em; cursor: pointer;
}
.sound svg { width: 1.25rem; height: 1.25rem; flex: none; }
.sound .sp { fill: currentColor; }
.sound .sw, .sound .sx { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sound[aria-pressed="true"] .sx, .sound[aria-pressed="false"] .sw { display: none; }
.sound[aria-pressed="false"] { color: var(--gt-muted); }
.steps { list-style: none; padding: 0; counter-reset: st; display: flex; flex-direction: column; border-top: 1px solid var(--gt-line); }
.steps li {
  counter-increment: st; display: grid; grid-template-columns: var(--gt-space-6) 6rem minmax(0, 1fr); gap: var(--gt-space-3); align-items: baseline;
  padding: var(--gt-space-3) var(--gt-space-2); border-bottom: 1px solid var(--gt-line); border-left: 4px solid transparent; font-size: var(--gt-text-sm);
}
.steps li::before { content: counter(st); font-family: var(--gt-font-display); font-size: var(--gt-text-lg); line-height: 1; color: var(--gt-muted); }
.steps b { font-family: var(--gt-font-mono); font-size: var(--gt-text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--gt-muted); font-weight: 500; }
.steps span { display: block; }
.steps .lab { font-weight: 700; margin-right: var(--gt-space-1); display: inline; }
.steps .tomorrow .lab { color: var(--gt-accent); }
.steps .today .lab { color: var(--gt-warn); }
.js [data-cam="today"] .tomorrow, .js [data-cam="tomorrow"] .today { display: none; }
.js [data-cam="today"] .steps li:nth-child(4) { background: var(--gt-warn-soft); border-left-color: var(--gt-warn); }
.js [data-cam="tomorrow"] .steps li:nth-child(4), .js [data-cam="tomorrow"] .steps li:nth-child(5) { background: var(--gt-accent-soft); border-left-color: var(--gt-accent); }
.stakes { padding: var(--gt-space-3) var(--gt-space-4); border-left: 4px solid var(--gt-warn); background: var(--gt-warn-soft); font-size: var(--gt-text-sm); }
.stakes strong { font-family: var(--gt-font-display); font-weight: 700; font-size: var(--gt-text-md); }
.stakes--tomorrow { border-left-color: var(--gt-accent); background: var(--gt-accent-soft); }
.js [data-cam="today"] .stakes--tomorrow, .js [data-cam="tomorrow"] .stakes--today { display: none; }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gt-space-3); list-style: none; padding: 0; }
.pillar {
  display: flex; flex-direction: column; gap: var(--gt-space-2); text-align: left; width: 100%; height: 100%;
  min-height: var(--gt-tap); padding: var(--gt-space-4);
  background: var(--gt-surface); color: var(--gt-ink); border: 1px solid var(--gt-line); border-top: 4px solid var(--gt-line); border-radius: var(--gt-radius);
  font: inherit; font-size: var(--gt-text-sm); cursor: default;
}
.js .pillar { cursor: pointer; }
.pillar strong { font-family: var(--gt-font-display); font-weight: 400; font-size: var(--gt-text-lg); color: var(--gt-head); line-height: 1.1; }
.pillar .pq { font-size: var(--gt-text-xs); color: var(--gt-muted); font-style: italic; }
.pillar .pq::before { content: "Core question: "; font-weight: 700; font-style: normal; }
.js .pillar .pq { display: none; }
.js .pillar[aria-pressed="true"] .pq { display: block; }
.js .pillar[aria-pressed="true"] { border-color: var(--gt-accent); border-top-color: var(--gt-accent); background: var(--gt-accent-soft); }
.pillar:hover { border-top-color: var(--gt-accent); }

/* The value question and the panels it opens */
.big { font-family: var(--gt-font-display); font-weight: 400; font-size: var(--gt-text-xxl); line-height: 1.1; text-wrap: balance; }
.panel { padding-block: var(--gt-space-7); display: flex; flex-direction: column; gap: var(--gt-space-4); border-top: 1px solid var(--gt-line); scroll-margin-top: var(--gt-bar-h); }
.panel > * { max-width: 36rem; }
.panel ul { padding-left: var(--gt-space-5); display: flex; flex-direction: column; gap: var(--gt-space-2); }
.panel li::marker { color: var(--gt-accent); }
.foot {
  max-width: var(--gt-page-w); margin: 0 auto; border-top: 1px solid var(--gt-line);
  padding-block: var(--gt-space-6) calc(var(--gt-space-7) + env(safe-area-inset-bottom, 0px));
  padding-inline: max(var(--gt-gutter), env(safe-area-inset-left, 0px)) max(var(--gt-gutter), env(safe-area-inset-right, 0px));
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--gt-space-5) var(--gt-space-7); justify-content: space-between;
}
.foot-fine { display: flex; flex-direction: column; gap: var(--gt-space-2); }
.foot-brand { display: flex; flex-direction: column; gap: var(--gt-space-3); align-items: flex-start; }
.foot-product { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gt-space-3); margin: 0; }
.logo-trueup { display: block; height: 1.5rem; width: auto; }
.foot .fine { max-width: 36rem; font-size: var(--gt-text-xs); color: var(--gt-muted); }
.foot .draft { font-family: var(--gt-font-mono); font-size: var(--gt-text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gt-muted); }


/* ── The scene ─────────────────────────────────────────────────────────────
   Symbols live in the .defs sheet; a <use> inherits custom properties but NOT ancestor
   selectors, so state is carried by the variables set on .stage below. */
.sa0 { stop-color: var(--gt-sky-a0); } .sa1 { stop-color: var(--gt-sky-a1); }
.sb0 { stop-color: var(--gt-sky-b0); } .sb1 { stop-color: var(--gt-sky-b1); }
.rg0 { stop-color: var(--gt-glow); stop-opacity: 0.9; } .rg1 { stop-color: var(--gt-glow); stop-opacity: 0; }
.rs0 { stop-color: var(--gt-sun-halo); stop-opacity: 0.95; } .rs1 { stop-color: var(--gt-sun-halo); stop-opacity: 0; }

/* State as variables. Default (and no script) = the worried morning. */
.stage {
  --warm: 0; --lit: 0; --conn: 0; --sun-o: 0.7; --sun-y: 22px; --opf: 1;
  --lbl: 0; --trust: 0; --etag: 0; --acct: 0; --econ: 0; --tom: 0; --tod: 1; --tw: 3.2;
}
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) { --warm: 1; --lit: 1; --conn: 1; --sun-o: 1; --sun-y: 0px; --opf: 0; --tod: 0; }
.stage:is([data-state="connected"], [data-state="pillar-intel"], [data-state="question"]) { --lbl: 1; }
.stage[data-state="pillar-trust"] { --trust: 1; }
.stage[data-state="pillar-intel"] { --etag: 1; --tw: 4.6; }
.stage[data-state="pillar-acct"] { --acct: 1; }
.stage[data-state="pillar-econ"] { --econ: 1; }
.stage[data-state="cam-tomorrow"] { --tom: 1; }
.stage[data-state="cam-today"] { --warm: 0.0; }

.dia text { font-family: var(--gt-font-body); }
.warm { opacity: var(--warm); }
.sun { opacity: var(--sun-o); transform: translateY(var(--sun-y)); }
.sun-disc { fill: var(--gt-sun); }
.cloud { fill: var(--gt-cloud); opacity: 0.9; }
.bird { fill: none; stroke: var(--gt-muted); stroke-width: 1.6; stroke-linecap: round; }
.hill { fill: var(--gt-hill); } .hill2 { fill: var(--gt-hill-2); }
.place-name text { fill: var(--gt-place-ink); }
.pl1 { font-size: var(--gt-svg-place); font-weight: 700; letter-spacing: 0.14em; }
.pl2 { font-size: var(--gt-svg-place); fill: var(--gt-place-sub); }
.dia--tall .pl1, .dia--tall .pl2 { font-size: var(--gt-svg-place-t); }
.dia--tall .pl1 { letter-spacing: 0.08em; }

/* the town */
.t-brick { fill: var(--gt-brick); } .t-brickd { fill: var(--gt-brick-d); }
.t-cream { fill: var(--gt-cream); } .t-creamd { fill: var(--gt-cream-d); }
.t-blue { fill: var(--gt-blue); } .t-blued { fill: var(--gt-blue-d); }
.t-stone { fill: var(--gt-stone); } .t-trim { fill: var(--gt-trim); } .t-roof { fill: var(--gt-roof); }
.t-glass { fill: var(--gt-glass); } .t-glassd { fill: var(--gt-glass-d); }
.t-door { fill: var(--gt-door); } .t-doorred { fill: var(--gt-brick-d); } .t-doorline { fill: none; stroke: var(--gt-brick); stroke-width: 1.5; }
.t-navy { fill: var(--gt-navy-sign); } .t-poster { fill: var(--gt-orange); }
.t-sign-cafe { fill: var(--gt-cream); stroke: var(--gt-brick-d); stroke-width: 1.5; }
.t-sign-roy { fill: var(--gt-navy-sign); }
.t-sign-essex { fill: var(--gt-navy-sign); stroke: var(--gt-orange); stroke-width: 3; }
.t-sign-statler { fill: var(--gt-paper); }
.t-face { fill: var(--gt-paper); stroke: var(--gt-navy-sign); stroke-width: 3; }
.t-hands { fill: none; stroke: var(--gt-navy-sign); stroke-width: 2.4; stroke-linecap: round; }
.t-hub { fill: var(--gt-navy-sign); }
.t-stem { fill: none; stroke: var(--gt-roof); stroke-width: 2; }
.t-lamp { fill: var(--gt-glow); }
.t-tree rect { fill: var(--gt-trunk); } .t-tree circle { fill: var(--gt-leaf); }
.t-mull { stroke: var(--gt-stone); stroke-width: 2; }
.t-carr rect { fill: var(--gt-car-red); } .t-cart rect { fill: var(--gt-car-teal); } .t-carr circle, .t-cart circle { fill: var(--gt-ink-line); }
.t-bladeclock { fill: var(--gt-paper); stroke: var(--gt-navy-sign); stroke-width: 1.8; }
.t-tenant circle { fill: var(--gt-skin-tenant); } .t-tenant path { fill: var(--gt-scarf); }
.sg { fill: var(--gt-sign-ink); font-weight: 700; font-size: var(--gt-svg-sign); }
.sg-cafe { fill: var(--gt-sign-ink-d); }
.sg-roy { font-size: var(--gt-svg-sign); }
.sg-essex { fill: var(--gt-trim); letter-spacing: 0.04em; font-size: calc(var(--gt-svg-sign) * 0.92); }
.sg-statler { fill: var(--gt-sign-ink-d); font-size: calc(var(--gt-svg-sign) * 0.94); }
.dia--tall .signs { display: none; }

/* light and the flagged window */
.lit { opacity: var(--lit); }
.lit-w { fill: var(--gt-lit); }
.lit-clock { fill: var(--gt-glow); opacity: 0.4; }
.flagwin { opacity: var(--tom); }
.flag-halo { fill: var(--gt-glow); opacity: 0.55; }
.flag-win { fill: var(--gt-lit); stroke: var(--gt-warn); stroke-width: 3; }

/* ground */
.walk { fill: var(--gt-walk); } .walk-j { stroke: var(--gt-walk-line); stroke-width: 1.5; }
.curb { fill: var(--gt-curb); } .road { fill: var(--gt-road); }
.road-dash { stroke: var(--gt-road-dash); stroke-width: 5; stroke-dasharray: 36 30; fill: none; }
.shadow { fill: var(--gt-shadow); }
.tr-t { fill: var(--gt-trunk); } .tr-l { fill: var(--gt-leaf); } .tr-l2 { fill: var(--gt-leaf-d); }

/* the thread: broken and dim today, one warm line once connected */
.lk { fill: none; stroke: var(--gt-thread-dim); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 38 24; }
.lkg { fill: none; stroke: var(--gt-glow); stroke-width: 11; stroke-linecap: round; opacity: calc(var(--conn) * 0.4); }
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .lk { stroke: var(--gt-thread); stroke-dasharray: 100 0; stroke-width: var(--tw); }
.fray { fill: none; stroke: var(--gt-thread-dim); stroke-width: 2.4; stroke-linecap: round; opacity: calc(1 - var(--conn)); }
.ribbon { fill: none; stroke: var(--gt-glow); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }
.rays { opacity: 0; }
.rays path { fill: var(--gt-glow); opacity: 0.2; }
.stage:is([data-state="pillar-econ"], [data-state="question"]) .rays { opacity: 1; }
.ledger-glow { opacity: var(--conn); }
.folders { opacity: var(--conn); }
.l-plinth { fill: var(--gt-stone); } .l-slab { fill: var(--gt-cream-d); } .l-cover { fill: var(--gt-navy-sign); }
.l-page { fill: var(--gt-paper); stroke: var(--gt-paper-edge); stroke-width: 1; } .l-pl { stroke: var(--gt-paper-line); stroke-width: 1.6; } .l-rib { fill: var(--gt-coat); }
.fo-a { fill: var(--gt-coat); } .fo-a2 { fill: var(--gt-coat-d); } .fo-b { fill: var(--gt-navy-sign); } .fo-b2 { fill: var(--gt-blue-d); } .fo-c { fill: var(--gt-scarf); } .fo-c2 { fill: var(--gt-scarf-d); }

/* the four pillars */
.gate { opacity: var(--trust); }
.g-dome { fill: var(--gt-layer); opacity: 0.1; }
.g-arch { fill: none; stroke: var(--gt-layer); stroke-width: 7; stroke-linecap: round; }
.g-arch2 { fill: none; stroke: var(--gt-layer); stroke-width: 1.6; opacity: 0.6; }
.g-key { fill: none; stroke: var(--gt-layer); stroke-width: 3.4; stroke-linecap: round; }
.g-lock { fill: var(--gt-scarf); stroke: var(--gt-scarf-d); stroke-width: 1.5; } .g-hole { fill: var(--gt-ink-line); }
.etag { opacity: var(--etag); }
.et { fill: var(--gt-navy-sign); stroke: var(--gt-paper); stroke-width: 1.5; stroke-linejoin: round; } .et-hole, .et-pg { fill: var(--gt-paper); } .et-l { stroke: var(--gt-navy-sign); stroke-width: 1.3; }
.bd { opacity: var(--acct); }
.bd-o { color: var(--gt-coat); } .bd-b { color: var(--gt-navy-sign); } .bd-p { color: var(--gt-blazer); }
.bd-card { fill: var(--gt-paper); stroke: currentColor; stroke-width: 2.4; } .bd-dot { fill: currentColor; } .bd-ln { fill: currentColor; opacity: 0.6; } .bd-str { fill: none; stroke: currentColor; stroke-width: 1.8; }
.coins-g { opacity: var(--econ); }
.cn1 { fill: var(--gt-coin); } .cn2 { fill: var(--gt-coin-d); } .cn-in { fill: none; stroke: var(--gt-coin-d); stroke-width: 1.4; }
.sp-stem { fill: none; stroke: var(--gt-leaf-d); stroke-width: 2.4; stroke-linecap: round; } .sp-leaf { fill: var(--gt-leaf); }
.coin-arc { fill: none; stroke: var(--gt-coin); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; opacity: 0.8; }

/* paper, letters and the sign-off */
.pp-s { fill: var(--gt-paper); stroke: var(--gt-paper-edge); stroke-width: 1.4; } .pp-f { fill: var(--gt-paper-edge); }
.pp-l { fill: none; stroke: var(--gt-paper-line); stroke-width: 1.5; stroke-linecap: round; } .pp-g { fill: none; stroke: var(--gt-paper-line); stroke-width: 1; }
.pp-c1 { fill: var(--gt-coat); } .pp-c2 { fill: var(--gt-scarf); } .pp-b { fill: var(--gt-navy-sign); } .pp-sp { fill: none; stroke: var(--gt-coat); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.en-b { fill: var(--gt-paper); stroke: var(--gt-paper-edge); stroke-width: 1.5; } .en-f { fill: none; stroke: var(--gt-paper-edge); stroke-width: 1.5; } .en-seal { fill: var(--gt-warn-fill); } .en-bang { stroke: var(--gt-on-fill); stroke-width: 2; stroke-linecap: round; }
.st-s { fill: var(--gt-paper); stroke: var(--gt-paper-edge); stroke-width: 1.4; } .st-h { fill: var(--gt-navy-sign); } .st-l { stroke: var(--gt-paper-line); stroke-width: 1.5; }
.st-hi { fill: var(--gt-glow); opacity: 0.4; } .st-ck { fill: none; stroke: var(--gt-coat); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } .st-t { fill: var(--gt-coat); }
.so-card { fill: var(--gt-paper); stroke: var(--gt-paper-edge); stroke-width: 1.5; } .so-l { stroke: var(--gt-paper-line); stroke-width: 1.5; stroke-linecap: round; }
.so-sig { fill: none; stroke: var(--gt-navy-sign); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .so-seal { fill: var(--gt-coat); } .so-ck { fill: none; stroke: var(--gt-on-fill); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.so { opacity: var(--tom); }
.pill rect { fill: var(--gt-pill); stroke: var(--gt-line); stroke-width: 1; }
.pill text { fill: var(--gt-pill-ink); font-size: var(--gt-svg-label); font-weight: 600; }
.dia--tall .pill text { font-size: var(--gt-svg-label-t); }
.lbl { opacity: var(--lbl); } .tag-flag, .tag-ok, .leader { opacity: var(--tom); }
.tag-flag rect { stroke: var(--gt-warn); stroke-width: 2.4; } .tag-ok rect { stroke: var(--gt-coat); stroke-width: 2.4; }
.leader { fill: none; stroke: var(--gt-warn); stroke-width: 2.4; stroke-dasharray: 5 5; }

/* the cast */
.o-pants { fill: var(--gt-pants); } .o-shoe { fill: var(--gt-ink-line); }
.o-coat { fill: var(--gt-coat); } .o-coatd { fill: var(--gt-coat-d); } .o-line { fill: none; stroke: var(--gt-coat-d); stroke-width: 1.4; } .o-btn { fill: var(--gt-coat-d); }
.o-strap { fill: none; stroke: var(--gt-bag); stroke-width: 3.4; } .o-bag { fill: var(--gt-bag); }
.o-scarf { fill: var(--gt-scarf); } .o-scarfd { fill: var(--gt-scarf-d); }
.o-skin { fill: var(--gt-skin-owner); } .o-skin2 { fill: var(--gt-skin-op); } .o-skin3 { fill: var(--gt-skin-tenant); }
.o-hair { fill: var(--gt-hair-owner); } .o-ring { fill: var(--gt-scarf); }
.o-glass { fill: var(--gt-paper); fill-opacity: 0.4; stroke: var(--gt-ink-line); stroke-width: 1.7; }
.o-eye { fill: var(--gt-ink-line); } .o-brow, .o-mouth { fill: none; stroke: var(--gt-ink-line); stroke-width: 2; stroke-linecap: round; } .o-blush { fill: var(--gt-blush); opacity: 0.35; }
.o-arm { fill: none; stroke: var(--gt-coat); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.tn-body { fill: var(--gt-scarf); }
.p-pants { fill: var(--gt-pants); } .p-shoe { fill: var(--gt-ink-line); }
.p-blazer { fill: var(--gt-blazer); } .p-blazerd { fill: var(--gt-blazer-d); } .p-shirt { fill: var(--gt-shirt); }
.p-lan { fill: none; stroke: var(--gt-coat); stroke-width: 2.2; } .p-badge { fill: var(--gt-paper); } .p-badgebar { fill: var(--gt-navy-sign); }
.p-skin { fill: var(--gt-skin-op); } .p-hair { fill: var(--gt-hair-op); }
.p-eye { fill: var(--gt-ink-line); } .p-brow { fill: none; stroke: var(--gt-hair-op); stroke-width: 2.2; stroke-linecap: round; } .p-smile { fill: none; stroke: var(--gt-shirt); stroke-width: 2.2; stroke-linecap: round; }
.p-arm { fill: none; stroke: var(--gt-blazer); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.p-tab { fill: var(--gt-ink-line); } .p-screen { fill: var(--gt-paper); } .p-tabl { fill: none; stroke: var(--gt-paper-line); stroke-width: 1.6; stroke-linecap: round; }
.tablet-ok { opacity: var(--tom); transform-box: fill-box; transform-origin: center; }
.tablet-ok circle { fill: var(--gt-coat); } .tablet-ok path { fill: none; stroke: var(--gt-on-fill); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* who is doing what, in each state */
.f-calm, .f-up, .a-ease, .a-hold, .hold-stack, .hold-statement, .pf-up { display: none; }
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .f-worry,
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .a-think { display: none; }
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .f-calm,
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .a-ease { display: inline; }
.stage[data-state="question"] .f-calm, .stage[data-state="question"] .pf-ease { display: none; }
.stage[data-state="question"] .f-up, .stage[data-state="question"] .pf-up { display: inline; }
.stage[data-state="cam-today"] .a-think { display: none; }
.stage[data-state="cam-today"] .a-hold, .stage[data-state="cam-tomorrow"] .a-hold { display: inline; }
.stage[data-state="cam-tomorrow"] .a-ease { display: none; }
.stage[data-state="cam-today"] .hold-stack { display: inline; }
.stage[data-state="cam-tomorrow"] .hold-statement { display: inline; }
.qb { opacity: var(--tod); }
.qb-c, .qb-t1, .qb-t2 { fill: var(--gt-paper); stroke: var(--gt-paper-edge); stroke-width: 2; }
.qb text { fill: var(--gt-warn); font-family: var(--gt-font-display); font-weight: 700; font-size: var(--gt-svg-q); }
.dia--tall .qb text { font-size: var(--gt-svg-q-t); }
.dia--wide .op { transform: translateX(calc(var(--opf) * 16px)); }
.dia--tall .op { transform: translateX(calc(var(--opf) * 12px)); }

/* Papers: loose today, one pile at the owner's feet in the CAM story, and carried into the ledger once connected. */
.pap { opacity: 1; transform: translate(var(--px), var(--py)) rotate(var(--pr)) scale(var(--ps)); }
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .pap { opacity: 0; }
.env { opacity: 0; }
.stage[data-state="cam-today"] .env { opacity: 1; }
.dia--wide .pap { --ps: 1.25; }
.dia--wide .p1 { --px: 60px; --py: 170px; --pr: -16deg; } .dia--wide .p2 { --px: 590px; --py: 175px; --pr: 14deg; }
.dia--wide .p3 { --px: 170px; --py: 226px; --pr: 8deg; } .dia--wide .p4 { --px: 545px; --py: 205px; --pr: -10deg; }
.dia--wide .p5 { --px: 30px; --py: 236px; --pr: 20deg; } .dia--wide .p6 { --px: 612px; --py: 250px; --pr: -18deg; }
.stage[data-state="cam-today"] .dia--wide .pap { --ps: 1; }
.stage[data-state="cam-today"] .dia--wide .p1 { --px: 188px; --py: 456px; --pr: -20deg; } .stage[data-state="cam-today"] .dia--wide .p2 { --px: 218px; --py: 463px; --pr: 12deg; }
.stage[data-state="cam-today"] .dia--wide .p3 { --px: 256px; --py: 458px; --pr: -8deg; } .stage[data-state="cam-today"] .dia--wide .p4 { --px: 202px; --py: 450px; --pr: 18deg; }
.stage[data-state="cam-today"] .dia--wide .p5 { --px: 240px; --py: 452px; --pr: -25deg; } .stage[data-state="cam-today"] .dia--wide .p6 { --px: 176px; --py: 463px; --pr: 6deg; }
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .dia--wide .pap { --px: 296px; --py: 420px; --pr: 0deg; --ps: 0.08; }
.dia--tall .pap { --ps: 0.85; }
.dia--tall .p1 { --px: 36px; --py: 70px; --pr: -16deg; } .dia--tall .p2 { --px: 352px; --py: 112px; --pr: 14deg; }
.dia--tall .p3 { --px: 22px; --py: 126px; --pr: 8deg; } .dia--tall .p4 { --px: 296px; --py: 66px; --pr: -10deg; }
.dia--tall .p5 { --px: 22px; --py: 262px; --pr: 20deg; } .dia--tall .p6 { --px: 46px; --py: 198px; --pr: -18deg; }
.stage[data-state="cam-today"] .dia--tall .pap { --ps: 0.7; }
.stage[data-state="cam-today"] .dia--tall .p1 { --px: 70px; --py: 288px; --pr: -20deg; } .stage[data-state="cam-today"] .dia--tall .p2 { --px: 96px; --py: 294px; --pr: 12deg; }
.stage[data-state="cam-today"] .dia--tall .p3 { --px: 130px; --py: 290px; --pr: -8deg; } .stage[data-state="cam-today"] .dia--tall .p4 { --px: 82px; --py: 280px; --pr: 18deg; }
.stage[data-state="cam-today"] .dia--tall .p5 { --px: 116px; --py: 282px; --pr: -25deg; } .stage[data-state="cam-today"] .dia--tall .p6 { --px: 54px; --py: 294px; --pr: 6deg; }
.stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .dia--tall .pap { --px: 195px; --py: 250px; --pr: 0deg; --ps: 0.06; }
.dia--wide .env { transform: translate(184px, 381px) scale(0.2); }
.stage[data-state="cam-today"] .dia--wide .env { transform: translate(178px, 332px) rotate(-10deg) scale(1.15); }
.dia--tall .env { transform: translate(142px, 202px) scale(0.2); }
.stage[data-state="cam-today"] .dia--tall .env { transform: translate(172px, 170px) rotate(-10deg) scale(0.8); }

/* The operator's stride: two frames of legs while he slides in. */
.legs-b { opacity: 0; }
@keyframes gt-step-a { 0% { opacity: 0; } 25% { opacity: 1; } 50% { opacity: 0; } 75% { opacity: 1; } 100% { opacity: 1; } }
@keyframes gt-step-b { 0% { opacity: 1; } 25% { opacity: 0; } 50% { opacity: 1; } 75% { opacity: 0; } 100% { opacity: 0; } }

/* Motion: one orchestrated moment per change, only after the visitor acts. */
@keyframes gt-ribbon { 0% { stroke-dashoffset: 100; opacity: 1; } 65% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes gt-pop { 0% { transform: scale(0.3); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes gt-glint { 0% { opacity: 0; } 45% { opacity: 1; } 65% { opacity: 0.5; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .pap, .env { transition: transform var(--gt-dur) ease-in-out, opacity var(--gt-dur) ease-in-out; }
  .p2 { transition-delay: 0.06s; } .p3 { transition-delay: 0.12s; } .p4 { transition-delay: 0.18s; } .p5 { transition-delay: 0.24s; } .p6 { transition-delay: 0.3s; }
  .sun, .op { transition: transform var(--gt-dur) ease-out, opacity var(--gt-dur); }
  .warm, .lit, .lkg, .fray, .ledger-glow, .folders, .gate, .etag, .bd, .coins-g, .rays, .so, .lbl, .tag-flag, .tag-ok, .leader, .qb, .flagwin, .tablet-ok { transition: opacity var(--gt-dur); }
  .lk { transition: stroke var(--gt-dur), stroke-dasharray var(--gt-dur), stroke-width var(--gt-dur-s); }
  .stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .legs-a { animation: gt-step-a 0.7s steps(1, end) both; }
  .stage[data-state]:not([data-state="fragmented"]):not([data-state="cam-today"]) .legs-b { animation: gt-step-b 0.7s steps(1, end) both; }
  .stage[data-state="connected"] .ribbon { animation: gt-ribbon 1.1s ease-in-out both; }
  .stage[data-state="cam-tomorrow"] .tablet-ok { animation: gt-pop 0.5s ease-out 0.3s both; }
  .stage[data-state="cam-tomorrow"] .flagwin { animation: gt-glint 0.9s ease-out both; }
  .cap { transition: opacity var(--gt-dur-s); }
}
@media (prefers-reduced-motion: reduce) {
  .stage *, .stage { transition: none; animation: none; }
}

/* ── Narrow screens (any height) ───────────────────────────────────────── */
@media (max-width: 760px) {
  .steps li { grid-template-columns: var(--gt-space-6) minmax(0, 1fr); }
  .steps li > div { grid-column: 2; }
  .steps b { grid-column: 2; }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .layout { column-gap: var(--gt-space-5); }
}
@media not all and (max-width: 760px) {
  /* Two columns: every tile keeps room for its question, so tiles stay level and nothing jumps. */
  .pillars { grid-auto-rows: 1fr; }
  .js .pillar .pq { display: block; visibility: hidden; }
  .js .pillar[aria-pressed="true"] .pq { visibility: visible; }
}
@media (max-width: 480px) {
  .mark { display: none; }
  .back { margin-right: auto; }
}

/* ── Phone, or any narrow tall screen: the scene is pinned under the bar, text scrolls beneath ── */
@media (max-width: 760px) and (min-height: 481px), (max-width: 1200px) and (orientation: portrait) and (min-height: 481px) {
  .layout { display: block; }
  .stage {
    position: sticky; top: calc(var(--gt-bar-h) + env(safe-area-inset-top, 0px)); z-index: 20;
    height: var(--gt-stage-h); padding: 0; gap: 0;
    border-bottom: 1px solid var(--gt-line);
    margin-inline: calc(-1 * max(var(--gt-gutter), env(safe-area-inset-left, 0px)));
  }
  .art { border-radius: 0; border: 0; width: 100%; aspect-ratio: auto; flex: 1 1 auto; min-height: 0; }
  .cap { display: none; }
  .dia--wide { display: none; }
  .dia--tall { display: block; }
  .copy { max-width: 40rem; margin-inline: auto; }
  .chapter {
    min-height: calc(100svh - var(--gt-bar-h) - var(--gt-stage-h) - env(safe-area-inset-top, 0px));
    justify-content: flex-start; padding-block: var(--gt-space-5) var(--gt-space-6); gap: var(--gt-space-4);
    scroll-margin-top: calc(var(--gt-bar-h) + var(--gt-stage-h) + env(safe-area-inset-top, 0px));
  }
  .chapter > .btn, .chapter > .actions { margin-top: auto; align-self: stretch; }
  .chapter > .actions .btn { flex: 1 1 100%; }
  .panel { scroll-margin-top: calc(var(--gt-bar-h) + var(--gt-stage-h) + env(safe-area-inset-top, 0px)); }
  /* a control reached by keyboard must not land under the pinned picture */
  .btn, .switch button, .sound, .pillar { scroll-margin-top: calc(var(--gt-bar-h) + var(--gt-stage-h) + var(--gt-space-3) + env(safe-area-inset-top, 0px)); }
  .cam-live { display: block; }
  h1 { font-size: var(--gt-text-xl); }
  .chapter::before { display: none; }
}
@media (min-width: 641px) and (min-height: 481px) {
  :root { --gt-stage-h: clamp(22rem, 40svh, 30rem); }
  .chapter > .btn, .chapter > .actions { margin-top: var(--gt-space-3); align-self: flex-start; }
}
@media (max-width: 480px) and (min-height: 481px) {
  .lockup-plate { gap: var(--gt-space-3); padding: var(--gt-space-1) var(--gt-space-3); }
  .logo-stiles { height: 1.0625rem; }
  .logo-ib { height: 1.5rem; }
  .with { padding-inline: var(--gt-space-2); }
}

/* ── Short screens (a phone on its side): two columns, no full-height chapters ── */
@media (max-height: 480px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--gt-space-5); }
  .chapter { min-height: 0; gap: var(--gt-space-3); padding-block: var(--gt-space-4) var(--gt-space-5); justify-content: flex-start; }
  .chapter::before { display: none; }
  .eyebrow { display: none; }
  .stage { padding-block: var(--gt-space-2); }
  .cap { display: none; }
  .cam-live { display: block; }
  .art { border-radius: var(--gt-space-3); width: 100%; aspect-ratio: auto; flex: 1 1 auto; min-height: 0; }
  .place-name { display: none; }
  h1 { font-size: var(--gt-text-lg); }
  h2 { font-size: var(--gt-text-lg); }
  .lede { font-size: var(--gt-text-md); }
  .big { font-size: var(--gt-text-lg); }
  .dia--wide { display: none; }
  .dia--tall { display: block; }
  .pill { display: none; }
  .lockup-plate { padding: var(--gt-space-1) var(--gt-space-3); gap: var(--gt-space-2); }
  .plan li { padding-block: var(--gt-space-2); }
}

/* ── The holding message (public shell): the only thing shown until a story arrives ── */
.gate {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--gt-space-4);
  max-width: 36rem; margin: 0 auto;
  padding-block: var(--gt-space-7);
  padding-inline: max(var(--gt-gutter), env(safe-area-inset-left, 0px)) max(var(--gt-gutter), env(safe-area-inset-right, 0px));
}
.gate::before { content: ""; display: block; width: var(--gt-space-7); border-top: 3px solid var(--gt-crimson); }
.gate-title { font-family: var(--gt-font-display); font-size: var(--gt-text-xl); line-height: 1.1; color: var(--gt-head); }
.gate-msg { font-size: var(--gt-text-md); color: var(--gt-muted); max-width: 30rem; }
