/* jpholecka.com — the boot-sequence site. Desktop and laptop only; phones are
   sent to /classic before this loads. Dark only. One stylesheet, no build.

   Layers, back to front:
     .film      fixed, the cyborg film (canvas scrub, then the idle loop)
     .cables    fixed SVG, the lines from the film's cable ends to the nav nodes
     main       the scrolling content, held to a rail on the left
     .nodes, .archive, .hud   fixed interface

   Boot visibility: anything with data-b="1|2|3" is hidden until <html> gains
   s1 / s2 / s3 (added in order by boot.js) or .on (boot finished or skipped).
   Without JavaScript none of that applies and everything is simply there. */

:root {
  --orange: #FF6B1A;
  --black: #121011;
  --cream: #F4EADF;
  --cream-2: rgba(244, 234, 223, .76);
  --rule: rgba(255, 107, 26, .3);
  --rule-2: rgba(255, 107, 26, .62);
  --ease: cubic-bezier(.16, 1, .3, 1);

  --font-display: "bite-stencil", "Hanken Grotesk", Impact, sans-serif;
  --font-text: "bd-terminal-vf", ui-monospace, SFMono-Regular, Menlo, monospace;

  --hair: rgba(244, 234, 223, .14);
  --r-panel: 2.5rem;
  --r-card: 1.75rem;
  --r-field: 1.1rem;

  --rail: clamp(1.5rem, 4vw, 4rem);
  --panel: min(44rem, 50vw);
  --side: 13.5rem;

  /* the six kinds of post in the archive, same hues as the tunnel's key */
  --k-post: #3987e5;
  --k-link: #199e70;
  --k-checkin: #c98500;
  --k-photo: #d95926;
  --k-album: #d55181;
  --k-note: #9085e9;

  color-scheme: dark;
}

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

html {
  background: var(--black);
  scroll-behavior: smooth;
  scrollbar-color: var(--rule-2) var(--black);
  scrollbar-width: thin;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--cream);
  font-family: var(--font-text);
  font-variation-settings: "wdth" 130;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--orange); color: var(--black); }

a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }

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

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; z-index: 30; left: var(--rail); top: .75rem;
  padding: .5rem .9rem; background: var(--orange); color: var(--black);
  text-decoration: none; transform: translateY(-300%);
}
.skip:focus { transform: none; }

html.js .no-js { display: none; }
html:not(.js) .js-only { display: none; }

/* ---------- film ---------- */

.film { position: fixed; inset: 0; z-index: 0; background: #000; overflow: hidden; }
.film-box { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.film-box > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* With JavaScript, boot.js sizes and places .film-box: always covering the
   window, slid left so the film's cable ends stop short of the nav column. */
.film.is-boxed .film-box > * { object-fit: fill; }

html.js .film-poster { display: none; }
html.js.rm .film-poster { display: block; }
html.js.rm .film-canvas, html.js.rm .film-idle { display: none; }

.film-idle { opacity: 0; transition: opacity .7s linear; }
html.idle .film-idle.is-ready { opacity: 1; }

/* Legibility. Measured on the comp, type over the warm glow fell to 2.9:1;
   this holds the left column above 4.5:1 against the brightest frame. */
.film-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(18,16,17,.9) 0%, rgba(18,16,17,.78) 20%, rgba(18,16,17,.34) 36%, rgba(18,16,17,0) 52%),
    linear-gradient(180deg, rgba(18,16,17,.72) 0%, rgba(18,16,17,0) 16%, rgba(18,16,17,0) 78%, rgba(18,16,17,.6) 100%),
    /* The cut. For most of the scrub the film's cables run on to the right edge.
       This wall is in place from the first frame and ends them where they end in
       the last one (--cut, set by boot.js), so the drawn lines always pick up
       from the same edge. Solid by the nav column (--col). */
    linear-gradient(90deg, rgba(18,16,17,0) calc(var(--cut, 78%) - 5rem), rgba(18,16,17,.8) calc(var(--cut, 78%) + 1.5rem), rgba(18,16,17,.97) var(--col, 86%));
}

