/* Hallmark · macrostructure: live instrument stage (plate centre, cabled controls), then dark field, wall and method · genre: atmospheric · tone: technical · anchor hue: tile red · theme: studied-DNA (source: L.I.S.A. by Locomotive, brand/INSPO.md) · nav: N9 edge-aligned · footer: Ft5 statement
 * Hallmark · pre-emit critique: see brand/SLOP-AUDIT.md */
@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('/assets/fonts/dm-mono.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --light: #d6d6d3; --mid: #b6b6b3; --edge: #83837f;
  --ink: #111112; --night: #0d0d0e; --cream: #ede6d6; --tile: #e5164f;
  --hair: rgba(17, 17, 18, .38); --hair-night: rgba(237, 230, 214, .22); --soft-night: #b9b4a8;
  --slab-hi: #1c1c1e; --slab-mid: #0b0b0c; --slab-lo: #070708; --well: #050506; --plate: #1a1a1b; --go-off: #3a3a3b; --readout: #cfcbc0;
  --shade-50: rgba(5, 5, 6, .5); --shade-58: rgba(5, 5, 6, .58); --shade-55: rgba(5, 5, 6, .55); --shade-20: rgba(5, 5, 6, .2); --tag: rgba(8, 8, 9, .82);
  --glint-09: rgba(237, 230, 214, .09); --glint-18: rgba(237, 230, 214, .18); --glint-05: rgba(237, 230, 214, .05);
  --font-body: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif; --font-mono: 'DM Mono', monospace;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}
