/*
KONBINI core: tokens, primitives, components, and the catalog's own spec
furniture. See DESIGN.md.

Two themes on one set of role names. Light is the daytime poster: a winter
sky falling into snow-white paper. Dark is the same poster at night: the sky
goes to ink, the paper to blue snow, and the glass is the brightest thing on
the street. Light sits on bare :root; dark is reachable by OS preference or
by the catalog's toggle, and an explicit choice wins in both directions.
*/

:root {
  color-scheme: light;

  /* ---- UI roles: day ---- */
  --field-top: #5fb2dd;     /* top stop of the one gradient */
  --field-mid: #8ecbe9;     /* middle stop, at 55% */
  --field-low: #c9e6f4;     /* horizon stop */
  --paper: #f4f8fa;         /* the page, and the ground under every scene */
  --plate: #ffffff;         /* raised plates: buttons, fields, chips, frames */
  --lit: #ffffff;           /* whatever catches light: display type on the field */
  --ink: #2563eb;           /* every word on paper; links; primary plates */
  --ink-strong: #2b3a55;    /* the strongest ink: pixel-step borders, labels, hover */
  --accent: #f08c1e;        /* the sign's warm accent: stripes and marks, never text */
  --recede: #a8cede;        /* whatever is far away: flat shadows, disabled */

  /* ---- art ramp: the inks pixel illustration is drawn with ----
     Seven alias a UI role; --art-line is authored per theme, because the
     outline that is right beside text is wrong around a silhouette at night. */
  --art-lit: var(--lit);
  --art-line: #2b3a55;
  --art-far: var(--recede);
  --art-haze: var(--field-low);
  --art-ground: var(--paper);
  --art-detail: var(--ink);
  --art-accent: var(--accent);
  --art-glass: var(--field-top);

  /* ---- type ---- */
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-cjk: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;

  /* ---- layout ---- */
  --page-max: 1180px;
  --page-pad: clamp(1.25rem, 5vw, 4rem);
  --measure: 62ch;
  --measure-note: 24ch;

  /* integer pixel scale for the hero scene (176x104 grid) */
  --scene-px: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    /* night: the same poster after dark, never a neutral grey */
    --field-top: #0a1430;
    --field-mid: #1b2d5a;
    --field-low: #3d5590;
    --paper: #0e1629;
    --plate: #17223d;
    --lit: #f1f5fb;
    --ink: #8db3ff;
    --ink-strong: #dbe5f4;
    --accent: #ff9b3d;
    --recede: #34466f;
    --art-line: #506596;
    --art-glass: var(--lit);
  }
}

/* explicit choice wins in both directions - the catalog has a toggle */
:root[data-theme="dark"] {
  color-scheme: dark;
  /* night: the same poster after dark, never a neutral grey */
  --field-top: #0a1430;
  --field-mid: #1b2d5a;
  --field-low: #3d5590;
  --paper: #0e1629;
  --plate: #17223d;
  --lit: #f1f5fb;
  --ink: #8db3ff;
  --ink-strong: #dbe5f4;
  --accent: #ff9b3d;
  --recede: #34466f;
  --art-line: #506596;
  --art-glass: var(--lit);
}

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

html {
  scroll-padding-top: 5.5rem; /* anchors land below the sticky masthead */
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.6;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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

code {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-strong);
}

/* ---------- primitives ---------- */

/* the one permitted gradient: vertical, the field */
.k-field {
  background: linear-gradient(180deg, var(--field-top) 0%, var(--field-mid) 55%, var(--field-low) 100%);
}

.k-display {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--lit);
}

.k-kana {
  font-family: var(--font-cjk);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.k-caption {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: lowercase;
}

.k-captions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.k-body {
  color: var(--ink);
  max-width: var(--measure);
}

.k-footnote {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: var(--measure-note); /* ragged right by nature */
}

.k-pageno {
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* sign band: lit/accent/lit fascia held by art-line hairlines. It is an
   illustrated object, so its hairline is an art ink, not a text ink. */
.k-band {
  height: 24px;
  background: var(--accent);
  border-top: 6px solid var(--lit);
  border-bottom: 6px solid var(--lit);
  box-shadow: 0 -2px 0 var(--art-line), 0 2px 0 var(--art-line);
  margin: 2px 0; /* room for the hairline shadows */
}

.k-band--thin {
  height: 14px;
  border-top: 4px solid var(--lit);
  border-bottom: 4px solid var(--lit);
}

/* ---------- components ---------- */

.k-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.k-link:hover,
.k-link.is-hover {
  color: var(--ink-strong);
  text-decoration-thickness: 2px;
}

/* buttons: poster plates with a 2px pixel-step border (edge shadows that leave
   the corners notched) and a flat recede shadow; states snap, nothing eases */
.k-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  padding: 10px 22px;
  background: var(--plate);
  color: var(--ink);
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong),
    4px 4px 0 var(--recede);
  margin: 2px 6px 6px 2px; /* reserve space for border + shadow */
}

