/* =========================================================
   MATT'S OS — stylesheet
   Themes: phosphor (default, dark) / paper (light manual)
   ========================================================= */

:root {
  --bg: #0d0d0c;
  --bg-2: #151513;
  --fg: #ebe6d9;
  --dim: #8d897e;
  --faint: #3d3b36;
  --line: #2a2926;
  --sig: #ff5a1f;
  --sig-ink: #0d0d0c;
  --ok: #a9ef6c;
  --warn: #ffc53d;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --display: "Archivo", "Arial Black", Impact, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --rail: 260px;
  color-scheme: dark;
}

:root[data-theme="paper"] {
  --bg: #ece7d9;
  --bg-2: #e3ddcc;
  --fg: #141411;
  --dim: #625e54;
  --faint: #b9b3a3;
  --line: #c8c2b1;
  --sig: #e2470c;
  --sig-ink: #ece7d9;
  --ok: #2c7a1c;
  --warn: #9a6200;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 56px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 14.5px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s, color .4s;
}

/* film grain + scanlines */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}
body::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .09;
  mix-blend-mode: overlay;
}
body::after {
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  opacity: .35;
}
:root[data-theme="paper"] body::after { opacity: 0; }

::selection { background: var(--sig); color: var(--sig-ink); }

a { color: inherit; text-decoration-color: var(--sig); text-underline-offset: 3px; }
a:hover { color: var(--sig); }
:focus-visible { outline: 2px solid var(--sig); outline-offset: 3px; }

b { font-weight: 600; }
code { font-family: var(--mono); }
.sig { color: var(--sig); }
.dim { color: var(--dim); }

/* ---------- LED / tags / buttons ---------- */
.led {
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 7px;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  vertical-align: 1px;
  animation: blink 1.6s steps(2, jump-none) infinite;
}
@keyframes blink { 50% { opacity: .25; } }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  white-space: nowrap;
  color: var(--dim);
}
.tag.ok { color: var(--ok); }
.tag.beta { color: var(--warn); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid var(--fg);
  font: 500 13px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  color: var(--fg);
  transition: background .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn-sig { background: var(--sig); border-color: var(--sig); color: var(--sig-ink); }
.btn-sig:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }

