/* dafeiyu — a field study. Warm paper, ink, one blue. */

:root {
  --paper: #f4f1e8;
  --paper-deep: #e9e4d6;
  --ink: #12141f;
  --night: #0e1120;
  --night-ink: #e9e6dc;
  --muted: #6f6b5f;
  --rule: #d7d1c0;
  --blue: #4d6bfe;
  --term-bg: #0c0e14;
  --term-line: #232936;
  --term-dim: #7b8398;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --gut: clamp(20px, 4vw, 56px);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
::selection { background: var(--blue); color: #fff; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image: radial-gradient(rgba(18, 20, 31, .05) 1px, transparent 1px);
  background-size: 4px 4px;
}

/* paper grain */
body::after {
  content: "";
  position: fixed; inset: 0;
  background: url("grain.png") repeat;
  opacity: .045;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 40;
}

a { color: inherit; text-decoration: none; }
h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 10px; letter-spacing: -.01em; }

/* ── progress ─────────────────────────────────────────────── */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--blue); z-index: 60; transition: width .1s linear;
}

/* ── masthead ─────────────────────────────────────────────── */
.masthead {
  max-width: var(--max); margin: 0 auto;
  padding: 24px var(--gut) 18px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
}
.mark { display: flex; align-items: baseline; gap: 12px; }
.mark-cn { font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .04em; }
.mark-en { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: clamp(14px, 2.2vw, 34px); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }
.nav a { color: var(--muted); position: relative; transition: color .18s ease; }
.nav a span { color: var(--blue); margin-right: 6px; font-size: 9px; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }
.nav a:hover, .nav a:focus-visible { color: var(--ink); }
.nav-out { color: var(--ink) !important; }

