/* brb.plus — Blu-ray Backup
   Vanilla CSS. No build step, no external requests. */

/* ───────────────────────────  fonts  ─────────────────────────── */
/* Source Code Pro carries the full ASCII range used here; Geo has no digits,
   so it is deliberately confined to the wordmark. */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/scp.woff2') format('woff2');
}

@font-face {
  font-family: 'Geo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/geo.woff2') format('woff2');
}

/* ───────────────────────────  tokens  ────────────────────────── */
:root {
  /* palette — the jz.bz Monokai line */
  --bg: #292A2D;
  --bg-deep: #1A1B1E;
  --bg-alt: #1E2024;
  --fg: #A9A9B3;
  --fg-bright: #D6D6DE;
  --hi: #A9E8FF;
  --accent: #4CC9F0;

  /* the terminal's five ANSI roles, mapped onto that palette.
     brb emits 34/32/33/31/2 and nothing else — no bold, no 256-colour. */
  --ansi-blue: #7DA6FF;
  --ansi-green: #A6E22E;
  --ansi-yellow: #E6DB74;
  --ansi-red: #F92672;
  /* SGR 2 is "faint", but a lot of real body copy is set in it here. At 0.55
     it composites to ~3.1:1 on this background; 0.78 clears 4.5:1 and is still
     plainly a step below --fg. */
  --ansi-dim: rgb(169 169 179 / 0.78);

  --line: rgb(169 169 179 / 0.14);
  --line-strong: rgb(169 169 179 / 0.26);
  --panel: rgb(255 255 255 / 0.028);
  --panel-2: rgb(0 0 0 / 0.22);

  --mono: 'Source Code Pro', ui-monospace, 'SFMono-Regular', Menlo, Consolas,
    'Liberation Mono', monospace;
  --display: 'Geo', 'Source Code Pro', ui-monospace, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.6rem, 3.4vw, 2.5rem);
  --fs-hero: clamp(4rem, 17vw, 11rem);

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 88px;
  --s10: 116px;

  --wrap: 1160px;
  --radius: 6px;

  --t-fast: 140ms;
  --t: 260ms;
  --t-slow: 520ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--mono);
  font-size: var(--fs-base);
  line-height: 1.62;
  color: var(--fg);
  background: var(--bg-deep);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: #000;
  background: var(--hi);
}

/* ───────────────────────  background canvas  ─────────────────── */
/* A disc surface: concentric tracks with a slow rotating sheen. */
#rot {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body::after {
  /* vignette, so the tracks never fight the text */
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 95% 75% at 50% 40%, transparent 0%, rgb(26 27 30 / 0.34) 62%, rgb(26 27 30 / 0.74) 100%);
}

/* ────────────────────────────  layout  ───────────────────────── */
.wrap {
  width: min(var(--wrap), 100% - 2 * var(--s5));
  margin-inline: auto;
}

.sec {
  position: relative;
  z-index: 2;
  padding-block: var(--s10);
  border-top: 1px solid var(--line);
}

.sec-alt {
  background: rgb(0 0 0 / 0.2);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--s3) var(--s4);
  background: var(--accent);
  color: #04212B;
  font-weight: 700;
}

.skip:focus {
  left: var(--s4);
  top: var(--s4);
}

:where(a):focus-visible,
:where(button):focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ────────────────────────────  header  ───────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(30 32 36 / 0.72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  padding-block: var(--s3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  text-decoration: none;
  color: var(--fg-bright);
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
}

.brand-arc {
  transform-origin: 16px 16px;
  transition: transform var(--t-slow) var(--ease);
}

.brand:hover .brand-arc {
  transform: rotate(45deg);
}

.brand-text {
  position: relative;
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* the sibling site's glitch, restrained */
.brand-text::before,
.brand-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t) var(--ease);
}

.brand-text::before {
  text-shadow: -2px 0 #ff00de;
  animation: glitch 3s infinite linear alternate-reverse;
}

.brand-text::after {
  text-shadow: 2px 0 #00fff9;
  animation: glitch 2.2s infinite linear alternate-reverse;
}

