/**
 * Components — every reusable piece of the almanac. Consumes tokens only.
 * Index: art · running head · section head · chapter plate · chamfer panel ·
 * roundel · tags · links · departures board · ticker · chapter panel ·
 * bar chart + figure tile · route map · capability grid · boarding pass ·
 * correspondence · specimen frame · pull quote · masthead
 */

/* ---------- Art (inline SVG ink drawings) ---------- */
.art { width: 100%; height: auto; overflow: visible; }
.art .k { fill: var(--ink); }
.art .p { fill: var(--paper); }
.art .b { fill: var(--blue); }
.art .bd { fill: var(--blue-deep); }
.art .r { fill: var(--red); }
.art .hb { fill: url(#ht-blue); }
.art .hk { fill: url(#ht-ink); }
.art .l, .art .l1, .art .l3, .art .lp { stroke-linecap: round; stroke-linejoin: round; }
.art .l  { stroke: var(--ink); stroke-width: 2; }
.art .l1 { stroke: var(--ink); stroke-width: 1.2; }
.art .l3 { stroke: var(--ink); stroke-width: 3.6; }
.art .lp { stroke: var(--paper); stroke-width: 1.6; fill: none; }
.art path.l, .art path.l1, .art path.l3 { fill: none; }
.art .p.l, .art .p.l1, .art .p.l3 { fill: var(--paper); }
.art .rough { filter: url(#rough); }
.art .brush { filter: url(#brush); }
.art .svg-letter { font: 500 15px var(--f-cond); fill: var(--ink); text-anchor: middle; }
.art .rocket-type { font: 500 13px var(--f-cond); letter-spacing: .3em; fill: var(--ink); }
.art-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  .drift { animation: drift 14s ease-in-out infinite alternate; transform-box: fill-box; }
  .drift--b { animation-duration: 19s; animation-delay: -6s; }
  @keyframes drift { from { transform: translate(-10px, 4px) rotate(-2deg); } to { transform: translate(14px, -8px) rotate(2deg); } }
}

/* ---------- Running page header ---------- */
.running-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4);
  font: 400 var(--t-xs)/1 var(--f-body); text-transform: uppercase; letter-spacing: var(--wide-track);
  padding-block: var(--s-4) var(--s-3);
  border-bottom: var(--rule);
}
@media (max-width: 600px) { .running-head { letter-spacing: .12em; } }
.running-head__folio { font-family: var(--f-cond); font-weight: 500; letter-spacing: .1em; font-size: var(--t-sm); }
.running-head--right { flex-direction: row-reverse; }

/* ---------- Section head ---------- */
.section-head { display: grid; gap: var(--s-3); margin-block: var(--s-7) var(--s-6); max-width: 60rem; }
.section-head__kicker { font: 500 var(--t-xs)/1.2 var(--f-cond); letter-spacing: var(--wide-track); text-transform: uppercase; display: flex; gap: var(--s-3); align-items: center; }
.section-head__kicker::before { content: ""; width: 28px; height: 10px; background: var(--blue); box-shadow: -3px 2px 0 var(--ink); }
.section-head__title { font-family: var(--f-display); font-size: var(--t-2xl); }
.section-head__lede { font-size: var(--t-lg); line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }

/* ---------- Chapter plate: outlined numeral in black block + blue band ---------- */
.plate { display: flex; align-items: stretch; min-height: 64px; position: relative; }
.plate__num {
  flex: none; display: grid; place-items: center;
  background: var(--ink); min-width: 1.15em; padding: .06em .14em;
  font: 700 clamp(2.6rem, 2rem + 2vw, 3.6rem)/1 var(--f-cond);
  color: transparent; -webkit-text-stroke: 1.6px var(--paper); paint-order: stroke;
  position: relative; z-index: 1;
}
.plate__band {
  flex: 1; display: flex; align-items: center; position: relative;
  background: var(--blue); padding: var(--s-2) var(--s-5);
}
.plate__band::after {          /* mis-registered keyline */
  content: ""; position: absolute; inset: 0;
  border: 1px solid var(--ink); transform: translate(-4px, 3px); pointer-events: none; opacity: .55;
}
.plate__title { font-family: var(--f-display); font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); line-height: 1.05; }
.plate--lg { min-height: 120px; }
.plate--lg .plate__num { font-size: clamp(4.4rem, 3rem + 5vw, 8rem); -webkit-text-stroke-width: 2.4px; }
.plate--lg .plate__title { font-size: var(--t-2xl); }
.plate--sm .plate__num { font-size: 2.2rem; -webkit-text-stroke-width: 1.3px; }
.plate--sm .plate__title { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); }
.plate--sm { min-height: 54px; }

/* ---------- Chamfered blue info panel ---------- */
.chamfer {
  --c: var(--chamfer);
  background: var(--blue); color: var(--ink);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  padding: var(--s-5);
}
.chamfer__title { font: 500 var(--t-sm)/1.2 var(--f-cond); text-transform: uppercase; letter-spacing: var(--caps-track); background: var(--ink); color: var(--paper); margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-4); padding: var(--s-3) var(--s-5) var(--s-3) calc(var(--s-5) + var(--c)); }
.facts { display: grid; gap: 0; margin: 0; }
.facts div { display: grid; gap: 2px; padding-block: var(--s-3); border-top: 1px solid rgba(22,22,22,.35); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { font: 500 var(--t-xs)/1.2 var(--f-cond); letter-spacing: var(--caps-track); text-transform: uppercase; }
.facts dd { margin: 0; font-size: var(--t-sm); line-height: 1.45; }

/* ---------- Roundel ---------- */
.roundel {
  aspect-ratio: 1; border-radius: 50%; background: var(--paper);
  display: grid; place-items: center; text-align: center; padding: 14%;
  box-shadow: 0 0 0 2px var(--ink), 5px -4px 0 2px var(--blue-deep);
  font-family: var(--f-display); line-height: 1.05;
}

/* ---------- Tags & links ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.tags li { font: 400 11px/1 var(--f-mono); letter-spacing: .04em; padding: 5px 7px; border: 1px solid var(--ink); }
.go {
  display: inline-flex; align-items: center; gap: .6em;
  font: 500 var(--t-sm)/1 var(--f-cond); letter-spacing: var(--caps-track); text-transform: uppercase;
  text-decoration: none; padding-block: 4px; border-bottom: 2px solid var(--ink);
}
.go__arrow { transition: transform 200ms var(--ease); }
.go:hover .go__arrow, a:hover > .go .go__arrow, .panel:hover .go__arrow { transform: translateX(4px); }
.btn {
  display: inline-flex; align-items: center; gap: .6em; text-decoration: none;
  font: 500 var(--t-sm)/1 var(--f-cond); letter-spacing: var(--caps-track); text-transform: uppercase;
  background: var(--ink); color: var(--paper); padding: 14px 20px; border: 0; cursor: pointer;
  box-shadow: 4px -3px 0 var(--blue);
  transition: box-shadow 200ms var(--ease);
}
.btn:hover { box-shadow: 6px -5px 0 var(--blue); }
.btn--ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); box-shadow: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; flex: none; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: blink 1.6s steps(2, jump-none) infinite; } @keyframes blink { 50% { opacity: .25; } } }

/* ---------- Departures board (split-flap) ---------- */
.board {
  background: var(--band); color: var(--on-band);
  padding: var(--s-4) clamp(10px, 2vw, var(--s-5)) var(--s-5);
  position: relative;
  box-shadow: 8px -6px 0 var(--blue);
}
.board__top { display: flex; justify-content: space-between; align-items: end; gap: var(--s-4); border-bottom: 1px solid var(--band-rule); padding-bottom: var(--s-3); margin-bottom: var(--s-3); }
.board__title { font: 700 clamp(1.4rem, 1rem + 2vw, 2.4rem)/1 var(--f-cond); letter-spacing: .12em; display: flex; gap: .5em; align-items: center; }
.board__title svg { width: 1.4em; fill: var(--on-band); }
.board__meta { font: 400 var(--t-xs)/1.4 var(--f-mono); color: var(--on-band-2); text-align: right; }
.board__clock { font: 500 var(--t-lg)/1 var(--f-mono); color: var(--on-band); }
.board { --h: clamp(22px, 1rem + 1vw, 32px); --cell: calc(var(--h) * .7 + 2px); }
.board__cols, .board__row { display: grid; grid-template-columns: calc(var(--cell) * 5) minmax(0, 1fr) calc(var(--cell) * 2) calc(var(--cell) * 8 + 14px) 1.4em; gap: clamp(6px, 1.4vw, 18px); align-items: center; }
.board__cols { font: 500 10px/1 var(--f-cond); letter-spacing: var(--wide-track); color: var(--on-band-2); padding: 0 var(--s-2) var(--s-2); }
.board__rows { list-style: none; display: grid; gap: 4px; }
.board__row { text-decoration: none; color: inherit; padding: 5px var(--s-2); border: 1px solid transparent; }
.board__row:hover, .board__row:focus-visible { border-color: var(--blue); outline: none; }
.board__row:hover .board__go { color: var(--blue); transform: translateX(3px); }
.board__go { font: 500 var(--t-md)/1 var(--f-cond); transition: transform 200ms var(--ease), color 200ms; }
.flaps { display: flex; gap: 2px; overflow: hidden; }
.flap {
  flex: none; width: calc(var(--h) * .7); height: var(--h);
  display: grid; place-items: center; position: relative;
  background: var(--band-2); border-radius: 2px;
  font: 500 calc(var(--h) * .64)/1 var(--f-mono); color: var(--on-band);
  text-transform: uppercase;
}
.flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--band); }
.flap.is-flip { animation: flip 90ms linear; }
@keyframes flip { 0% { transform: scaleY(1); } 50% { transform: scaleY(.15); } 100% { transform: scaleY(1); } }
.flaps--status .flap { color: var(--blue); }
.flaps--boarding .flap { color: var(--paper); background: #3a1a14; }
.board__status { display: flex; gap: 6px; align-items: center; }
.board__foot { margin-top: var(--s-3); font: 400 var(--t-xs)/1.4 var(--f-mono); color: var(--on-band-2); }
@media (max-width: 720px) {
  .board { --h: 19px; }
  .board__cols, .board__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .board__cols span:not(:first-child):not(:nth-child(4)), .board__row .board__gate, .board__row .board__go { display: none; }
  .board__cols span:first-child::after { content: " · DESTINATION"; }
  .board__flight { grid-column: 1; }
  .board__dest { grid-column: 1 / -1; grid-row: 2; }
  .board__status { grid-column: 2; grid-row: 1; justify-content: end; }
  .board__row { border-bottom: 1px solid var(--band-rule); padding-block: 8px; }
}

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-block: var(--rule); background: var(--blue); }
.ticker__track { display: flex; width: max-content; }
.ticker__list { display: flex; list-style: none; flex: none; }
.ticker__list li { font: 500 var(--t-sm)/1 var(--f-cond); letter-spacing: var(--caps-track); padding: 12px 0; white-space: nowrap; display: flex; align-items: center; }
.ticker__list li::after { content: "✦"; margin-inline: 1.4em; font-size: .8em; }
@media (prefers-reduced-motion: no-preference) {
  .ticker__track { animation: tick var(--tick-dur, 80s) linear infinite; }
  .ticker:hover .ticker__track { animation-play-state: paused; }
  @keyframes tick { to { transform: translateX(-50%); } }
}

/* ---------- Chapter panel ---------- */
.panel { position: relative; display: grid; gap: var(--s-4); align-content: start; padding-block: var(--s-5) var(--s-6); border-top: 3px solid var(--ink); }
.panel__art { position: relative; padding: 26px 4% 0; }
.panel__flight { position: absolute; top: 0; right: 0; font: 400 11px/1 var(--f-mono); letter-spacing: .08em; padding-top: var(--s-2); }
.panel__meta { font: 400 var(--t-xs)/1.4 var(--f-mono); color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.panel__stand { font-size: var(--t-md); line-height: 1.55; max-width: 52ch; margin: 0; }
.panel__link { text-decoration: none; }
.panel__link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.panel__link:focus-visible { outline: none; }
.panel:focus-within { outline: var(--focus); outline-offset: 6px; }
.panel__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.panel .art { transition: transform 500ms var(--ease); }
@media (prefers-reduced-motion: no-preference) { .panel:hover .art { transform: translateY(-4px) rotate(-.4deg); } }

/* ---------- Bar chart (1957 reversed bars) ---------- */
.chart {
  --c: 26px;
  display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: var(--s-5); align-items: center;
  background: var(--blue); padding: var(--s-5);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.chart__roundel { font-size: clamp(1rem, .8rem + .6vw, 1.35rem); text-transform: uppercase; letter-spacing: .04em; }
.chart__roundel small { display: block; font: 500 10px/1.2 var(--f-cond); letter-spacing: var(--caps-track); margin-top: .6em; }
.chart__body { display: grid; gap: 4px; min-width: 0; }
.chart__head { background: var(--ink); color: var(--paper); font: 500 var(--t-xs)/1 var(--f-cond); letter-spacing: var(--caps-track); padding: 7px 10px; text-transform: uppercase; display: flex; justify-content: space-between; gap: var(--s-3); }
.bar { display: grid; grid-template-columns: 6.2em 1fr; gap: 4px; align-items: stretch; }
.bar__val { background: var(--paper); font: 500 var(--t-sm)/1 var(--f-cond); padding: 7px 8px; text-align: right; letter-spacing: .04em; }
.bar__track { position: relative; display: flex; align-items: center; min-width: 0; }
.bar__fill { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--ink); transform-origin: left; }
.bar__label { position: relative; font: 500 11px/1.1 var(--f-cond); letter-spacing: .1em; padding: 0 10px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: var(--w); }
.bar--in .bar__label { margin-left: 0; width: var(--w); text-align: right; color: var(--paper); }
.chart__note { font: 400 11px/1.4 var(--f-mono); padding-top: var(--s-2); }
.js .chart .bar__fill { transform: scaleX(0); transition: transform 1100ms var(--ease); transition-delay: calc(var(--i, 0) * 110ms); }
.js .chart.is-in .bar__fill { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .js .chart .bar__fill { transform: none; } }
@media (max-width: 720px) {
  .chart { grid-template-columns: 1fr; }
  .chart__roundel { width: 160px; justify-self: center; }
  .bar__label { white-space: normal; }
}
.figtile { border-top: 3px solid var(--ink); padding-top: var(--s-3); display: grid; gap: var(--s-2); align-content: start; }
.figtile__num { font: 700 clamp(2.6rem, 2rem + 2.5vw, 4.4rem)/1 var(--f-cond); letter-spacing: .01em; color: transparent; -webkit-text-stroke: 1.6px var(--ink); text-shadow: 4px -3px 0 var(--blue); }
.figtile__label { font: 500 var(--t-xs)/1.3 var(--f-cond); letter-spacing: var(--caps-track); }
.figtile__unit { font-size: var(--t-sm); line-height: 1.4; color: var(--ink-2); margin: 0; }
.figtile__src { font: 400 10px/1.3 var(--f-mono); color: var(--ink-3); }

/* ---------- Route map ---------- */
.routemap { width: 100%; height: auto; }
.routemap .grat { stroke: var(--paper-3); stroke-width: 1; fill: none; }
.routemap .land { fill: var(--blue); }
.routemap .land-ht { fill: url(#ht-blue); }
.routemap .leg { fill: none; stroke: var(--ink); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.routemap .track { display: none; }
.routemap .trail { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 1.5 7; stroke-linecap: round; opacity: .4; }
.routemap .halo { fill: none; stroke: var(--red); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.routemap .port circle.ring { transform-box: fill-box; transform-origin: center; }
.routemap.is-anim .port circle.core { transition: fill .25s; }
.routemap.is-anim .port:not(.is-lit) circle.core { fill: var(--paper); }
@keyframes route-core { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes route-halo { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .routemap .port--now.is-pulse circle.core { animation: route-core 2.4s ease-in-out infinite; }
  .routemap .port--now.is-pulse .halo { animation: route-halo 2.4s ease-out infinite; }
}
.routemap .port circle.ring { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.routemap .port circle.core { fill: var(--ink); }
.routemap .port text { font: 500 13px var(--f-cond); letter-spacing: .12em; fill: var(--ink); text-anchor: middle; }
.routemap .port .yrs { font: 400 11px var(--f-mono); letter-spacing: 0; fill: var(--ink-3); }
.routemap .port--now circle.core { fill: var(--red); }
.routemap .port.start text { text-anchor: start; }
.routemap .port.end text { text-anchor: end; }
.routemap .compass text { font: 500 11px var(--f-cond); fill: var(--ink); text-anchor: middle; }
.legs { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); border-top: var(--rule); }
.leg-card { padding: var(--s-4) var(--s-4) var(--s-5) 0; border-bottom: var(--rule-soft); display: grid; gap: 6px; align-content: start; }
.leg-card__when { font: 400 var(--t-xs)/1 var(--f-mono); color: var(--ink-3); }
.leg-card__who { font: 500 var(--t-md)/1.2 var(--f-cond); letter-spacing: .08em; text-transform: uppercase; }
.leg-card__role { font-size: var(--t-sm); font-weight: 500; }
.leg-card__hl { font-size: var(--t-sm); line-height: 1.5; color: var(--ink-2); margin: 0; }

/* ---------- Capability grid ---------- */
.caps-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: var(--rule); border-left: var(--rule); }
.cap { padding: var(--s-5); border-right: var(--rule); border-bottom: var(--rule); display: grid; gap: var(--s-2); align-content: start; position: relative; }
.cap__n { font: 400 var(--t-xs)/1 var(--f-mono); color: var(--ink-3); }
.cap__name { font: 500 var(--t-md)/1.2 var(--f-cond); letter-spacing: .08em; text-transform: uppercase; }
.cap__text { font-size: var(--t-sm); line-height: 1.5; margin: 0; color: var(--ink-2); }
.cap::before { content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 0; background: var(--blue); transition: width 400ms var(--ease); }
.cap:hover::before { width: 100%; }

/* ---------- Boarding pass ---------- */
.pass { display: grid; grid-template-columns: 1.5fr 1fr; background: var(--paper); border: 2px solid var(--ink); box-shadow: 10px -8px 0 var(--blue); position: relative; }
.pass__main { padding: clamp(20px, 3vw, 40px); display: grid; gap: var(--s-4); align-content: start; }
.pass__stub { border-left: 2px dashed var(--ink); padding: var(--s-5); display: grid; align-content: space-between; gap: var(--s-4); background: var(--paper-2); position: relative; }
.pass__stub::before, .pass__stub::after { content: ""; position: absolute; left: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.pass__stub::before { top: -14px; clip-path: inset(50% 0 0 0); }
.pass__stub::after { bottom: -14px; clip-path: inset(0 0 50% 0); }
.pass__kicker { display: flex; justify-content: space-between; font: 500 var(--t-xs)/1 var(--f-cond); letter-spacing: var(--wide-track); border-bottom: var(--rule); padding-bottom: var(--s-3); }
.pass__title { font-family: var(--f-display); font-size: var(--t-2xl); }
.pass__grid { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: var(--s-2) var(--s-6); margin: 0; }
.pass__grid dt { font: 500 10px/1 var(--f-cond); letter-spacing: var(--wide-track); color: var(--ink-3); }
.pass__grid dd { margin: 4px 0 0; font: 500 var(--t-lg)/1 var(--f-mono); }
.pass__barcode { height: 38px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 7px, transparent 7px 9px, var(--ink) 9px 10px, transparent 10px 13px); }
@media (max-width: 820px) { .pass { grid-template-columns: 1fr; } .pass__stub { border-left: 0; border-top: 2px dashed var(--ink); } .pass__stub::before, .pass__stub::after { display: none; } .pass__grid { grid-template-columns: repeat(2, auto); } }

/* ---------- Correspondence (contact) ---------- */
.letters { list-style: none; border-top: 3px solid var(--ink); }
.letters a { display: grid; grid-template-columns: 9em 1fr auto; gap: var(--s-4); align-items: baseline; padding: var(--s-4) 0; border-bottom: var(--rule); text-decoration: none; }
.letters__k { font: 500 var(--t-xs)/1 var(--f-cond); letter-spacing: var(--wide-track); }
.letters__v { font: 400 var(--t-xl)/1.1 var(--f-display); overflow-wrap: anywhere; }
.letters a:hover .letters__v { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--blue-deep); }
.letters a:hover .go__arrow { transform: translateX(4px); }
@media (max-width: 600px) { .letters a { grid-template-columns: 1fr auto; } .letters__k { grid-column: 1 / -1; } }

/* ---------- Pull quote ---------- */
.pull p { font: inherit; margin: 0; max-width: none; }
.pull { margin: var(--s-7) 0; padding: var(--s-5) 0 var(--s-5) var(--s-6); border-left: 10px solid var(--blue); box-shadow: -14px 0 0 -10px var(--ink); font: 400 var(--t-xl)/1.2 var(--f-display); max-width: 30ch; }

/* ---------- Specimen frame ---------- */
.specimen-frame { border: 2px solid var(--ink); background: var(--paper); box-shadow: 8px -6px 0 var(--blue); }
.specimen-frame__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); background: var(--ink); color: var(--paper); padding: 8px var(--s-4); font: 500 var(--t-xs)/1 var(--f-cond); letter-spacing: var(--wide-track); }
.specimen-frame__bar span { display: inline-flex; gap: 8px; align-items: center; }
.specimen { min-height: 360px; position: relative; }
.specimen__placeholder { position: absolute; inset: 0; display: grid; place-items: center; font: 400 var(--t-xs)/1.5 var(--f-mono); color: var(--ink-3); text-align: center; padding: var(--s-5); background: var(--halftone-paper), var(--paper-2); }
.specimen-frame__cap { font: 400 var(--t-xs)/1.5 var(--f-mono); color: var(--ink-3); padding: var(--s-3) var(--s-4); border-top: var(--rule-soft); margin: 0; }

/* ---------- Masthead ---------- */
.masthead { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: var(--rule); }
.masthead__in { max-width: var(--page-max); margin: 0 auto; padding: 10px var(--gutter); display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); }
.masthead__brand { font: 400 var(--t-md)/1 var(--f-display); text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.masthead__nav { display: flex; gap: clamp(10px, 2vw, 28px); list-style: none; }
.masthead__nav a { font: 500 var(--t-xs)/1 var(--f-cond); letter-spacing: var(--caps-track); text-transform: uppercase; text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.masthead__nav a:hover { border-color: var(--blue-deep); }
@media (max-width: 760px) { .masthead__nav li:not(.keep) { display: none; } }

/* ---------- Specimens (shared) ---------- */
.specimen > [class^="sp-"] { padding: var(--s-5); }
.sp-note { font: 400 var(--t-xs)/1.55 var(--f-mono); color: var(--ink-3); margin: var(--s-4) 0 0; max-width: 70ch; }
.sp-note--band { color: var(--on-band-2); }
[class^="sp-"] canvas:focus-visible, .sp-term__out:focus-visible { outline: 3px solid var(--blue-deep); outline-offset: 2px; }
.sp-entropy__bar, .sp-mm__bar, .sp-bullet__bar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-bottom: var(--s-4); }
.sp-entropy__bar .btn, .sp-mm__bar .btn, .sp-bullet__bar .btn, .sp-ws__bar .btn { padding: 10px 14px; }
.sp-entropy__bar .btn[aria-pressed="true"], .sp-mm__bar .btn[aria-pressed="true"], .sp-bullet__bar .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: 4px -3px 0 var(--blue); }

/* specimen: entropy */
.sp-entropy__tog { font: 500 var(--t-xs)/1 var(--f-cond); letter-spacing: var(--caps-track); text-transform: uppercase; display: inline-flex; gap: 6px; align-items: center; }
.sp-entropy__src { font-size: var(--t-xs); color: var(--ink-3); margin-left: auto; }
.sp-entropy__stage { display: flex; justify-content: center; }
.sp-entropy canvas { display: block; touch-action: none; cursor: grab; background: var(--paper); box-shadow: 6px -5px 0 var(--blue); max-width: 100%; }
.sp-entropy__read { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: var(--s-5) 0 0; border-top: var(--rule); font-size: var(--t-xs); }
.sp-entropy__read div { padding: var(--s-2) var(--s-3) 0 0; }
.sp-entropy__read dt { font: 500 10px/1 var(--f-cond); letter-spacing: var(--wide-track); color: var(--ink-3); }
.sp-entropy__read dd { margin: 4px 0 0; font-size: var(--t-md); }

/* specimen: wordsearch */
.sp-ws__main { display: flex; flex-wrap: wrap; gap: var(--s-5); align-items: flex-start; justify-content: center; }
.sp-ws canvas { display: block; touch-action: none; cursor: crosshair; border: 0; box-shadow: 6px -5px 0 var(--blue); max-width: 100%; }
.sp-ws__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(90px, 1fr)); gap: 6px var(--s-5); font: 500 var(--t-md)/1.2 var(--f-cond); letter-spacing: var(--caps-track); }
.sp-ws__list li { padding-bottom: 4px; border-bottom: var(--rule-soft); }
.sp-ws__list li.is-found { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; background: var(--blue); }
.sp-ws__msg { margin: var(--s-4) 0 var(--s-3); font-size: var(--t-xs); color: var(--ink-2); }