/* ── cover ────────────────────────────────────────────────── */
.cover {
  max-width: var(--max); margin: 0 auto;
  min-height: calc(100vh - 64px);
  padding: clamp(22px, 3vw, 40px) var(--gut) 16px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.cover-grid {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
  padding: clamp(14px, 2.4vw, 34px) 0;
}

.kicker {
  margin: 0 0 clamp(20px, 2.6vw, 34px);
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}

h1 {
  font-family: var(--serif); font-optical-sizing: auto; font-weight: 500;
  font-size: clamp(44px, 6.5vw, 88px); line-height: .96; letter-spacing: -.035em;
  margin: 0 0 clamp(22px, 2.6vw, 34px);
}
h1 .l { display: block; overflow: hidden; }
.ready h1 .l { animation: line-up 1s cubic-bezier(.2,.75,.25,1) both; }
.ready h1 .l:nth-child(2) { animation-delay: .09s; }
@keyframes line-up { from { transform: translateY(106%); } to { transform: none; } }

.lede {
  margin: 0 0 clamp(26px, 3vw, 40px); max-width: 46ch;
  font-size: clamp(12.5px, 1.05vw, 14px); line-height: 1.95; color: #3a3a35;
}

.cta { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 15px 24px; background: var(--blue); color: #fff;
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--blue); transition: background .18s ease, transform .18s ease;
}
.btn:hover, .btn:focus-visible { background: #3d5af0; transform: translateY(-1px); }
.btn-quiet {
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  border-bottom: 1px solid var(--ink); padding-bottom: 3px;
  display: inline-flex; gap: 8px; align-items: baseline;
}
.btn-quiet .arr { transition: transform .2s ease; }
.btn-quiet:hover { color: var(--blue); border-color: var(--blue); }
.btn-quiet:hover .arr { transform: translateY(2px); }

.cover-plate { display: flex; flex-direction: column; gap: 12px; }
.specimen { margin: 0; }

.specimen-desktop {
  position: relative; border: 1px solid var(--rule); background: var(--paper-deep);
  padding: clamp(24px, 3vw, 38px);
  display: grid; place-items: center; min-height: clamp(320px, 32vw, 400px); overflow: hidden;
}
.specimen-desktop::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(18,20,31,.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(18,20,31,.055) 1px, transparent 1px);
  background-size: 28px 28px; pointer-events: none;
}
.widget { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.widget-tag { padding: 3px 8px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 500; border-radius: 3px; white-space: nowrap; }
.widget-doing { font-size: 10.5px; color: var(--blue); margin-bottom: 2px; }
#hero { width: 240px; height: 240px; margin-top: 12px; image-rendering: pixelated; display: block; cursor: pointer; }
#hero:active { transform: translateY(1px); }

figcaption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-top: 11px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.live { display: inline-flex; align-items: center; gap: 8px; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.live-state { color: var(--ink); letter-spacing: .04em; text-transform: none; }
#hero-clock { font-variant-numeric: tabular-nums; letter-spacing: .1em; }

.plate-caption { margin: 0; font-size: 10px; letter-spacing: .06em; color: var(--muted); }
.feed-cue {
  margin: 14px 0 0; font-size: 13px; letter-spacing: .04em; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
}
.feed-cue::before {
  content: ""; width: 6px; height: 6px; background: var(--blue); display: inline-block;
}
.plate-caption b { color: var(--ink); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; font-size: 9px; margin-right: 6px; }

.cover-foot {
  display: flex; justify-content: center; align-items: center;
  border-top: 1px solid var(--rule); padding-top: 18px;
}
.cover-line {
  margin: 0; font-size: 13px; letter-spacing: .01em; color: var(--ink);
  text-align: center; max-width: 62ch;
}
.cover-line::before { content: "— "; color: var(--muted); }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; }
.scroll-cue i { display: block; width: 1px; height: 26px; background: var(--blue); animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0%,100% { transform: scaleY(.35); opacity: .4 } 50% { transform: scaleY(1); opacity: 1 } }

/* ── session ──────────────────────────────────────────────── */
.session {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gut);
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.session-side {
  padding: 18px 20px 18px 0; border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 8px;
}
.session-label { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; }
.session-sub { font-size: 10px; line-height: 1.7; color: var(--muted); }
.session-lines {
  list-style: none; margin: 0; padding: 12px 0 12px clamp(16px, 2vw, 32px);
  display: flex; flex-direction: column; gap: 2px; font-size: 11.5px;
  min-height: 150px; justify-content: flex-end;
}
.session-lines li {
  display: grid; grid-template-columns: 68px 128px 1fr; gap: 12px;
  color: var(--muted); opacity: .5; transition: opacity .3s ease, color .3s ease;
}
.session-lines li.now { opacity: 1; color: var(--ink); }
.session-lines li.now .t-state { color: var(--blue); }
.session-lines li .t { font-variant-numeric: tabular-nums; }
.session-lines li .caret::after { content: "▍"; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0 } }

/* ── figures ──────────────────────────────────────────────── */
.figures { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.figures dl { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; border-bottom: 1px solid var(--rule); }
.figures dl > div { padding: 26px 0 22px; border-right: 1px solid var(--rule); padding-left: clamp(12px, 2vw, 26px); }
.figures dl > div:last-child { border-right: 0; }
.figures dt { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.figures dd {
  margin: 4px 0 0; font-family: var(--serif); font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 500; letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums;
}

/* ── sections ─────────────────────────────────────────────── */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 9vw, 128px) var(--gut) 0; }
.section-head {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 40px); align-items: baseline;
  padding-bottom: 26px; border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(22px, 3vw, 36px);
}
.num { font-size: 11px; letter-spacing: .16em; color: var(--blue); font-variant-numeric: tabular-nums; }
.section-head h2 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -.025em; margin: 0; line-height: 1.02;
}
.section-note { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.85; max-width: 44ch; }