.brand:hover .brand-text::before,
.brand:hover .brand-text::after {
  opacity: 0.75;
}

@keyframes glitch {
  0% { clip-path: inset(72% 0 12% 0); }
  20% { clip-path: inset(18% 0 61% 0); }
  40% { clip-path: inset(46% 0 33% 0); }
  60% { clip-path: inset(8% 0 79% 0); }
  80% { clip-path: inset(61% 0 22% 0); }
  100% { clip-path: inset(30% 0 55% 0); }
}

.brand-cursor {
  width: 9px;
  height: 1.05rem;
  background: var(--hi);
  border-radius: 1px;
  box-shadow: 0 0 10px rgb(169 232 255 / 0.7);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.site-nav {
  display: flex;
  gap: var(--s5);
  font-size: var(--fs-sm);
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  padding-block: var(--s1);
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─────────────────────────────  hero  ────────────────────────── */
.hero {
  position: relative;
  z-index: 2;
  padding-block: var(--s8) var(--s9);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
  gap: var(--s8);
  align-items: start;
}

/* The widest line brb can print is the 24-cell progress bar at 85 columns.
   Sizing the type off the panel rather than the viewport is what keeps that
   line intact instead of letting it slide under a scrollbar. */
.hero-term {
  container-type: inline-size;
}

.hero-title {
  font-family: var(--display);
  font-size: var(--fs-hero);
  line-height: 0.78;
  letter-spacing: -0.02em;
  margin-bottom: var(--s4);
  background: linear-gradient(100deg, var(--fg-bright) 0%, var(--hi) 24%, var(--accent) 56%, #3B82F6 84%, #8B5CF6 100%);
  background-size: 250% 250%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: sweep 9s ease-in-out infinite;
  filter: drop-shadow(0 0 42px rgb(76 201 240 / 0.22));
}

.hero-title::selection,
.hero-title *::selection {
  -webkit-text-fill-color: #000;
  color: #000;
  background: var(--hi);
}

@keyframes sweep {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-tagline {
  font-size: var(--fs-lg);
  color: var(--fg-bright);
  margin-bottom: var(--s5);
  text-wrap: balance;
}

.hero-body {
  max-width: 56ch;
  margin-bottom: var(--s6);
}

.hero-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--line-strong);
}

.hero-body a:hover {
  border-bottom-color: var(--accent);
  text-shadow: 0 0 14px rgb(76 201 240 / 0.5);
}

.mount-line {
  margin-bottom: var(--s6);
  padding-left: var(--s4);
  border-left: 2px solid var(--accent);
}

.mount-line figcaption {
  font-size: var(--fs-sm);
  color: var(--ansi-dim);
  margin-bottom: var(--s3);
}

.mount-note {
  font-size: var(--fs-sm);
  margin-top: var(--s3);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s4);
}

.ver {
  font-size: var(--fs-xs);
  color: var(--ansi-dim);
  letter-spacing: 0.05em;
}

.nowrap,
.nowrap-md {
  white-space: nowrap;
}

/* ────────────────────────────  buttons  ──────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  font: inherit;
  font-weight: 700;
  color: var(--fg-bright);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}

.btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgb(76 201 240 / 0.16);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #04212B;
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  color: #04212B;
  background: var(--hi);
  border-color: var(--hi);
  box-shadow: 0 10px 30px rgb(169 232 255 / 0.28);
}

.btn-small {
  padding: var(--s2) var(--s4);
  font-size: var(--fs-sm);
  font-weight: 400;
}

/* ─────────────────────────  command blocks  ──────────────────── */
.cmd {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* The code scrolls, not the block — otherwise a long command slides under
   the copy button. */
.cmd code {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  font-size: var(--fs-sm);
  color: var(--fg-bright);
  white-space: pre;
}

.cmd code::before {
  content: '$ ';
  color: var(--accent);
  user-select: none;
}

.tok-cmd {
  color: var(--accent);
}

.cmd-final {
  border-color: rgb(76 201 240 / 0.45);
  background: rgb(76 201 240 / 0.06);
  box-shadow: 0 0 0 1px rgb(76 201 240 / 0.08), 0 8px 30px rgb(76 201 240 / 0.08);
}

.copy {
  flex: none;
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--ansi-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px var(--s2);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copy[data-done] {
  color: var(--accent);
  border-color: var(--accent);
}

/* ───────────────────────────  terminal  ──────────────────────── */
.term {
  background: rgb(18 19 22 / 0.94);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(0 0 0 / 0.3);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  background: rgb(255 255 255 / 0.035);
  border-bottom: 1px solid var(--line);
}

.term-dots {
  display: inline-flex;
  gap: 6px;
}

.term-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.term-dots i:first-child { background: rgb(249 38 114 / 0.6); }
.term-dots i:nth-child(2) { background: rgb(230 219 116 / 0.6); }
.term-dots i:last-child { background: rgb(166 226 46 / 0.6); }

.term-title {
  flex: 1;
  font-size: var(--fs-xs);
  color: var(--ansi-dim);
  text-align: center;
}

.term-replay {
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--ansi-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px var(--s2);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.term-replay:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.term-body {
  margin: 0;
  padding: var(--s4);
  font-size: 0.7rem;
  line-height: 1.66;
  color: var(--fg-bright);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  tab-size: 4;
}

/* 85 columns * 0.6em advance + 32px of padding, expressed against the panel */
@supports (container-type: inline-size) {
  .term-body {
    font-size: clamp(0.62rem, 1.78cqw, 0.78rem);
  }
}

.term-body code {
  display: block;
  white-space: pre;
  min-width: max-content;
}

/* the five prefixes, coloured exactly where brb colours them:
   the reset lands before the separating space, so message bodies stay default */
.p-log { color: var(--ansi-blue); }
.p-ok { color: var(--ansi-green); }
.p-warn { color: var(--ansi-yellow); }
.p-fail { color: var(--ansi-red); }
.p-step { color: var(--ansi-dim); }
.p-raw { color: var(--fg-bright); }
.p-cmd { color: var(--accent); }

.term .l {
  display: block;
}

/* JS hides lines to replay them; without JS every line is simply visible */
.term.playing .l {
  opacity: 0;
}

.term.playing .l.shown {
  opacity: 1;
}

.cur {
  display: inline-block;
  width: 8px;
  height: 1em;
  vertical-align: text-bottom;
  background: var(--hi);
  animation: blink 1.1s steps(1) infinite;
}

/* ────────────────────────  section furniture  ────────────────── */
.eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s4);
}

h2 {
  font-size: var(--fs-xl);
  line-height: 1.2;
  font-weight: 700;
  color: var(--fg-bright);
  letter-spacing: -0.01em;
  margin-bottom: var(--s5);
  text-wrap: balance;
}

h3 {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--hi);
  margin-bottom: var(--s3);
}

h4 {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--fg-bright);
  margin-bottom: var(--s1);
}

