/* linuxlab.html. Palette and type follow Linuxlab's own "Glacier" system, pushed further on the stages. */
:root {
  --paper: #f1f5f9;
  --surface: #ffffff;
  --line: #bec8d2;
  --ink: #0b1c30;
  --muted: #3e4850;
  --subtle: #5d6872;
  --accent: #006591;
  --accent-deep: #004c6e;
  --ice: #bfefff;
  --cyan: #5fd8f5;
  --well: #0b1c30;
  --well-fg: #eaf1ff;
  --well-dim: #8ea6c4;
  --well-line: #1f3652;
  --mint: #79e6bd;
  --coral: #ff9c94;
  --amber: #f2c572;
  --dive: 0;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.72 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
code { font: 500 .9em var(--mono); }
h1, h2, h3 { font-family: var(--serif); text-wrap: balance; }
main:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.stage :focus-visible,
.term :focus-visible,
.chapter-broken :focus-visible,
.anatomy :focus-visible,
.foot :focus-visible { outline-color: var(--cyan); }

.skip-link {
  position: fixed;
  z-index: 30;
  left: 12px;
  top: -60px;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--ink);
  font: 500 1rem var(--sans);
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

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

.js-only { display: none; }
.js .js-only { display: revert; }
.js .term.js-only { display: flex; }

/* The stages: a canvas with copy on it. The hero stays pinned while the camera falls into the belly.
   lvh keeps the canvas still when a phone's toolbar slides away; --bar lifts the copy clear of it. */
.hero {
  position: relative;
  height: 300vh;
  background: var(--paper);
}
.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background: #06152a;
  color: #f4fbff;
  --bar: 0px;
}
@supports (height: 100lvh) {
  .hero { height: 300lvh; }
  .stage { height: 100lvh; --bar: calc(100lvh - 100svh); }
}
.hero-stage { position: sticky; top: 0; }

.no-gl .stage,
html:not(.js) .stage {
  background: #06152a url("../media/linuxlab/hero-poster.webp") center / cover no-repeat;
}
.no-gl .hero,
html:not(.js) .hero { height: auto; }
.no-gl .hero-canvas { display: none; }
.no-gl .hero-cue,
html:not(.js) .hero-cue { display: none; }
html:not(.js) .reader { display: block; }

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-nav {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 14px clamp(20px, 3.4vw, 56px);
  font: 500 .95rem var(--sans);
  opacity: calc(1 - var(--dive) * 8);
}
.hero-nav a {
  color: inherit;
  text-decoration: none;
  padding: 10px 2px;
  text-shadow: 0 0 12px rgba(6, 21, 40, .9);
}
.hero-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero-copy {
  position: absolute;
  z-index: 2;
  left: clamp(20px, 3.4vw, 56px);
  bottom: calc(clamp(30px, 7vh, 80px) + var(--bar));
  width: min(54vw, 60rem);
  opacity: calc(1 - var(--dive) * 5.5);
  transform: translateY(calc(var(--dive) * -22vh));
}
.diving .hero-copy { pointer-events: none; }
.diving .hero-actions,
.diving .hero-nav,
.diving .hero-cue { visibility: hidden; }