.blackout { position: fixed; inset: 0; z-index: 20; background: #000; pointer-events: none; opacity: 0; }
html.short .blackout { animation: lift .5s ease-out both; }
@keyframes lift { from { opacity: 1; } to { opacity: 0; } }

/* ---------- cables ---------- */

.cables {
  position: fixed; inset: 0; z-index: 2; width: 100%; height: 100%;
  pointer-events: none; --amp: 0; --cw: 1; /* --cw: the film's scale, set by boot.js, so the lines stay as thick as its cables */
}
html:not(.js) .cables { display: none; }
/* The lines have to read as the same lit cable as the film's: a thick orange
   body, a hot pale core, and bloom in three widths (tight, mid, wide haze). */
.cables g {
  filter:
    drop-shadow(0 0 calc(3px * var(--cw, 1)) rgba(255, 170, 110, .95))
    drop-shadow(0 0 calc(10px * var(--cw, 1) + var(--amp) * 8px) rgba(255, 107, 26, .9))
    drop-shadow(0 0 calc(26px * var(--cw, 1) + var(--amp) * 14px) rgba(255, 96, 20, .6));
}
.cable {
  fill: none; stroke: url(#cable-fade); stroke-width: calc(4.6px * var(--cw, 1)); stroke-linecap: round;
  opacity: var(--k, 1); /* --k: brightness, brought up by the scroll in boot.js */
  transition: opacity .5s var(--ease);
}
.core {
  fill: none; stroke: url(#cable-core); stroke-width: calc(1.7px * var(--cw, 1)); stroke-linecap: round;
  opacity: var(--k, 1);
  transition: opacity .5s var(--ease);
}
.pulse {
  fill: none; stroke: #FFD9BF; stroke-width: 3.4; stroke-linecap: round;
  stroke-dasharray: 34 var(--len, 600); stroke-dashoffset: 34; opacity: 0;
}
.pulse.is-pinging { animation: ping .75s var(--ease) both; }
@keyframes ping {
  0% { stroke-dashoffset: 34; opacity: 0; }
  12% { opacity: 1; }
  100% { stroke-dashoffset: calc(var(--len, 600) * -1); opacity: 0; }
}
.cables.has-active .cable, .cables.has-active .core { opacity: calc(var(--k, 1) * .28); }
.cables.has-active .cable.is-active, .cables.has-active .core.is-active { opacity: var(--k, 1); }

/* ---------- top of the interface ---------- */

.hud {
  position: fixed; z-index: 6; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 1.5rem;
  height: 4rem; padding: 0 var(--rail);
  /* sections scroll underneath: a solid band, feathered at its lower edge */
  background: linear-gradient(180deg, rgba(18,16,17,.97) 0%, rgba(18,16,17,.97) 62%, rgba(18,16,17,0) 100%);
  font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
}
.home {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 2.75rem; color: var(--cream); text-decoration: none; white-space: nowrap;
}
.home::before { content: ""; width: .7rem; height: .7rem; background: var(--orange); }
.home:hover { color: var(--orange); }

.radio { display: flex; align-items: center; gap: .6rem; min-width: 0; color: var(--cream-2); }
.radio-btn {
  flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  padding: 0; border: 0; background: none; color: var(--orange); cursor: pointer;
}
.radio-btn[hidden] { display: none; }
.radio-btn svg { width: 1rem; height: 1rem; fill: currentColor; }
.radio-btn:hover { color: var(--cream); }
.radio-btn .i-pause, .radio.is-playing .i-play { display: none; }
.radio.is-playing .i-pause { display: block; }
.radio-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }
.radio-links { display: flex; gap: .9rem; }
.radio-links a { color: var(--cream-2); }
.radio-links a:hover { color: var(--orange); }
@media (max-width: 1279px) { .radio-links { display: none; } }

.hud-right { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.clock { margin: 0; color: var(--cream-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock b { font-weight: inherit; color: var(--cream); }

.swap {
  display: flex; padding: 3px; border-radius: 999px; background: rgba(244, 234, 223, .1);
}
.swap a {
  display: inline-flex; align-items: center; min-height: 2rem; padding: 0 .9rem; border-radius: 999px;
  color: var(--cream-2); text-decoration: none; transition: color .2s var(--ease), background-color .2s var(--ease);
}
.swap a:hover { color: var(--cream); background: rgba(244, 234, 223, .12); }
.swap a[aria-current] { background: var(--orange); color: var(--black); }
@media (max-width: 1179px) { .clock { display: none; } }

.strip { position: relative; display: flex; gap: 3px; margin: 0; padding: 0; list-style: none; }
.strip li { position: relative; width: 1.15rem; height: .8rem; background: var(--c); transition: transform .35s var(--ease); }
.strip span {
  position: absolute; right: 50%; top: 1.5rem; transform: translateX(50%) rotate(-52deg);
  transform-origin: 100% 50%; white-space: nowrap; font-size: .6875rem; letter-spacing: .06em;
  color: var(--cream); opacity: 0; transition: opacity .3s var(--ease);
}
html.key .strip li { transform: scaleY(1.5); }
html.key .strip span { opacity: 1; }

@media (max-width: 1400px) { :root { --side: 11.75rem; } }

/* ---------- nav nodes ---------- */

.nodes {
  position: fixed; z-index: 5; right: var(--rail); top: 13vh; height: 62vh; width: var(--side);
}
.nodes ol {
  list-style: none; margin: 0; padding: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
}
.nodes a {
  display: grid; grid-template-columns: 2.25rem 1fr; align-items: center; gap: .8rem;
  min-height: 2.75rem; color: var(--cream); text-decoration: none;
  font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; line-height: 1.25;
}
.node-dot {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border: 1.5px solid var(--rule-2); border-radius: 50%; background: rgba(18, 16, 17, .6);
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease), background-color .4s var(--ease);
}
.node-dot::after {
  content: ""; width: .42rem; height: .42rem; border-radius: 50%;
  background: var(--orange); opacity: .35; transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.node-num { color: var(--orange); margin-right: .55em; }
.nodes li.lit .node-dot { border-color: var(--orange); box-shadow: 0 0 10px rgba(255, 150, 80, .7), 0 0 30px rgba(255, 107, 26, .55), inset 0 0 10px rgba(255, 107, 26, .35); }
.nodes li.lit .node-dot::after { box-shadow: 0 0 8px rgba(255, 190, 140, .9); }
.nodes li.lit .node-dot::after { opacity: 1; }
.nodes a:hover .node-dot, .nodes a:focus-visible .node-dot { background: rgba(255, 107, 26, .22); }
.nodes a:hover .node-dot::after, .nodes a:focus-visible .node-dot::after { transform: scale(1.5); opacity: 1; }
.nodes a[aria-current] .node-dot { background: var(--orange); }
.nodes a[aria-current] .node-dot::after { background: var(--black); opacity: 1; }
.nodes a[aria-current] .node-name { color: var(--orange); }
html:not(.js) .node-dot { border-color: var(--orange); }
html:not(.js) .node-dot::after { opacity: 1; }
.nodes li { transition: transform .8s var(--ease); }
.nodes li.no-move { transition: none; }

/* ---------- recovered archive ---------- */

.archive {
  position: fixed; z-index: 5; right: var(--rail); bottom: 1.5rem; width: var(--side);
  border-radius: var(--r-card); overflow: hidden;
  transition: opacity .4s var(--ease), background-color .3s var(--ease);
}
.archive:hover, .archive:focus-within { background-color: rgba(52, 44, 42, .5); }
html.at-archive .archive { opacity: 0; pointer-events: none; }
.archive canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .7; }
.archive-in { position: relative; padding: 1rem 1.15rem 1.05rem; }
.archive h2 {
  margin: 0; font: inherit; font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--orange);
}
.archive-count {
  margin: .15rem 0 0; font-family: var(--font-display); font-variation-settings: normal;
  font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--cream);
}
.archive-meta { margin: .2rem 0 .6rem; font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-2); }
.archive .door, .archive .entry { font-size: .75rem; }

/* ---------- the wake: pinned first screen ---------- */

main { position: relative; z-index: 3; }

.wake { height: 330vh; margin-bottom: 24vh; }
html.rm .wake, html:not(.js) .wake { height: 100vh; }
.wake-pin { position: sticky; top: 0; height: 100vh; height: 100svh; }

.ident {
  /* Sits below the helmet's stencilled 09, which the name would otherwise run across. */
  position: absolute; left: var(--rail); top: 61%; transform: translateY(-50%);
  width: min(22rem, 24vw);
}
.ident h1 {
  margin: 0; font-family: var(--font-display); font-variation-settings: normal; font-weight: 400;
  font-size: clamp(2.25rem, 3.5vw, 4rem); line-height: .9; letter-spacing: 0;
  text-transform: uppercase; color: var(--cream);
}
.ident h1 span { display: block; }
.ident-meta {
  margin: 1rem 0 0; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase;
  line-height: 1.5; color: var(--cream);
}
.ident-meta::after { content: ""; display: block; width: 4.5rem; height: 3px; margin-top: 1rem; background: var(--orange); }
.claim { margin: 1.4rem 0 0; font-size: 1.0625rem; line-height: 1.5; color: var(--cream); text-wrap: pretty; }
.fact { margin: .9rem 0 0; font-size: .875rem; line-height: 1.55; color: var(--cream-2); text-wrap: pretty; }
.w { opacity: 0; transition: opacity .25s linear; }
.w.in { opacity: 1; }

.log {
  position: absolute; left: var(--rail); bottom: 1.75rem; margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: auto auto; column-gap: 1.25rem; row-gap: .1rem;
  font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5;
}
.log li { display: contents; }
.log .k { color: var(--orange); }
.log .v { color: var(--cream); font-variant-numeric: tabular-nums; }
html.js:not(.on) .log li:not(.in) > * { visibility: hidden; }

.cue {
  position: absolute; left: 50%; bottom: 1.75rem; transform: translateX(-50%); margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cream);
  transition: opacity .4s var(--ease);
}
.cue::after { content: ""; width: 1px; height: 2rem; background: var(--orange); transform-origin: top; animation: drip 2s var(--ease) infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
html.js.moved .cue[data-b], html.js.rm .cue[data-b], html:not(.js) .cue { opacity: 0; }
html.js.moved:not(.rm) .log[data-b] { opacity: 0; transition: opacity .4s var(--ease); }

.cursor {
  position: fixed; z-index: 7; left: var(--rail); top: 44%; width: .6rem; height: 1.1rem;
  background: var(--orange); display: none;
}
html.js:not(.s1):not(.on) .cursor { display: block; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- boot visibility ---------- */

html.js [data-b] { opacity: 0; visibility: hidden; }
html.js.s1 [data-b="1"], html.js.s2 [data-b="2"], html.js.s3 [data-b="3"], html.js.on [data-b] {
  opacity: 1; visibility: visible;
}
/* Power-on flicker: small elements only, two dips in .9s, never to black.
   Nothing here flashes more than three times a second (WCAG 2.3.1). */
html.js.s2:not(.on) [data-b="2"], html.js.s3:not(.on) [data-b="3"] { animation: flick .9s linear both; }
html.js.s2:not(.on) .nodes { animation-delay: .12s; }
html.js.s2:not(.on) .archive { animation-delay: .24s; }
@keyframes flick {
  0% { opacity: 0; } 8% { opacity: .8; } 22% { opacity: .4; } 46% { opacity: .95; } 62% { opacity: .6; } 100% { opacity: 1; }
}

/* ---------- section feeds ---------- */

.feed, .recovered, .end {
  position: relative; margin-left: var(--rail); width: var(--panel);
}
.feed, .recovered {
  margin-bottom: 20vh; border-radius: var(--r-panel); overflow: hidden;
  scroll-margin-top: 5.5rem;
}
.feed-head { position: relative; overflow: hidden; padding: 3.25rem 2.5rem 1.25rem; }
.feed-loop {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; mix-blend-mode: screen; filter: grayscale(1); transition: opacity .8s linear;
}
.feed.is-live .feed-loop { opacity: .24; }
.feed h2, .recovered h2 {
  position: relative; margin: 0; font-family: var(--font-display); font-variation-settings: normal; font-weight: 400;
  font-size: clamp(2rem, 3.3vw, 3.25rem); line-height: .95; text-transform: uppercase; color: var(--orange);
  text-wrap: balance;
}
.feed-body { padding: 1.25rem 2.5rem 2.75rem; }
.feed-body > :first-child { margin-top: 0; }

.prose p { margin: 0 0 1.1em; max-width: 62ch; color: var(--cream-2); text-wrap: pretty; }
.prose .lede { font-size: 1.125rem; line-height: 1.55; color: var(--cream); }
.prose p:last-child { margin-bottom: 0; }
.lead-in { margin: 0 0 1.25rem; max-width: 58ch; font-size: 1.0625rem; color: var(--cream); text-wrap: pretty; }

.ruled { list-style: none; margin: 0; padding: 0; }
.ruled > li { border-top: 1px solid var(--hair); }
.ruled > li:last-child { border-bottom: 1px solid var(--hair); }

.door, .entry {
  display: block; width: 100%; padding: .85rem 0; text-align: left; text-decoration: none;
  font: inherit; font-variation-settings: inherit; color: var(--cream); background: none; border: 0; margin: 0;
}
.door { cursor: pointer; }
.door .title, .entry .title { display: block; transition: color .2s var(--ease), transform .35s var(--ease); }
.door .meta, .entry .meta {
  display: block; margin-top: .15rem; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-2);
}
.door:hover .title, .door:focus-visible .title { color: var(--orange); transform: translateX(.35rem); }

.row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 3rem; padding: .7rem 0; text-decoration: none; color: var(--cream);
  transition: color .2s var(--ease), padding .35s var(--ease);
}
.row:hover, .row:focus-visible { color: var(--orange); padding-left: .35rem; }