.lede {
  font-size: var(--fs-md);
  max-width: 68ch;
  margin-bottom: var(--s7);
}

p + p {
  margin-top: var(--s4);
}

.fine {
  font-size: var(--fs-sm);
  color: var(--ansi-dim);
}

.fine code,
.fine strong {
  color: var(--fg);
}

.dim {
  color: var(--ansi-dim);
  font-weight: 400;
}

code {
  font-family: var(--mono);
}

:not(pre) > code {
  font-size: 0.92em;
  color: var(--hi);
  background: rgb(169 232 255 / 0.07);
  padding: 1px 5px;
  border-radius: 3px;
}

strong {
  color: var(--fg-bright);
  font-weight: 700;
}

em {
  color: var(--fg-bright);
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

/* ───────────────────  the disc set (signature)  ──────────────── */
.discset {
  margin-bottom: var(--s8);
  padding: var(--s6);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* The discs themselves are in the markup and worth seeing either way; the
   controls that only JS can honour are not shown when it has not run. */
html:not(.js) .mode,
html:not(.js) #discs-reset,
html:not(.js) .term-replay {
  display: none;
}

html:not(.js) .disc {
  cursor: default;
}

.discset-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s6);
}

.discset-hint {
  font-size: var(--fs-sm);
  color: var(--ansi-dim);
}

