/* ═══════════════════════════════════════════════════════════════════════
   SKRUBIT — skrubit.in
   Legacy / terminal / infrastructure. One accent, hairlines, no shadows,
   no gradients, no radii above 2px. The animation earns the restraint.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --ink:        #0A0A0B;   /* canvas — not pure black; pure black kills grain */
  --panel:      #131316;   /* screenshot wells, spec blocks                   */
  --rule:       #26262B;   /* hairline borders. never a shadow                */
  --paper:      #EDEDE8;   /* primary text, and the censor bar                */
  --muted:      #7A7A82;   /* secondary                                       */
  --phosphor:   #FFB000;   /* the one accent. P3 terminal amber               */

  --faint:      #4A4A52;
  --phos-wash:  rgba(255, 176, 0, .13);
  --phos-line:  rgba(255, 176, 0, .34);
  --paper-wash: rgba(237, 237, 232, .07);

  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono",
          Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;

  --w: 1180px;
  --gut: clamp(20px, 5vw, 56px);

  /* 4 / 8 / 16 / 24 / 32 / 48 / 80 — nothing else */
  --s1: 4px;  --s2: 8px;  --s3: 16px; --s4: 24px;
  --s5: 32px; --s6: 48px; --s7: 80px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 16px/1.65 var(--sans);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
p { margin: 0 0 var(--s3); }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
code { font: 400 .88em/1 var(--mono); color: var(--phosphor); }
b, strong { font-weight: 500; color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 3px;
}

/* the sticky header must not sit on top of an anchor target */
section[id], main[id] { scroll-margin-top: 76px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 var(--gut); }
/* Feature sections run wider than the prose measure so a 1360px capture
   lands near 1:1. Text inside them is still capped at a readable measure. */
.wrap--wide { max-width: 1420px; }
.wrap-narrow { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 var(--gut); }

/* ── film grain ─────────────────────────────────────────────────────── */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══ 00 · ENTRY ══════════════════════════════════════════════════════ */
.boot {
  position: fixed; inset: 0; z-index: 100;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
.boot.gone { opacity: 0; pointer-events: none; }
.boot[hidden] { display: none; }
.boot-inner { width: min(560px, 88vw); }
.boot-log {
  margin: 0;
  font: 400 13px/1.85 var(--mono);
  color: var(--muted);
  white-space: pre-wrap;
  min-height: 11.1em;
}
.boot-log .ok { color: var(--phosphor); }
.boot-log .hi { color: var(--paper); }
.boot-skip {
  position: absolute; right: var(--s4); bottom: var(--s4);
  background: none; border: 1px solid var(--rule); color: var(--faint);
  font: 400 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  padding: var(--s2) var(--s3); cursor: pointer;
}
.boot-skip:hover { color: var(--paper); border-color: var(--muted); }

/* ═══ CHROME ══════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) var(--gut);
  background: rgba(10, 10, 11, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.mark {
  display: flex; align-items: center; gap: var(--s2);
  text-decoration: none;
  font: 600 13px/1 var(--mono); letter-spacing: .22em;
}
.mark img { width: 20px; height: 20px; }
.topnav { display: flex; align-items: center; gap: var(--s4); }
.topnav a {
  font: 400 12px/1 var(--mono); letter-spacing: .1em;
  color: var(--muted); text-decoration: none;
}
.topnav a:hover { color: var(--paper); }
.topnav-cta { color: var(--phosphor) !important; }
.topnav-cta::before { content: "▸ "; }
@media (max-width: 680px) {
  .topnav a:not(.topnav-cta) { display: none; }
}

/* ═══ HERO ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: var(--s6) 0 var(--s6);
  border-bottom: 1px solid var(--rule);
}
.hero::before {           /* scanlines, hero only, very low */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
  opacity: .5;
}
.hero .wrap { position: relative; z-index: 2; }