.topics { counter-reset: none; }
.topics li { display: grid; grid-template-columns: 2.5rem 1fr; align-items: baseline; padding: .8rem 0; }
.topics .idx { color: var(--orange); font-size: .8125rem; letter-spacing: .06em; }
.topics h3 { margin: 0; font: inherit; font-variation-settings: inherit; font-size: 1.0625rem; line-height: 1.4; color: var(--cream); text-wrap: balance; }

.block { margin-top: 2.25rem; }
.block p:not(.label) { margin: 0 0 1rem; max-width: 62ch; color: var(--cream-2); text-wrap: pretty; }
.label {
  display: block; margin: 0 0 .5rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--orange);
}

.copy {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.1rem;
  font: inherit; font-variation-settings: inherit; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cream); background: rgba(244, 234, 223, .1); border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.copy:hover { background: rgba(244, 234, 223, .2); }
.copy-strong { background: var(--orange); color: var(--black); }
.copy-strong:hover { background: var(--cream); color: var(--black); }
.copy:active { transform: translateY(1px); }
.copy:disabled, .is-sending .copy { opacity: .55; cursor: progress; }

/* form */
.form { display: grid; gap: 1.1rem; max-width: 34rem; }
.field { display: grid; }
.form input, .form select, .form textarea {
  width: 100%; min-height: 2.9rem; padding: .65rem .8rem;
  font: inherit; font-variation-settings: inherit; color: var(--cream);
  background: rgba(244, 234, 223, .09); border: 0; border-radius: var(--r-field);
  caret-color: var(--orange); transition: background-color .2s var(--ease);
}
.form textarea { resize: vertical; line-height: 1.5; }
.form input:hover, .form select:hover, .form textarea:hover { background-color: rgba(244, 234, 223, .14); }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline-offset: 2px; border-radius: var(--r-field); background-color: rgba(244, 234, 223, .14); }
.form :user-invalid { box-shadow: inset 0 0 0 2px #FF9F8A; }
.select { position: relative; }
.select select { appearance: none; padding-right: 2.4rem; }
.select option { background: var(--black); color: var(--cream); }
.select-caret { position: absolute; right: .9rem; top: 50%; width: .7rem; height: .45rem; transform: translateY(-50%); color: var(--orange); pointer-events: none; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .copy { justify-self: start; }
.form-status { margin: 0; min-height: 1.5em; font-size: .875rem; color: var(--cream); }

/* the archive, full size, after 07 */
.recovered { padding: 3.25rem 2.5rem 2.75rem; }
.recovered canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.recovered > :not(canvas) { position: relative; }
.recovered-count {
  margin: 1.25rem 0 0; font-family: var(--font-display); font-variation-settings: normal;
  font-size: clamp(4rem, 8.5vw, 6rem); line-height: .9; font-variant-numeric: tabular-nums; color: var(--cream);
}
.recovered-meta { margin: .4rem 0 1.5rem; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cream-2); }
.recovered .lead-in { max-width: 52ch; }
.recovered .door { display: inline-flex; width: auto; align-items: center; min-height: 3.25rem; padding: 0 1.4rem; background: var(--orange); color: var(--black); border-radius: 999px; font-size: .9375rem; letter-spacing: .06em; text-transform: uppercase; transition: background-color .2s var(--ease); }
.recovered .door:hover, .recovered .door:focus-visible { background: var(--cream); }
.recovered .door .title { transform: none; color: inherit; }
.recovered .door .meta { display: none; }
.recovered-note { margin: .9rem 0 0; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-2); }