/* specimen: minimap */
.sp-mm__modes { display: flex; gap: var(--s-2); }
.sp-mm__read { font-size: var(--t-xs); color: var(--ink-3); margin-left: auto; }
.sp-mm__stage { display: flex; justify-content: center; }
.sp-mm canvas { display: block; touch-action: none; cursor: ns-resize; max-width: 100%; box-shadow: 6px -5px 0 var(--blue); }

/* specimen: bullet */
.sp-bullet { --bh: 18px; }
.sp-bullet[data-size="s"] { --bh: 10px; } .sp-bullet[data-size="l"] { --bh: 30px; } .sp-bullet[data-size="xl"] { --bh: 44px; }
.sp-bullet__sizes { display: flex; gap: var(--s-2); }
.sp-bullet__rows { display: grid; gap: var(--s-5); }
.sp-bullet__row { margin: 0; display: grid; gap: 6px; }
.sp-bullet__row figcaption { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; font-size: var(--t-sm); }
.sp-bullet__row figcaption .mono { font-size: var(--t-xs); }
.sp-bullet__row small { font: 400 var(--t-xs)/1.4 var(--f-mono); color: var(--ink-3); }
.sp-bullet__g { position: relative; height: var(--bh); background: var(--paper-2); display: grid; grid-template-columns: 1fr 1fr 1fr; transition: height 300ms var(--ease); }
.sp-bullet__g i { display: block; }
.sp-bullet__g .b1 { background: var(--paper-3); } .sp-bullet__g .b2 { background: var(--paper-2); box-shadow: inset 1px 0 0 var(--paper), inset -1px 0 0 var(--paper); } .sp-bullet__g .b3 { background: var(--paper); border: 1px solid var(--paper-3); }
.sp-bullet__g .bar { position: absolute; left: 0; top: 33%; height: 34%; width: 0; background: var(--ink); transition: width 900ms var(--ease); }
.sp-bullet__g .mk { position: absolute; top: 12%; bottom: 12%; width: 3px; left: var(--mark); margin-left: -1.5px; background: var(--red); opacity: 0; transition: opacity 400ms 700ms; }
.sp-bullet__row.is-on .bar { width: var(--bar); } .sp-bullet__row.is-on .mk { opacity: 1; }
.sp-bullet__ax { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .sp-bullet__g .bar, .sp-bullet__g .mk, .sp-bullet__g { transition: none; } }