.kicker {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* =========================================================
   BOOT
   ========================================================= */
.boot { display: none; }
.js .boot.on {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: var(--gutter);
  background: #050505;
  color: #d8d4c8;
  cursor: pointer;
  transition: opacity .6s, transform .6s;
}
.boot.off { opacity: 0; transform: scale(1.02); pointer-events: none; }
.boot-log {
  margin: 0;
  font: 400 clamp(11px, 1.3vw, 14px)/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}
.boot-log .ok { color: #a9ef6c; }
.boot-log .sig { color: #ff5a1f; }
.boot-log .dim { color: #6f6c64; }
.boot-log .big {
  display: block;
  margin-top: 14px;
  font: 900 clamp(48px, 12vw, 160px)/.85 var(--display);
  font-stretch: 125%;
  color: #ff5a1f;
}
.boot-skip {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  margin: 0;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6f6c64;
}
body.booting { overflow: hidden; }

/* =========================================================
   SYSTEM BAR
   ========================================================= */
.sysbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 44px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sysbar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.sysbar-logo .sq { width: 11px; height: 11px; background: var(--sig); }
.sysbar-nav { display: flex; gap: 2px; }
.sysbar-nav a {
  padding: 4px 9px;
  text-decoration: none;
  color: var(--dim);
}
.sysbar-nav a:hover { color: var(--fg); background: var(--bg-2); }
.sysbar-nav a.hot { color: var(--sig); }
.sysbar-nav a.active { color: var(--bg); background: var(--fg); }
.sysbar-stat { display: flex; align-items: center; gap: 18px; white-space: nowrap; color: var(--dim); }
.sysbar-stat b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.sysbar-stat b.sig { color: var(--sig); }
.theme-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  background: none;
  color: var(--fg);
  font-size: 15px;
  cursor: pointer;
}
.theme-btn:hover { border-color: var(--sig); color: var(--sig); }

@media (max-width: 1100px) { .sysbar-nav { display: none; } }
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .sysbar { font-size: 11px; gap: 10px; }
  .sysbar-logo .dim { display: none; }
}

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden;
  background: var(--sig);
  color: var(--sig-ink);
  border-bottom: 1px solid var(--line);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: tick 38s linear infinite;
}
.ticker span {
  padding: 11px 26px;
  font: 800 15px/1 var(--display);
  font-stretch: 112%;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ticker span::after { content: "✕"; margin-left: 52px; font-weight: 400; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* =========================================================
   SECTIONS
   ========================================================= */
.sec {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 40px;
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  border-bottom: 1px solid var(--line);
}
.sec-head {
  position: sticky;
  top: 76px;
  align-self: start;
}
.sec-no {
  display: block;
  font: 800 13px/1 var(--mono);
  color: var(--sig);
  letter-spacing: .1em;
}
.sec-head h2 {
  margin: 10px 0 8px;
  font: 850 clamp(28px, 2.6vw, 42px)/.92 var(--display);
  font-stretch: 104%;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.sec-path { font-size: 12px; color: var(--dim); }
.sec-body { min-width: 0; }

@media (max-width: 900px) {
  .sec { grid-template-columns: 1fr; gap: 28px; }
  .sec-head { position: static; }
}

/* reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- §01 neofetch ---------- */
.neofetch {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.nf-logo {
  margin: 0;
  font: 400 clamp(14px, 1.6vw, 20px)/1.15 var(--mono);
  color: var(--sig);
}
.nf-info { flex: 1 1 340px; min-width: 0; }
.nf-info p { margin: 0; }
.nf-user { font-weight: 600; }
.nf-rule { color: var(--faint); overflow: hidden; white-space: nowrap; }
.nf-info dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 3px 12px;
  margin: 8px 0 16px;
}
.nf-info dt { color: var(--sig); font-weight: 600; }
.nf-info dd { margin: 0; overflow-wrap: anywhere; }
.nf-swatch { display: flex; }
.nf-swatch i { width: 26px; height: 14px; }
.nf-swatch i:nth-child(1) { background: var(--fg); }
.nf-swatch i:nth-child(2) { background: var(--dim); }
.nf-swatch i:nth-child(3) { background: var(--faint); }
.nf-swatch i:nth-child(4) { background: var(--sig); }
.nf-swatch i:nth-child(5) { background: var(--ok); }
.nf-swatch i:nth-child(6) { background: var(--warn); }

.readme {
  max-width: 720px;
  margin-top: 40px;
  font-size: clamp(15px, 1.3vw, 17px);
}
.readme p { margin: 0 0 1em; }
.file-tag {
  display: inline-block;
  padding: 2px 8px;
  margin-bottom: 14px !important;
  background: var(--fg);
  color: var(--bg);
  font-size: 11px;
  letter-spacing: .1em;
}

/* ---------- §02 calls ---------- */
.calls {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: call;
  border-top: 1px solid var(--line);
}
.calls li {
  counter-increment: call;
  display: grid;
  grid-template-columns: 40px minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
  gap: 8px 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.calls li::before {
  content: counter(call, decimal-leading-zero);
  font-size: 12px;
  color: var(--dim);
}
.calls li:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--sig) 9%, transparent), transparent 70%); }
.calls li:hover .call { color: var(--sig); }
.call {
  font: 700 clamp(15px, 1.4vw, 19px)/1.3 var(--mono);
  transition: color .2s;
  overflow-wrap: anywhere;
}
.call i { font-style: normal; font-weight: 400; color: var(--dim); }
.calls p { margin: 0; color: var(--dim); }
.calls p a { color: var(--fg); }
@media (max-width: 760px) {
  .calls li { grid-template-columns: 32px 1fr; }
  .calls li p, .calls li .tag { grid-column: 2; justify-self: start; }
}

/* errata strip */
.errata { margin-top: 40px; padding: 24px; border: 1px solid var(--line); background: var(--bg-2); }
.errata ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 30px;
  margin: 4px 0 14px;
  padding: 0;
  font: 800 clamp(26px, 3.2vw, 46px)/1.1 var(--display);
  font-stretch: 112%;
  text-transform: uppercase;
}
.errata li::before { content: "✕ "; color: var(--sig); font-size: .5em; vertical-align: .35em; }
.errata .dim { margin: 0; font-size: 13px; }