.k-btn:hover,
.k-btn.is-hover {
  transform: translate(-2px, -2px);
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong),
    6px 6px 0 var(--recede);
}

.k-btn:active,
.k-btn.is-active {
  transform: translate(4px, 4px);
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong);
}

.k-btn--primary {
  background: var(--ink);
  color: var(--plate);
}

.k-btn:disabled {
  background: var(--paper);
  color: var(--recede);
  cursor: not-allowed;
  transform: none;
  box-shadow:
    0 -2px 0 var(--recede),
    0 2px 0 var(--recede),
    -2px 0 0 var(--recede),
    2px 0 0 var(--recede);
}

/* chips: miniature sign-band stripes; a toggle, so they are buttons */
.k-chip {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.6;
  text-transform: lowercase;
  color: var(--ink);
  background: var(--plate);
  border: none;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  padding: 3px 12px;
  cursor: pointer;
}

.k-chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--plate);
}

.k-chip:disabled {
  color: var(--recede);
  border-color: var(--recede);
  cursor: not-allowed;
}

/* pagination: poster folios */
.k-pagination {
  display: inline-flex;
  align-items: baseline;
  gap: 1rem;
  font-weight: 700;
  color: var(--ink-strong);
}

.k-pagination .current {
  color: var(--ink);
  font-weight: 800;
}

.k-pagination button {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
}

.k-pagination button:hover {
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.k-pagination button:disabled {
  color: var(--recede);
  text-decoration: none;
  cursor: not-allowed;
}

/* entry: plate field on paper, strong bottom rule, ink caret */
.k-entry {
  display: block;
}

.k-entry > label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink-strong);
  margin-bottom: 6px;
}

.k-input {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  width: 100%;
  max-width: 260px;
  background: var(--plate);
  color: var(--ink-strong);
  caret-color: var(--ink);
  border: none;
  border-bottom: 2px solid var(--ink-strong);
  border-radius: 0;
  padding: 8px 10px;
}

.k-input::placeholder {
  color: var(--ink);
  opacity: 1;
}

.k-input:focus {
  border-bottom-color: var(--ink);
}

.k-input:disabled {
  background: var(--recede);
  border-bottom-color: var(--recede);
  color: var(--ink-strong);
  cursor: not-allowed;
}

/* ---------- hero poster ---------- */

.poster-sky {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(3.5rem, 9vh, 6.5rem) 1rem 0;
}

.poster-title {
  font-size: clamp(3.25rem, 12vw, 8rem);
  text-align: center;
}

.poster-sub {
  margin-top: 1rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: lowercase;
  color: var(--ink-strong);
  text-align: center;
}

.poster-scene {
  position: relative;
  z-index: 1;
  margin-top: clamp(1.5rem, 5vh, 3.5rem);
  /* the scene's own ground strip (10 grid rows) overlaps into the paper half
     so the horizon lines up exactly at the scene's ground line */
  margin-bottom: calc(-10 * var(--scene-px));
}

.poster-scene svg {
  display: block;
  width: calc(176 * var(--scene-px));
  height: calc(104 * var(--scene-px));
  shape-rendering: crispEdges;
}

.poster-snow {
  background: var(--paper);
  padding: clamp(2.5rem, 6vh, 4.5rem) var(--page-pad) 3rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(2rem, 5vh, 3.5rem);
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
}

.poster-kana {
  font-size: clamp(3.5rem, 16vw, 10rem);
  letter-spacing: 0.04em;
  text-align: center;
}

.poster-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.poster-foot .thesis {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.thesis b {
  color: var(--ink-strong);
}

/* ---------- motion: the only two authored moments ---------- */

@keyframes k-hop-a {
  0% { transform: none; }
  46% { transform: translate(3px, 0); }
  58% { transform: translate(3px, -2px); }
  64% { transform: translate(3px, 0); }
  100% { transform: none; }
}

@keyframes k-hop-b {
  0% { transform: none; }
  31% { transform: translate(-4px, -1px); }
  55% { transform: none; }
  100% { transform: none; }
}

@keyframes k-away {
  0% { opacity: 1; transform: none; }
  72% { opacity: 1; transform: translate(2px, 0); }
  80% { opacity: 0; transform: translate(2px, 0); }
  94% { opacity: 1; transform: none; }
  100% { opacity: 1; transform: none; }
}

.k-bird-1 { animation: k-hop-a 9s steps(1, end) infinite; }
.k-bird-2 { animation: k-hop-b 13s steps(1, end) infinite 2s; }
.k-bird-3 { animation: k-away 17s steps(1, end) infinite 5s; }

@keyframes k-drift {
  from { transform: translateX(0); }
  to { transform: translateX(28px); }
}

.k-cloud { animation: k-drift 160s steps(28) infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  .k-bird-1, .k-bird-2, .k-bird-3, .k-cloud { animation: none; }
}

/* ---------- catalog spreads ---------- */

.spread {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) var(--page-pad);
}