/* specimen: sabre */
.sp-sabre { text-align: center; }
.sp-sabre__screen { display: inline-block; max-width: 100%; padding: 14px; background: var(--ink); box-shadow: 8px -6px 0 var(--blue); }
.sp-sabre canvas { display: block; image-rendering: pixelated; max-width: 100%; outline-offset: 6px; touch-action: none; }
.sp-sabre__read { margin: var(--s-4) 0 var(--s-2); font-size: var(--t-xs); color: var(--ink-2); }
.sp-sabre__pad { display: inline-grid; grid-template-columns: repeat(4, 44px); gap: 6px; margin-bottom: var(--s-2); }
.sp-sabre__pad button { height: 44px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 14px var(--f-mono); cursor: pointer; }
.sp-sabre__pad button:active { background: var(--blue); }
.sp-sabre__bytes { font-size: 11px; color: var(--ink-3); margin: 0; }
.sp-sabre .sp-note { margin-inline: auto; text-align: left; }

/* specimens: terminals (emote-go, emote-cli) */
.sp-term { background: var(--band); color: var(--on-band); }
.sp-term__ctl { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); margin-bottom: var(--s-4); }
.sp-term fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.sp-term legend { padding: 0; margin-bottom: 6px; color: var(--on-band-2); font-size: var(--t-xs); letter-spacing: var(--wide-track); }
.sp-term label { font: 400 var(--t-xs)/1.4 var(--f-mono); display: flex; gap: 8px; align-items: center; }
.sp-term select, .sp-term input[type=text] { font: 400 var(--t-sm) var(--f-mono); background: var(--band-2); color: var(--on-band); border: 1px solid var(--band-rule); padding: 8px 10px; border-radius: 0; min-width: 0; }
.sp-term :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sp-term__out { margin: 0; min-height: 190px; padding: var(--s-4); background: var(--band-2); border: 1px solid var(--band-rule); font: 400 var(--t-xs)/1.7 var(--f-mono); white-space: pre-wrap; word-break: break-word; overflow-x: hidden; }
.sp-term .ln--ok::first-line { color: var(--on-band); } .sp-term .ln--cmd { color: var(--blue); } .sp-term .ln--warn { color: var(--on-band-2); }
.sp-term .ln--ok { color: var(--on-band); } .sp-term .ln { color: var(--on-band-2); }
.sp-term__bar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-top: var(--s-4); }
.sp-term .btn { background: var(--paper); color: var(--ink); } .sp-term__hint { font-size: var(--t-xs); color: var(--on-band-2); }
.sp-chip { font: 400 11px/1.3 var(--f-mono); background: transparent; color: var(--on-band); border: 1px solid var(--band-rule); padding: 6px 8px; cursor: pointer; text-align: left; }
.sp-chip:hover { border-color: var(--blue); }
.sp-cli__chips { display: grid; gap: 6px; }
.sp-cli__form { display: flex; gap: 8px; align-items: center; margin-bottom: var(--s-3); font-size: var(--t-xs); }
.sp-cli__form input { flex: 1; }
.specimen > .sp-term { min-height: 360px; }