/* format toggle — the comparison is the argument */
.mode {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 2px;
  padding: 2px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mode-opt {
  cursor: pointer;
  /* both labels are nowrap; without this the flex row's min-content width is
     the sum of them and the control runs off the side of a phone */
  min-width: 0;
  flex: 0 1 auto;
}

.mode-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-opt span {
  display: block;
  padding: var(--s2) var(--s4);
  font-size: var(--fs-xs);
  color: var(--ansi-dim);
  border-radius: 4px;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.mode-opt:hover span {
  color: var(--fg-bright);
}

.mode-opt input:checked + span {
  color: #04212B;
  background: var(--accent);
  font-weight: 700;
}

.mode-opt input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.discs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(76px, 100%), 1fr));
  gap: var(--s5) var(--s4);
  margin-bottom: var(--s6);
}

/* "one stream, split across discs": the pieces are visibly one thing */
.discs.stream::before {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  top: 0;
  height: calc(100% - 2.1rem);
  max-height: 84px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgb(169 169 179 / 0.10), rgb(169 169 179 / 0.20), rgb(169 169 179 / 0.10));
  border: 1px dashed rgb(169 169 179 / 0.35);
  pointer-events: none;
}

/* Flat steel with no sheen: the point is that this is not ten objects, it is
   one block that happens to be cut in ten places. */
.discs.stream .disc-face {
  background:
    repeating-linear-gradient(90deg,
      rgb(169 169 179 / 0.22) 0 2px,
      transparent 2px 6px),
    linear-gradient(160deg, rgb(169 169 179 / 0.26), rgb(169 169 179 / 0.10));
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgb(169 169 179 / 0.4),
    0 6px 20px rgb(0 0 0 / 0.4);
}

.discs.stream .disc-face::before {
  display: none;
}

.discs.stream .disc[data-state='ok'] .disc-label {
  color: var(--fg);
}

.disc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: 0;
  font: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ansi-dim);
}

.disc-face {
  position: relative;
  width: 100%;
  max-width: 84px;
  aspect-ratio: 1;
  border-radius: 50%;
  /* data tracks */
  background:
    repeating-radial-gradient(circle at 50% 50%,
      rgb(169 232 255 / 0.20) 0 1px,
      transparent 1px 4px),
    conic-gradient(from var(--sheen, 0deg),
      rgb(59 130 246 / 0.62),
      rgb(76 201 240 / 0.72),
      rgb(169 232 255 / 0.62),
      rgb(139 92 246 / 0.52),
      rgb(59 130 246 / 0.62));
  box-shadow:
    inset 0 0 0 1px rgb(169 232 255 / 0.55),
    0 6px 20px rgb(0 0 0 / 0.45);
  transition: transform var(--t) var(--ease), filter var(--t) var(--ease),
    box-shadow var(--t) var(--ease), opacity var(--t) var(--ease);
}

/* hub */
.disc-face::before {
  content: '';
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: #16171a;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* scratch, revealed by state */
.disc-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  background:
    linear-gradient(58deg, transparent 44%, rgb(230 219 116 / 0.95) 47%, rgb(255 255 255 / 0.6) 49%, transparent 52%),
    linear-gradient(72deg, transparent 60%, rgb(230 219 116 / 0.7) 62%, transparent 64%);
}

.disc:hover .disc-face {
  transform: translateY(-4px) scale(1.05);
  box-shadow:
    inset 0 0 0 1px rgb(76 201 240 / 0.7),
    0 14px 34px rgb(76 201 240 / 0.22);
}

.disc-label {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  transition: color var(--t-fast) var(--ease);
}

.disc[data-state='ok'] .disc-label {
  color: var(--accent);
}