html { font-size: clamp(15px, .35vw + 10px, 20px); background: var(--mid); scroll-behavior: auto; overflow-x: clip; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font: 400 1rem/1.4 var(--font-body); overflow-x: clip; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd, fieldset { margin: 0; padding: 0; border: 0; }
h1, h2, h3 { overflow-wrap: anywhere; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.go:active:not(:disabled), .plain:active:not(:disabled), .glyph:active, .coin:active, .ca:active, .mark:active { opacity: .7; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

#sweep, #night, #grain { position: fixed; inset: 0; pointer-events: none; }
#sweep { z-index: -3; background: radial-gradient(ellipse 72% 64% at 50% 42%, var(--light) 0, var(--mid) 48%, var(--edge) 100%); }
#night { z-index: -2; background: var(--night); opacity: 0; }
#grain { z-index: 50; opacity: .07; mix-blend-mode: overlay; background-size: 160px 160px; }

/* The room */
.lab { position: relative; min-height: 100svh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
#cables { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#cables path { fill: none; stroke: var(--ink); stroke-width: 1; stroke-linecap: round; }

.corners { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem clamp(1rem, 2.4vw, 2.6rem); }
.mark { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 500; }
.mark img { width: 1.9rem; height: 1.9rem; display: block; }
.corner-nav { display: flex; align-items: center; gap: clamp(.7rem, 1.5vw, 1.5rem); }
.glyph { display: inline-grid; place-items: center; width: 2rem; height: 2rem; transition: transform .25s var(--ease-out); }
.glyph:hover { transform: translateY(-2px); }
.plain { position: relative; display: inline-block; text-decoration: none; padding: .2rem 0; }
.plain::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease-out); }
.plain:hover::after { transform: scaleX(1); }
.plain:disabled { opacity: .9; }
.plain:disabled::after { display: none; }
.strong { font-weight: 500; }
.ca { padding: .2rem 0; white-space: nowrap; }
.ca:disabled { opacity: .85; color: inherit; cursor: default; }

.bench { position: relative; z-index: 2; display: grid; grid-template-columns: clamp(15rem, 19vw, 22rem) minmax(0, 1fr) clamp(16rem, 21vw, 24rem); gap: clamp(1.2rem, 3vw, 3.5rem); align-items: center; padding: .25rem clamp(1rem, 2.4vw, 2.6rem) .9rem; }

/* Controls */
.controls { display: grid; gap: .72rem; }
.controls h1 { font-size: clamp(1.45rem, 1.75vw, 2.05rem); line-height: 1.12; font-weight: 500; letter-spacing: -.02em; margin-bottom: .5rem; }
.row { display: block; }
.row label, .row legend, .field-w label, .field-w legend { display: flex; justify-content: space-between; width: 100%; padding: 0; font-size: .86rem; }
output { font-variant-numeric: tabular-nums; }
.seed-line { display: flex; gap: .7rem; align-items: baseline; }
input:not([type=range]), textarea, select { width: 100%; background: none; border: 0; border-bottom: 1px solid color-mix(in oklab, currentColor 62%, transparent); border-radius: 0; padding: .28rem 0; }
input:not([type=range]):focus, textarea:focus, select:focus { outline: 0; border-bottom: 2px solid currentColor; padding-bottom: calc(.28rem - 1px); }
textarea { resize: none; display: block; }
select { appearance: auto; }
select option { color: var(--ink); background: var(--light); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 1.3rem; background: none; margin: 0; display: block; cursor: grab; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
input[type=range]::-moz-range-track { height: 1px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: .95rem; height: .95rem; margin-top: calc(-.475rem + .5px); border-radius: 50%; background: var(--ink); transition: transform .18s var(--ease-out); }
input[type=range]::-moz-range-thumb { width: .95rem; height: .95rem; border: 0; border-radius: 50%; background: var(--ink); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.3); }
.choices { display: flex; flex-wrap: wrap; gap: .1rem .95rem; padding-top: .12rem; }
.choices button { padding: .12rem 0; border-bottom: 1px solid transparent; transition: border-color .2s var(--ease-out); font-size: .94rem; }
.choices button:hover { border-bottom-color: var(--hair); }
.choices button[aria-pressed=true] { border-bottom: 2px solid currentColor; font-weight: 500; }
.stains { display: flex; gap: .5rem; padding-top: .3rem; }
.stains button { width: 1.45rem; height: 1.45rem; border-radius: 50%; box-shadow: 0 0 0 1px var(--hair); transition: transform .2s var(--ease-out); }
.stains button:hover { transform: scale(1.12); }
.stains button[aria-pressed=true] { box-shadow: 0 0 0 2px var(--mid), 0 0 0 3.5px var(--ink); }
.keep { display: flex; flex-wrap: wrap; gap: .1rem 1rem; font-size: .88rem; padding-top: .2rem; }

/* The plate */
.stage { position: relative; display: grid; place-items: center; perspective: 1500px; }
.shadow { position: absolute; left: 12%; right: 12%; bottom: -3%; height: 9%; background: radial-gradient(closest-side, var(--shade-50), transparent); filter: blur(10px); }
.slab { position: relative; width: min(100%, calc(100svh - 12.6rem)); min-width: 16rem; padding: .85rem .85rem .55rem; border-radius: 1.5rem; background: linear-gradient(160deg, var(--slab-hi) 0, var(--slab-mid) 42%, var(--slab-lo) 100%); box-shadow: inset 0 0 0 1px var(--glint-09), inset 0 1px 0 var(--glint-18), 0 2.2rem 3.6rem -1.2rem var(--shade-58); transform-style: preserve-3d; will-change: transform; }
.dish { position: relative; display: block; width: 100%; border-radius: .8rem; overflow: hidden; background: var(--well); }
.dish canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.dish:focus-visible { outline-color: var(--cream); }
.reseed { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); padding: .22rem .6rem; border-radius: .3rem; background: var(--tag); color: var(--cream); font: 400 .8rem var(--font-mono); white-space: nowrap; }
.readout { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; padding: .55rem .15rem 0; color: var(--readout); font: 400 .74rem/1.5 var(--font-mono); font-variant-numeric: tabular-nums; }

/* Launch slip */
.slip { display: grid; gap: .72rem; }
.slip h2 { font-size: clamp(1.1rem, 1.3vw, 1.5rem); font-weight: 500; letter-spacing: -.01em; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 6.2rem; gap: .9rem; align-items: end; }
.writer { display: flex; flex-wrap: wrap; gap: 0 .7rem; font-size: .84rem; align-items: baseline; }
.go { width: 100%; padding: .78rem 1rem; border-radius: .45rem; background: var(--ink); color: var(--cream); font-weight: 500; transition: transform .2s var(--ease-out); }
.go:hover:not(:disabled) { transform: translateY(-1px); }
.go:disabled { background: var(--go-off); }
.say { font-size: .86rem; min-height: 0; }
.say:empty { display: none; }
.say a { text-decoration: underline; }
.say.bad { font-weight: 500; }
.fee { font-size: .8rem; line-height: 1.38; }

/* Live coin rail */
.rail { position: relative; z-index: 2; overflow: hidden; border-top: 1px solid var(--hair); padding: .55rem 0; }
.rail:hover .rail-run, .rail:focus-within .rail-run { animation-play-state: paused; }
.rail-note { padding: .25rem clamp(1rem, 2.4vw, 2.6rem); font-size: .88rem; }
.rail-run { display: flex; width: max-content; animation: drift 110s linear infinite; }
@keyframes drift { to { transform: translateX(-50%); } }
.coin { display: inline-flex; align-items: center; gap: .45rem; padding: .1rem clamp(.8rem, 1.2vw, 1.3rem); white-space: nowrap; font-size: .88rem; font-variant-numeric: tabular-nums; transition: opacity .2s var(--ease-out); }
.coin:hover { opacity: .66; }
.coin img { width: 1.5rem; height: 1.5rem; border-radius: 50%; object-fit: cover; background: var(--shade-20); }
.coin b { font-weight: 500; }

/* Below the room: the light has gone */
.wall, .fieldlane, .method, .foot { position: relative; color: var(--cream); padding-inline: clamp(1rem, 2.4vw, 2.6rem); }
.wall { padding-top: clamp(9rem, 22vh, 15rem); padding-bottom: clamp(5rem, 12vh, 9rem); }
.wall h2, .fieldlane h2, .method h2 { font-size: clamp(3rem, 8vw, 9.5rem); line-height: .98; font-weight: 500; letter-spacing: -.035em; }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.word > span { display: inline-block; }
.wall-head, .field-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.2rem clamp(1.5rem, 4vw, 5rem); align-items: end; margin-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.wall-head p, .field-head p { max-width: 34rem; font-size: 1.05rem; }
.tabs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }
.tabs button { padding: .25rem 0; border-bottom: 1px solid transparent; color: var(--soft-night); transition: color .2s var(--ease-out); font-variant-numeric: tabular-nums; }
.tabs button:hover { color: var(--cream); }
.tabs button[aria-pressed=true] { color: var(--cream); border-bottom: 2px solid currentColor; font-weight: 500; }

.pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: clamp(3rem, 6vh, 5rem) clamp(1.5rem, 3vw, 3.5rem); }
.piece { position: relative; padding-top: 3.2rem; }
.piece::before { content: ''; position: absolute; left: 50%; top: 0; height: 3.2rem; width: 1px; background: var(--hair-night); }
.piece > img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .5rem; background: var(--plate); transition: transform .5s var(--ease-out); transform-origin: top center; }
.piece:hover > img { transform: rotate(-.7deg) translateY(3px); }
.piece h3 { font-size: 1.2rem; font-weight: 500; letter-spacing: -.01em; margin-top: .85rem; }
.piece h3 span { font-weight: 400; color: var(--soft-night); }
.piece p { color: var(--soft-night); font-size: .92rem; font-variant-numeric: tabular-nums; }
.piece-acts { display: flex; flex-wrap: wrap; gap: .1rem 1rem; margin-top: .4rem; font-size: .92rem; }
.piece-print { font: 400 .78rem/1.5 var(--font-mono); color: var(--soft-night); margin-top: .35rem; overflow-wrap: anywhere; }

.vacant { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 6rem); align-items: center; }
.vacant-art { position: relative; justify-self: center; width: min(100%, 68vh); padding-top: 12vh; }
.vacant-art::before { content: ''; position: absolute; left: 50%; top: 0; height: 12vh; width: 1px; background: var(--hair-night); }
.vacant-art canvas { display: block; width: 100%; height: auto; border-radius: .6rem; }
.vacant h3 { font-size: clamp(1.7rem, 3vw, 3.6rem); line-height: 1.06; font-weight: 500; letter-spacing: -.025em; max-width: 18em; margin-bottom: 1rem; }
.vacant p { max-width: 32rem; color: var(--soft-night); font-size: 1.05rem; margin-bottom: 1.2rem; }