/* specimen: emote-chat */
.sp-chat__pipe { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: var(--rule); }
.sp-chat__pipe li { padding: var(--s-2) var(--s-3); border-right: 1px solid var(--ink); display: grid; gap: 2px; align-content: start; font-size: 11px; line-height: 1.35; color: var(--ink-3); transition: background 250ms; }
.sp-chat__pipe li:last-child { border-right: 0; }
.sp-chat__pipe li b { font-size: 11px; color: var(--ink); letter-spacing: .08em; }
.sp-chat__pipe li.is-done { background: var(--paper-2); } .sp-chat__pipe li.is-on { background: var(--blue); color: var(--ink); }
.sp-chat__log { min-height: 170px; max-height: 260px; overflow-y: auto; padding: var(--s-3); background: var(--paper-2); display: flex; flex-direction: column; gap: var(--s-2); }
.sp-chat__empty { margin: auto; font-size: var(--t-xs); color: var(--ink-3); text-align: center; }
.sp-chat__b { max-width: 82%; padding: 8px 12px; font-size: var(--t-sm); line-height: 1.4; display: grid; gap: 2px; }
.sp-chat__b small { font-size: 10px; color: var(--ink-3); }
.sp-chat__b.is-you { align-self: flex-end; background: var(--blue); }
.sp-chat__b.is-bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--ink); }
.sp-chat__b.is-tag { align-self: flex-end; padding: 2px 6px; font-size: var(--t-xs); background: transparent; display: block; color: var(--ink-2); }
.sp-chat__say { display: grid; gap: 6px; margin: var(--s-4) 0; }
.sp-chat__say label { display: flex; gap: 8px; align-items: baseline; font-size: var(--t-sm); cursor: pointer; }
.sp-chat__bar { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.sp-chat__talk { touch-action: none; user-select: none; -webkit-user-select: none; }
.sp-chat__talk.is-held { box-shadow: 0 0 0 3px var(--red); }
.sp-chat__state { font-size: var(--t-xs); color: var(--ink-3); }
@media (max-width: 560px) {
  .sp-chat__pipe { grid-template-columns: repeat(2, 1fr); } .sp-chat__pipe li:nth-child(2) { border-right: 0; } .sp-chat__pipe li:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .sp-entropy__read { grid-template-columns: repeat(2, 1fr); } .specimen > [class^="sp-"] { padding: var(--s-4); }
  .sp-entropy__src { margin-left: 0; }
}
/* specimen: minimap — code + map split viewer */
.sp-mm__stage--split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-5); align-items: start; justify-content: stretch; }
.sp-mm__code { margin: 0; height: clamp(320px, 52vh, 540px); overflow: auto; background: var(--paper); border: 2px solid var(--ink); padding: 12px 14px 12px 0; font: 400 12.5px/1.6 var(--f-mono); color: var(--ink); tab-size: 4; box-shadow: 6px -5px 0 var(--blue); }
.sp-mm__code .ln { display: block; white-space: pre; padding-left: 52px; text-indent: -52px; }
.sp-mm__code .ln__n { display: inline-block; width: 40px; margin-right: 12px; text-align: right; color: var(--ink-3); opacity: .6; user-select: none; text-indent: 0; }
.sp-mm__code .tk-c { color: var(--ink-3); font-style: italic; }
.sp-mm__code .tk-k { color: var(--blue-deep); font-weight: 600; }
.sp-mm__code .tk-s { color: var(--red); }
.sp-mm__code .tk-p { color: var(--ink-2); }
.sp-mm__map canvas { image-rendering: pixelated; border: 2px solid var(--ink); }
@media (max-width: 640px) {
  .sp-mm__stage--split { grid-template-columns: 1fr; }
  .sp-mm__map { justify-self: center; }
  .sp-mm__code { height: 300px; font-size: 11.5px; }
}
/* specimen: sabre — VIC-20 walk player (from the sabre-wulf-vic20 atlas) */
.sp-vic__panel { background: #52C6D4; border-radius: 10px; padding: 20px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 8px -6px 0 var(--ink); }
.sp-vic__screen { position: relative; background: #0a0c10; border-radius: 4px; overflow: hidden; line-height: 0; }
.sp-vic__screen canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.sp-vic__screen canvas:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }
.sp-vic__scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.18) 3px 4px); }
.sp-vic__ctl { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 14px; font: 600 11px/1.2 var(--f-mono); letter-spacing: .1em; color: rgba(0,0,0,.72); }
.sp-vic__ctl label { display: inline-flex; align-items: center; gap: 8px; }
.sp-vic__ctl button, .sp-vic__ctl select { font: 600 11px/1 var(--f-mono); letter-spacing: .1em; background: rgba(0,0,0,.82); color: #e8f4f2; border: none; border-radius: 3px; padding: 12px 14px; min-height: 40px; cursor: pointer; }
.sp-vic__ctl input[type=range] { accent-color: #1a1a1a; }
.sp-vic__note { margin-left: auto; opacity: .75; }
@media (max-width: 640px) { .sp-vic__note { margin-left: 0; } .sp-vic__panel { padding: 12px; } }
