@font-face { font-family: "Pixelify Sans"; src: url("/fonts/pixelify-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/manrope.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* One system for the whole page.
   Space: 4 / 8 / 12 / 16 / 24 / 32 / 48. Type: 16 / 20 / 24 / 32 / 48 / 64 (the kit's floor for any label is 16).
   One container: max 1440 px, the same gutter on the wall and in the sections below it. */
:root {
  --night: #14111A; --brick: #6B2E2A; --mortar: #3A2422;
  --gold: #FFD23F; --gold-hi: #FFE27A; --chrome: #FFF4D6; --paint: #8A8F98;
  --ink: #14111A; --paper: #FFF4D6; --muted: #4A4253; --line: #DCCFB0;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --t1: 16px; --t2: 20px; --t3: 24px; --t4: 32px; --t5: 48px; --t6: 64px;
  --gutter: 48px;
  --container: min(1440px, calc(100% - 2 * var(--gutter)));
  --display: "Pixelify Sans", "Manrope", system-ui, sans-serif;
  --text: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --shadow: 6px 6px 0 var(--mortar);
}
@media (max-width: 1280px) { :root { --gutter: 32px; } }
@media (max-width: 900px) { :root { --gutter: 16px; } }

* { box-sizing: border-box; }
html { background: var(--night); scroll-behavior: smooth; }
body { margin: 0; color: var(--chrome); font: 400 var(--t1)/1.6 var(--text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: var(--mono); font-size: 0.875em; background: rgba(20, 17, 26, 0.08); padding: 0 4px; word-break: break-word; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--gold); color: var(--ink); padding: 12px 24px; font-weight: 800; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid #3FE0FF; outline-offset: 3px; }

/* ---------- the wall: as tall as the window allows, the picture held to the bottom so the curb is always seen ---------- */
.stage {
  --imgH: 56.28vw;                                    /* the picture's height at this width (1672 x 941) */
  position: relative; height: min(var(--imgH), max(600px, 100svh)); overflow: hidden; background: var(--brick); isolation: isolate;
}
.stage-bg, .stage-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-bg img { object-fit: cover; object-position: 50% 100%; }
.marks { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; z-index: 1; }
.lampglow { position: absolute; left: 44%; top: calc(100% - var(--imgH) * 0.905); width: 12%; height: 6%; z-index: 0; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 220, 140, 0.55), rgba(255, 200, 100, 0)); opacity: 0; animation: flicker 9s steps(1) infinite; }
@keyframes flicker { 0%, 61%, 63%, 100% { opacity: 0; } 62% { opacity: 1; } }
.stage-in { position: absolute; top: 0; bottom: 0; left: max(var(--gutter), calc((100% - 1440px) / 2)); right: max(var(--gutter), calc((100% - 1440px) / 2)); z-index: 3; pointer-events: none; }
.stage-in > * { pointer-events: auto; }

/* the right column: the box (pages), the stickers (links), the contract tape. One width, one right edge, 12 px apart. */
.rail { position: absolute; right: 0; top: max(var(--s4), calc(100% - var(--imgH) * 0.985)); width: clamp(300px, 24vw, 380px); display: flex; flex-direction: column; gap: var(--s3); }
.box { position: relative; }
.box-art { width: 100%; height: auto; }
.menu { display: none; }
.breakers { position: absolute; left: 12.5%; right: 12.5%; top: 31%; bottom: 22%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: var(--s2); }
.breakers a { display: flex; align-items: center; justify-content: center; gap: var(--s2); padding: 0 1em; min-height: 44px; text-decoration: none; font: 700 var(--t1)/1 var(--text); color: var(--ink); background: var(--chrome); border: 2px solid var(--ink); }
.breakers a i { flex: none; width: 12px; height: 8px; background: var(--ink); position: relative; }
.breakers a i::after { content: ""; position: absolute; left: 1px; top: 1px; width: 4px; height: 6px; background: var(--paint); }
.breakers a:hover { background: var(--gold-hi); }
.breakers a:active { transform: translateY(2px); }
.breakers a[aria-current="page"] { background: var(--gold); }
.breakers a[aria-current="page"] i::after { left: auto; right: 1px; background: var(--chrome); }
.stickers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.sticker { display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 1em; text-decoration: none; background: #FFFFFF; color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--mortar); font: 800 var(--t1)/1 var(--text); white-space: nowrap; }
.sticker img { width: 20px; height: 20px; object-fit: contain; }
.sticker[aria-disabled="true"] { background: #D9D4C8; color: #3E3946; cursor: not-allowed; box-shadow: none; }
.sticker[aria-disabled="true"] img { opacity: 0.6; filter: grayscale(1); }
.sticker:not([aria-disabled="true"]):hover { background: var(--gold-hi); }
.sticker:not([aria-disabled="true"]):active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--mortar); }
.tape { display: flex; align-items: stretch; gap: var(--s2); padding: var(--s2); background: var(--chrome); color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--mortar); }
.tape-field { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: var(--s1); padding: var(--s3) var(--s4); background: #FFFFFF; border: 2px solid var(--ink); }
.tape-field b { font: 800 var(--t1)/1 var(--text); letter-spacing: 0.08em; }
.tape-addr { font: 500 var(--t1)/1.35 var(--mono); user-select: all; word-break: break-all; }
.tape-addr.empty { font-family: var(--text); font-weight: 600; user-select: none; color: var(--muted); }
.tape-copy { flex: none; min-width: 80px; padding: 0 1em; background: var(--ink); color: var(--chrome); border: 2px solid var(--ink); font: 800 var(--t1)/1 var(--text); }
.tape-copy:hover:not(:disabled) { background: #2E2838; }
.tape-copy:active:not(:disabled) { transform: translateY(2px); }
.tape-copy:disabled { background: #6F6A78; border-color: #6F6A78; color: #F4EFE3; cursor: not-allowed; }
.tape-copy.ok { background: var(--gold); color: var(--ink); }
.tape-phone { display: none; }

/* the name in the lamp's pool, never as wide as to reach the right column */
.name { position: absolute; left: 50%; top: max(var(--s4), calc(100% - var(--imgH) * 0.83)); transform: translateX(-50%); width: min(46vw, calc(100% - 2 * (clamp(300px, 24vw, 380px) + var(--s5)))); margin: 0; display: flex; flex-direction: column; align-items: center; }
.name img { width: 100%; height: auto; }
.name .ticker { margin-top: var(--s2); font: 400 var(--t3)/1 var(--display); color: var(--chrome); letter-spacing: 0.06em; }

/* the curb: the can stands on it, the button beside it, Docs last */
.curb { position: absolute; left: 50%; bottom: calc(var(--imgH) * 0.15 - 2px); transform: translateX(-50%); display: flex; align-items: flex-end; gap: var(--s4); }
.can-art { flex: none; width: clamp(150px, 12vw, 220px); height: auto; }
.callit { min-height: 64px; padding: var(--s4) var(--s6); background: var(--gold); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--mortar); font: 400 var(--t4)/1 var(--display); white-space: nowrap; margin-bottom: 6px; }
.callit:hover { background: var(--gold-hi); }
.callit:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--mortar); }
.key { display: inline-flex; align-items: center; justify-content: center; min-height: 64px; padding: 0 var(--s5); margin-bottom: 6px; background: var(--chrome); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--mortar); font: 800 var(--t2)/1 var(--text); text-decoration: none; white-space: nowrap; }
.key:hover { background: var(--gold-hi); }
.key:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--mortar); }