/* scratched */
.disc[data-state='scratched'] .disc-face {
  filter: hue-rotate(-38deg) saturate(0.75);
  box-shadow:
    inset 0 0 0 1px rgb(230 219 116 / 0.7),
    0 6px 22px rgb(230 219 116 / 0.18);
}

.disc[data-state='scratched'] .disc-face::after {
  opacity: 1;
}

.disc[data-state='scratched'] .disc-label {
  color: var(--ansi-yellow);
}

/* lost */
.disc[data-state='lost'] .disc-face {
  filter: grayscale(1) brightness(0.32);
  opacity: 0.55;
  transform: scale(0.92);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.disc[data-state='lost'] .disc-face::after {
  opacity: 0.35;
  filter: grayscale(1);
}

.disc[data-state='lost']:hover .disc-face {
  transform: scale(0.95) translateY(-3px);
}

.disc[data-state='lost'] .disc-label {
  color: var(--ansi-red);
  text-decoration: line-through;
}

.discset-readout {
  display: grid;
  gap: var(--s2);
  padding: var(--s5);
  margin-bottom: var(--s5);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
}

.ro-row {
  display: flex;
  gap: var(--s4);
  align-items: baseline;
}

.ro-key {
  flex: none;
  width: 5ch;
  color: var(--ansi-dim);
}

.ro-val b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  transition: color var(--t-fast) var(--ease);
}

/* scoped to the readout, not to .ro-val: the note paragraph emits these too */
.discset-readout .warnish { color: var(--ansi-yellow); }
.discset-readout .badish { color: var(--ansi-red); }

.ro-note {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  color: var(--fg);
}

/* ─────────────────────────────  cards  ───────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--s5);
}

.card {
  padding: var(--s5);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease);
}

.card:hover {
  border-color: rgb(76 201 240 / 0.4);
  transform: translateY(-3px);
}

.card p {
  font-size: var(--fs-sm);
}

/* ───────────────────────────  pipeline  ──────────────────────── */
.pipe {
  list-style: none;
  counter-reset: none;
  border-top: 1px solid var(--line);
}

.pipe-stage {
  position: relative;
  border-bottom: 1px solid var(--line);
}

/* the flow line down the left gutter */
.pipe-stage::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}

.pipe-stage:first-child::before { top: 50%; }
.pipe-end::before { bottom: 50%; }

.pipe-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  padding: var(--s5) var(--s4) var(--s5) 0;
  font: inherit;
  text-align: left;
  color: var(--fg);
  background: transparent;
  border: 0;
  cursor: pointer;
  list-style: none;
  transition: color var(--t-fast) var(--ease);
}

/* the default disclosure triangle, gone in both engines */
.pipe-head::-webkit-details-marker {
  display: none;
}

.pipe-head::marker {
  content: '';
}

.pipe-head:hover {
  color: var(--fg-bright);
}

.pipe-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: 9px;
  border-radius: 50%;
  font-size: var(--fs-xs);
  color: var(--ansi-dim);
  background: var(--bg-deep);
  border: 1px solid var(--line-strong);
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}

.pipe-head:hover .pipe-n,
.pipe-det[open] .pipe-n {
  color: #04212B;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgb(76 201 240 / 0.4);
}

.pipe-name {
  flex: none;
  font-weight: 700;
  color: var(--fg-bright);
  min-width: 11ch;
}

.pipe-det[open] .pipe-name {
  color: var(--accent);
}

.pipe-sub {
  font-size: var(--fs-sm);
  color: var(--ansi-dim);
}

/* <details> does the open/close itself: no measured heights, no JS, and it
   still works when the script does not load. The reveal is a content fade
   rather than a height animation, which nothing can get wrong. */
.pipe-body {
  overflow: hidden;
}

.pipe-det[open] .pipe-inner {
  animation: pipeIn var(--t) var(--ease) both;
}

@keyframes pipeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* Spacing lives on the children, never on .pipe-inner: padding on a grid item
   is not clipped by overflow:hidden, so it would floor the collapsed row at
   the padding's height instead of zero. */