.hero-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(14px, 2.4vh, 24px);
  font: 600 1.1rem var(--sans);
}
.hero-name img { border-radius: 7px; }
.hero h1,
.finale-copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, min(7.5vw, 14.2vh), 8.6rem);
  font-weight: 340;
  line-height: .98;
  letter-spacing: -.028em;
  text-shadow: 0 0 34px rgba(6, 21, 40, .85), 0 0 8px rgba(6, 21, 40, .5);
}
.hero-lede {
  max-width: 34rem;
  margin: clamp(16px, 2.8vh, 28px) 0 0;
  font: 400 clamp(1.05rem, 1.35vw, 1.3rem)/1.5 var(--sans);
  color: #dcecf8;
  text-shadow: 0 0 18px rgba(6, 21, 40, .95);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(18px, 3vh, 30px);
}
.hero-cue {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(14px + var(--bar));
  margin: 0;
  transform: translateX(-50%);
  font: 500 .9rem var(--sans);
  color: #d4e9f8;
  white-space: nowrap;
  opacity: calc(.86 - var(--dive) * 12);
  text-shadow: 0 0 10px rgba(6, 21, 40, 1), 0 0 22px rgba(6, 21, 40, 1), 0 1px 2px rgba(6, 21, 40, 1);
  animation: cue-in 1s ease 3.2s backwards;
}
@keyframes cue-in { from { opacity: 0; } }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 500 1rem var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s, color .16s, border-color .16s;
}
.btn[hidden] { display: none; }
.btn-ice { background: #f4fbff; color: var(--ink); }
.btn-ice:hover { background: var(--ice); }
.btn-line { border-color: rgba(220, 240, 255, .55); color: #f4fbff; background: rgba(6, 21, 40, .35); }
.btn-line:hover { background: rgba(220, 240, 255, .16); border-color: #f4fbff; }
.btn-ink { background: #f4fbff; color: var(--ink); }
.btn-ink:hover { background: var(--ice); }
.btn-ink:disabled { background: var(--well-line); color: var(--well-dim); cursor: default; }
.btn-text {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--cyan);
  font: 500 1rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.btn-text:hover { color: #fff; }
.link {
  display: inline-block;
  padding-block: 8px;
  color: var(--accent);
  font: 500 1.02rem/1.4 var(--sans);
  text-underline-offset: 4px;
}
.link:hover { color: var(--accent-deep); }

/* Reader: book on the left, terminal on the right, as on Linuxlab itself. */
.reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 45vw;
  align-items: start;
}
.book {
  min-width: 0;
  padding: 0 clamp(28px, 5vw, 96px);
}
.chapter {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(80px, 15vh, 170px) 0;
}
.chapter h2 {
  margin: 0 0 .62em;
  font-size: clamp(2.5rem, 4.6vw, 4.7rem);
  font-weight: 340;
  line-height: 1.02;
  letter-spacing: -.026em;
}
.chapter h3 {
  margin: 2.1em 0 .55em;
  font: 600 1.05rem/1.4 var(--sans);
}
.chapter p { margin: 0 0 1.05em; }
.chapter .note {
  margin-top: 1.8em;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  font: 400 1rem/1.62 var(--sans);
  color: var(--muted);
}
.note-narrow { display: none; }

.pull {
  margin: 0 0 1.5em;
  padding: 0;
}
.chapter .pull p {
  margin: 0;
  font-size: clamp(1.6rem, 2.7vw, 2.7rem);
  font-style: italic;
  font-weight: 340;
  line-height: 1.32;
  letter-spacing: -.008em;
  color: var(--accent-deep);
}

/* The command you can take apart */
.anatomy {
  margin-top: 1.7em;
  padding: clamp(20px, 2.4vw, 32px);
  background: var(--well);
  color: var(--well-fg);
  border-radius: 12px;
}
.chapter .anatomy-cmd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .1em .46em;
  margin: 0 0 16px;
  font: 500 clamp(1.15rem, 1.9vw, 1.62rem)/1.4 var(--mono);
}
.anatomy-prompt { color: var(--well-dim); }
.tok {
  padding: .05em .16em;
  background: none;
  border: 0;
  border-bottom: 2px dotted rgba(95, 216, 245, .55);
  border-radius: 3px 3px 0 0;
  color: inherit;
  font: inherit;
  cursor: help;
  touch-action: manipulation;
  transition: background-color .14s, color .14s;
}
.tok:hover, .tok:focus-visible, .tok.on {
  background: var(--cyan);
  color: var(--well);
  border-bottom-color: var(--cyan);
}
.chapter .anatomy-note {
  min-height: 7.4em;
  margin: 0 0 8px;
  font: 400 1rem/1.58 var(--sans);
  color: #d6e4f6;
}
.anatomy-note strong { color: #fff; font-weight: 600; }

/* The shelf */
.shelf { display: grid; gap: clamp(36px, 6vh, 60px); }
.volume {
  display: grid;
  grid-template-columns: clamp(130px, 13vw, 190px) minmax(0, 1fr);
  gap: clamp(20px, 2.4vw, 36px);
  align-items: start;
}
.volume-cover img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 38px -22px rgba(0, 76, 110, .55);
}
.tilt {
  display: block;
  position: relative;
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}
.tilt.on { transition: transform .08s linear; }
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  opacity: 0;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .34), transparent 58%);
  transition: opacity .3s;
  pointer-events: none;
}
.tilt.on::after { opacity: 1; }
.volume h3 {
  margin: 0 0 .3em;
  font: 400 clamp(1.6rem, 2.2vw, 2.1rem)/1.15 var(--serif);
  letter-spacing: -.012em;
}
.volume h3 a { color: inherit; text-decoration: none; }
.volume h3 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.volume p { font-size: 1.04rem; line-height: 1.64; }
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin: 0;
  font-family: var(--sans);
}
.facts div { display: flex; flex-direction: column-reverse; }
.facts dt { font-size: .875rem; color: var(--subtle); }
.facts dd { margin: 0; font: 400 1.65rem/1.15 var(--serif); }