.end { padding: 0 0 22vh; display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; font-size: .875rem; }
.end a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--cream); }
.end a:hover { color: var(--orange); }

/* ---------- frosted glass ----------
   The panels and the archive card: no outline, a large radius, and the film
   blurred through them. The tint is dark enough that body text holds 4.5:1
   even with the cable glow behind. Without backdrop-filter they go near-solid. */
.feed, .recovered, .archive {
  background-color: rgba(26, 23, 23, .93);
  box-shadow: 0 2rem 4rem -1.5rem rgba(0, 0, 0, .65), inset 0 1px 0 rgba(244, 234, 223, .12), inset 0 0 0 1px rgba(244, 234, 223, .04);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .feed, .recovered, .archive {
    background-color: rgba(30, 26, 26, .41);
    -webkit-backdrop-filter: blur(28px) saturate(1.35);
    backdrop-filter: blur(28px) saturate(1.35);
  }
}

/* ---------- build ----------
   A panel assembles as it comes up into the page: the glass rises, sharpens
   and settles, then its heading and each row follow in order. boot.js adds
   .is-built once, on first sight, and numbers the rows (--i). */
html.js .build {
  opacity: 0; transform: translateY(4.5rem) scale(.94); filter: blur(14px);
  transform-origin: 30% 0;
  /* A jump to an unbuilt panel is measured while it still sits 4.5rem low;
     the extra margin makes it land where the built panel will be. */
  scroll-margin-top: 10rem;
  transition: opacity .6s var(--ease), transform 1s var(--ease), filter .7s var(--ease);
}
html.js .build.is-built { opacity: 1; transform: none; filter: none; scroll-margin-top: 5.5rem; }
html.js .build .bi {
  opacity: 0; transform: translateY(1.4rem);
  transition: opacity .55s var(--ease), transform .8s var(--ease);
  transition-delay: calc(.22s + var(--i, 0) * 60ms);
}
html.js .build.is-built .bi { opacity: 1; transform: none; }
html.js .build h2.bi { transform: translateY(1.4rem) scale(.96); transform-origin: 0 100%; }
html.js .build.is-built h2.bi { transform: none; }
html.js.rm .build, html.js.rm .build .bi { opacity: 1; transform: none; filter: none; }