.spread-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.spread-head h2,
.t-section {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--ink);
}

.spread-head .n {
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink-strong);
  white-space: nowrap;
}

.spread h3 {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  color: var(--ink-strong);
  margin: 2.75rem 0 1rem;
}

.spread p {
  color: var(--ink);
  max-width: var(--measure);
  margin-bottom: 0.75rem;
}

.spread p.k-footnote {
  max-width: var(--measure-note); /* the footnote keeps its narrow measure inside spreads */
}

.spread .lede {
  font-size: 1.0625rem;
  margin-bottom: 2rem;
}

.spread .lede b,
.spread p b {
  color: var(--ink-strong);
}

.spread-folio {
  display: flex;
  justify-content: flex-end;
  margin-top: 3rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.row--tight {
  gap: 1rem;
  align-items: center;
}

.cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.lbl {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink-strong);
}

/* specimen field: the gradient block display type floats in */
.specimen-field {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 520px;
}

.specimen-field .k-display {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

.specimen-field .k-caption {
  color: var(--ink-strong); /* small type on the field is ink-strong, never lit */
}

.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 2.5rem;
}

.icon-grid .cell {
  align-items: center;
}

.icon-grid svg {
  width: 48px;
  height: 48px;
  shape-rendering: crispEdges;
}

.scale-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2.5rem;
}

.scale-demo svg {
  shape-rendering: crispEdges;
  display: block;
}

/* vertical kana column */
.kana-column {
  writing-mode: vertical-rl;
  font-family: var(--font-cjk);
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 0.1em;
  line-height: 1;
}

/* ============================================================
   SPEC FURNITURE
   The catalog's own parts: masthead, implementer brief, token
   tables, day/night swatches, scale bars, callouts, do/don't,
   the shader stage. Set in the same language as everything
   else - plates with pixel-step borders, accent stripes that
   never carry text, flat shadows. None of this is a component
   the system ships.
   ============================================================ */

/* ---- sticky masthead: a paper strip with the thin sign band under it ---- */
.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
}

.mast-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0.5rem var(--page-pad) 0.25rem;
}

.mast-brand {
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.mast nav {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}

.mast nav::-webkit-scrollbar {
  display: none;
}

.mast nav a {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.mast nav a:hover {
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.mast .k-btn {
  padding: 6px 14px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* ---- implementer brief: the one poster plate that is all text ---- */
.brief {
  background: var(--plate);
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong),
    8px 8px 0 var(--recede);
  margin: 2px 10px 10px 2px;
  padding: 1.75rem 2rem 2rem;
  border-top: 6px solid var(--accent);
  max-width: 820px;
}

.brief .hd {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  color: var(--ink-strong);
  margin-bottom: 1rem;
}

.brief ol {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.brief li {
  color: var(--ink);
}

.brief li::marker {
  font-weight: 800;
  color: var(--ink-strong);
}

.brief b {
  color: var(--ink-strong);
}

/* ---- token tables ---- */
.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.table-wrap + .table-wrap {
  margin-top: 2rem;
}

table.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: var(--ink);
}

table.spec th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink-strong);
  padding: 0 1rem 0.5rem 0;
  border-bottom: 2px solid var(--ink-strong);
}

table.spec td {
  padding: 0.625rem 1rem 0.625rem 0;
  border-bottom: 2px solid var(--recede);
  vertical-align: middle;
}

table.spec td:first-child {
  font-weight: 700;
  color: var(--ink-strong);
  white-space: nowrap;
}

table.spec td.v {
  white-space: nowrap;
  font-weight: 700;
}

table.spec td.d {
  line-height: 1.55;
  min-width: 16rem;
}

table.spec td.d b {
  color: var(--ink-strong);
}

/* ---- day / night swatches: each plate split, day left and night right ---- */
.duo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.duo .plate {
  background: var(--plate);
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong);
  margin: 2px;
}

.duo .halves {
  display: flex;
  height: 64px;
}

.duo .halves i {
  flex: 1;
  display: block;
}

.duo .cap {
  padding: 0.625rem 0.75rem 0.75rem;
  border-top: 2px solid var(--ink-strong);
}

.duo .nm {
  display: block;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--ink-strong);
}