.eyebrow {
  font: 400 11px/1 var(--mono); letter-spacing: .18em;
  text-transform: uppercase; color: var(--faint);
  margin: 0 0 var(--s4);
}
.h1 {
  font: 500 clamp(26px, 3.3vw, 42px)/1.2 var(--mono);
  letter-spacing: -.028em;
  max-width: 26ch;
  margin: 0 0 var(--s4);
  text-wrap: balance;
}
.lede {
  font-size: clamp(16px, 1.55vw, 18.5px);
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 var(--s5);
}
.lede strong { color: var(--paper); }

.hero-cta {
  display: flex; align-items: center; gap: var(--s4);
  flex-wrap: wrap; margin: 0 0 var(--s5);
}
.btn {
  display: inline-block;
  font: 500 13px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: var(--phosphor);
  border: 1px solid var(--phosphor); border-radius: 0;
  padding: 14px var(--s4);
  text-decoration: none; cursor: pointer;
  transition: background .14s linear, color .14s linear;
}
.btn:hover { background: transparent; color: var(--phosphor); }
.hero-cta-note { font-size: 13px; color: var(--faint); }

/* ── THE PASS ────────────────────────────────────────────────────────── */
.pass {
  margin: 0 0 var(--s3);
  border: 1px solid var(--rule);
  background: var(--panel);
}
.pass-chrome {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--rule);
  font: 400 11px/1.6 var(--mono); letter-spacing: .06em;
  color: var(--faint);
}
.pass-title { color: var(--muted); }
.pass-state {
  color: var(--phosphor);
  border: 1px solid var(--phos-line);
  padding: 1px 7px;
  letter-spacing: .14em; text-transform: uppercase;
}
.pass-net { margin-left: auto; }

.pass-body { display: grid; grid-template-columns: minmax(0,1fr) 258px; }
.pass-doc {
  margin: 0; padding: var(--s4) var(--s3) var(--s4) var(--s4);
  font: 400 clamp(10px, 1.02vw, 13px)/1.95 var(--mono);
  color: var(--paper);
  white-space: pre-wrap;
  overflow-x: auto;
  tab-size: 2;
}
.pass-doc .dim { color: var(--muted); }

/* a span the engine may claim */
.tok, .hold {
  position: relative;
  display: inline-block;
  padding: 0 2px;
  transition: background .18s linear, color .18s linear;
}
.tok.scan   { background: var(--phos-wash); box-shadow: inset 0 -1px 0 var(--phos-line); }
.tok.claim  { background: var(--phos-wash); color: var(--phosphor);
              box-shadow: inset 0 -1px 0 var(--phosphor); }
.tok.bar    { color: transparent !important; background: var(--paper) !important;
              box-shadow: none !important; }
.tok.done   { color: var(--phosphor); background: transparent;
              box-shadow: inset 0 -1px 0 var(--phos-line); }
/* Considered and declined, not processed — a dotted rule so it never reads
   as the solid one a masked value carries. */
.hold.held  { color: var(--muted); border-bottom: 1px dotted var(--faint); }

.pass-gut {
  border-left: 1px solid var(--rule);
  padding: var(--s4) var(--s3);
  font: 400 11px/1.7 var(--mono);
  min-height: 260px;
}
.gut-idle, .gut-row { display: flex; gap: var(--s2); margin-bottom: var(--s1); }
.gut-k { color: var(--faint); min-width: 62px; letter-spacing: .06em; }
.gut-v { color: var(--muted); word-break: break-word; }
.gut-v.on { color: var(--phosphor); }
.gut-v.pap { color: var(--paper); }
.gut-sep { height: 1px; background: var(--rule); margin: var(--s3) 0; }
.gut-verdict {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 7px; display: inline-block; margin-top: var(--s1);
}
.gut-verdict.auto   { color: var(--ink); background: var(--phosphor); }
.gut-verdict.review { color: var(--phosphor); border: 1px solid var(--phos-line); }
.gut-verdict.never  { color: var(--muted); border: 1px solid var(--rule); }