/* the two plates on the street: one line each, on one horizontal, at the container's edges */
.plate, .readout { position: absolute; bottom: var(--s4); margin: 0; min-height: 48px; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); background: rgba(20, 17, 26, 0.9); border: 2px solid #3E3550; font: 400 var(--t1)/1.5 var(--text); white-space: nowrap; }
.plate { left: 0; max-width: calc(100% - 360px); overflow: hidden; }
.plate span { overflow: hidden; text-overflow: ellipsis; }
.plate b { font: 400 var(--t2)/1 var(--display); color: var(--gold); letter-spacing: 0.04em; }
.readout { right: 0; gap: var(--s5); }
.readout b { font: 800 var(--t2)/1 var(--text); color: var(--gold); }

/* ---------- below the wall: the same container ---------- */
main { background: var(--night); padding: var(--s7) 0; }
.wrap { width: var(--container); margin: 0 auto; }
.wrap.narrow { max-width: 760px; }
.sh { margin: 0 0 var(--s6); }
.sh h2 { margin: 0 0 var(--s2); font: 400 var(--t6)/1 var(--display); color: var(--gold); }
.sh p { margin: 0; color: #E2D8C2; }
.posters { display: grid; gap: var(--s5); margin-bottom: var(--s5); }
.posters.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.posters.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.poster { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--shadow); padding: var(--s5) var(--s6); }
.poster h3 { margin: 0 0 var(--s4); font: 800 var(--t1)/1.25 var(--text); text-transform: uppercase; letter-spacing: 0.08em; }
.poster p { margin: 0 0 var(--s4); }
.poster p:last-child { margin-bottom: 0; }
/* the three stat cards: one structure (label, value + unit on one baseline, a meter, one line), equal heights */
.stat { display: grid; grid-template-rows: auto auto auto 1fr; }
.val { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s4) !important; }
.val b { font: 800 var(--t5)/1 var(--text); letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.val span { font: 700 var(--t1)/1.25 var(--text); color: var(--muted); }
.fine { font-size: var(--t1); color: var(--muted); }
.meter { height: 16px; background: #E4D9BF; border: 2px solid var(--ink); margin-bottom: var(--s4); }
.meter i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 300ms steps(6); }
.rowhead { display: flex; justify-content: space-between; margin: 0 calc(-1 * var(--s4)) var(--s1) !important; padding: var(--s3) var(--s4); border-bottom: 2px solid var(--ink); font: 800 var(--t1)/1.25 var(--text); color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); margin: 0 calc(-1 * var(--s4)); border-bottom: 1px solid var(--line); font-size: var(--t1); min-height: 56px; }
.rows li:last-child { border-bottom: 0; }
.rows canvas { display: block; image-rendering: pixelated; }
.rows .w { font-size: var(--t1); overflow-wrap: anywhere; }
.rows button.w { background: none; border: 0; padding: 4px 0; text-align: left; color: var(--ink); text-decoration: underline; text-decoration-color: #B8AA8A; text-underline-offset: 3px; }
.rows button.w:hover { text-decoration-color: var(--ink); color: #6B2E2A; }
.rows button.w:active { color: #3A2422; }
.rows .v { font-weight: 800; white-space: nowrap; text-align: right; }
.rows .gold { color: #7A4F00; }
.rows .grey { color: #4E535E; }
.empty { color: var(--muted); font-size: var(--t1); }
.ranks li { grid-template-columns: 24px 32px minmax(0, 1fr) auto; }
.ranks .n { font: 800 var(--t2)/1 var(--text); }

.steps { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
.step { display: flex; flex-direction: column; }
.step img { height: 64px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; margin-bottom: var(--s4); }
.step .mini { display: block; height: 64px; margin-bottom: var(--s4); }
.step .mini canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.docs .poster h3 { font-size: var(--t2); text-transform: none; letter-spacing: 0; }
.ticks { margin: 0 0 var(--s4); padding-left: var(--s5); }
.split { width: 100%; border-collapse: collapse; margin-bottom: var(--s4); font-size: var(--t1); }
.split th, .split td { text-align: left; padding: var(--s2) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.split th { width: 46%; padding-right: var(--s3); }

.lookup label { display: block; font-weight: 800; font-size: var(--t1); margin-bottom: var(--s2); }
.lookup .row { display: flex; gap: var(--s3); }
.lookup input { flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--s4); font: 500 var(--t1) var(--mono); border: 3px solid var(--ink); background: #FFFFFF; color: var(--ink); }
.btn { min-height: 48px; padding: 0 var(--s5); border: 3px solid var(--ink); background: var(--gold); color: var(--ink); font-weight: 800; font-size: var(--t1); box-shadow: 0 4px 0 var(--mortar); }
.btn:hover { background: var(--gold-hi); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--mortar); }
.btn:disabled { background: #CFC6B2; color: #4A4553; cursor: not-allowed; }

dialog.card { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; margin: auto; }
dialog::backdrop { background: rgba(20, 17, 26, 0.72); }
dialog .x { float: right; min-height: 44px; padding: 0 var(--s4); background: var(--ink); color: var(--chrome); border: 0; font-weight: 800; font-size: var(--t1); margin: -8px -16px 8px 16px; }
dialog .x:hover { background: #2E2838; }
dialog h2 { margin: 0 0 var(--s1); font: 400 var(--t4)/1.1 var(--display); }
.card-head { display: flex; gap: var(--s4); align-items: center; margin-bottom: var(--s4); }
.card-mark { width: 64px; height: 64px; image-rendering: pixelated; background: var(--brick); border: 2px solid var(--ink); flex: none; }
.state { margin: 0; font-weight: 800; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); margin: 0 0 var(--s4); font-size: var(--t1); }
.facts dt { font-weight: 800; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .mono { font-family: var(--mono); }
.facts a { color: #6B2E2A; }
.facts a:hover { color: var(--ink); }
.callnote { font-size: var(--t1); }
.wallets { display: grid; gap: var(--s2); margin: var(--s4) 0; }
.wallets button { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s4); border: 3px solid var(--ink); background: #FFFFFF; color: var(--ink); font-weight: 800; text-align: left; }
.wallets button img { width: 24px; height: 24px; }
.wallets button:hover { background: var(--gold-hi); }
.wallets button:active { transform: translateY(2px); }
.err { color: #8E1B2C; font-weight: 700; font-size: var(--t1); }

@media (max-width: 1100px) {
  .posters.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posters.three .stat:last-child { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh h2 { font-size: var(--t5); }
}

/* a narrow desktop: the wall is short, so the curb row centres in the space left of the right column */
@media (min-width: 901px) and (max-width: 1100px) {
  .curb { left: calc((100% - clamp(300px, 24vw, 380px) - var(--s5)) / 2); }
}

/* ---------- phone and tablet: the tall wall scrolls, the box is the bar on top, Call it the bar at the bottom ---------- */
@media (max-width: 900px) {
  body { padding-top: 64px; padding-bottom: 88px; }
  .stage { --imgH: 177.7vw; height: auto; aspect-ratio: 941 / 1672; }
  .lampglow { top: 9%; }
  .name { top: 15%; width: 88%; }
  .rail { position: fixed; left: 0; right: 0; top: 0; width: auto; z-index: 30; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--gutter); background: #2B2733; border-bottom: 3px solid var(--ink); }
  .rail > .tape { display: none; }
  .box-art { display: none; }
  .menu { display: inline-flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s4); background: var(--chrome); color: var(--ink); border: 2px solid var(--ink); font: 800 var(--t1)/1 var(--text); }
  .menu i { width: 16px; height: 10px; background: var(--ink); }
  .menu:hover { background: var(--gold-hi); }
  .breakers { display: none; position: absolute; left: 0; right: auto; top: calc(100% + 8px); bottom: auto; width: 220px; grid-template-columns: 1fr; grid-template-rows: none; padding: var(--s2); gap: var(--s2); background: #2B2733; border: 3px solid var(--ink); }
  .box.open .breakers { display: grid; }
  .breakers a { min-height: 48px; justify-content: flex-start; }
  .stickers { grid-template-columns: 48px 48px; gap: var(--s2); }
  .sticker { min-height: 44px; padding: 0; box-shadow: none; }
  .sticker span { display: none; }
  .tape-phone { display: flex; position: absolute; left: 0; right: 0; top: 31%; }
  .curb { position: fixed; left: 0; right: 0; bottom: 0; transform: none; justify-content: center; align-items: center; gap: var(--s3); padding: var(--s2) var(--gutter) calc(var(--s2) + env(safe-area-inset-bottom)); background: rgba(20, 17, 26, 0.98); border-top: 3px solid var(--ink); z-index: 30; }
  .can-art { width: 96px; }
  .callit, .key { min-height: 56px; margin-bottom: 0; }
  .callit { font-size: var(--t3); padding: 0 var(--s5); }
  .plate, .readout { left: 0; right: 0; max-width: none; white-space: normal; }
  .plate { bottom: calc(3% + 64px); }
  .readout { bottom: 3%; justify-content: space-between; }
  .posters.three, .posters.two, .steps { grid-template-columns: 1fr; }
  .posters.three .stat:last-child { grid-column: auto; }
  .poster { padding: var(--s5); }
  .lookup .row { flex-direction: column; }
  .sh h2 { font-size: var(--t5); }
}
@media (max-width: 380px) { .can-art { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lampglow { animation: none; }
  .meter i { transition: none; }
}