/* ---------- §03 modules ---------- */
.ps-head,
.mod summary {
  display: grid;
  grid-template-columns: 64px 130px minmax(0, 1fr) 90px 92px;
  gap: 16px;
  align-items: center;
}
.ps-head {
  padding: 0 16px 10px;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--dim);
  border-bottom: 1px solid var(--fg);
}
.mod { border-bottom: 1px solid var(--line); }
.mod summary {
  padding: 18px 16px;
  cursor: pointer;
  list-style: none;
  transition: background .15s, color .15s;
}
.mod summary::-webkit-details-marker { display: none; }
.mod summary:hover { background: var(--bg-2); }
.mod[open] summary { background: var(--fg); color: var(--bg); }
.mod[open] summary .pdesc,
.mod[open] summary .pid,
.mod[open] summary .psince { color: var(--bg); }
.pid { color: var(--dim); font-variant-numeric: tabular-nums; }
.pname { font-weight: 700; font-size: 16px; }
.pname::before { content: "▸ "; color: var(--sig); }
.mod[open] .pname::before { content: "▾ "; }
.pdesc { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psince { color: var(--dim); font-size: 13px; }
.pstate { font-size: 11px; font-weight: 600; letter-spacing: .1em; }
.pstate.run { color: var(--ok); }
.pstate.run::before { content: "● "; }
.pstate.done { color: var(--dim); }
.mod[open] .pstate.run { color: var(--bg); }
.mod-body {
  padding: 22px 16px 26px calc(64px + 16px + 16px);
  border-left: 3px solid var(--sig);
  background: var(--bg-2);
}
.mod-body ul { margin: 0; padding: 0; list-style: none; max-width: 760px; }
.mod-body li { position: relative; padding-left: 22px; margin-bottom: 9px; }
.mod-body li::before { content: "→"; position: absolute; left: 0; color: var(--sig); }
.deps { margin: 16px 0 0; font-size: 12px; color: var(--dim); }
@media (max-width: 760px) {
  .ps-head, .mod summary { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .pdesc, .psince { display: none; }
  .mod-body { padding: 18px 16px 22px 20px; }
}

/* ---------- §04 incident ---------- */
.incident {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 32px;
  align-items: start;
}
.case { margin: 0; border-top: 1px solid var(--fg); }
.case div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.case dt { font-size: 11px; letter-spacing: .16em; color: var(--sig); }
.case dd { margin: 3px 0 0; }
@media (max-width: 1100px) { .incident { grid-template-columns: 1fr; } }

.logwin, .term {
  border: 1px solid var(--line);
  background: #070707;
  color: #d9d5c9;
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--sig) 85%, transparent);
}
.logwin-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid #262522;
  font-size: 12px;
  color: #77736a;
}
.logwin-bar i { width: 10px; height: 10px; border: 1px solid #4a4843; border-radius: 50%; }
.logwin-bar i:first-child { background: #ff5a1f; border-color: #ff5a1f; }
.logwin-bar span { margin-left: 8px; }
.logwin-btn {
  margin-left: auto;
  border: 1px solid #3a3934;
  background: none;
  color: #a9a597;
  font: 12px var(--mono);
  padding: 2px 8px;
  cursor: pointer;
}
.logwin-btn:hover { color: #ff5a1f; border-color: #ff5a1f; }
.logwin-out {
  min-height: 380px;
  margin: 0;
  padding: 18px;
  font: 400 12.5px/1.75 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}
.logwin-out .e { color: #ff6b5e; }
.logwin-out .w { color: #ffc53d; }
.logwin-out .ok { color: #a9ef6c; }
.logwin-out .c { color: #ff5a1f; font-weight: 600; }
.logwin-out .d { color: #6f6c64; }
.logwin-note { margin: 0; padding: 10px 18px; border-top: 1px solid #262522; font-size: 11px; color: #6f6c64; }

/* ---------- §05 changelog ---------- */
.log { list-style: none; margin: 0; padding: 0; }
.log li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.log li:first-child { border-top-color: var(--fg); }
.ver b {
  display: block;
  font: 900 clamp(44px, 5vw, 72px)/.85 var(--display);
  font-stretch: 125%;
  color: var(--faint);
  transition: color .3s;
}
.log li:hover .ver b, .log li:first-child .ver b { color: var(--sig); }
.ver span { display: block; margin-top: 8px; font-size: 12px; color: var(--dim); }
.rel h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.rel h3 .tag { margin-left: 8px; vertical-align: 2px; }
.rel p { margin: 0 0 4px; color: var(--dim); }
.rel code { color: var(--fg); }
.add { color: var(--ok); font-weight: 700; margin-right: 6px; }
.rel p.also { margin-top: 10px; padding-left: 18px; font-size: 12.5px; color: var(--dim); opacity: .8; }
.rel p.also code { color: var(--dim); }
@media (max-width: 640px) {
  .log li { grid-template-columns: 1fr; gap: 10px; }
  .ver { display: flex; align-items: baseline; gap: 14px; }
}

/* ---------- §06 updates / issues ---------- */
.updates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}
.upd { padding: 18px; border: 1px solid var(--line); }
.upd-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.upd-top b { font-size: 22px; font-weight: 600; color: var(--sig); }
.upd p { margin: 10px 0 0; font-size: 12px; }
.bar {
  position: relative;
  height: 14px;
  margin-top: 12px;
  border: 1px solid var(--fg);
  background: repeating-linear-gradient(90deg, transparent 0 6px, var(--line) 6px 7px);
  overflow: hidden;
}
.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  background: repeating-linear-gradient(90deg, var(--sig) 0 6px, transparent 6px 7px);
  transition: width 1.6s cubic-bezier(.2,.7,.2,1);
}
.bar.indet i { width: 30%; animation: indet 2.2s ease-in-out infinite; }
@keyframes indet { 0% { left: -30%; } 100% { left: 100%; } }

.issues { width: 100%; border-collapse: collapse; }
.issues caption {
  text-align: left;
  padding-bottom: 12px;
  font: 850 clamp(22px, 2.4vw, 30px)/1 var(--display);
  font-stretch: 118%;
}
.issues th {
  text-align: left;
  padding: 8px 12px 8px 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--fg);
}
.issues td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.issues td:first-child { color: var(--sig); font-weight: 600; width: 56px; }
.issues td:last-child { width: 1%; white-space: nowrap; padding-right: 0; }
@media (max-width: 640px) {
  .issues thead { display: none; }
  .issues tr { display: grid; grid-template-columns: 44px 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .issues td { padding: 0; border: 0; width: auto !important; }
  .issues td:last-child { grid-column: 2; margin-top: 8px; }
}

/* ---------- §07 terminal ---------- */
.term { max-width: 960px; }
.term-out {
  height: 400px;
  overflow-y: auto;
  padding: 18px 18px 6px;
  font: 400 13px/1.65 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: #3a3934 transparent;
}
.term-out .sig { color: #ff5a1f; }
.term-out .ok { color: #a9ef6c; }
.term-out .e { color: #ff6b5e; }
.term-out .w { color: #ffc53d; }
.term-out .d { color: #77736a; }
.term-out a { color: #ebe6d9; }
.term-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 16px;
  font-size: 13px;
}
.term-line label { white-space: nowrap; }
.term-line .dim { color: #77736a; }
.term-line .sig { color: #ff5a1f; }
.term-line input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ebe6d9;
  font: 400 13px var(--mono);
  caret-color: #ff5a1f;
}
.term-hint { margin: 26px 0 0; font-size: 12px; color: var(--dim); }
.term-hint button {
  margin: 4px 4px 0 0;
  padding: 3px 9px;
  border: 1px solid var(--line);
  background: none;
  color: var(--fg);
  font: 12px var(--mono);
  cursor: pointer;
}
.term-hint button:hover { border-color: var(--sig); color: var(--sig); }
@media (max-width: 640px) {
  .term-out { height: 340px; font-size: 12px; }
  .term-line label .dim, .term-line label { font-size: 12px; }
}

/* ---------- §08 rent ---------- */
.rent-lede {
  max-width: 820px;
  margin: 0 0 40px;
  font: 700 clamp(22px, 2.6vw, 36px)/1.15 var(--display);
  font-stretch: 105%;
}
.licences {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--fg);
}
.lic {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 22px;
  border-right: 1px solid var(--fg);
  transition: background .2s, color .2s;
}
.lic:last-child { border-right: 0; }
.lic:hover { background: var(--bg-2); }
.lic-full { background: var(--sig); color: var(--sig-ink); }
.lic-full:hover { background: var(--fg); color: var(--bg); }
.lic-no { margin: 0 0 30px; font-size: 12px; letter-spacing: .14em; }
.lic h3 {
  margin: 0;
  font: 900 clamp(30px, 2.6vw, 42px)/.9 var(--display);
  font-stretch: 100%;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.lic-sub { margin: 8px 0 22px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.lic > p:not([class]) { margin: 0 0 24px; flex: 1; }
.lic-term { margin: 0 0 18px; padding-top: 12px; border-top: 1px dashed currentColor; font-size: 13px; }
.lic-term span { display: inline-block; width: 52px; font-size: 11px; letter-spacing: .14em; opacity: .65; }
.barcode {
  height: 30px;
  background: repeating-linear-gradient(90deg,
    currentColor 0 2px, transparent 2px 4px, currentColor 4px 5px, transparent 5px 8px,
    currentColor 8px 11px, transparent 11px 12px, currentColor 12px 13px, transparent 13px 17px);
  opacity: .85;
}
@media (max-width: 1100px) {
  .licences { grid-template-columns: 1fr; }
  .lic { border-right: 0; border-bottom: 1px solid var(--fg); }
  .lic:last-child { border-bottom: 0; }
}

.session { margin-top: 72px; }
.session-mail {
  display: block;
  margin-bottom: 26px;
  font: 900 clamp(26px, 6.2vw, 96px)/.95 var(--display);
  font-stretch: 112%;
  letter-spacing: -.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .2s;
}
.session-mail:hover { color: var(--sig); }
.session-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.session > p.dim { margin: 0; font-size: 13px; }

/* ---------- footer ---------- */
.foot {
  position: relative;
  padding: 40px var(--gutter) 0;
  font-size: 12px;
  overflow: hidden;
}
.foot p { margin: 0 0 6px; }
.linkish {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--sig);
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:hover { color: var(--sig); }


/* =========================================================
   FILM HERO (from v2) — always dark, whatever the page theme
   ========================================================= */
.scrub {
  --bg: #0b0b0a;
  --fg: #ebe6d9;
  --dim: #8c887d;
  --sig: #ff5a1f;
  --ok: #8ee36a;
  --no: #ff6b5e;
  --g: var(--gutter);
  --serif: "Instrument Serif", Georgia, serif;
  --disp: var(--display);
  color: var(--fg);
}
/* =========================================================
   ACT 1 — FILM
   ========================================================= */
.scrub { position: relative; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  margin-bottom: -100vh;
  margin-bottom: -100svh;
  overflow: hidden;
  background: #050505;
}
.stage-poster, .stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stage-video { opacity: 0; transition: opacity .5s; }
.stage.ready .stage-video { opacity: 1; }
.stage-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 65% at 55% 50%, transparent 45%, rgba(5,5,5,.55) 100%),
    linear-gradient(to right, rgba(5,5,5,.55), transparent 45%);
}

/* drawing frame */
.crop { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(235,230,217,.6); }
.crop.tl { top: 70px; left: var(--g); border-width: 1px 0 0 1px; }
.crop.tr { top: 70px; right: var(--g); border-width: 1px 1px 0 0; }
.crop.bl { bottom: 18px; left: var(--g); border-width: 0 0 1px 1px; }
.crop.br { bottom: 18px; right: var(--g); border-width: 0 1px 1px 0; }
.ruler {
  position: absolute;
  top: 110px;
  bottom: 60px;
  right: calc(var(--g) - 2px);
  width: 9px;
  background:
    repeating-linear-gradient(to bottom, rgba(235,230,217,.5) 0 1px, transparent 1px 50px) right / 9px 100% no-repeat,
    repeating-linear-gradient(to bottom, rgba(235,230,217,.3) 0 1px, transparent 1px 10px) right / 4px 100% no-repeat;
}
.hud {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(235, 230, 217, .6);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hud > span:first-child { color: var(--sig); }
.hud-bar { position: relative; width: 140px; height: 1px; background: rgba(235, 230, 217, .22); }
.hud-bar i { position: absolute; inset: -1px auto -1px 0; width: 0; background: var(--sig); }

/* chapters */
.ch { position: relative; z-index: 2; height: 190vh; }
.ch-hero { height: 150vh; }
.ch-root { height: 210vh; }
.ch-in {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 104px calc(var(--g) + 28px) 72px;
  display: flex;
  align-items: center;
  will-change: opacity, transform;
}
.js .ch:not(.ch-hero) .ch-in { opacity: 0; }

/* figure caption: mono tag + italic serif */
.fig-cap { margin: 0 0 18px; font-size: 10.5px; letter-spacing: .16em; color: rgba(235,230,217,.75); }
.fig-cap b { font-weight: 700; color: var(--fg); margin-right: 6px; }
.fig-cap em { font: italic 400 17px/1.2 var(--serif); letter-spacing: 0; }

/* label tape: a black strip behind each line of text, like a Dymo label on a prototype */
.tape {
  background: var(--bg);
  color: var(--fg);
  padding: .06em .34em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.tape-sig { background: var(--sig); color: var(--bg); }
.tape-head {
  margin: 0 0 22px;
  font: 800 clamp(40px, 6.4vw, 104px)/1.08 var(--disp);
  font-stretch: 62%;
  letter-spacing: -.005em;
  text-transform: uppercase;
}
.tape-text { margin: 0 0 26px; font-size: 13px; line-height: 2.05; letter-spacing: .03em; }
.tape-text .tape { padding: .3em .55em; }

/* FIG. 1 hero */
.ch-hero .ch-in { display: block; padding-top: 96px; }
.hero-title {
  margin: 0;
  font: 900 clamp(40px, 11.4vw, 240px)/.82 var(--disp);
  font-stretch: 125%;
  letter-spacing: -.035em;
  white-space: nowrap;
  text-shadow: 0 6px 60px rgba(0,0,0,.5);
}
.hero-sub {
  margin: 26px 0 0;
  font: 500 clamp(14px, 1.25vw, 17px)/2.2 var(--mono);
  letter-spacing: .06em;
}
.hero-sub .tape { padding: .35em .6em; }
.spec-strip {
  position: absolute;
  left: calc(var(--g) + 28px);
  right: calc(var(--g) + 28px);
  bottom: 62px;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  border-top: 1px solid rgba(235,230,217,.35);
}
.spec-strip div { flex: 1 1 140px; padding: 10px 16px 0 0; }
.spec-strip dt { font-size: 9.5px; letter-spacing: .2em; color: var(--dim); }
.spec-strip dd { margin: 2px 0 0; font-size: 12px; letter-spacing: .04em; }
.scroll-cue {
  position: absolute;
  right: calc(var(--g) + 28px);
  top: 112px;
  margin: 0;
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--dim);
  writing-mode: vertical-rl;
}
.scroll-cue span { display: inline-block; color: var(--sig); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* FIG. 2 callouts — numbered balloons with leader lines toward the chip */
.ch-kernel .ch-in { justify-content: space-between; gap: 24px; }
.callouts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 12px;
}
.callouts li { position: relative; display: flex; align-items: center; gap: 12px; }
.callouts li::before {
  content: "";
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  width: clamp(30px, 9vw, 170px);
  border-top: 1px solid rgba(235,230,217,.7);
}
.callouts li::after {
  content: "";
  position: absolute;
  right: calc(100% + 4px + clamp(30px, 9vw, 170px));
  top: calc(50% - 3px);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sig);
  box-shadow: 0 0 8px var(--sig);
}
.callouts b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 1.5px solid var(--fg);
  border-radius: 50%;
  background: var(--bg);
  font-size: 11px;
}
.callouts .tape { padding: .4em .6em; }
.callouts em { font-style: normal; font-weight: 700; margin-right: 8px; letter-spacing: .1em; }
.callouts u { text-decoration: none; color: var(--sig); }

/* FIG. 3 biometric readout */
.readout {
  margin: 0 0 24px;
  padding: 14px 18px;
  display: inline-block;
  background: rgba(8,8,7,.86);
  border: 1px solid rgba(235,230,217,.3);
  font: 400 12px/1.85 var(--mono);
  letter-spacing: .06em;
}
.readout span { color: var(--dim); }
.readout b { font-weight: 700; color: var(--ok); }
.readout b.no { color: var(--no); }
.readout b.sig { color: var(--sig); }
.tape-btn {
  display: table;
  padding: 13px 18px;
  background: var(--sig);
  color: var(--bg);
  font: 700 12px/1 var(--mono);
  letter-spacing: .14em;
  text-decoration: none;
  transition: background .15s;
}
.tape-btn:hover { background: var(--fg); }

@media (max-width: 1000px) {
  .ch-kernel .ch-in { flex-direction: column; align-items: flex-start; justify-content: center; }
  .callouts { gap: 10px; }
  .callouts li::before, .callouts li::after { display: none; }
}
@media (max-width: 760px) {
  .ch-in { padding: 84px var(--g) 64px; }
  .stage-shade { background: linear-gradient(to top, rgba(5,5,5,.8) 0%, rgba(5,5,5,.35) 50%, transparent 80%); }
  .ch:not(.ch-hero) .ch-in { align-items: flex-end; }
  .ch-kernel .ch-in { justify-content: flex-end; }
  .ruler, .scroll-cue, .crop { display: none; }
  .spec-strip { left: var(--g); right: var(--g); bottom: 58px; }
  .spec-strip div { flex-basis: 45%; }
  .callouts { font-size: 11px; }
  .tape-text { line-height: 2.2; }
  .tape-text br { display: none; }
  .hud-bar { width: 70px; }
}


/* everything after the film sits above the (sticky) stage, which otherwise
   lingers one viewport past the end of the scrub */
.scrub ~ .ticker,
.scrub ~ .sec { position: relative; z-index: 3; }
.scrub ~ .sec { background-color: var(--bg); }
.foot { position: relative; z-index: 3; background-color: var(--bg); }