/* A table of contents that answers in the terminal */
.toc {
  margin: 1.1em 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
}
.toc li { border-top: 1px solid var(--line); }
.toc li:last-child { border-bottom: 1px solid var(--line); }
.toc button {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 9px 6px;
  background: none;
  border: 0;
  color: inherit;
  font: 500 .98rem/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s, color .15s;
}
.toc button span { flex: none; color: var(--subtle); font-weight: 400; }
.toc button:hover { background: #e2ebf4; color: var(--accent-deep); }
.toc button:active { background: #d6e3ef; }

/* The plate */
.plate { margin: 2em -2.4% 0; }
.plate a { display: block; border-radius: 4px; }
.plate img { width: 100%; }

.well {
  margin: 1.5em 0;
  padding: 20px 24px;
  overflow-x: auto;
  background: var(--well);
  color: var(--well-fg);
  border-radius: 8px;
}
.well code { font: 400 .95rem/1.7 var(--mono); }
.well-c { color: var(--cyan); }

/* The broken machine: the whole screen goes dark with the terminal. */
.chapter-broken {
  max-width: none;
  margin: 0 calc(clamp(28px, 5vw, 96px) * -1);
  padding-left: clamp(28px, 5vw, 96px);
  padding-right: clamp(28px, 5vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 42rem);
  justify-content: center;
  background: var(--well);
  color: var(--well-fg);
}
.chapter-broken ::selection { background: var(--cyan); color: var(--well); }
.chapter-broken .link { color: var(--cyan); }
.chapter-broken .link:hover { color: #fff; }

/* The mystery, at a glance: two honest commands, two numbers that disagree. */
.verdict {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.4vw, 36px);
  margin: 2.2em 0 14px;
}
.chapter .verdict p { margin: 0; }
.chapter .verdict .verdict-cmd { font: 500 .875rem/1.5 var(--mono); color: var(--cyan); }
.chapter .verdict .verdict-num {
  font: 300 clamp(3.1rem, 6.6vw, 6.8rem)/1.02 var(--serif);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  transition: color .6s;
}
.chapter .verdict .hot { color: var(--coral); }
.chapter .verdict .good { color: var(--mint); }
.chapter .verdict .verdict-say { font: 400 .94rem/1.35 var(--sans); color: var(--well-dim); }
.disk {
  height: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #1a324e;
  border-radius: 5px;
}
.disk span {
  display: block;
  height: 100%;
  width: 94%;
  background: var(--coral);
  border-radius: 5px;
  transition: width 1.1s cubic-bezier(.2, .9, .2, 1), background-color .6s;
}
.disk.good span { background: var(--mint); }
.chapter .broken-lede {
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
  line-height: 1.3;
  color: var(--cyan);
  font-style: italic;
  font-weight: 340;
}
.chapter .broken-go { font: 500 1.02rem/1.55 var(--sans); }
.criteria {
  list-style: none;
  margin: 0;
  padding: 0;
  font: 500 1.04rem/1.4 var(--sans);
}
.criteria li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--well-line);
  transition: color .2s;
}
.criteria li:last-child { border-bottom: 1px solid var(--well-line); }
.tick {
  flex: none;
  position: relative;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--well-dim);
  border-radius: 50%;
  background: transparent;
  transition: background-color .25s, border-color .25s;
}
.criteria li.met { color: var(--mint); }
.criteria li.met .tick { background: var(--mint); border-color: var(--mint); }
.criteria li.met .tick::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid var(--well);
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.repaired {
  margin-top: 22px;
  padding: 20px 24px;
  background: #0f2c3a;
  border: 1px solid #2c6d68;
  color: var(--well-fg);
  border-radius: 12px;
  animation: rise .5s cubic-bezier(.2, .9, .2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.chapter .repaired h3 { margin: 0 0 .25em; font: 400 1.75rem/1.2 var(--serif); color: var(--mint); }
.chapter .repaired p { margin: 0; font: 400 1.02rem/1.55 var(--sans); }
.chapter .hint-note { margin-bottom: .8em; font: 400 .98rem/1.5 var(--sans); color: var(--well-dim); }
.ladder {
  margin: 0 0 12px;
  padding: 0 0 0 1.5em;
  font: 400 1.02rem/1.55 var(--sans);
}
.ladder li { margin-bottom: .75em; animation: rise .3s ease; }
.ladder li::marker { color: var(--well-dim); }
.ladder button.cmd {
  display: inline-block;
  margin-top: 4px;
  min-height: 36px;
  padding: 6px 12px;
  background: #16304d;
  color: var(--well-fg);
  border: 1px solid #2b4a6c;
  border-radius: 6px;
  font: 500 .9rem var(--mono);
  cursor: pointer;
  touch-action: manipulation;
}
.ladder button.cmd:hover { background: #21456c; border-color: var(--cyan); }
.ladder-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.more {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--well-line);
  font-size: 1.04rem;
}

/* Audiobooks */
.tapes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 26px);
  list-style: none;
  margin: 1.8em 0 0;
  padding: 0;
}
.tapes a {
  display: block;
  color: inherit;
  text-decoration: none;
  font-family: var(--sans);
}
.tapes img {
  margin-bottom: 12px;
  border-radius: 8px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  box-shadow: 0 22px 40px -22px rgba(11, 28, 48, .7);
}
.tapes a:hover strong { color: var(--accent); }
.tapes strong { display: block; font-weight: 500; font-size: .98rem; line-height: 1.32; }
.tapes .tape-time { font-size: .9rem; color: var(--subtle); }