/* the archive card comes up from the corner when the interface powers on */
html.js.s2:not(.on) .archive { animation: flick .9s linear .24s both, card-up 1s var(--ease) .24s both; }
html.js.short .archive, html.js.short .nodes { animation: card-up .9s var(--ease) .15s both; }
@keyframes card-up { from { transform: translateY(2.5rem) scale(.9); } to { transform: none; } }

/* ---------- glitch hover ----------
   The filled buttons and the archive door. On hover or focus the button jolts,
   a tear line jumps across it, and two sliced ghosts of the label slip sideways
   while boot.js rescrambles the letters. Under half a second, then it settles
   into its ordinary hover colour. boot.js adds .glitch / .gl and data-text. */
/* these buttons turn cream on hover, so the ghosts are orange and black */
.glitch { position: relative; overflow: hidden; --g1: var(--orange); --g2: #000; }
.archive .glitch { overflow: visible; --g1: var(--orange); --g2: var(--cream); }
.gl { position: relative; display: inline-block; }
.gl::before, .gl::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  white-space: nowrap; opacity: 0; pointer-events: none;
}
.gl::before { color: var(--g1); }
.gl::after { color: var(--g2); }
.glitch::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--g1); opacity: 0; pointer-events: none;
}
.glitch:hover, .glitch:focus-visible { animation: gl-jolt .45s steps(1) both; }
.glitch:hover::after, .glitch:focus-visible::after { animation: gl-tear .45s steps(1) both; }
.glitch:hover .gl::before, .glitch:focus-visible .gl::before { animation: gl-a .45s steps(1) both; }
.glitch:hover .gl::after, .glitch:focus-visible .gl::after { animation: gl-b .45s steps(1) both; }
.archive .glitch::after { display: none; }
@keyframes gl-jolt {
  0% { transform: translate(-4px, 1px) skewX(-9deg); }
  14% { transform: translate(4px, -1px) skewX(6deg); }
  28% { transform: translate(-2px, 0) skewX(0deg); }
  46% { transform: translate(3px, 1px) skewX(-4deg); }
  62% { transform: translate(-1px, -1px) skewX(2deg); }
  78%, 100% { transform: none; }
}
@keyframes gl-tear {
  0% { opacity: .9; top: 22%; } 18% { opacity: 0; } 34% { opacity: .9; top: 68%; height: 5px; }
  50% { opacity: 0; } 62% { opacity: .8; top: 41%; height: 2px; } 76%, 100% { opacity: 0; }
}
@keyframes gl-a {
  0% { opacity: .95; transform: translateX(-6px); clip-path: inset(0 0 58% 0); }
  18% { opacity: .95; transform: translateX(7px); clip-path: inset(52% 0 14% 0); }
  36% { opacity: .95; transform: translateX(-4px); clip-path: inset(26% 0 44% 0); }
  54% { opacity: .95; transform: translateX(5px); clip-path: inset(72% 0 0 0); }
  70% { opacity: .95; transform: translateX(-2px); clip-path: inset(8% 0 74% 0); }
  84%, 100% { opacity: 0; }
}
@keyframes gl-b {
  0% { opacity: .8; transform: translateX(5px); clip-path: inset(60% 0 8% 0); }
  18% { opacity: .8; transform: translateX(-6px); clip-path: inset(6% 0 66% 0); }
  36% { opacity: .8; transform: translateX(4px); clip-path: inset(44% 0 30% 0); }
  54% { opacity: .8; transform: translateX(-5px); clip-path: inset(18% 0 60% 0); }
  70% { opacity: .8; transform: translateX(3px); clip-path: inset(78% 0 0 0); }
  84%, 100% { opacity: 0; }
}

