/* Lockwork — a facility lit high-key and shadowless. Floors darken with consequence.
   Humans speak in Chivo, the agent in Chivo Mono. Yellow means: a person decides here. */
:root {
  --lab: #EDEEEA; --lab-2: #E3E5E0; --l2: #D5D8D2; --l3: #AEB3AC; --l4: #1C1F21; --l4-2: #2A2E31;
  --ink: #15171A; --ink-2: #4C514E; --ink-3: #6E736F; --hair: #C2C5BF; --hair-d: #3A3F42;
  --pale: #E6E8E3; --pale-2: #A9AFAA;
  --key: #F2C200; --key-ink: #15171A;
  --slate-h: 56px; --printer-h: 40px;
  --sans: "Chivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Chivo Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --gut: clamp(16px, 2.4vw, 36px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--lab); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font: 400 17px/1.5 var(--sans); background: var(--lab); }
::selection { background: var(--key); color: var(--key-ink); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sc-final :focus-visible, .sc-credits :focus-visible, .gate :focus-visible { outline-color: var(--pale); }
.sc-final .m-seam :focus-visible { outline-color: var(--ink); }
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--lab); padding: 10px 14px; font: 500 14px var(--mono); }
.skip:focus { top: 10px; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: .98; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- labels: the facility's stencil ---------- */
.eyebrow, .ph, .micro, .caption, .fine, .lvl-n, .hint, .verdict-cap, .sb-note, .form-note, .log-total, .closing {
  font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.eyebrow { color: var(--ink-2); margin-bottom: 18px; }

/* ---------- the switch device: the diff ---------- */
.diff s { text-decoration: none; position: relative; color: var(--ink-3); font-weight: 400; }
.diff s::after { content: ""; position: absolute; left: -.04em; right: -.04em; top: 52%; height: .075em; background: currentColor; transform-origin: 0 50%; transform: scaleX(var(--strike, 1)); }
.diff .ins { display: inline-block; clip-path: inset(0 calc((1 - var(--ins, 1)) * 100%) 0 0); }

/* ---------- the key plate: every human decision, including asking for access ---------- */
.keyplate {
  --notch: 7px;
  display: inline-flex; align-items: center; gap: .7em; position: relative;
  background: var(--key); color: var(--key-ink); border: 0; text-decoration: none;
  font: 700 14px/1 var(--sans); letter-spacing: -.005em;
  padding: 11px calc(16px + var(--notch) * 2) 11px 12px; min-height: 40px;
  clip-path: polygon(0 0, 100% 0, 100% 38%, calc(100% - var(--notch)) 38%, calc(100% - var(--notch)) 62%, calc(100% - var(--notch) * 2) 62%, calc(100% - var(--notch) * 2) 100%, 0 100%);
}
.keyplate::before {
  content: ""; width: 9px; height: 13px; flex: none; background: currentColor; transition: transform .16s ease-out;
  clip-path: polygon(50% 0, 82% 12%, 94% 36%, 80% 58%, 70% 62%, 86% 100%, 14% 100%, 30% 62%, 20% 58%, 6% 36%, 18% 12%);
}
.keyplate:hover::before, .keyplate:focus-visible::before { transform: rotate(90deg); }
.keyplate:active { transform: translateY(1px); }
.keyplate:focus-visible { outline-offset: 4px; }
.keyplate-lg { font-size: 16px; padding: 15px calc(20px + var(--notch) * 2) 15px 16px; min-height: 50px; --notch: 9px; }
.stopbtn { background: transparent; border: 1.5px solid currentColor; padding: 10px 18px; font: 700 14px/1 var(--sans); min-height: 40px; }
.stopbtn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.textlink { font: 500 15px var(--sans); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.textlink:hover { text-decoration-thickness: 2px; }

/* ---------- slate ---------- */
.slate {
  position: fixed; inset: 0 0 auto 0; height: var(--slate-h); z-index: 40; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gut); background: var(--lab); border-bottom: 1px solid var(--hair);
}
.wordmark { display: inline-flex; align-items: center; gap: 9px; font: 800 19px/1 var(--sans); letter-spacing: -.035em; text-decoration: none; justify-self: start; }
.keyhole { width: 13px; height: 17px; fill: var(--ink); }
.floor { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; justify-self: center; }
.floor-label { color: var(--ink-2); font: 500 10px/1.1 var(--mono); letter-spacing: .12em; text-transform: uppercase; width: 5.5em; text-align: right; }
.led { display: block; width: 132px; height: 34px; background: #0f1112; color: var(--pale); font: 700 12px/34px var(--mono); text-align: center; letter-spacing: .1em; }
.led.tfx { color: transparent; }
.slate-nav { justify-self: end; display: flex; align-items: center; gap: 22px; }
.docs { font: 500 14px var(--sans); text-decoration: none; }
.docs:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- the monitor wall (hero and sandbox) ---------- */
.panel { position: relative; padding: 18px 20px; min-width: 0; }
.ph { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); padding-bottom: 10px; border-bottom: 1px solid var(--hair); margin-bottom: 14px; }
.ph-sub { margin-top: 22px; }
.wall { display: grid; background: var(--hair); gap: 1px; border-block: 1px solid var(--hair); }
.wall > .panel { background: var(--lab); }

.sc-floor .frame { padding-top: var(--slate-h); }
.sc-floor .wall {
  height: calc(100svh - var(--slate-h) - var(--printer-h)); min-height: 600px;
  grid-template-columns: 1.06fr 1fr 1fr; grid-template-rows: 44fr 56fr;
  grid-template-areas: "words task tools" "words task gate";
}
.p-words { grid-area: words; display: flex; flex-direction: column; padding: clamp(24px, 3.4vh, 44px) clamp(22px, 2.4vw, 40px); }
.p-task { grid-area: task; overflow: clip; }
.p-tools { grid-area: tools; overflow: clip; }
.p-gate { grid-area: gate; overflow: clip; }

.p-words h1 { font-size: clamp(30px, 3.15vw, 54px); margin-bottom: 26px; }
.h-line { display: block; }
.h-second { margin-top: .18em; color: var(--ink); }
.sub { font-size: clamp(15px, 1.12vw, 18px); max-width: 30em; color: var(--ink); line-height: 1.5; }
.ctas { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin-top: 28px; }
.micro { color: var(--ink-2); margin-top: 14px; }
.queue { margin-top: auto; padding-top: 28px; }
.queue .ph { margin-bottom: 4px; }
.queue ol { list-style: none; margin: 0; padding: 0; font: 400 12.5px/1.3 var(--mono); }
.queue li { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--hair); color: var(--ink-3); }
.queue li[data-st="running"], .queue li[data-st="key"] { color: var(--ink); font-weight: 700; }
.queue .q-st { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.queue li[data-st="key"] .q-st { background: var(--key); color: var(--key-ink); padding: 1px 5px; }
.runstrip { display: none; border-block: 1px solid var(--ink); padding: 10px 0 11px; margin-bottom: 20px; font: 400 13px/1.4 var(--mono); }
.rs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rs-task { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-lvl { flex: none; font: 700 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; background: var(--ink); color: var(--lab); padding: 4px 6px; }
.rs-lvl[data-key="true"] { background: var(--key); color: var(--key-ink); }
.rs-plan { margin-top: 6px; color: var(--ink-2); min-height: 2.8em; }
.rs-plan.tfx .tfx-stage { display: grid; white-space: normal; width: 100%; line-height: 1.4 !important; }
.rs-plan.tfx .tfx-stage span { white-space: pre-wrap !important; }
.caption { margin-top: 18px; padding-top: 20px; display: flex; gap: 14px; align-items: center; color: var(--ink-3); }
.play { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--ink-2); padding: 6px 10px 6px 8px; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); flex: none; }
.play-ico { width: 10px; height: 10px; background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.play[aria-pressed="true"] .play-ico { background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }

.task-line { font: 500 clamp(20px, 2.15vw, 36px)/1.18 var(--mono); letter-spacing: -.035em; min-height: 2.36em; }
.plan-line { font: 400 15px/1.45 var(--mono); min-height: 2.9em; color: var(--ink); }
.plan-line.tfx .tfx-stage { line-height: 1.45 !important; }
.plan-state { color: var(--ink-3); }
.steps { list-style: none; margin: 18px 0 0; padding: 0; font: 400 13px/1.35 var(--mono); }
.steps li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.steps li[data-s="wait"] { opacity: .32; }
.steps .lv { font-weight: 700; font-size: 11px; letter-spacing: .04em; }
.steps .st { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.steps li[data-s="run"] .st::before { content: "■ "; animation: blink .9s steps(2) infinite; }
.steps li[data-s="key"] .st { background: var(--key); color: var(--key-ink); padding: 2px 5px; }
.steps li[data-s="stopped"] { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-3); }
.steps li[data-s="skipped"] { color: var(--ink-3); }
@keyframes blink { 50% { opacity: 0; } }
.reduced-motion .steps li[data-s="run"] .st::before { animation: none; }

.tools { list-style: none; margin: 0; padding: 0; font: 400 12.5px/1.6 var(--mono); color: var(--ink); }
.tools li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools li .ar { color: var(--ink-3); }
.tools li .res { color: var(--ink); font-weight: 700; }
.tools li.prev, .effects li.prev { opacity: .4; } /* the tail of the job before: the new run overwrites it line by line */
.tool-count { font-variant-numeric: tabular-nums; }

.effects { list-style: none; margin: 0; padding: 0; font: 500 15px/1.35 var(--sans); }
.effects li { display: grid; grid-template-columns: 26px 1fr; padding: 6px 0; }
.effects li .lv { font: 700 11px/1.9 var(--mono); color: var(--ink-3); }
.effects li:last-child { font-weight: 700; }

/* the gate: a door of two halves with a level plate on the seam */
.gate { position: absolute; inset: 0; pointer-events: none; overflow: clip; --open: 1; }
.gate .door { position: absolute; left: 0; right: 0; height: 50%; }
.door-t { top: 0; transform: translateY(calc(var(--open, 1) * -100%)); }
.door-b { bottom: 0; transform: translateY(calc(var(--open, 1) * 100%)); }
.door-t::after, .door-b::before { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--hair-d); }
.door-t::after { bottom: 0; } .door-b::before { top: 0; }
/* the door's material: ribbed steel, one tone lighter than the deepest floor, an edge and a lip on the seam,
   so a closed door never reads as an empty graphite frame */
.gate .door, .bigdoor .door, .monolith .door, .access-form {
  background-color: var(--l4-2);
  background-image: repeating-linear-gradient(90deg, transparent 0 119px, rgba(255,255,255,.05) 119px 120px);
}
.gate .door-t, .bigdoor .door-t, .monolith .door-t { box-shadow: inset 0 1px 0 var(--hair-d), inset 0 -7px 0 rgba(255,255,255,.04); }
.gate .door-b, .bigdoor .door-b, .monolith .door-b { box-shadow: inset 0 -1px 0 var(--hair-d), inset 0 7px 0 rgba(255,255,255,.04); }
.seam { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: calc(1 - var(--open, 1) * 1.6); }
/* level plates are lab white; only the Level 4 door carries key yellow (a person decides here) */
.seam span { display: block; background: var(--lab); color: var(--ink); font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; white-space: nowrap; }
[data-level]:not([data-level="4"]) > .seam span { box-shadow: inset 0 0 0 1.5px var(--ink); } /* the white plate holds its edge on a white floor */
[data-level="4"] > .seam span { background: var(--key); color: var(--key-ink); }
.ask { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 24px 26px; color: var(--pale); opacity: 0; visibility: hidden; }
.gate[data-state="ask"] { pointer-events: auto; }
.gate[data-state="ask"] .ask { opacity: 1; visibility: visible; }
.gate[data-state="ask"] .seam { opacity: 0; }
.ask-tag { align-self: flex-start; background: var(--key); color: var(--key-ink); font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 6px 9px; }
.ask-action { font: 700 clamp(17px, 1.45vw, 24px)/1.2 var(--sans); letter-spacing: -.02em; margin-top: 6px; }
.ask-holder { font: 400 14px/1.4 var(--sans); color: var(--pale-2); }
.ask-timer { font: 500 12px/1.3 var(--mono); color: var(--pale-2); min-height: 1.3em; }
.ask-btns { display: flex; gap: 12px; margin-top: 8px; }
.ask .stopbtn { color: var(--pale); }

/* ---------- the teleprinter strip ---------- */
.printer {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--printer-h); z-index: 39; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 var(--gut); background: var(--lab-2); border-top: 1px solid var(--hair); font: 400 12px/1 var(--mono); color: var(--ink); white-space: nowrap;
}
.pr-line { overflow: hidden; text-overflow: ellipsis; }
.pr-line[data-key="true"]::before { content: "KEY"; background: var(--key); padding: 3px 5px; margin-right: 10px; font-weight: 700; letter-spacing: .1em; }
.pr-clock { color: var(--ink-2); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.phonebar { display: none; }

/* ---------- the doors that open scenes ---------- */
.bigdoor { position: absolute; inset: 0; pointer-events: none; }
.bigdoor .door { position: absolute; left: 0; right: 0; height: 50%; }
.bigdoor .seam span, .monolith .seam span { font-size: 12px; padding: 8px 14px; }
.bigdoor .seam { opacity: calc(1 - var(--open, 0) * 2.4); }

/* ---------- 2 · pilot ---------- */
.sc-pilot .frame { display: grid; align-content: center; padding: calc(var(--slate-h) + 6vh) var(--gut) calc(var(--printer-h) + 6vh); }
.pilot-copy { max-width: 1180px; margin-left: 8.33vw; opacity: clamp(0, calc((var(--open, 1) - .35) * 3), 1); } /* the seam never shows a sliver of a sentence */
.reduced-motion .pilot-copy { opacity: 1; }
.statement { font: 700 clamp(26px, 3.15vw, 52px)/1.12 var(--sans); letter-spacing: -.03em; max-width: 22em; text-wrap: balance; }
.follow { margin-top: 34px; max-width: 34em; font-size: clamp(16px, 1.15vw, 19px); color: var(--ink); margin-left: 34%; }

/* ---------- 3 · the lift ---------- */
.sc-levels .frame { padding: calc(var(--slate-h) + 5vh) var(--gut) calc(var(--printer-h) + 4vh); min-height: 100svh; display: grid; }
.lift { display: grid; grid-template-columns: 5fr 7fr; grid-template-rows: auto 1fr auto; gap: 0 4vw; --g: var(--lab); }
.lift-head { grid-column: 1 / -1; display: grid; grid-template-columns: 5fr 7fr; gap: 4vw; align-items: end; padding-bottom: 3.4vh; }
.lift-head h2 { font-size: clamp(30px, 3.15vw, 54px); }
.lift-head p { max-width: 34em; }
.lift-stage { grid-column: 1 / -1; position: relative; border: 1.5px solid var(--ink); display: grid; grid-template-columns: 5fr 7fr; gap: 0 4vw; background: var(--g); color: var(--fg, var(--ink)); overflow: clip; min-height: min(52vh, 520px); padding: 3.4vh 2.4vw; outline: none; }
.lift[data-level="2"] { --g: var(--l2); }
.lift[data-level="3"] { --g: var(--l3); }
.lift[data-level="4"] { --g: var(--l4); --fg: var(--pale); }
.numeral { grid-row: 1 / span 2; font: 900 min(34vmin, 42vh)/0.78 var(--sans); letter-spacing: -.06em; align-self: end; font-variant-numeric: tabular-nums; }
.lvl-name { grid-column: 2; font: 800 clamp(40px, 6.4vw, 108px)/1 var(--sans); letter-spacing: -.04em; height: 1.3em; align-self: start; justify-self: start; }
.lvl-name.tfx .tfx-stage > span { border-radius: 0; }
.floors { grid-column: 2; align-self: end; }
.lvl { max-width: 36em; }
.lvl h3 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 10px; display: flex; gap: 14px; align-items: baseline; }
.lvl h3 .lvl-n { color: inherit; opacity: .7; }
.lvl p { font-size: clamp(16px, 1.2vw, 20px); }
.lvl-ex { margin-top: 16px; font: 400 14px/1.4 var(--mono) !important; }
.lvl-ex span { font-weight: 700; margin-right: 10px; }
.lvl-who { margin-top: 8px; font-weight: 700; }
.lift[data-level="4"] .lvl-who { color: var(--key); }
.js .lvl { display: none; } .js .lvl.on { display: block; }
.yours { grid-column: 2; margin-top: 16px; font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.yours span { background: var(--key); color: var(--key-ink); padding: 5px 8px; }
.liftdoor { position: absolute; inset: 0; pointer-events: none; --open: 1; }
.liftdoor .door { position: absolute; left: 0; right: 0; height: 50%; background: var(--ink); }
.liftdoor .seam { opacity: calc(1 - var(--open, 1) * 2); }
.panelbtns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 16px; }
.panelbtns button { display: inline-flex; gap: 10px; align-items: center; background: var(--lab); border: 1.5px solid var(--ink); padding: 0 18px 0 6px; height: 48px; font: 700 15px/1 var(--sans); }
.panelbtns button b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); font: 700 14px var(--mono); }
.panelbtns button[aria-pressed="true"] { background: var(--ink); color: var(--lab); }
.panelbtns button[aria-pressed="true"] b { border-color: var(--lab); background: var(--lab); color: var(--ink); }
.panelbtns button.is-key[aria-pressed="true"] b { background: var(--key); border-color: var(--key); color: var(--key-ink); }
.hint { margin-left: auto; color: var(--ink-3); }