.fieldlane { padding-top: clamp(4rem, 10vh, 8rem); padding-bottom: clamp(5rem, 12vh, 9rem); }
.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger th { padding: .5rem .6rem; text-align: left; font-weight: 400; font-size: .86rem; color: var(--soft-night); border-bottom: 1px solid var(--hair-night); }
.ledger td { padding: .62rem .6rem; border-bottom: 1px solid var(--hair-night); transition: background .2s var(--ease-out); }
.ledger tbody tr:hover td { background: var(--glint-05); }
.ledger .n { text-align: right; white-space: nowrap; }
.ledger th:first-child, .ledger td:first-child { padding-left: 0; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; text-align: right; }
.who { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.who img { width: 2.1rem; height: 2.1rem; border-radius: 50%; object-fit: cover; background: var(--plate); flex: none; }
.who b { font-weight: 500; display: block; }
.who small { display: block; color: var(--soft-night); font-size: .84rem; max-width: 20rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waiting { color: var(--soft-night); }

.method { padding-top: clamp(4rem, 10vh, 8rem); padding-bottom: clamp(5rem, 12vh, 9rem); }
.method-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 8rem); margin-top: clamp(2.5rem, 6vh, 4.5rem); }
.method-text { display: grid; gap: 1.1rem; font-size: clamp(1.1rem, 1.5vw, 1.65rem); line-height: 1.32; letter-spacing: -.01em; }
.proof { align-self: start; border-top: 1px solid var(--hair-night); padding-top: 1rem; }
.proof dl { margin-top: 1rem; display: grid; gap: .45rem; font: 400 .86rem/1.4 var(--font-mono); }
.proof dt { font-family: var(--font-body); }
.proof dl div { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.proof dt { color: var(--soft-night); }
.proof #pResult { margin-top: .8rem; font-weight: 500; min-height: 1.4em; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1.4rem; padding-bottom: 1.6rem; border-top: 1px solid var(--hair-night); margin-inline: 0; }
.foot p { color: var(--soft-night); font-size: .9rem; }
.foot-icons { display: flex; gap: .7rem; }

/* Ticket */
.ticket { width: min(32rem, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border: 0; padding: 1.4rem; background: var(--mid); color: var(--ink); overflow-y: auto; }
.ticket::backdrop { background: var(--shade-55); }
.ticket[open] { display: grid; gap: .9rem; align-content: start; }
.ticket-head { display: flex; gap: .8rem; align-items: center; }
.ticket-head img { width: 2.8rem; height: 2.8rem; border-radius: 50%; object-fit: cover; background: var(--shade-20); }
.ticket-head div { flex: 1; min-width: 0; }
.ticket h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -.01em; }
.ticket p { font-size: .9rem; font-variant-numeric: tabular-nums; }
#tChart { width: 100%; height: auto; display: block; border-radius: .4rem; background: var(--night); }
.t-empty:empty { display: none; }
.t-links { display: flex; gap: 1rem; }
.ticket a { text-decoration: underline; }

@media (max-width: 1080px) {
  .bench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .stage { grid-column: 1 / -1; order: -1; }
  .slab { width: min(100%, 78svh); }
  #cables { display: none; }
}
@media (max-width: 640px) {
  .bench { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .corners { padding-inline: .9rem; }
  .corner-nav { gap: .5rem; font-size: .9rem; }
  .mark span { display: none; }
  .ca { max-width: 6.2rem; line-height: 1.1; text-align: right; font-size: .78rem; }
  .slab { padding: .55rem .55rem .4rem; border-radius: 1.1rem; min-width: 0; }
  .readout { font-size: .68rem; }
  .wall-head, .field-head, .method-grid, .vacant { grid-template-columns: minmax(0, 1fr); }
  .opt { display: none; }
  .who small { max-width: 6.2rem; }
  .who b { max-width: 6.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .who { gap: .45rem; }
  .who img { width: 1.7rem; height: 1.7rem; }
  .ledger th, .ledger td { padding-inline: .3rem; font-size: .9rem; }
  .wall { padding-top: 14rem; }
}
@media (prefers-reduced-motion: reduce) {
  .rail-run { animation: none; overflow-x: auto; width: auto; }
  .plain::after, .glyph, .piece > img, .go, .coin { transition: none; }
  html { scroll-behavior: auto; }
}