/* ---------- phone layout (html.m) ----------
   Set by the head script on anything under 1024px wide or taller than wide.
   The portrait film fits the width and hangs from the top; its seven cables
   run straight down the right edge and the drawn lines carry them on to the
   bottom of the screen. Cards are full width and each is plugged onto its own
   cable. The nav is a dock along the bottom, in thumb reach. */
html.m { --rail: 1rem; --panel: auto; --r-panel: 1.75rem; }
html.m body { font-size: 1rem; }

html.m .film { background: #0c0e0f; }
/* a tall phone is longer than the film: fade its foot out; the drawn cables cover the join */
html.m .film.is-short .film-box {
  -webkit-mask-image: linear-gradient(180deg, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 86%, transparent 100%);
}
html.m .film-scrim {
  background: linear-gradient(180deg, rgba(18,16,17,.8) 0, rgba(18,16,17,0) 11%);
}
/* dark ground for the name, lower left only: it must not reach the cables on the right */
html.m .film-scrim::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18,16,17,.92) 0, rgba(18,16,17,.86) 46%, rgba(18,16,17,0) 74%);
  -webkit-mask-image: linear-gradient(180deg, transparent 36%, #000 60%);
  mask-image: linear-gradient(180deg, transparent 36%, #000 60%);
}

/* one layer of bloom, not three: stacked glow filters are costly on a phone */
html.m .cables g { filter: drop-shadow(0 0 5px rgba(255, 120, 40, .9)); }
html.m .cables.has-active .cable, html.m .cables.has-active .core { opacity: var(--k, 1); }
html.m.idle:not(.rm) .cables g { animation: breathe 4.5s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .78; } }