/* ---------- 4 · sandbox ---------- */
.sc-sandbox .frame { padding: 12vh var(--gut) 8vh; border-top: 1px solid var(--hair); }
.sb-head { display: grid; grid-template-columns: 5fr 7fr; gap: 0 4vw; align-items: end; margin-bottom: 4vh; }
.sb-head .eyebrow { grid-column: 1 / -1; }
.sb-head h2 { font-size: clamp(30px, 3.15vw, 54px); }
.sb-head p:last-child { max-width: 34em; }
.prompt { display: grid; grid-template-columns: 1fr auto; gap: 0; border: 1.5px solid var(--ink); background: #F6F7F4; }
.field { position: relative; display: flex; align-items: center; }
.field-pre { padding-left: 18px; font: 500 clamp(16px, 1.4vw, 22px) var(--mono); color: var(--ink-3); flex: none; }
.prompt input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 20px 14px; font: 500 clamp(16px, 1.4vw, 22px)/1.2 var(--mono); color: var(--ink); letter-spacing: -.01em; }
.prompt input::placeholder { color: var(--ink-3); opacity: 1; }
.prompt input:focus { outline: none; }
.prompt:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.ghost { position: absolute; left: calc(18px + 4.6ch + 14px); right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; font: 500 clamp(16px, 1.4vw, 22px)/1.2 var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.ghost.tfx .tfx-stage { line-height: 1.2 !important; }
.has-ghost .prompt input::placeholder { color: transparent; }
.runbtn { border: 0; border-left: 1.5px solid var(--ink); background: var(--ink); color: var(--lab); padding: 0 26px; font: 700 15px var(--sans); }
.runbtn:hover { background: #2b2f33; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4vh; }
.chip { background: transparent; border: 1px solid var(--ink-2); padding: 8px 12px; font: 400 13px var(--mono); }
.chip:hover, .chip:focus-visible { background: var(--ink); color: var(--lab); }
.wall-sb { grid-template-columns: 0.9fr 1.15fr 1fr; min-height: 420px; }
.wall-sb > .panel { grid-area: auto; }
.wall-sb[data-idle="true"] .verdict .slot { display: none; }
.wall-sb[data-idle="true"] .verdict::before { content: "L? ----"; color: var(--hair); }
.wall-sb .p-verdict { display: flex; flex-direction: column; }
.verdict { font: 700 clamp(26px, 2.6vw, 44px)/1 var(--mono); margin-top: 8px; color: var(--ink); }
.verdict .slot { letter-spacing: .02em; }
.verdict-cap { color: var(--ink-2); margin-top: 12px; }
.sb-task { margin-top: auto; font: 500 15px/1.35 var(--mono); color: var(--ink-2); padding-top: 18px; }
.wall-sb[data-idle="true"] .p-task, .wall-sb[data-idle="true"] .p-gate { color: var(--ink-3); }
.wall-sb .p-gate { min-height: 300px; }
.sb-note { margin-top: 14px; color: var(--ink-2); }

/* ---------- 5 · log ---------- */
.sc-log .frame { background: var(--lab-2); }
.logwall { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; font: 400 10.5px/1.62 var(--mono); color: var(--ink-2); display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 28px; padding: calc(var(--slate-h) + 12px) var(--gut) 0; white-space: nowrap; will-change: transform; }
.logwall .col { overflow: hidden; }
.logwall .ln { overflow: hidden; text-overflow: clip; }
.logwall .ln.k4 { color: var(--ink); }
.logwall .ln.k4 b { background: var(--key); color: var(--key-ink); font-weight: 700; padding: 0 3px; }
.logwall .ln.lead { color: var(--ink); font-weight: 700; }
.log-copy { position: absolute; left: var(--gut); bottom: calc(var(--printer-h) + 4vh); width: min(620px, 46vw); background: var(--lab); border: 1px solid var(--hair); padding: 28px 30px 24px; }
.log-copy h2 { font-size: clamp(28px, 2.7vw, 46px); margin-bottom: 14px; }
.log-copy > p:not(.log-total) { font-size: 16px; }
.logrows { list-style: none; margin: 18px 0 0; padding: 0; font: 400 12.5px/1.3 var(--mono); }
.logrows li { display: grid; grid-template-columns: 70px 74px 28px 1fr; gap: 8px; padding: 7px 4px; border-top: 1px solid var(--hair); cursor: default; }
.logrows li:focus-visible { outline-offset: 0; }
.logrows li:hover, .logrows li:focus-visible { background: var(--lab-2); }
.logrows .who { grid-column: 4; }
.logrows .kh { white-space: nowrap; }
.logrows li.you { font-weight: 700; }
.log-total { margin-top: 14px; color: var(--ink-2); }

/* ---------- 6 · results ---------- */
.sc-results .frame, .sc-access .frame, .sc-faq .frame { padding: 12vh var(--gut); }
.sc-results .frame { border-top: 1px solid var(--hair); }
.doc-head { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; border-bottom: 1px solid var(--ink); padding-bottom: 12px; }
.doc-head .eyebrow { margin: 0; color: var(--ink); }
.doc-head .fine { color: var(--ink-2); text-transform: none; letter-spacing: .02em; font-size: 12px; }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.figures > div { padding: 5vh 2vw 4vh 0; border-right: 1px solid var(--hair); }
.figures > div + div { padding-left: 2vw; }
.figures > div:last-child { border-right: 0; }
.fig { font: 800 clamp(48px, 6.2vw, 112px)/1 var(--sans); letter-spacing: -.045em; display: flex; align-items: baseline; gap: .12em; font-variant-numeric: tabular-nums; }
.fig small { font: 500 14px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.fig .odo.tfx .tfx-stage { line-height: 1 !important; }
.figures dd { margin: 18px 0 0; max-width: 17em; font-size: 15px; color: var(--ink); }
.quote { margin: 7vh 0 0 33.3%; max-width: 40em; }
.quote blockquote { margin: 0; }
.quote p { font: 500 clamp(21px, 1.9vw, 32px)/1.3 var(--sans); letter-spacing: -.02em; }
.quote figcaption { margin-top: 16px; font: 400 13px var(--mono); color: var(--ink-2); }

/* ---------- 7 · access ---------- */
.sc-access .frame { display: grid; grid-template-columns: 6fr 5fr; gap: 6vw; background: var(--lab); border-top: 1px solid var(--hair); }
.access-text h2 { font-size: clamp(30px, 3.15vw, 54px); margin-bottom: 20px; }
.month { list-style: none; margin: 28px 0 0; padding: 0; }
.month li { display: grid; grid-template-columns: 8em 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--hair); }
/* the month is stencilled like the level plates; the price is a plate posted on the wall beside the door */
.month b { justify-self: start; align-self: start; font: 700 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; background: var(--ink); color: var(--lab); padding: 6px 9px; }
.price { margin-top: 24px; font-weight: 700; background: var(--lab-2); border: 1px solid var(--hair); border-left: 6px solid var(--ink); padding: 14px 18px; }
/* the form is the door: ribbed steel, fields set into it as lab-white plates, stencilled labels,
   and the key plate inserted in a lit seam, the same seam the last door opens on */
.access-form { position: relative; display: grid; gap: 18px; align-content: start; color: var(--pale); padding: 30px 30px 26px;
  border: 1.5px solid var(--ink); box-shadow: inset 0 0 0 1px var(--hair-d); } /* the jamb: the seam stays inside the door */
.access-form label { display: grid; gap: 8px; font: 700 11px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--pale); }
.access-form input, .access-form textarea { font: 400 16px/1.4 var(--sans); color: var(--ink); background: var(--lab); border: 0; border-radius: 0; padding: 13px 14px; text-transform: none; letter-spacing: 0; resize: vertical;
  box-shadow: inset 0 2px 0 var(--l3), 0 0 0 1px #0f1112; }
.access-form input::placeholder { color: var(--ink-3); opacity: 1; }
.access-form :focus-visible, .access-form input:focus, .access-form textarea:focus { outline: 2px solid var(--pale); outline-offset: 3px; }
.access-form [aria-invalid="true"] { box-shadow: inset 0 2px 0 var(--l3), inset 0 -3px 0 var(--ink), 0 0 0 1px #0f1112; }
.f-seam { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 8px -30px 4px; padding: 18px 30px; background: #F6F7F4; color: var(--ink);
  box-shadow: inset 0 1px 0 var(--ink), inset 0 -1px 0 var(--ink), inset 0 7px 0 rgba(21,23,26,.06); }
.access-form .f-seam :focus-visible { outline-color: var(--ink); }
.access-form .keyplate { flex: none; }
.form-note { flex: 1 1 16em; color: var(--ink-2); text-transform: none; letter-spacing: .02em; font-size: 12.5px; }
.form-sent { font: 700 15px var(--sans); background: var(--lab); color: var(--ink); padding: 12px 14px; border-left: 6px solid var(--ink); }
.security { font-size: 14px; color: var(--pale-2); border-top: 1px solid var(--hair-d); padding-top: 14px; }

/* ---------- 8 · questions ---------- */
.sc-faq .frame { display: grid; grid-template-columns: 5fr 7fr; gap: 4vw; border-top: 1px solid var(--hair); }
.faq-h { font-size: clamp(30px, 3.15vw, 54px); }
.faq details { border-top: 1px solid var(--ink); }
.faq details:last-child { border-bottom: 1px solid var(--ink); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; font: 700 clamp(18px, 1.35vw, 22px)/1.3 var(--sans); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font: 400 22px var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 22px; max-width: 38em; }

/* ---------- 9 · the last door ---------- */
.sc-final, .sc-credits { background: var(--l4); }
/* the Monolith: the last door stops ajar; the seam holds your task, lit from the next floor, with the key in it */
.sc-final .frame { background: var(--l4); color: var(--pale); }
.monolith { position: absolute; inset: 0; --gap: 22svh; --lip: calc(var(--open, 1) * var(--gap) / 2); }
.monolith .door { position: absolute; left: 0; right: 0; height: calc(50% - var(--lip)); transform: none; display: flex; flex-direction: column; padding: 0 var(--gut) 0 calc(var(--gut) + 8.33vw); }
.monolith .door-t { top: 0; justify-content: flex-end; padding-bottom: 4.4vh; }
.monolith .door-b { bottom: 0; justify-content: flex-start; align-items: flex-start; padding-top: 4vh; gap: 14px; }
.monolith .door-t::after, .monolith .door-b::before { display: none; }
.monolith h2 { font-size: clamp(30px, 3.2vw, 54px); max-width: 16em; }
.monolith .diff s { color: var(--pale-2); }
.m-line { color: var(--pale-2); max-width: 32em; }
.monolith .textlink { color: var(--pale); }
.m-seam { position: absolute; left: 0; right: 0; top: calc(50% - var(--lip)); height: calc(var(--lip) * 2); overflow: clip;
  display: flex; align-items: center; justify-content: space-between; gap: 20px 4vw; padding: 0 var(--gut) 0 calc(var(--gut) + 8.33vw);
  background: var(--lab); color: var(--ink); }
.m-seam > * { opacity: clamp(0, calc((var(--open, 1) - .45) * 3), 1); }
.monolith > .seam { z-index: 2; opacity: calc(1 - var(--open, 1) * 2.4); }
.echo { font: 500 clamp(20px, 2.2vw, 34px)/1.25 var(--mono); letter-spacing: -.02em; color: var(--ink); min-height: 1.25em; max-width: 30em; text-wrap: balance; }
.echo.tfx .tfx-stage { line-height: 1.25 !important; white-space: normal; }
.m-seam .keyplate { flex: none; }
/* the plate's clip-path cuts any outline away: in the conversion seams, focus inverts the key plate instead */
.f-seam .keyplate:focus-visible, .m-seam .keyplate:focus-visible { background: var(--ink); color: var(--key); }
.sc-credits .frame { background: var(--l4); color: var(--pale-2); padding: 8vh var(--gut) calc(var(--printer-h) + 6vh); }
.sc-credits footer { border-top: 1px solid var(--hair-d); padding-top: 22px; display: grid; gap: 12px; max-width: 760px; margin-left: 8.33vw; font-size: 14px; }
.closing { display: flex; gap: 18px; color: var(--pale); }
.closing span:first-child { background: var(--key); color: var(--key-ink); padding: 4px 8px; }
.sc-credits .fine { text-transform: none; letter-spacing: .02em; }

/* ---------- no-JS / before load: everything readable ---------- */
html:not(.js) .bigdoor, html:not(.js) .gate, html:not(.js) .liftdoor { display: none; }
.reduced-motion .bigdoor { display: none; }

/* ---------- short frames ---------- */
@media (max-height: 700px) and (min-width: 761px) {
  .sc-floor .wall { min-height: 540px; }
  .p-words h1 { font-size: clamp(28px, 2.7vw, 42px); margin-bottom: 16px; }
  .ctas { margin-top: 18px; }
  .micro { display: none; }
  .queue li:nth-child(3) { display: none; }
  .queue { padding-top: 14px; }
  .ph-sub { margin-top: 12px; }
  .steps li { padding: 4px 0; }
  .lift-stage { min-height: 46vh; }
}

/* ---------- tablet ---------- */
@media (max-width: 1100px) and (min-width: 761px) {
  .sc-floor .wall { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; grid-template-areas: "words words" "task gate"; height: auto; }
  .p-tools { display: none; }
  .p-words { padding-bottom: 28px; }
  .p-task, .p-gate { min-height: 420px; }
}

/* ---------- the phone cut ---------- */
@media (max-width: 760px) {
  :root { --slate-h: 52px; --gut: 16px; }
  html { scroll-padding: calc(var(--slate-h) + 8px) 0 calc(88px + env(safe-area-inset-bottom)); } /* a focused field never hides under the slate or the key bar */
  body { font-size: 16px; }
  .slate { grid-template-columns: auto 1fr; gap: 12px; }
  .floor { justify-self: end; gap: 8px; }
  .floor-label { display: none; }
  .led { width: 104px; height: 30px; line-height: 30px; }
  .slate-nav { display: none; }
  .printer { display: none; }
  .phonebar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 39; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--lab); border-top: 1px solid var(--hair); }
  .phonebar .keyplate { flex: 1; justify-content: center; min-height: 48px; font-size: 16px; }
  .sc-floor .wall { height: auto; min-height: 0; grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "words" "task" "gate"; }
  .p-tools { display: none; }
  .p-words { padding: 28px 16px 24px; }
  .p-words h1 { font-size: clamp(32px, 9.4vw, 44px); }
  .p-task { min-height: 0; padding: 16px; }
  .p-gate { min-height: 300px; padding: 16px; }
  .ctas { gap: 14px 18px; }
  .p-words h1 { margin-bottom: 18px; }
  .caption { margin-top: 22px; align-items: flex-start; }
  .sc-pilot .frame { padding: calc(var(--slate-h) + 4vh) 16px calc(var(--safe-bottom) + 90px); }
  .pilot-copy { margin-left: 0; }
  .statement { font-size: clamp(25px, 7.4vw, 34px); }
  .follow { margin-left: 0; margin-top: 24px; }
  .sc-levels .frame { padding: calc(var(--slate-h) + 4vh) 16px 96px; }
  .lift, .lift-head { grid-template-columns: 1fr; }
  .lift-head { gap: 14px; }
  .lift-stage { grid-template-columns: auto 1fr; padding: 20px 16px; min-height: 480px; align-content: start; gap: 0 14px; }
  .numeral { font-size: 34vmin; grid-row: 1; align-self: start; }
  .lvl-name { grid-column: 2; font-size: 13vw; align-self: end; }
  .floors, .yours { grid-column: 1 / -1; margin-top: 18px; }
  .panelbtns button { padding: 0 12px 0 5px; height: 46px; font-size: 14px; gap: 6px; }
  .panelbtns button b { width: 30px; height: 30px; }
  .hint { display: none; }
  .sc-sandbox .frame { padding: 9vh 16px 6vh; }
  .sb-head { grid-template-columns: 1fr; gap: 14px; }
  .prompt { grid-template-columns: 1fr; }
  .runbtn { border-left: 0; border-top: 1.5px solid var(--ink); padding: 15px; }
  .field-pre { padding-left: 12px; }
  .ghost { left: calc(12px + 4.6ch + 14px); }
  .wall-sb { grid-template-columns: 1fr; }
  .wall-sb .p-gate { min-height: 280px; }
  .logwall { grid-template-columns: 1fr; font-size: 9.5px; }
  .logwall .col:nth-child(n+2) { display: none; }
  .log-copy { left: 12px; right: 12px; width: auto; bottom: calc(var(--safe-bottom) + 84px); padding: 20px 18px; }
  .log-copy > p:not(.log-total) { font-size: 15px; }
  .logrows li { grid-template-columns: 60px 1fr; }
  .logrows li > :nth-child(3) { display: none; }
  .logrows .who { grid-column: 2; }
  .logrows li:nth-child(n+4) { display: none; }
  .sc-results .frame, .sc-access .frame, .sc-faq .frame { padding: 9vh 16px; }
  .doc-head { flex-direction: column; gap: 6px; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > div { padding: 4vh 12px 3vh 0; border-bottom: 1px solid var(--hair); }
  .figures > div:nth-child(2n) { border-right: 0; padding-left: 12px; }
  .figures > div:nth-child(3) { padding-left: 0; }
  .fig { font-size: 15vw; }
  .quote { margin-left: 0; }
  .sc-access .frame, .sc-faq .frame { grid-template-columns: 1fr; }
  .month li { grid-template-columns: 1fr; gap: 4px; }
  .access-form { padding: 22px 18px 20px; }
  .f-seam { margin: 6px -18px 2px; padding: 16px 18px; }
  .monolith { --gap: 30svh; }
  .monolith .door { padding-left: 16px; padding-right: 16px; }
  .monolith .door-t { padding-bottom: 3vh; }
  .monolith .door-b { padding-top: 2.4vh; gap: 10px; }
  .monolith h2 { font-size: clamp(30px, 8.6vw, 40px); }
  .m-seam { flex-direction: column; align-items: flex-start; justify-content: center; padding: 0 16px; gap: 18px; }
  .echo { font-size: clamp(18px, 5.2vw, 22px); }
  .runstrip { display: block; }
  .sc-credits .frame { padding-bottom: 110px; }
  .sc-credits footer { margin-left: 0; }
}
/* phone portrait: one key in the thumb zone (the bar), and the lead working right under the headline */
@media (max-width: 760px) and (max-aspect-ratio: 5/4) {
  .p-words .ctas .keyplate { display: none; }
  .p-words .ctas { margin-top: 20px; }
}
@media (prefers-reduced-motion: reduce) { .keyplate::before { transition: none; } }

/* type-fx typewriters that must wrap like the copy they replace */
.plan-line.tfx .tfx-stage, .echo.tfx .tfx-stage { display: grid; white-space: normal; width: 100%; }
.plan-line.tfx .tfx-stage span, .echo.tfx .tfx-stage span { white-space: pre-wrap !important; }
.statement.tfx .tfx-stage { white-space: normal; }

.gate[data-state="ask"] .door-t::after, .gate[data-state="ask"] .door-b::before { opacity: 0; }