.pass-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s2) var(--s3);
  border-top: 1px solid var(--rule);
  font: 400 11px/1.6 var(--mono); color: var(--faint); letter-spacing: .06em;
}
.pass-replay {
  background: none; border: 1px solid var(--rule); color: var(--muted);
  font: 400 11px/1 var(--mono); letter-spacing: .1em;
  padding: var(--s1) var(--s2); cursor: pointer;
}
.pass-replay:hover { color: var(--phosphor); border-color: var(--phos-line); }

.pass-note {
  font-size: 13px; color: var(--faint); max-width: 68ch;
  margin: 0 0 var(--s5);
}

.tape {
  list-style: none; margin: 0; padding: var(--s3) 0 0;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6);
  font: 400 12px/1.4 var(--mono); color: var(--muted); letter-spacing: .04em;
}
.tape b { color: var(--phosphor); font-weight: 500; }

@media (max-width: 860px) {
  .pass-body { grid-template-columns: 1fr; }
  .pass-gut { border-left: 0; border-top: 1px solid var(--rule); min-height: 0; }
}

/* ═══ SECTION FURNITURE ═══════════════════════════════════════════════ */
.sec-n {
  font: 400 11px/1 var(--mono); letter-spacing: .22em;
  text-transform: uppercase; color: var(--phosphor);
  margin: 0 0 var(--s4);
}
.cat, .path, .spec, .access { padding: var(--s7) 0; border-bottom: 1px solid var(--rule); }
.cat-head { max-width: 62ch; margin-bottom: var(--s6); }
.cat-head h2, .path h2, .spec h2, .access h2 {
  font: 500 clamp(22px, 2.7vw, 32px)/1.25 var(--mono);
  letter-spacing: -.02em;
  margin: 0 0 var(--s3);
}
.cat-sub { color: var(--muted); margin: 0; max-width: 62ch; }

/* ═══ 01 · THESIS ═════════════════════════════════════════════════════ */
.thesis {
  padding: var(--s7) 0;
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}
.thesis-line {
  margin: 0 0 var(--s6);
  font: 500 clamp(22px, 3.2vw, 38px)/1.28 var(--mono);
  letter-spacing: -.028em;
  max-width: 28ch;
  color: var(--paper);
  border-left: 2px solid var(--phosphor);
  padding-left: var(--s4);
  text-wrap: balance;
}
.thesis-grid {
  display: grid; gap: 0 var(--s5);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  border-top: 1px solid var(--rule);
  margin-bottom: var(--s4);
}
.thesis-grid > div {
  padding: var(--s3) var(--s3) var(--s3) 0;
  border-bottom: 1px solid var(--rule);
}
.thesis-grid .k {
  display: block;
  font: 400 11px/1.6 var(--mono); letter-spacing: .12em;
  text-transform: uppercase; color: var(--phosphor);
}
.thesis-grid .v { display: block; font-size: 14px; color: var(--muted); }
.thesis-foot { color: var(--faint); font-size: 14px; max-width: 66ch; margin: 0; }

/* ═══ CARDS ═══════════════════════════════════════════════════════════ */
.cards { display: flex; flex-direction: column; gap: var(--s6); }

.card { border: 1px solid var(--rule); background: var(--panel); }

/* A full-window capture is 1360px wide. Put it beside a text column and it
   renders at about half scale, where the interface it is meant to prove is
   no longer readable — proof you cannot read is decoration. So the wide
   captures stack under their text and get the whole container, which in
   these sections is deliberately wider than the prose measure. */
.card.wide { display: block; }
.card-txt { padding: var(--s5); }
.card-txt > * { max-width: 76ch; }
.card.wide .shot { border-top: 1px solid var(--rule); }

/* Small captures are legible beside text, so those cards keep two columns. */
.card.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
}
.card.split .card-txt {
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; justify-content: center;
}
.card.split .card-txt > * { max-width: none; }
.card-txt h3, .card > h3 {
  font: 500 clamp(17px, 1.9vw, 21px)/1.35 var(--mono);
  letter-spacing: -.015em;
  margin: 0 0 var(--s3);
}
.card p { font-size: 15px; }
.card p:last-child { margin-bottom: 0; }
.meta { font-size: 13.5px; color: var(--muted); }
.quote {
  border-left: 2px solid var(--phosphor);
  padding-left: var(--s3);
  color: var(--paper);
  font-size: 14.5px;
}
.ctl {
  font: 500 10.5px/1 var(--mono); letter-spacing: .18em;
  text-transform: uppercase; color: var(--phosphor);
  margin: 0 0 var(--s2);
}