.pipe-inner {
  max-width: calc(78ch + 62px);
}

.pipe-inner > * {
  margin-left: 62px;
  margin-right: var(--s4);
}

.pipe-inner > :last-child {
  margin-bottom: var(--s6);
}

.pipe-body p {
  font-size: var(--fs-sm);
}

.pipe-note {
  color: var(--ansi-dim);
}

.argv {
  margin-top: var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--ansi-blue);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  color: var(--fg-bright);
  overflow-x: auto;
  scrollbar-width: thin;
}

.argv code {
  white-space: pre;
}

/* ─────────────────────────  disc contents  ───────────────────── */
.disc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--s7);
  align-items: start;
}

.tree {
  padding: var(--s5);
  background: rgb(18 19 22 / 0.8);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: clamp(0.6rem, 0.85vw, 0.75rem);
  line-height: 1.85;
  overflow-x: auto;
  scrollbar-width: thin;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
}

.tree code {
  white-space: pre;
  min-width: max-content;
  display: block;
}

.t-f { color: var(--fg-bright); }
.t-d { color: var(--ansi-blue); }
.t-c { color: var(--ansi-dim); }

.disc-aside p {
  font-size: var(--fs-sm);
}

.mini {
  margin: var(--s4) 0;
  padding: var(--s4);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
}

.mini dt {
  color: var(--hi);
  margin-top: var(--s3);
}

.mini dt:first-child {
  margin-top: 0;
}

.mini dd {
  color: var(--ansi-dim);
  padding-left: var(--s3);
  border-left: 1px solid var(--line);
  margin-top: 2px;
}

.mini dd strong {
  color: var(--fg);
}

/* ──────────────────────────  the recipe  ─────────────────────── */
/* the whole read-side dependency set, in one line */
.ladder {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s6);
}

.ladder li {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
}

.ladder code {
  color: var(--fg-bright);
}

.ladder span {
  color: var(--ansi-dim);
}

.ladder-none {
  border-color: rgb(76 201 240 / 0.45);
  background: rgb(76 201 240 / 0.07);
}

.ladder-none code {
  color: var(--accent);
}

.recipe {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: var(--s5);
  margin-bottom: var(--s9);
}

/* min-width:0 on the grid item: its automatic minimum is min-content, and the
   longest command in the block would otherwise widen the whole column past the
   viewport instead of scrolling inside its own box. */
.recipe > li {
  counter-increment: step;
  position: relative;
  min-width: 0;
  padding-left: 52px;
}

.recipe > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: var(--fs-xs);
  color: var(--accent);
  background: var(--bg-deep);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.recipe > li:last-child::before {
  color: #04212B;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 22px rgb(76 201 240 / 0.45);
}

.recipe p {
  margin-top: var(--s3);
  font-size: var(--fs-sm);
  color: var(--ansi-dim);
  max-width: 74ch;
}

.recipe p code,
.recipe p strong {
  color: var(--fg);
}

/* ───────────────────────  split / tables  ────────────────────── */
/* a split that follows running text needs its own separation; where one
   follows a heading or a list the block above already provides it */
p + .split {
  margin-top: var(--s8);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: var(--s7);
  align-items: start;
}

.split > * {
  min-width: 0;
}

.split > div > h3:not(:first-child) {
  margin-top: var(--s7);
}

.split p {
  font-size: var(--fs-sm);
}

.tbl-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--s4);
  font-size: var(--fs-sm);
  text-align: left;
}

.tbl th,
.tbl td {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.tbl thead th {
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ansi-dim);
  font-weight: 400;
  border-bottom-color: var(--line-strong);
}

.tbl tbody th {
  color: var(--fg-bright);
  font-weight: 700;
  white-space: nowrap;
}

.tbl .yes { color: var(--accent); }
.tbl .part { color: var(--ansi-yellow); }
.tbl .hl { color: var(--hi); }

.tbl-media td,
.tbl-media th {
  white-space: nowrap;
}