.duo .role {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink);
  margin-top: 0.25rem;
}

.duo .hex {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-strong);
}

.duo .hex span {
  flex: 1;
}

/* ---- scale bars: whole steps, flat ink ---- */
.scale-bar {
  height: 12px;
  background: var(--ink);
}

/* ---- form specimens ---- */
.plate-demo {
  width: 96px;
  height: 56px;
  background: var(--plate);
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong);
  margin: 2px 10px 10px 2px;
}

.plate-demo--rest {
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong),
    4px 4px 0 var(--recede);
}

.plate-demo--lift {
  transform: translate(-2px, -2px);
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong),
    6px 6px 0 var(--recede);
}

.plate-demo--frame {
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong),
    8px 8px 0 var(--recede);
}

/* the notch, magnified: a 2px border drawn at 8x so the empty corner shows */
.notch-demo {
  display: block;
  width: 96px;
  height: 96px;
  shape-rendering: crispEdges;
}

/* ---- callout: a plate with the accent stripe on top ---- */
.callout {
  background: var(--plate);
  border-top: 3px solid var(--accent);
  padding: 1rem 1.25rem 1.125rem;
  margin-top: 2rem;
  max-width: 70ch;
  color: var(--ink);
  line-height: 1.65;
}

.callout b {
  color: var(--ink-strong);
}

.callout-note {
  margin-top: 1rem;
  font-size: 0.9375rem;
}

/* ---- do / do not ---- */
.dodont {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dodont section {
  background: var(--plate);
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 6px solid var(--ink);
}

.dodont .do {
  border-top-color: var(--ink);
}

.dodont .dont {
  border-top-color: var(--accent);
}

.dodont .hd {
  font-size: 1.0625rem;
  font-weight: 800;
  text-transform: lowercase;
  color: var(--ink-strong);
  margin-bottom: 0.75rem;
}

.dodont ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dodont li {
  color: var(--ink);
  line-height: 1.55;
}

.dodont b {
  color: var(--ink-strong);
}

/* ---- screen: the shader stage and its CSS fallback ---- */
.shader-row {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.shader-cell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* The stage IS the fallback: the one gradient, exactly as the static design
   draws it. The canvas sits on top and is transparent until its first frame. */
.shader-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong);
  margin: 2px;
}

.shader-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0; /* transparent until the first frame lands; it snaps in, never fades */
}

.shader-stage .k-display {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: clamp(2.5rem, 6vw, 4rem);
  pointer-events: none;
}

/* ---- composition specimen: one poster plate ---- */
.spec-poster {
  background: var(--plate);
  box-shadow:
    0 -2px 0 var(--ink-strong),
    0 2px 0 var(--ink-strong),
    -2px 0 0 var(--ink-strong),
    2px 0 0 var(--ink-strong),
    8px 8px 0 var(--recede);
  margin: 2rem 10px 10px 2px;
  max-width: 720px;
}

.spec-field {
  padding: 2.25rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.spec-field .k-display {
  font-size: clamp(2rem, 5vw, 3rem);
}

.spec-field .k-caption {
  color: var(--ink-strong); /* small type on the field is ink-strong, never lit */
  letter-spacing: 0.28em;
}

.spec-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.item-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 2px solid var(--paper);
}

.item-list li:last-child {
  border-bottom: none;
}

.item-list svg {
  width: 32px;
  height: 32px;
  flex: none;
  shape-rendering: crispEdges;
}

.item-list .item {
  font-weight: 700;
  color: var(--ink-strong);
}

.item-list .note {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink);
}

.item-list .tally {
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border-top: 3px solid var(--accent);
  padding: 2px 10px;
  white-space: nowrap;
}

.spec-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- footer ---------- */

.k-footer {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 2.5rem var(--page-pad) 4rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.k-footer .note {
  font-size: 0.8125rem;
  color: var(--ink-strong);
  max-width: 52ch;
}

/* ---------- responsive: integer scene steps, stacking captions ---------- */

@media (min-width: 1500px) {
  :root { --scene-px: 4px; }
}

@media (max-width: 700px) {
  :root { --scene-px: 2px; }
}

@media (max-width: 640px) {
  .k-captions {
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    text-align: center;
  }

  .poster-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .spread-head {
    flex-direction: column;
    gap: 0.25rem;
  }

  .scale-demo {
    gap: 1.5rem;
  }

  .mast-row {
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
  }

  .mast nav {
    order: 3;
    flex-basis: 100%;
  }

  .mast .k-btn {
    margin-left: auto;
  }

  table.spec td.d {
    min-width: 12rem;
  }

  .brief,
  .spec-body,
  .spec-field {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (max-width: 380px) {
  :root { --scene-px: 2px; }

  .poster-sky {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}