/* Both control rows hold four cards, so the column count is pinned to two
   rather than left to auto-fit: at these container widths auto-fit lands on
   three and orphans the fourth. */
.ctl-row {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ctl-row .card { padding: var(--s4); }
@media (max-width: 760px) { .ctl-row { grid-template-columns: 1fr; } }

/* screenshots: raw, in a well, with a scanline film — no device mockups */
.shot { margin: 0; position: relative; background: var(--ink); overflow: hidden;
        display: flex; align-items: center; justify-content: center; }
.shot img { width: 100%; }
.shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  opacity: .55;
}
/* A capture narrower than the column it sits in is shown at its own size
   rather than upscaled — a blurred screenshot of a precision tool is a
   worse argument than a small sharp one. */
.shot--fit { padding: var(--s4); }
.shot--fit img { width: auto; max-width: 100%; }

.shot.bare { border: 1px solid var(--rule); margin-top: var(--s6); display: block; }
.shot.bare figcaption {
  font: 400 11px/1.6 var(--mono); color: var(--faint);
  padding: var(--s2) var(--s3); border-top: 1px solid var(--rule);
  position: relative; z-index: 2;
}

@media (max-width: 900px) {
  .card.split { grid-template-columns: 1fr; }
  .card.split .card-txt { border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* ═══ 03 · LAYERS ═════════════════════════════════════════════════════ */
.layers {
  list-style: none; margin: 0 0 var(--s5); padding: 0;
  border-top: 1px solid var(--rule);
}
.layers li {
  display: grid;
  grid-template-columns: 46px 130px minmax(0, 1fr);
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.ln { font: 500 13px/1.5 var(--mono); color: var(--phosphor); letter-spacing: .08em; }
.lt { font: 400 13px/1.5 var(--mono); color: var(--paper); letter-spacing: .04em; }
.ld { font-size: 14px; color: var(--muted); }
@media (max-width: 680px) {
  .layers li { grid-template-columns: 46px minmax(0, 1fr); }
  .ld { grid-column: 2; }
}

.gate-note {
  border: 1px solid var(--phos-line);
  background: var(--phos-wash);
  padding: var(--s4);
  margin: 0 0 var(--s6);
}
.gate-note p { font-size: 15px; }
.gate-note p:last-child { margin-bottom: 0; }
.gate-k {
  font: 500 11px/1 var(--mono); letter-spacing: .18em;
  text-transform: uppercase; color: var(--phosphor);
  margin: 0 0 var(--s2) !important;
}

/* ═══ 05 · TERMINAL SNIPPET ═══════════════════════════════════════════ */
.term {
  margin: 0 0 var(--s3);
  padding: var(--s3);
  border: 1px solid var(--rule);
  background: var(--ink);
  font: 400 12.5px/1.75 var(--mono);
  color: var(--phosphor);
  white-space: pre-wrap;
  overflow-x: auto;
}

/* ═══ 06 · THE PATH ═══════════════════════════════════════════════════ */
.flow {
  list-style: none; margin: var(--s6) 0 0; padding: 0;
  border-top: 1px solid var(--rule);
}
.flow-step {
  display: grid;
  grid-template-columns: 40px 150px minmax(0, 1fr);
  gap: var(--s3);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  position: relative;
}
.fs-n {
  font: 500 13px/1.5 var(--mono); color: var(--phosphor);
  border: 1px solid var(--rule); text-align: center;
  padding: 2px 0; width: 28px;
}
.fs-t { font: 500 15px/1.5 var(--mono); letter-spacing: -.01em; }
.fs-d { font-size: 14px; color: var(--muted); }
.flow-step.gate { background: var(--phos-wash); }
.flow-step.gate .fs-n { border-color: var(--phosphor); }
.flow-step.gate .fs-t { color: var(--phosphor); }
@media (max-width: 680px) {
  .flow-step { grid-template-columns: 40px minmax(0, 1fr); }
  .fs-d { grid-column: 2; }
}

/* ═══ 07 · SPEC ═══════════════════════════════════════════════════════ */
.spec { background: var(--panel); }
.spec-cols {
  display: grid; gap: var(--s6);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: var(--s6);
}
.spec-h {
  font: 500 12px/1.5 var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--phosphor);
  margin: 0 0 var(--s3); padding-bottom: var(--s2);
  border-bottom: 1px solid var(--rule);
}
.kv { margin: 0 0 var(--s3); }
.kv dt {
  font: 400 12px/1.7 var(--mono); color: var(--muted);
  letter-spacing: .04em; float: left; clear: left; width: 46%;
}
.kv dd {
  font: 400 12px/1.7 var(--mono); color: var(--paper);
  margin: 0 0 0 46%; padding-bottom: var(--s1);
}
.kv dd b { color: var(--phosphor); font-weight: 500; font-size: 14px; }
.sm { font-size: 12.5px; line-height: 1.65; color: var(--faint); }
.kv .sm { color: var(--faint); }
.warn { border-left: 2px solid var(--phosphor); padding-left: var(--s3); }

.tbl { width: 100%; border-collapse: collapse; margin-bottom: var(--s3); }
.tbl td {
  font: 400 12px/1.9 var(--mono);
  padding: 1px var(--s2) 1px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}
.tbl td:nth-child(2), .tbl td:nth-child(4) { color: var(--paper); text-align: right;
                                             width: 62px; padding-right: var(--s4); }
.tbl td.bad { color: var(--phosphor); }

.gaps { list-style: none; margin: 0; padding: 0; }
.gaps li {
  font-size: 14px; color: var(--muted);
  padding: var(--s2) 0 var(--s2) var(--s4);
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.gaps li::before {
  content: "—"; position: absolute; left: 0; color: var(--faint);
  font-family: var(--mono);
}
.prov {
  margin: var(--s6) 0 0; padding-top: var(--s3);
  border-top: 1px solid var(--rule);
  font: 400 12px/1.7 var(--mono); color: var(--faint);
}

/* ═══ 08 · ACCESS ═════════════════════════════════════════════════════ */
.access .cat-sub { margin-bottom: var(--s6); }
.form { display: block; }
.f-row { margin-bottom: var(--s4); }
.f-row label {
  display: block;
  font: 400 11px/1.8 var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: var(--s1);
}
.opt { color: var(--faint); text-transform: none; letter-spacing: .04em; }
.f-row input, .f-row textarea {
  width: 100%; display: block;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--paper);
  font: 400 15px/1.5 var(--mono);
  padding: 11px var(--s3);
  transition: border-color .14s linear;
}
.f-row input:focus, .f-row textarea:focus {
  outline: none; border-color: var(--phosphor);
}
.f-row input.bad, .f-row textarea.bad { border-color: var(--phosphor); }
.f-row textarea { resize: vertical; }
.f-err {
  font: 400 12.5px/1.6 var(--mono); color: var(--phosphor);
  margin: 0 0 var(--s3);
}
.f-actions { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.f-note { font-size: 12.5px; color: var(--faint); }
.f-done {
  font: 400 15px/1.7 var(--mono); color: var(--phosphor);
  border-left: 2px solid var(--phosphor); padding-left: var(--s3);
  margin: 0;
}

/* ═══ FOOT ════════════════════════════════════════════════════════════ */
.foot { padding: var(--s5) 0; }
.foot .wrap {
  display: flex; justify-content: space-between;
  font: 400 12px/1 var(--mono); letter-spacing: .1em; color: var(--faint);
}

/* ═══ REDUCED MOTION ══════════════════════════════════════════════════
   Everything still arrives — it just arrives already finished.        */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hero::before, .shot::after { display: none; }
}
