@font-face { font-family: "Chakra Petch"; src: url("/fonts/chakra-petch-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("/fonts/chakra-petch-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("/fonts/chakra-petch-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("/fonts/chakra-petch-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Spline Sans Mono"; src: url("/fonts/spline-sans-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Spline Sans Mono"; src: url("/fonts/spline-sans-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ground: #070605;
  --ink-hot: #ffdc04;
  --ink: #e3c271;
  --ink-mid: #b7963f;
  --ink-dim: #7d6830;
  --line: #6a5214;
  --line-lit: #c89a10;
  --wash: #0a0806;
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gap: 18px;
  --side: 128px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 400 18px/1.55 var(--display);
  min-height: 100svh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--mono); font-variant-ligatures: none; }

/* ---------------------------------------------------------------- the world */
.world { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.world-img {
  position: absolute; inset: -8%;
  background: url("/img/ground.jpg") center/cover no-repeat;
  filter: blur(14px) saturate(0.85);
  opacity: 0.62;
  animation: drift 64s ease-in-out infinite alternate;
  will-change: transform;
}
.world-dark {
  position: absolute; inset: 0;
  background: radial-gradient(130% 100% at 50% 0%, rgba(7,6,5,0.2), rgba(7,6,5,0.76) 62%, #050404 100%);
}
@keyframes drift {
  from { transform: translate3d(-1.4%, -1%, 0) scale(1.04); }
  to   { transform: translate3d(1.4%, 1.6%, 0) scale(1.09); }
}

/* ------------------------------------------------- the cut corner primitive */
.cut { position: relative; isolation: isolate; --c: 14px; }
[data-cut="sm"] { --c: 10px; }
[data-cut="md"] { --c: 14px; }
[data-cut="lg"] { --c: 18px; }
.cut::before, .cut::after {
  content: ""; position: absolute; pointer-events: none;
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.cut::before { inset: 0; background: var(--line); z-index: -2; }
.cut::after  { inset: 1px; background: var(--wash); z-index: -1; }

/* ------------------------------------------------------------- the frame
   The outer frame keeps a see through interior, so the shaft wall behind the
   page stays visible inside it. Its hairline is built from eight background
   layers: four straight edges and four 45 degree corner cuts. */
.frame {
  --fc: 24px;
  --fw: 1px;
  position: relative; z-index: 1;
  margin: 20px;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  gap: var(--gap);
  align-content: start;
  min-height: calc(100svh - 40px);
  background:
    linear-gradient(var(--line-lit), var(--line-lit)) var(--fc) 0 / calc(100% - var(--fc) * 2) var(--fw) no-repeat,
    linear-gradient(var(--line-lit), var(--line-lit)) var(--fc) 100% / calc(100% - var(--fc) * 2) var(--fw) no-repeat,
    linear-gradient(var(--line-lit), var(--line-lit)) 0 var(--fc) / var(--fw) calc(100% - var(--fc) * 2) no-repeat,
    linear-gradient(var(--line-lit), var(--line-lit)) 100% var(--fc) / var(--fw) calc(100% - var(--fc) * 2) no-repeat,
    linear-gradient(45deg, transparent calc(50% - 0.6px), var(--line-lit) calc(50% - 0.6px), var(--line-lit) calc(50% + 0.6px), transparent calc(50% + 0.6px)) 0 0 / var(--fc) var(--fc) no-repeat,
    linear-gradient(-45deg, transparent calc(50% - 0.6px), var(--line-lit) calc(50% - 0.6px), var(--line-lit) calc(50% + 0.6px), transparent calc(50% + 0.6px)) 100% 0 / var(--fc) var(--fc) no-repeat,
    linear-gradient(-45deg, transparent calc(50% - 0.6px), var(--line-lit) calc(50% - 0.6px), var(--line-lit) calc(50% + 0.6px), transparent calc(50% + 0.6px)) 0 100% / var(--fc) var(--fc) no-repeat,
    linear-gradient(45deg, transparent calc(50% - 0.6px), var(--line-lit) calc(50% - 0.6px), var(--line-lit) calc(50% + 0.6px), transparent calc(50% + 0.6px)) 100% 100% / var(--fc) var(--fc) no-repeat;
}
/* the four tick marks that sit outside the frame's corners in his picture */
.ticks { position: absolute; inset: -11px; pointer-events: none; }
.ticks i { position: absolute; width: 11px; height: 11px; }
.ticks i::before, .ticks i::after { content: ""; position: absolute; background: var(--line); }
.ticks i::before { left: 0; top: 0; width: 11px; height: 1px; }
.ticks i::after { left: 0; top: 0; width: 1px; height: 11px; }
.ticks i:nth-child(1) { left: 0; top: 0; }
.ticks i:nth-child(2) { right: 0; top: 0; transform: scaleX(-1); }
.ticks i:nth-child(3) { left: 0; bottom: 0; transform: scaleY(-1); }
.ticks i:nth-child(4) { right: 0; bottom: 0; transform: scale(-1); }

/* ------------------------------------------------------------ 1. the title */
.titlerow {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 20px var(--gap);
  align-items: flex-start; justify-content: space-between;
  padding-bottom: 4px;
}
.ident { min-width: 0; flex: 1 1 420px; }
.titlerow > .states { flex: 0 0 auto; }
.ident-name {
  margin: 0;
  font: 600 clamp(32px, 3.4vw, 58px)/1.02 var(--display);
  letter-spacing: 0.012em;
  color: var(--ink-hot);
  text-shadow: 0 0 26px rgba(255, 220, 4, 0.22);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3em;
}
.ident-no { font-weight: 400; color: var(--ink-mid); font-size: 0.56em; letter-spacing: 0.08em; }
.ident-slash { font-weight: 400; color: var(--ink-dim); font-size: 0.56em; }
.ident-exe { font-weight: 400; color: var(--ink-mid); font-size: max(17px, 0.4em); letter-spacing: 0.02em; margin-left: -0.28em; }
.ident-strap {
  margin: 10px 0 0;
  font-size: 17px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mid);
}
.states { display: flex; gap: 10px; flex-wrap: wrap; }
.state { min-width: 128px; }
.state-in { padding: 12px 20px 13px; display: grid; gap: 2px; }
.state-k { font-size: 17px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.state-v { font: 600 20px/1.1 var(--display); color: var(--ink); letter-spacing: 0.04em; }
.state.is-live .state-v { color: var(--ink-hot); }
.state.is-siren::before { background: #ff5a1f; }
.state.is-siren .state-v { color: #ff8a3d; }

/* ---------------------------------------------------------- 2. the console */
.console {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--gap);
  min-height: clamp(360px, calc(100svh - 468px), 660px);
}
.hero { min-height: 0; }
.hero-in { position: absolute; inset: 1px; overflow: hidden; display: flex; flex-direction: column; clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
.hero-pit { position: relative; flex: 1 1 auto; min-height: 0; }
.shaft { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: auto; }
.hero-bird {
  position: absolute; left: 26px; bottom: 22px;
  width: clamp(64px, 11%, 132px); height: auto;
  filter: drop-shadow(0 0 22px rgba(255, 220, 4, 0.45));
  pointer-events: none;
}
.hero-read {
  flex: 0 0 auto; margin: 0;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap;
  padding: 15px 26px 16px;
  border-top: 1px solid var(--line);
}
.hero-read-k { font-size: 16px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); }
.hero-read-v { font: 600 20px/1.2 var(--display); color: var(--ink-hot); letter-spacing: 0.03em; }

.rail { min-width: 0; display: grid; grid-template-rows: repeat(5, minmax(88px, 1fr)); gap: 12px; }
.cell-in {
  height: 100%;
  display: grid; align-content: center;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  padding: 16px 24px;
}
.cell-k {
  grid-area: 1 / 1; font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mid);
  display: flex; align-items: baseline; gap: 10px; min-width: 0;
}
.cell-note { font-style: normal; font-size: 15px; letter-spacing: 0.06em; color: var(--ink-dim); text-transform: none; }
.cell-v {
  grid-area: 2 / 1; font: 600 clamp(26px, 2.1vw, 40px)/1.08 var(--display);
  color: var(--ink-hot); letter-spacing: 0.01em; margin-top: 4px;
  min-width: 0; overflow-wrap: anywhere;
}
.cell-v.is-quiet { font-size: clamp(20px, 1.35vw, 26px); color: var(--ink-mid); }
.state-v { }
.cell-i { grid-area: 1 / 2 / 3 / 3; width: 56px; height: 56px; align-self: center; opacity: 0.9; }
.cell-bar .cell-in { grid-template-columns: minmax(0, 1fr); }
.cell-bar .cell-k, .cell-bar .cell-v { grid-area: auto; }
.bar { position: relative; height: 10px; margin-top: 12px; background: rgba(106, 82, 20, 0.35); }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: var(--span); background: var(--ink-hot); box-shadow: 0 0 14px rgba(255, 220, 4, 0.5); transition: width 0.6s ease; }

/* -------------------------------------------------------- 3. the key row */
.keyrow { grid-column: 1; }
.keyrow-in { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.key {
  display: grid; justify-items: center; align-content: center; gap: 10px;
  padding: 18px 14px; min-height: 112px;
  color: var(--ink-mid);
  border-left: 1px dotted var(--line);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.key:first-child { border-left: 0; }
.key img { width: 52px; height: 52px; opacity: 0.72; transition: opacity 0.15s ease, filter 0.15s ease; }
.key span { font-size: 17px; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; }
.key:hover, .key:focus-visible { color: var(--ink); background: rgba(255, 220, 4, 0.05); }
.key:hover img, .key:focus-visible img { opacity: 1; }
.key[aria-current="page"] { color: var(--ink-hot); background: rgba(255, 220, 4, 0.09); }
.key[aria-current="page"] img { opacity: 1; filter: drop-shadow(0 0 10px rgba(255, 220, 4, 0.55)); }

.lamp { grid-column: 2; }
.lamp-in { height: 100%; display: grid; place-items: center; padding: 16px; }
.cell-name { display: none; font-size: 17px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mid); }
.lamp-in img { width: 64px; height: 64px; opacity: 0.3; filter: grayscale(0.7); transition: opacity 0.3s ease, filter 0.3s ease; }
.lamp.is-lit::before { background: #ff5a1f; }
.lamp.is-lit .lamp-in img { opacity: 1; filter: drop-shadow(0 0 22px rgba(255, 138, 61, 0.85)); animation: pulse 1.1s steps(2, end) infinite; }
@keyframes pulse { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.45; } }

/* ------------------------------------------------------------ 4. the band */
.band { grid-column: 1; }
.band-in { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 18px 26px; min-height: 96px; }
.band-arrow { font: 600 22px/1 var(--mono); color: var(--ink-dim); }
.band-ca { min-width: 0; flex: 1 1 340px; display: grid; gap: 4px; }
.band-k { font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mid); }
.band-v { font: 400 clamp(15px, 1.12vw, 18px)/1.4 var(--mono); color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.band-v.is-empty { color: var(--ink-dim); font-family: var(--display); letter-spacing: 0.04em; user-select: auto; }
.band-keys { display: flex; gap: 10px; flex-wrap: wrap; }
.bkey {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  font: 500 17px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); background: rgba(255, 220, 4, 0.06);
  border: 1px solid var(--line); cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.bkey img { width: 22px; height: 22px; object-fit: contain; }
.bkey:hover:not([disabled]):not([aria-disabled="true"]),
.bkey:focus-visible { background: rgba(255, 220, 4, 0.16); color: var(--ink-hot); }
.bkey:active:not([disabled]):not([aria-disabled="true"]) { transform: translateY(1px); }
.bkey[disabled], .bkey[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.badge { grid-column: 2; }
.badge-in { height: 100%; display: grid; place-items: center; padding: 16px; }
.badge-in img { width: 60px; height: 60px; opacity: 0.85; }

/* ----------------------------------------------------------- 5. the sheet */
.sheet { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.sheet:empty { display: none; }
.mod { min-width: 0; }
.mod-in { min-width: 0; padding: 26px 28px 30px; }
.mod-h { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 0 0 20px; }
.mod-t { margin: 0; font: 600 clamp(26px, 2.4vw, 36px)/1.14 var(--display); color: var(--ink-hot); letter-spacing: 0.02em; }
.mod-s { margin: 0; font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.mod p { margin: 0 0 14px; max-width: 72ch; color: var(--ink); }
.mod p:last-child { margin-bottom: 0; }
.mod strong { color: var(--ink-hot); font-weight: 600; }

/* the rung table, built as rules and cells like the reference's own grammar */
.tbl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tbl-r { min-width: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr) 150px 140px 176px; gap: 1px; background: var(--line); }
/* cells are opaque: a see-through cell lets the rule colour under the grid muddy every row */
.tbl-h .tbl-c { background: #120e07; color: var(--ink); font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; padding: 15px 24px; }
.tbl-c { background: var(--wash); padding: 18px 24px; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; }
.tbl-r:not(.tbl-h) { cursor: pointer; }
.tbl-r:not(.tbl-h):hover .tbl-c, .tbl-r.is-open .tbl-c { background: #19130a; }
.tbl-time { white-space: nowrap; }
.addr-short { display: none; }
.tbl-note { margin: 16px 0 0 !important; max-width: none !important; font-size: 15px; line-height: 1.6; color: var(--ink-dim) !important; }
.tbl-k { font: 600 21px/1.1 var(--display); color: var(--ink-hot); letter-spacing: 0.02em; }
.tbl-a { font: 400 16px/1.4 var(--mono); color: var(--ink-mid); }
.tbl-p { font: 600 19px/1.1 var(--display); color: var(--ink); }
.tbl-m { font-size: 16px; color: var(--ink-mid); }

.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.row { min-width: 0; background: var(--wash); display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1px 24px; padding: 18px 26px; align-items: baseline; }
.row > dt { font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mid); margin: 0; }
.row > dd { margin: 0; min-width: 0; overflow-wrap: anywhere; word-break: break-word; color: var(--ink); }
.row > dd.mono, .row > dd .mono { font: 400 17px/1.5 var(--mono); }

.steps { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.step-in { padding: 24px 26px 26px; height: 100%; display: grid; align-content: start; gap: 10px; }
.step-n { font: 600 42px/1 var(--display); color: var(--ink-hot); }
.step-t { font: 600 20px/1.2 var(--display); color: var(--ink); letter-spacing: 0.04em; }
.step-d { font-size: 17px; color: var(--ink-mid); margin: 0; }

.dls { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.dl-in { padding: 24px 26px 26px; height: 100%; display: grid; align-content: start; gap: 12px; }
.dl-in .bkey { margin-top: auto; justify-self: stretch; }
.step-d, .dl-d { max-width: none; }
.dl-t { font: 600 21px/1.2 var(--display); color: var(--ink-hot); letter-spacing: 0.02em; }
.dl-d { font-size: 17px; color: var(--ink-mid); margin: 0; }

.feed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feed-i { min-width: 0; background: var(--wash); display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 10px 24px; padding: 18px 26px; align-items: center; }
.feed-t { font-size: 16px; color: var(--ink-dim); font-family: var(--mono); }
.feed-x { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.feed-l { font-size: 16px; color: var(--ink-mid); font-family: var(--mono); }
.mod .empty { max-width: none; color: var(--ink-mid); padding: 22px; background: var(--wash); border: 1px solid var(--line); }

.fld { display: grid; gap: 8px; margin: 0 0 16px; }
.fld label { font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mid); }
.fld input, .fld textarea {
  font: 400 17px/1.5 var(--mono); color: var(--ink);
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line);
  padding: 14px 18px; min-height: 52px; width: 100%;
}
.fld input:focus-visible, .fld textarea:focus-visible { outline: 2px solid var(--ink-hot); outline-offset: 1px; }
.mod .out { max-width: none; font: 400 17px/1.6 var(--mono); color: var(--ink); background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); padding: 18px 20px; overflow-wrap: anywhere; white-space: pre-wrap; min-height: 58px; }
.out.is-bad { color: #ff8a3d; border-color: #7a3a12; }
.out.is-good { color: var(--ink-hot); }
.code { max-width: 100%; font: 400 16px/1.65 var(--mono); color: var(--ink-mid); background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); padding: 20px 22px; overflow-x: auto; overscroll-behavior-x: contain; white-space: pre; }

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

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(14px);
  padding: 14px 26px; background: #0d0a05; border: 1px solid var(--line-lit); color: var(--ink-hot);
  font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 9;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------- widths */
@media (max-width: 1240px) {
  .tbl-r { grid-template-columns: 104px minmax(0, 1fr) 128px 168px; }
  .tbl-r > .tbl-c:nth-child(4) { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  :root { --side: 104px; --gap: 14px; }
  .console { grid-template-columns: minmax(0, 1fr); }
  .rail { grid-template-rows: none; grid-auto-rows: minmax(110px, auto); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console { height: auto; }
  .hero { min-height: clamp(360px, 46vh, 480px); }
  .cell-bar { grid-column: 1 / -1; }
  .hero { min-height: clamp(360px, 44vh, 480px); }
}
@media (max-width: 640px) {
  .rail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .frame { --fc: 16px; margin: 12px; padding: 18px; grid-template-columns: minmax(0, 1fr); min-height: calc(100svh - 24px); }
  .ticks { inset: -9px; }
  .ticks i { width: 9px; height: 9px; }
  .ticks i::before { width: 9px; }
  .ticks i::after { height: 9px; }
  .keyrow, .lamp, .band, .badge { grid-column: 1; }
  /* on a phone the two side cells are only ornament, so they go; the lamp comes back when it is lit */
  .badge, .lamp:not(.is-lit) { display: none; }
  .keyrow-in { grid-template-columns: minmax(0, 1fr); }
  .key { grid-template-columns: 44px minmax(0, 1fr); justify-items: start; align-items: center; gap: 18px; min-height: 68px; padding: 12px 22px; border-left: 0; border-top: 1px dotted var(--line); }
  .key:first-child { border-top: 0; }
  .key img { width: 44px; height: 44px; }
  .key span { text-align: left; }
  .lamp-in, .badge-in { grid-template-columns: 44px minmax(0, 1fr); justify-items: start; align-items: center; gap: 18px; padding: 12px 22px; min-height: 68px; }
  .lamp-in img, .badge-in img { width: 44px; height: 44px; }
  .cell-name { display: block; }
  .states { width: 100%; }
  .state { flex: 1 1 0; min-width: 0; }
  .state-in { padding: 11px 16px 12px; }
  .state-k { font-size: 16px; letter-spacing: 0.08em; }
  .hero-read { padding: 13px 20px 14px; }
  /* a phone gets one card per rung: rung and pot on top, the address, the rough time */
  .tbl-h { display: none; }
  .tbl-r:not(.tbl-h) {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k p" "a a" "t t";
    gap: 6px 14px; background: var(--wash); padding: 15px 18px;
  }
  .tbl-r:not(.tbl-h):hover, .tbl-r.is-open { background: #19130a; }
  .tbl-r:not(.tbl-h) > .tbl-c { background: transparent !important; padding: 0; }
  .tbl-r > .tbl-k { grid-area: k; }
  .tbl-r > .tbl-p { grid-area: p; justify-self: end; }
  .tbl-r > .tbl-a { grid-area: a; font-size: 15px; }
  .tbl-r > .tbl-age { display: none; }
  .tbl-r > .tbl-time { grid-area: t; display: flex; font-size: 15px; color: var(--ink-dim); }
  .addr-full { display: none; }
  .addr-short { display: inline; }
  .tbl-k { font-size: 19px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .steps, .dls { grid-template-columns: minmax(0, 1fr); }
  .feed-i { grid-template-columns: minmax(0, 1fr); }
  .mod-in { padding: 22px 20px 24px; }
  .code { white-space: pre-wrap; overflow-x: visible; word-break: break-word; }
}
@media (max-width: 420px) {
  body { font-size: 17px; }
  .frame { margin: 8px; padding: 14px; }
  .ticks { inset: -6px; }
  .ticks i { width: 7px; height: 7px; }
  .ticks i::before { width: 7px; }
  .ticks i::after { height: 7px; }
  .states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .state { min-width: 0; }
  .state-in { padding: 10px 12px 11px; }
  .state-k { font-size: 16px; letter-spacing: 0.02em; }
  .state-v { font-size: 18px; overflow-wrap: anywhere; }
  .ident-strap { font-size: 16px; letter-spacing: 0.1em; }
  .band-in { padding: 16px 18px; gap: 16px; }
  .band-keys { width: 100%; }
  .bkey { flex: 1 1 auto; padding: 0 16px; }
  .hero-bird { left: 16px; bottom: 16px; width: 86px; }
}

/* Laptop screens: the band with the contract and the links closes the FIRST screen,
   so on short viewports everything above it gets denser, never pushed below the fold. */
@media (min-width: 1021px) and (max-height: 1000px) {
  :root { --gap: 12px; --side: 112px; }
  .frame { padding: 18px; margin: 12px; min-height: calc(100svh - 24px); }
  .ident-name { font-size: clamp(30px, 2.7vw, 46px); }
  .ident-strap { margin-top: 6px; font-size: 15px; }
  .state-in { padding: 8px 16px 9px; }
  .state-k { font-size: 14px; }
  .state-v { font-size: 18px; }
  .console { min-height: clamp(300px, calc(100svh - 348px), 600px); }
  .rail { grid-template-rows: repeat(5, minmax(60px, 1fr)); gap: 8px; }
  .cell-in { padding: 8px 20px; }
  .cell-k { font-size: 14px; }
  .cell-v { font-size: clamp(22px, 1.55vw, 30px); margin-top: 1px; }
  .cell-v.is-quiet { font-size: clamp(18px, 1.2vw, 22px); }
  .cell-i { width: 40px; height: 40px; }
  .bar { margin-top: 8px; height: 8px; }
  .hero-read { padding: 9px 22px 10px; }
  .hero-read-k { font-size: 14px; }
  .hero-read-v { font-size: 17px; }
  .key { min-height: 78px; padding: 10px 10px; gap: 6px; }
  .key img { width: 36px; height: 36px; }
  .key span { font-size: 15px; }
  .lamp-in img { width: 48px; height: 48px; }
  .badge-in img { width: 46px; height: 46px; }
  .band-in { min-height: 72px; padding: 10px 22px; gap: 16px; }
  .band-k { font-size: 14px; }
  .bkey { min-height: 44px; padding: 0 16px; font-size: 15px; }
  .bkey img { width: 18px; height: 18px; }
}
@media (min-width: 1021px) and (max-height: 760px) {
  .frame { padding: 16px; margin: 10px; min-height: calc(100svh - 20px); }
  .ticks { inset: -8px; }
  .ticks i { width: 9px; height: 9px; }
  .ticks i::before { width: 9px; }
  .ticks i::after { height: 9px; }
  .console { min-height: 280px; }
  .rail { grid-template-rows: repeat(5, minmax(54px, 1fr)); gap: 6px; }
  .cell-in { padding: 6px 18px; }
  .cell-v { font-size: clamp(20px, 1.45vw, 26px); }
  .cell-i { width: 34px; height: 34px; }
  .key { min-height: 68px; padding: 8px; }
  .key img { width: 32px; height: 32px; }
  .band-in { min-height: 64px; padding: 8px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .world-img { animation: none; }
  .lamp.is-lit .lamp-in img { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