/* ── stage ────────────────────────────────────────────────── */
.stage {
  position: sticky; top: 0; z-index: 6;
  display: grid; grid-template-columns: 44px 86px minmax(0, 1fr) auto;
  align-items: center; gap: 14px; padding: 9px 0;
  background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-bottom: 14px;
}
.stage canvas { width: 44px; height: 44px; image-rendering: pixelated; }
.stage-label { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--blue); }
.stage-text { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.stage-state { font-size: 12.5px; }
.stage-why { font-size: 11px; color: var(--muted); }
.stage-meta {
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  font-variant-numeric: tabular-nums; display: flex; gap: 16px; align-items: baseline;
}
.stage-hint { color: var(--rule); text-transform: none; letter-spacing: .02em; }

/* ── catalogue ────────────────────────────────────────────── */
.catalog { display: flex; flex-direction: column; gap: 30px; }
.group-title {
  position: sticky; top: 65px; background: var(--paper);
  font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  padding: 10px 0 9px; border-bottom: 1px solid var(--rule); margin-bottom: 2px;
  display: flex; justify-content: space-between;
}
.group-title em { font-style: normal; color: var(--muted); }
.rows { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 4vw, 64px); }
.row {
  display: grid; grid-template-columns: 44px minmax(110px, 156px) 1fr auto;
  align-items: center; gap: 12px; padding: 8px 6px 8px 0;
  border-bottom: 1px solid rgba(215, 209, 192, .55);
  transition: background .15s ease, padding-left .15s ease;
}
.row:hover, .row:focus-visible { background: rgba(77, 107, 254, .06); padding-left: 8px; outline: none; }
.row canvas { width: 44px; height: 44px; image-rendering: pixelated; }
.row-name { font-size: 12px; display: flex; align-items: baseline; gap: 8px; }
.row-num { font-size: 8.5px; letter-spacing: .1em; color: var(--rule); font-variant-numeric: tabular-nums; }
.row-why { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 9.5px; letter-spacing: .1em; color: var(--rule); opacity: 0; transition: opacity .15s ease; font-variant-numeric: tabular-nums; }
.row:hover .row-meta, .row:focus-visible .row-meta { opacity: 1; color: var(--muted); }
.catalog-foot {
  margin: 26px 0 0; font-size: 10.5px; letter-spacing: .04em; color: var(--muted);
  border-top: 1px solid var(--rule); padding-top: 14px;
}