html.m .hud { height: 3.5rem; gap: .5rem; padding: 0 var(--rail); }
html.m .radio-title, html.m .radio-links, html.m .clock, html.m .strip, html.m .log, html.m .archive { display: none; }
html.m .swap a { min-height: 2.25rem; padding: 0 .8rem; }

/* the dock */
html.m .nodes {
  top: auto; left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  width: auto; height: auto; padding: .25rem; border-radius: 999px;
  background-color: rgba(24, 21, 21, .96); /* solid: the drawn cables run behind it */
  box-shadow: 0 1rem 2rem -1rem rgba(0, 0, 0, .7), inset 0 1px 0 rgba(244, 234, 223, .12);
  transform: translateY(calc(100% + 2rem)); transition: transform .7s var(--ease);
}
html.m.docked .nodes, html.m.rm .nodes { transform: none; }
html.m.short .nodes { animation: none; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  /* Darker than the desktop glass: the lit cables sit right behind the cards'
     right-hand side here, and text has to hold its contrast over them. */
  html.m .feed, html.m .recovered { -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); background-color: rgba(22, 19, 19, .8); }
}
html.m .nodes ol { flex-direction: row; justify-content: space-between; }
html.m .nodes a {
  display: grid; place-items: center; grid-template-columns: none; gap: 0;
  width: 2.75rem; height: 2.75rem; min-height: 0; border-radius: 50%;
  font-size: .875rem; letter-spacing: .04em; transition: background-color .25s var(--ease);
}
html.m .node-dot, html.m .node-name { display: none; }
html.m .node-num { margin: 0; color: var(--cream); }
html.m .nodes a[aria-current] { background: var(--orange); }
html.m .nodes a[aria-current] .node-num { color: var(--black); }