/* Pricing */
.prices {
  width: 100%;
  margin-top: 1.3em;
  border-collapse: collapse;
  font: 400 1rem/1.4 var(--sans);
}
.prices th, .prices td {
  padding: 15px 12px 15px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: baseline;
}
.prices tr:last-child > * { border-bottom: 1px solid var(--line); }
.prices th { font-weight: 500; }
.prices td { color: var(--muted); }
.prices .price {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
  color: var(--ink);
  font: 400 1.4rem var(--serif);
}

/* The terminal holds half the screen for the whole read. */
.term {
  position: sticky;
  top: 0;
  z-index: 3;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--well);
  color: var(--well-fg);
  font: 400 .92rem/1.58 var(--mono);
  transition: box-shadow .5s;
}
.term.live { box-shadow: inset 3px 0 0 var(--cyan); }
.term.won { box-shadow: inset 3px 0 0 var(--mint); }
/* The moment the machine comes back: one sweep of light across the terminal. */
.term.flash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(105deg, transparent 30%, rgba(121, 230, 189, .2) 50%, transparent 70%);
  animation: sweep 1.1s cubic-bezier(.3, .7, .3, 1) forwards;
  pointer-events: none;
}
@keyframes sweep {
  from { transform: translateX(-70%); }
  to { transform: translateX(70%); opacity: 0; }
}
.term-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 6px 22px;
  border-bottom: 1px solid var(--well-line);
  font-size: .875rem;
  color: var(--well-dim);
}
.term-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.term-tag { flex: none; font-family: var(--sans); }
.term-open {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #2b4a6c;
  border-radius: 6px;
  color: var(--well-fg);
  font: 500 .875rem var(--sans);
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.term-open:hover { background: #21456c; border-color: var(--cyan); }
/* A small status line, so the state of the repair stays in view while you type. */
.hud {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hud[hidden] { display: none; }
.hud i {
  display: block;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--well-dim);
  border-radius: 50%;
  transition: background-color .25s, border-color .25s;
}
.hud i.on { background: var(--mint); border-color: var(--mint); }
.hud i.pop { animation: pop .42s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.7); } }
.hud b { margin-left: 4px; font-weight: 500; color: var(--coral); font-variant-numeric: tabular-nums; }
.hud b.good { color: var(--mint); }
.term-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-color: #2b4663 transparent;
  scrollbar-width: thin;
}
.term-log:focus { outline: none; }
.term-log:focus-visible { outline: 2px solid var(--cyan); outline-offset: -3px; }
.term-log .ln { min-height: 1.58em; }
.t-cmd { color: #fff; }
.t-p { color: var(--cyan); }
.t-dim { color: var(--well-dim); }
.t-err { color: var(--coral); }
.t-ok { color: var(--mint); }
.t-warn { color: var(--amber); }
.t-b { color: #fff; font-weight: 500; }
.term-chips {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 22px 2px;
}
.term-chips[hidden] { display: none; }
.term-chips button {
  min-height: 36px;
  padding: 0 12px;
  background: #16304d;
  color: var(--well-fg);
  border: 1px solid #2b4a6c;
  border-radius: 6px;
  font: 500 .875rem var(--mono);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .12s, border-color .12s;
}
.term-chips button { flex: none; }
.term-chips button:hover { background: #21456c; border-color: var(--cyan); }
.term-chips button:active { background: #2b5887; }
.term-line {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 1ch;
  padding: 10px 22px 18px;
  transition: box-shadow .15s;
}
.term-prompt { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; color: var(--cyan); }
.term-cursor {
  flex: none;
  width: .62em;
  height: 1.2em;
  background: var(--cyan);
  opacity: .8;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.term-line:focus-within .term-cursor,
.term-line:has(#termInput:not(:placeholder-shown)) .term-cursor { display: none; }
#termInput {
  flex: 1 1 12ch;
  min-width: 0;
  min-height: 36px;
  padding: 0;
  background: none;
  border: 0;
  outline: none;
  color: #fff;
  font: inherit;
  caret-color: var(--cyan);
}
#termInput::placeholder { color: var(--well-dim); opacity: 1; }
.term-line:focus-within { box-shadow: inset 0 2px 0 var(--cyan); }

.foot {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 26px clamp(28px, 3.4vw, 56px);
  background: var(--well);
  color: var(--well-fg);
  font: 400 .96rem/1.5 var(--sans);
  border-top: 1px solid var(--well-line);
}
.foot p { margin: 0; }
.foot ul { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
.foot a { color: inherit; text-underline-offset: 4px; }
.foot a:hover { color: var(--cyan); }

/* On small upright screens the terminal docks under the text. A phone on its side keeps it beside. */
@media (max-width: 1000px) and (max-aspect-ratio: 13/10), (max-width: 560px) {
  /* Keyboard focus must not land behind the dock. */
  html { scroll-padding-bottom: 50vh; }
  .reader { display: block; }
  .note-wide { display: none; }
  .note-narrow { display: inline; }
  .chapter { padding: 64px 0; }
  .chapter-broken { padding-inline: clamp(28px, 5vw, 96px); padding-bottom: 96px; }
  .term {
    bottom: 0;
    top: auto;
    height: 30vh;
    height: 30svh;
    margin-top: 0;
    font-size: .875rem;
    border-top: 1px solid #2b4a6c;
    box-shadow: 0 -10px 30px rgba(11, 28, 48, .25);
  }
  .term.live {
    height: 46vh;
    height: 46svh;
    box-shadow: inset 0 3px 0 var(--cyan), 0 -10px 30px rgba(11, 28, 48, .25);
  }
  .term.won { box-shadow: inset 0 3px 0 var(--mint), 0 -10px 30px rgba(11, 28, 48, .25); }
  .term-bar { min-height: 44px; padding: 4px 16px; }
  .term-log { padding: 10px 16px 4px; }
  .term-chips { padding: 6px 16px 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .term-line { padding: 6px 16px 10px; }
  #termInput { font-size: 16px; }
  .term.live .term-open { display: none; }
  .book { padding-bottom: 8px; }
}

@media (max-height: 700px) {
  .term-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 1000px) and (max-aspect-ratio: 13/10) and (max-height: 620px), (max-width: 560px) and (max-height: 620px) {
  .term { height: 36vh; height: 36svh; }
}
@media (max-width: 1000px) and (max-aspect-ratio: 13/10) and (max-height: 520px), (max-width: 560px) and (max-height: 520px) {
  .term { height: 44vh; height: 44svh; }
  .term.live { height: 62vh; height: 62svh; }
  .term-bar { min-height: 36px; padding-block: 0; }
  .term-line { padding-block: 0 4px; }
  .term-log { padding-block: 6px 2px; }
}

/* The shapes the shader lays out for: the sculpture above the copy instead of beside it. */
@media (max-aspect-ratio: 23/20) {
  .hero-copy { width: auto; left: 20px; right: 20px; bottom: calc(46px + var(--bar)); }
  .finale-copy { bottom: calc(26px + var(--bar)); }
  .hero h1,
  .finale-copy h2 { font-size: clamp(2.6rem, 12.4vw, 6rem); }
  .hero-lede { max-width: none; font-size: clamp(1rem, 2.6vw, 1.3rem); }
  .no-gl .stage,
  html:not(.js) .stage { background-position: 80% center; }
}
@media (max-aspect-ratio: 23/20) and (max-height: 640px) {
  .hero-name,
  .hero-stage .hero-lede,
  .hero-cue { display: none; }
  .hero-copy { bottom: calc(22px + var(--bar)); }
}
@media (min-aspect-ratio: 23/20) and (max-height: 500px) {
  .hero-name,
  .hero-cue { display: none; }
  .hero-lede { font-size: .95rem; }
  .hero-copy { bottom: calc(16px + var(--bar)); width: min(58vw, 60rem); }
  .hero h1, .finale-copy h2 { font-size: clamp(2.2rem, min(7vw, 15vh), 4rem); }
}

@media (max-width: 1100px) {
  .term-title { display: none; }
  .term-tag { margin-right: auto; }
  .term.live .term-tag { margin-right: 0; }
  .term.live .hud { margin-right: auto; }
}

@media (max-width: 760px) {
  .btn { padding: 0 18px; }
  .volume { display: block; }
  .volume-cover { float: left; width: 96px; margin: 4px 16px 8px 0; }
  .volume .facts, .volume .toc { clear: both; }
  .volume > div > p { font-size: 1rem; }
  .facts dd { font-size: 1.35rem; }
  .plate { margin-inline: -20px; }
  .prices th, .prices td { display: block; border: 0; padding: 0; }
  .prices tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
  .prices tr:last-child { border-bottom: 1px solid var(--line); }
  .prices tr:last-child > * { border-bottom: 0; }
  .prices td:not(.price) { grid-column: 1; grid-row: 2; font-size: .94rem; }
  .prices .price { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .tapes strong { font-size: .9rem; }
}
/* Fingers need more room than pointers. */
@media (pointer: coarse) {
  .tok { padding: .34em .3em; }
  .term-chips button,
  .ladder button.cmd,
  #termInput,
  .term-open { min-height: 44px; }
  #termInput { font-size: 16px; }
  .toc button { min-height: 48px; }
  .link { padding-block: 12px; }
  .foot a { display: inline-block; padding-block: 11px; }
  .volume h3 a { display: inline-block; padding-block: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { height: auto; }
  .hero-cue { display: none; }
  .btn, .tok, .tick, .term, .disk span, .toc button, .hud i, .chapter .verdict .verdict-num { transition: none; }
  .tilt { transform: none; }
  .repaired, .ladder li, .term-cursor, .hud i.pop { animation: none; }
  .term.flash::after { display: none; }
}