/* ── night ────────────────────────────────────────────────── */
.night { background: var(--night); color: var(--night-ink); margin-top: 0; padding-top: clamp(64px, 9vw, 120px); }
.night-inner { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 110px) var(--gut); }
.night-head {
  display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(16px, 3vw, 40px); align-items: start;
  padding-bottom: 34px; border-bottom: 1px solid #262c45;
}
.night .num { color: var(--blue); }
.night h2 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5vw, 62px);
  letter-spacing: -.03em; line-height: .98; margin: 0;
}
.night-head p { margin: 0; font-size: 12px; line-height: 1.95; color: #a9a89e; max-width: 42ch; }
.night-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: #262c45; border: 1px solid #262c45; margin-top: 1px;
}
.night-cell { background: var(--night); padding: clamp(18px, 2.6vw, 34px) clamp(16px, 2vw, 26px); display: flex; align-items: center; gap: clamp(14px, 2vw, 24px); }
.night-cell canvas { width: 96px; height: 96px; image-rendering: pixelated; flex: 0 0 96px; }
.night-cell div { min-width: 0; }
.night-cell b { display: block; font-weight: 500; font-size: 12.5px; letter-spacing: .01em; margin-bottom: 4px; }
.night-cell span { font-size: 10.5px; color: #85847b; line-height: 1.7; display: block; }
.night-foot { margin: 18px 0 0; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: #6d6c64; }

/* ── feed ─────────────────────────────────────────────────── */
.feed-row {
  display: grid; grid-template-columns: 170px 1fr 90px; gap: 20px; align-items: baseline;
  padding: 15px 0; border-bottom: 1px solid var(--rule);
}
.feed-name { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.path { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.feed-flag { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--blue); text-align: right; }
.push { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.push p { margin: 0; color: #3a3a35; font-size: 12.5px; line-height: 1.9; max-width: 42ch; }
.push pre { margin: 0; padding: 18px 20px; background: var(--ink); color: #d9e0ff; font-size: 10.5px; line-height: 1.95; overflow-x: auto; }

/* ── install ──────────────────────────────────────────────── */
.install-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.btn-large { padding: 20px 30px; font-size: 12px; letter-spacing: .1em; }
.fine { margin: 16px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.9; }
.fine code { color: var(--ink); }
.install-notes p { margin: 0 0 14px; font-size: 12px; line-height: 1.9; color: #3a3a35; }
.install-notes strong { font-weight: 500; color: var(--ink); }
.install-notes em { font-style: normal; border-bottom: 1px solid var(--rule); }

/* ── footer ───────────────────────────────────────────────── */
.footer {
  max-width: var(--max); margin: clamp(72px, 10vw, 140px) auto 0;
  padding: 26px var(--gut) 44px; border-top: 1px solid var(--rule);
  font-size: 10px; letter-spacing: .08em; color: var(--muted);
}
.footer-top { display: flex; justify-content: space-between; gap: 24px; align-items: baseline; padding-bottom: 26px; }
.footer-mark { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--ink); }
.footer-note { text-transform: none; letter-spacing: .02em; max-width: 46ch; }
.footer-out { color: var(--ink); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 8px 28px; padding-top: 14px;
  border-top: 1px solid var(--rule); text-transform: uppercase; font-size: 9px; letter-spacing: .16em;
}

/* ── reveal & motion ──────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .live i, .scroll-cue i { animation: none; }
  .ready h1 .l { animation: none; }
}

/* ── narrow ───────────────────────────────────────────────── */
@media (max-width: 980px) {
  .cover { min-height: 0; }
  .cover-grid { grid-template-columns: 1fr; }
  .figures dl { grid-template-columns: repeat(3, 1fr); }
  .figures dl > div:nth-child(3) { border-right: 0; }
  .section-head { grid-template-columns: 40px 1fr; }
  .section-note { grid-column: 2; margin-top: 10px; }
  .rows { grid-template-columns: 1fr; }
  .push { grid-template-columns: 1fr; }
  .install-grid { grid-template-columns: 1fr; }
  .night-head { grid-template-columns: 40px 1fr; }
  .night-head p { grid-column: 2; margin-top: 12px; }
  .night-grid { grid-template-columns: 1fr 1fr; }
  .session { grid-template-columns: 1fr; }
  .session-side { border-right: 0; border-bottom: 1px solid var(--rule); flex-direction: row; justify-content: space-between; padding-right: 0; }
  .session-lines { padding-left: 0; }
  .feed-row { grid-template-columns: 130px 1fr; }
  .feed-flag { display: none; }
  .footer-top { flex-direction: column; }
}

@media (max-width: 620px) {
  .nav a:not(.nav-out) { display: none; }
  .figures dl { grid-template-columns: repeat(2, 1fr); }
  .figures dl > div:nth-child(3) { border-right: 1px solid var(--rule); }
  .figures dl > div:nth-child(2n) { border-right: 0; }
  .row { grid-template-columns: 44px 1fr; }
  .row-why { grid-column: 2; }
  .row-meta { display: none; }
  .night-grid { grid-template-columns: 1fr; }
  .session-lines li { grid-template-columns: 54px 1fr; }
  .session-lines li .t-state { grid-column: 2; }
  .session-lines li .t-detail { grid-column: 2; }
  .cover-foot span:nth-child(2) { display: none; }
}

@supports (font-variation-settings: "opsz" 96) {
  h1, h2, .figures dd, .feed-name, .footer-mark, .mark-cn, h3 { font-variation-settings: "opsz" 96; }
  h1 { font-variation-settings: "opsz" 144; }
}

/* ── full-bleed session on wide screens ──────────────────── */

.session { background: rgba(18, 20, 31, .022); }

@media (min-width: 1100px) {
  .session {
    max-width: none;
    width: 100%;
    padding-left: max(var(--gut), calc((100vw - var(--max)) / 2));
    padding-right: max(var(--gut), calc((100vw - var(--max)) / 2));
    border-left: 0;
    border-right: 0;
  }
}

/* ── dark: the same room at night ────────────────────────── */



.hovering .specimen-desktop { border-color: var(--blue); }
.specimen-desktop { transition: border-color .18s ease; }

/* ── the tag, as the product draws it ────────────────────── */

.widget-tag {
  background: #000;
  color: #9fe6b0;
  font-size: 10.5px;
  letter-spacing: .04em;
}

/* ── session as a terminal window ────────────────────────── */

.session {
  display: block;
  max-width: var(--max);
  margin: clamp(36px, 5vw, 72px) auto 0;
  padding: 0 var(--gut);
  background: none;
  border: 0;
  width: auto;
}

.term {
  background: #0b0d12;
  border: 1px solid #1d2331;
  border-radius: 8px;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 14px;
  background: #12151d;
  border-bottom: 1px solid #1d2331;
}

.lights { display: flex; gap: 6px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.lights i:nth-child(1) { background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }

.term-title {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #7d869c;
}
.term-meta {
  margin-left: auto; font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: #4b5568;
}

.term-body { padding: 18px 20px 22px; }

.term-cmd {
  margin: 0 0 14px; font-size: 11.5px; color: #7d869c;
}
.term-cmd .prompt { color: #4fcf86; margin-right: 6px; }

.session-lines {
  margin: 0; padding: 0; list-style: none;
  min-height: 158px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 3px;
  font-size: 11.5px;
}

.session-lines li {
  display: grid;
  grid-template-columns: 74px 138px 1fr;
  gap: 12px;
  color: #6b7488;
  opacity: .52;
  transition: opacity .25s ease, color .25s ease;
}
.session-lines li .t { color: #4b5568; font-variant-numeric: tabular-nums; }
.session-lines li .t-state { color: #8b93a7; }
.session-lines li .t-detail { color: #6b7488; }

.session-lines li.now { opacity: 1; }
.session-lines li.now .t { color: #5b6478; }
.session-lines li.now .t-state { color: #4fcf86; }
.session-lines li.now .t-detail { color: #e8eef7; }
.session-lines li.now .caret::after { content: "▍"; color: #4fcf86; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }

/* ── the closing line, at pull-quote size ────────────────── */

.cover-line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(18px, 1.95vw, 27px);
  line-height: 1.3;
  letter-spacing: -.012em;
  color: var(--ink);
  max-width: 36ch;
  text-align: center;
}

/* ── replay: a log, not a clip-art terminal ──────────────── */

.term {
  border-radius: 0;
  border: 1px solid var(--term-line);
  background: var(--term-bg);
}

.term-bar {
  height: 34px;
  padding: 0 16px;
  background: transparent;
  border-bottom: 1px solid var(--term-line);
  justify-content: space-between;
}
.term-title { color: #9aa3b8; font-size: 10px; letter-spacing: .18em; }
.term-meta { color: #586074; }

.term-body {
  padding: 22px 22px 26px;
  border-left: 2px solid #4d6bfe;
}

.term-cmd { font-size: 12.5px; color: #8b93a7; margin-bottom: 16px; }
.term-cmd .prompt { color: #9fe6b0; }

.session-lines { min-height: 176px; gap: 7px; font-size: 12.5px; }
.session-lines li { grid-template-columns: 78px 150px 1fr; gap: 14px; color: #7b8398; opacity: .45; }
.session-lines li.now .t-state { color: #9fe6b0; }
.session-lines li.now .t-detail { color: #f0f3fa; }
.session-lines li.now .caret::after { color: #9fe6b0; }

/* ── the catalogue preview, finally at a readable size ───── */

.stage {
  grid-template-columns: 84px 96px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 14px 0;
}
.stage canvas { width: 84px; height: 84px; }
.stage-label { font-size: 10px; }
.stage-state { font-size: 17px; letter-spacing: -.01em; }
.stage-why { font-size: 13px; }
.stage-meta { font-size: 10px; }

/* ── the cover specimen, larger again ────────────────────── */

#hero { width: 288px; height: 288px; }
.specimen-desktop { min-height: clamp(360px, 34vw, 440px); }
.widget-tag { font-size: 11.5px; padding: 5px 11px; }
.widget-doing { font-size: 12px; }

/* ── dark: same page, lights down — not a different site ─── */

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151821;
    --paper-deep: #1b1f2b;
    --ink: #ece9de;
    --muted: #a6a294;
    --rule: #2b303e;
    --blue: #8b9dff;
    --cream: #1a1e29;
    --term-bg: #10131b;
    --term-line: #2a3040;
    --term-dim: #9aa2b6;
  }

  body {
    background-image: radial-gradient(rgba(236, 233, 222, .045) 1px, transparent 1px);
  }

  .lede, .push p, .install-notes p, .section-note { color: #bdb9ab; }

  .specimen-desktop::before {
    background-image:
      linear-gradient(to right, rgba(236,233,222,.05) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(236,233,222,.05) 1px, transparent 1px);
  }

  .push pre { background: #0b0e16; color: #cdd6ff; }

  .btn { color: #0f1219; }
  .btn:hover, .btn:focus-visible { background: #a3b2ff; border-color: #a3b2ff; }
  .nav-out, .footer-out { color: var(--ink) !important; }

  /* the catalogue rows: contrast that survives a dim screen */
  .row-name { color: #e9e6db; }
  .row-why { color: #a6a294; }
  .row:hover, .row:focus-visible { background: rgba(139, 157, 255, .09); }
  .row-meta { color: #6d7488; }

  .group-title { color: #b3afa2; }
  .stage-why { color: #a6a294; }
  .stage-meta, .stage-hint { color: #7d8497; }

  .night { background: #0f121a; }
}

/* ── chonk mode, closing statement, night callout ────────── */

.chonk-toggle {
  margin-left: 16px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chonk-toggle:hover { color: var(--ink); border-color: var(--ink); }
.chonk-toggle[aria-pressed="true"] {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

.closing {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 140px) var(--gut) 0;
  text-align: center;
}
.closing-kicker {
  margin: 0 0 18px;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.closing-line {
  margin: 0 auto;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(22px, 2.6vw, 36px);
  line-height: 1.24; letter-spacing: -.02em;
  max-width: 24ch;
}

.night-callout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-top: clamp(28px, 3.5vw, 48px);
}
.night-callout canvas {
  width: 168px; height: 168px; image-rendering: pixelated; display: block;
}
.night-callout p {
  margin: 0; font-size: 14px; line-height: 1.8; color: #b8c0d8; max-width: 44ch;
}
@media (max-width: 720px) {
  .night-callout { grid-template-columns: 1fr; }
  .night-callout canvas { width: 128px; height: 128px; }
}

/* the night head no longer carries an index */
.night-head { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }

/* ── bigger state previews ───────────────────────────────── */

.row {
  grid-template-columns: 64px minmax(130px, 176px) 1fr auto;
  gap: 16px;
  padding: 10px 8px 10px 0;
}
.row canvas { width: 64px; height: 64px; }
.row-name { font-size: 13px; }
.row-why { font-size: 12px; }
.row-num { font-size: 9px; color: var(--muted); opacity: .7; }

@media (max-width: 900px) {
  .row { grid-template-columns: 64px 1fr; }
}

/* ── the bar, as macOS actually draws it ─────────────────── */

.term-bar { justify-content: flex-start; gap: 14px; }

.lights { display: flex; gap: 8px; }
.lights i {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .25);
}
.lights i:nth-child(1) { background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }

.term-title { color: #9aa3b8; }

.term-cmd {
  display: flex;
  align-items: center;
  gap: 12px;
}
#term-sprite {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  margin: -10px 0 -10px 4px;
  opacity: .95;
}

/* ── the headline can breathe ────────────────────────────── */

h1 { line-height: 1.1; }