.tbl tbody tr {
  transition: background-color var(--t-fast) var(--ease);
}

.tbl tbody tr:hover {
  background: rgb(76 201 240 / 0.045);
}

.reasons {
  list-style: none;
  counter-reset: r;
  display: grid;
  gap: var(--s5);
  margin-top: var(--s5);
}

.reasons li {
  counter-increment: r;
  position: relative;
  padding-left: var(--s6);
}

.reasons li::before {
  content: counter(r) '.';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

.reasons p {
  font-size: var(--fs-sm);
  color: var(--ansi-dim);
}

/* ─────────────────────────  install bits  ────────────────────── */
.run {
  padding: var(--s5);
  background: rgb(18 19 22 / 0.8);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: var(--fs-sm);
  line-height: 1.9;
  color: var(--fg-bright);
  overflow-x: auto;
  scrollbar-width: thin;
}

.run code {
  white-space: pre;
  display: block;
  min-width: max-content;
}

.warnbox {
  margin-top: var(--s5);
  padding: var(--s4) var(--s5);
  font-size: var(--fs-sm);
  color: var(--fg-bright);
  background: rgb(230 219 116 / 0.07);
  border: 1px solid rgb(230 219 116 / 0.3);
  border-left: 3px solid var(--ansi-yellow);
  border-radius: var(--radius);
}

.limits {
  list-style: none;
  display: grid;
  gap: var(--s4);
  margin-top: var(--s4);
  font-size: var(--fs-sm);
}

.limits li {
  padding-left: var(--s5);
  position: relative;
  color: var(--ansi-dim);
}

.limits li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--line-strong);
}

.limits strong {
  color: var(--fg-bright);
}

/* ────────────────────────────  footer  ───────────────────────── */
.site-footer {
  position: relative;
  z-index: 2;
  padding-block: var(--s7);
  border-top: 1px solid var(--line);
  background: rgb(0 0 0 / 0.3);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  font-size: var(--fs-sm);
}

.foot-brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s3);
}

.foot-brand .brand-text {
  font-size: 1.25rem;
  color: var(--fg-bright);
}

.foot-links {
  display: flex;
  gap: var(--s5);
}

.foot-links a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dotted var(--line-strong);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.foot-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.foot-note {
  width: 100%;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  color: var(--ansi-dim);
  font-size: var(--fs-xs);
}

/* ─────────────────────────  scroll reveal  ───────────────────── */
/* Hiding is gated on the .js class the document sets for itself, so a failed
   or blocked script can never leave the page blank. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

/* ──────────────────────────  responsive  ─────────────────────── */
@media (width < 1080px) {
  /* minmax(0, …) and not 1fr: a bare 1fr floors the track at the item's
     min-content width, and the terminal's min-content is 85 monospace
     columns — enough to push the whole page wider than the viewport. */
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s7);
  }

  .disc-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s6);
  }
}

@media (width < 760px) {
  :root {
    --s10: 84px;
    --s9: 60px;
  }

  .site-nav {
    display: none;
  }

  .header-inner {
    justify-content: flex-start;
  }

  .hero {
    padding-block: var(--s7) var(--s9);
  }

  .discset {
    padding: var(--s4);
  }

  .discs {
    grid-template-columns: repeat(auto-fit, minmax(min(58px, 100%), 1fr));
    gap: var(--s4) var(--s3);
  }

  .mode {
    width: 100%;
  }

  .mode-opt {
    flex: 1 1 100%;
  }

  .mode-opt span {
    white-space: normal;
    text-align: center;
  }

  .pipe-inner > * {
    margin-left: var(--s5);
  }

  .pipe-head {
    flex-wrap: wrap;
    gap: var(--s3);
  }

  .pipe-sub {
    flex-basis: 100%;
    padding-left: 55px;
  }

  .term-body {
    font-size: 0.58rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ────────────────────────  reduced motion  ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .term.playing .l {
    opacity: 1;
  }

  #rot {
    display: none;
  }

  .brand-cursor,
  .cur {
    animation: none;
    opacity: 1;
  }
}