/* first screen */
html.m .wake { height: 250vh; margin-bottom: 12vh; }
html.m.rm .wake { height: 100vh; }
html.m .ident {
  left: var(--rail); right: auto; top: auto; bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  transform: none; width: min(66vw, 21rem);
}
html.m .ident h1 { font-size: min(10.4vw, 3.5rem); }
html.m .ident-meta { margin-top: .75rem; font-size: .75rem; }
html.m .ident-meta::after { margin-top: .75rem; width: 3.5rem; }
html.m .claim { margin-top: 1rem; font-size: .9375rem; line-height: 1.45; }
html.m .fact { margin-top: .6rem; font-size: .8125rem; line-height: 1.5; }
html.m .cue { left: var(--rail); bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); transform: none; flex-direction: row; align-items: center; gap: .75rem; }
html.m .cue::after { width: 2rem; height: 1px; transform-origin: left; animation-name: drip-x; }
@keyframes drip-x { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
html.m .cursor { top: auto; bottom: 45%; }

/* cards */
html.m .feed, html.m .recovered { margin: 0 .75rem 5.5rem; width: auto; scroll-margin-top: 5rem; }
html.m .feed { overflow: visible; }
html.m .feed-head { padding: 2.5rem 1.25rem .75rem; border-radius: var(--r-panel) var(--r-panel) 0 0; }
html.m .feed-body { padding: 1rem 1.25rem 2rem; }
html.m .feed h2, html.m .recovered h2 { font-size: 2rem; }
html.m .recovered { padding: 2.5rem 1.25rem 2rem; }
html.m .recovered-count { font-size: 4rem; }
html.m .prose .lede { font-size: 1.0625rem; }
html.m .topics li { grid-template-columns: 2.25rem 1fr; }
html.m .end { margin: 0 1.25rem; width: auto; max-width: 62vw; /* clear of the cables */ padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px)); }
/* no blur-to-sharp on the build: the rise and the row stagger carry it */
html.m.js .build { filter: none; transform: translateY(3rem) scale(.97); scroll-margin-top: 8rem; }
html.m.js .build.is-built { transform: none; scroll-margin-top: 5rem; }

/* the plug: each card rides its own cable, like a bead on a wire */
.plug {
  position: absolute; top: -1rem; width: 2rem; height: 2rem; margin-left: -1rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--black); border: 1.5px solid var(--orange);
  box-shadow: 0 0 10px rgba(255, 150, 80, .6), 0 0 22px rgba(255, 107, 26, .45);
  transition: background-color .3s var(--ease);
}
.plug::after { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--orange); transition: background-color .3s var(--ease); }
.plug.is-live { background: var(--orange); }
.plug.is-live::after { background: var(--black); }

@media (max-height: 700px) { html.m .fact { display: none; } }

/* ---------- no JavaScript, narrow window ----------
   With JavaScript a narrow screen gets the phone layout above (or is sent to
   /classic). Without it, this keeps the page readable: film as a backdrop,
   the fixed interface back in the flow. */
@media (max-width: 1023px) {
  html:not(.js) { --panel: calc(100vw - 2 * var(--rail)); }
  html:not(.js) .archive { display: none; }
  html:not(.js) .film-scrim { background: rgba(18, 16, 17, .72); }
  html:not(.js) .wake { height: auto; }
  html:not(.js) .wake-pin { position: static; height: auto; padding: 6rem var(--rail) 2rem; }
  html:not(.js) .ident { position: static; transform: none; width: auto; max-width: 30rem; }
  html:not(.js) .log { position: static; margin-top: 2rem; }
  html:not(.js) .nodes { position: static; width: auto; height: auto; margin: 0 var(--rail) 3rem; }
  html:not(.js) .nodes ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .25rem 1rem; }
  html:not(.js) .feed, html:not(.js) .recovered { margin-bottom: 3rem; }
}

@media (max-height: 819px) and (min-width: 1024px) {
  .log { display: none; } /* the name block now sits low and would meet it */
}

@media (max-height: 779px) and (min-width: 1024px) {
  .nodes { top: 12vh; height: 56vh; }
}

@media (max-height: 699px) and (min-width: 1024px) {
  .archive-meta { display: none; }
  .archive-count { font-size: 1.5rem; margin-bottom: .4rem; }
  .log { display: none; }
}

/* ---------- reduced motion: the end state, still ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .cue { display: none; }
}

@media print {
  .film, .cables, .hud, .nodes, .archive, .cue, .cursor, .blackout { display: none !important; }
  body { background: #fff; color: #000; }
  .wake { height: auto; } .wake-pin { position: static; height: auto; } .ident { position: static; transform: none; }
}
