/* JACKFILED landing: full-screen switchboard + thin HUD + gate + module panels. No page scroll. */
@font-face { font-family: 'Martian Mono'; font-style: normal; font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap;
  src: url('/assets/fonts/martian-mono-latin-var.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-600.woff2') format('woff2'); }

:root {
  --bakelite: #0A0908; --panel: #141210; --panel-2: #1D1A16; --line: #2C2823; --brass: #B08D57;
  --text: #ECE6D9; --dim: #8C857A; --lime: #C6FF3D; --magenta: #FF2E88; --cyan: #2EE6FF; --amber: #FFB020; --red: #FF4A3D;
  --fd: 'Martian Mono', 'IBM Plex Mono', ui-monospace, monospace;
  --fb: 'IBM Plex Mono', ui-monospace, monospace;
  --hud-h: 46px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bakelite); color: var(--text); font-family: var(--fb); font-size: 14px; -webkit-font-smoothing: antialiased; }
html.js:not(.nogl), html.js:not(.nogl) body { overflow: hidden; overscroll-behavior: none; }
body { font-variant-numeric: tabular-nums; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
kbd { font-family: var(--fb); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: default; }
#gl.grab { cursor: grab; } #gl.grabbing { cursor: grabbing; } #gl.point { cursor: pointer; }

/* ── HUD ─────────────────────────────────────────────── */
.hud { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: calc(var(--hud-h) + var(--safe-t)); padding: var(--safe-t) 18px 0;
  display: flex; align-items: center; gap: 16px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  background: linear-gradient(180deg, rgba(10,9,8,0.82), rgba(10,9,8,0.35) 70%, rgba(10,9,8,0)); transition: opacity .6s; }
.hud a, .hud button { text-decoration: none; }
.hud-logo { display: flex; align-items: center; gap: 9px; font-family: var(--fd); font-weight: 800; font-stretch: 112.5%; font-size: 13px; letter-spacing: 0.12em; }
.hud-logo svg { width: 24px; height: 24px; }
.hud-count { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); padding: 5px 10px; border: 1px solid var(--line); border-radius: 3px; white-space: nowrap; }
.hud-count b { color: var(--text); font-weight: 600; }
.lamp { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); display: inline-block; flex: none; }
.lamp.blink { animation: blink 1.1s steps(2) infinite; } .lamp.on { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
@keyframes blink { 50% { opacity: .25; } }
.hud-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hud-ca { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px; background: rgba(20,18,16,0.6); text-transform: uppercase; letter-spacing: 0.08em; }
.hud-ca .t { color: var(--brass); font-weight: 600; } .hud-ca .a { color: var(--dim); text-transform: none; letter-spacing: 0.02em; }
.hud-ca.live .a { color: var(--text); }
.hud-ca svg { width: 13px; height: 13px; color: var(--dim); }
.hud-ca:hover { border-color: var(--brass); } .hud-ca:hover svg { color: var(--text); }
.hud-buy { padding: 7px 12px; background: var(--lime); color: #0A0908; font-weight: 700; border-radius: 3px; letter-spacing: 0.08em; white-space: nowrap; box-shadow: 0 0 18px rgba(198,255,61,0.25); }
.hud-buy:hover { filter: brightness(1.08); box-shadow: 0 0 24px rgba(198,255,61,0.45); }
.hud-links { display: flex; align-items: center; gap: 2px; }
.hud-links a { padding: 7px 8px; color: var(--dim); border-radius: 3px; }
.hud-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.hud-links .ico { display: inline-flex; padding: 7px; } .hud-links .ico svg { width: 14px; height: 14px; }
.hud-sound { display: inline-flex; align-items: flex-end; gap: 2px; height: 28px; padding: 0 8px 7px; color: var(--dim); border: 1px solid var(--line); border-radius: 3px; text-transform: uppercase; letter-spacing: 0.08em; }
.hud-sound i { width: 2px; height: 4px; background: currentColor; display: block; transition: height .2s; }
.hud-sound span { margin-left: 6px; line-height: 1; }
.hud-sound[aria-pressed="true"] { color: var(--lime); border-color: rgba(198,255,61,0.35); }
.hud-sound[aria-pressed="true"] i { animation: eq 0.9s ease-in-out infinite alternate; }
.hud-sound[aria-pressed="true"] i:nth-child(2) { animation-delay: -.3s; } .hud-sound[aria-pressed="true"] i:nth-child(3) { animation-delay: -.6s; } .hud-sound[aria-pressed="true"] i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }

/* ── gate ────────────────────────────────────────────── */
.gate { position: fixed; z-index: 15; left: 50%; top: calc(var(--hud-h) + var(--safe-t) + 4vh); transform: translateX(-50%); width: min(560px, calc(100vw - 32px));
  text-align: center; transition: opacity .7s, transform .9s; }
.gate::before { content: ''; position: absolute; z-index: -1; inset: -40px -60px -30px; background: radial-gradient(closest-side, rgba(6,5,4,0.78), rgba(6,5,4,0.45) 60%, rgba(6,5,4,0)); pointer-events: none; }
html.no-gate .gate, .gate.off { opacity: 0; transform: translate(-50%, -12px); pointer-events: none; }
html:not(.ready) .gate { opacity: 0; }
.gate-kicker { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); }
.gate-title { margin: 0 0 18px; font-family: var(--fd); font-weight: 800; font-stretch: 112.5%; font-size: clamp(26px, 4.4vw, 46px); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); text-shadow: 0 0 28px rgba(255,176,32,0.25); }
.gate-field { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px; border: 1px solid rgba(255,176,32,0.35); border-radius: 4px; background: rgba(10,9,8,0.72);
  box-shadow: 0 0 0 4px rgba(255,176,32,0.05), 0 10px 40px rgba(0,0,0,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gate-dollar { font-family: var(--fd); font-weight: 800; font-size: 26px; color: var(--amber); }
.gate-field input { width: 8.6ch; font-family: var(--fd); font-weight: 800; font-size: 26px; letter-spacing: 0.12em; text-transform: uppercase; color: #ffcf7a; background: transparent; border: 0; outline: 0;
  caret-color: var(--amber); text-shadow: 0 0 14px rgba(255,176,32,0.5); padding: 4px 0; }
.gate-field input::placeholder { color: rgba(255,176,32,0.22); text-shadow: none; }
.gate-go { width: 44px; height: 44px; border-radius: 3px; background: var(--amber); color: #0A0908; font-size: 20px; font-weight: 700; }
.gate-go:hover { filter: brightness(1.1); }
.gate-sub { margin: 14px 0 0; color: var(--dim); font-size: 12px; letter-spacing: 0.04em; }
.gate-sub b { color: var(--text); } .gate-sub kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--text); font-size: 11px; }
.gate-skip { margin-top: 10px; color: var(--dim); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; padding: 8px 10px; }
.gate-skip:hover { color: var(--text); }

/* ── boot ────────────────────────────────────────────── */
.boot { position: fixed; z-index: 30; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center; background: var(--bakelite); color: var(--dim);
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; transition: opacity .8s; }
.boot i { width: 120px; height: 2px; background: linear-gradient(90deg, transparent, var(--amber), transparent); background-size: 200% 100%; animation: sweep 1.2s linear infinite; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: -100% 0; } }
html.ready .boot { opacity: 0; pointer-events: none; }

/* ── jack bay (hint + keys) ──────────────────────────── */
.bay { position: fixed; z-index: 12; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: opacity .6s, transform .6s; }
html:not(.live) .bay, .bay.off { opacity: 0; transform: translate(-50%, 10px); pointer-events: none; }
.bay-hint { margin: 0; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text); text-shadow: 0 1px 8px #000; white-space: nowrap; }
.bay-hint .d { color: var(--dim); } .bay-hint b { color: var(--text); font-weight: 600; }
.bay-keys { display: flex; gap: 6px; }
.bay-keys button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 6px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
  background: rgba(14,12,10,0.7); border: 1px solid var(--line); border-radius: 3px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.bay-keys button kbd { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 2px; background: var(--panel-2); color: var(--c); font-size: 10px; font-weight: 600; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.6); }
.bay-keys button:hover, .bay-keys button.on { color: var(--text); border-color: var(--c); }
@media (min-width: 761px) { body.panel-open .bay { left: calc((100vw - min(460px, 40vw) - 40px) / 2); } body.panel-open .bay-hint { opacity: 0; } }
.bay-keys button.on { box-shadow: 0 0 14px color-mix(in srgb, var(--c) 35%, transparent); }

/* ── module panel ────────────────────────────────────── */
.panel { position: fixed; z-index: 18; top: calc(var(--hud-h) + var(--safe-t) + 14px); right: 20px; bottom: 20px; width: min(460px, 40vw); display: flex; flex-direction: column;
  background: rgba(14,12,10,0.88); border: 1px solid var(--line); border-top: 2px solid var(--c, var(--lime)); border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transform: translateX(16px); transition: opacity .35s, transform .45s cubic-bezier(.2,.8,.2,1); }
.panel.open { opacity: 1; transform: none; }
.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.panel-idx { font-size: 11px; color: var(--dim); letter-spacing: 0.14em; }
.panel-jack { font-family: var(--fd); font-weight: 800; font-stretch: 112.5%; font-size: 15px; letter-spacing: 0.1em; color: var(--c); }
.panel-close { margin-left: auto; padding: 6px 9px; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 3px; }
.panel-close:hover { color: var(--text); border-color: var(--dim); }
.panel-body { padding: 18px 18px 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.panel-body h2 { margin: 0 0 12px; font-family: var(--fd); font-weight: 700; font-stretch: 100%; font-size: 21px; line-height: 1.3; letter-spacing: -0.005em; text-wrap: balance; }
.panel-body p { margin: 0 0 12px; color: #cdc6b8; line-height: 1.62; font-size: 13.5px; }
.panel-body p b, .panel-body li b { color: var(--text); font-weight: 600; }
.panel-body ul { margin: 0 0 14px; padding: 0; list-style: none; }
.panel-body li { position: relative; padding: 7px 0 7px 18px; border-top: 1px dashed var(--line); color: #cdc6b8; font-size: 13px; line-height: 1.55; }
.panel-body li::before { content: ''; position: absolute; left: 2px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.panel-body code { font-family: var(--fb); font-size: 12px; padding: 1px 5px; border-radius: 2px; background: var(--panel-2); color: var(--text); }
.panel-body a { color: var(--c); text-underline-offset: 3px; }
.readout { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px; background: #0b0a09; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: baseline; }
.readout .k { color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.readout .v { font-family: var(--fd); font-weight: 700; font-size: 18px; color: var(--c); text-shadow: 0 0 12px color-mix(in srgb, var(--c) 45%, transparent); text-align: right; }
.readout .v.small { font-size: 13px; }
.readout .note { grid-column: 1 / -1; color: var(--dim); font-size: 11.5px; line-height: 1.5; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); background: var(--panel); }
.btn:hover { border-color: var(--c); }
.btn.primary { background: var(--c); color: #0A0908; border-color: var(--c); font-weight: 700; }
.panel-body a.btn { color: var(--text); } .panel-body a.btn.primary { color: #0A0908; }

/* split bar + raise-only toy */
.split { display: flex; height: 10px; border-radius: 2px; overflow: hidden; margin: 6px 0 4px; background: var(--panel-2); }
.split i { display: block; height: 100%; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.split-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); letter-spacing: 0.06em; margin-bottom: 12px; }
.split-legend b { font-weight: 600; }
.toy { margin: 4px 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 3px; background: #0b0a09; }
.toy-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; }
.toy-row .lbl { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.toy-row .val { font-family: var(--fd); font-weight: 700; min-width: 4.5ch; text-align: right; }
.toy button { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font-weight: 700; }
.toy button:hover { border-color: var(--c); }
.toy-log { min-height: 1.5em; margin-top: 8px; font-size: 11.5px; color: var(--dim); }
.toy-log.err { color: var(--red); } .toy-log.ok { color: var(--lime); }

/* checker */
.check-form { display: flex; gap: 8px; margin: 4px 0 14px; }
.check-form input { flex: 1; min-width: 0; padding: 11px 12px; background: #0b0a09; border: 1px solid var(--line); border-radius: 3px; color: var(--text); font-family: var(--fb); font-size: 13px; outline: 0; }
.check-form input:focus { border-color: var(--c); }
.receipt { position: relative; margin: 0 0 14px; padding: 16px 16px 14px; background: #0b0a09; border: 1px dashed #3a342c; border-radius: 3px; font-size: 12.5px; line-height: 1.75; }
.receipt .row { display: flex; justify-content: space-between; gap: 12px; } .receipt .row span:first-child { color: var(--dim); } .receipt .row span:last-child { text-align: right; word-break: break-all; }
.receipt hr { border: 0; border-top: 1px dashed #3a342c; margin: 10px 0; }
.receipt .ttl { font-family: var(--fd); font-weight: 700; letter-spacing: 0.12em; font-size: 11px; color: var(--dim); text-align: center; margin-bottom: 8px; }
.receipt .verdict { font-family: var(--fd); font-weight: 700; font-size: 14px; line-height: 1.45; }
.receipt .verdict.open { color: var(--red); } .receipt .verdict.contract { color: var(--amber); } .receipt .verdict.patched { color: var(--lime); }
.receipt.loading { color: var(--dim); }
.muted { color: var(--dim); }

/* toast (shared/site.js) */
.jf-toast { position: fixed; z-index: 90; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); width: max-content;
  padding: 11px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 3px; color: var(--text); font-size: 12.5px; transition: opacity .25s, transform .25s; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.jf-toast.show { opacity: 1; transform: translate(-50%, 0); } .jf-toast.ok { border-left-color: var(--lime); } .jf-toast.err { border-left-color: var(--red); }

/* ── static page (no WebGL / no JS); also the source of the panel text ── */
.static { display: none; max-width: 760px; margin: 0 auto; padding: calc(var(--hud-h) + 48px) 20px 60px; }
html.nogl .static { display: block; }
html.nogl #gl, html.nogl .gate, html.nogl .bay, html.nogl .boot, html.nogl .hud-sound, html.nogl .panel { display: none !important; }
html.nogl .hud { background: rgba(10,9,8,0.92); border-bottom: 1px solid var(--line); }
.st-kicker { color: var(--brass); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; margin: 0 0 8px; }
.st-title { font-family: var(--fd); font-weight: 800; font-stretch: 112.5%; font-size: clamp(36px, 8vw, 64px); letter-spacing: 0.06em; margin: 0 0 16px; }
.st-lede { font-size: 15px; line-height: 1.7; color: #cdc6b8; }
.st-links { line-height: 2; } .st-links a { color: var(--lime); }
.c-burn { color: var(--lime); } .c-holders { color: var(--magenta); } .c-fund { color: var(--cyan); } .c-creator { color: var(--amber); }
.st-mod { margin-top: 28px; padding: 20px; border: 1px solid var(--line); border-top: 2px solid var(--c); border-radius: 4px; background: var(--panel); }
.st-mod h2 { font-family: var(--fd); font-size: 20px; margin: 0 0 10px; }
.st-mod p, .st-mod li { color: #cdc6b8; line-height: 1.65; }
.st-mod a { color: var(--c); }
.st-foot { margin-top: 40px; color: var(--dim); font-size: 12px; line-height: 1.6; }

/* ── responsive ──────────────────────────────────────── */
@media (max-width: 1180px) { .hud-count { display: none; } }
@media (max-width: 920px) {
  .hud-links a:not(.ico) { display: none; }
  .hud-ca .t { display: none; }
}
@media (max-width: 760px), (orientation: portrait) and (max-width: 900px) {
  :root { --hud-h: 84px; }
  .hud { flex-wrap: wrap; align-content: center; row-gap: 6px; column-gap: 8px; padding: calc(var(--safe-t) + 8px) 12px 6px; height: auto; min-height: calc(var(--hud-h) + var(--safe-t)); }
  .hud-logo span { font-size: 12px; }
  .hud-right { display: contents; }
  .hud-links { order: 2; margin-left: auto; } .hud-links a:not(.ico) { display: inline-block; padding: 6px 6px; }
  .hud-sound { order: 3; height: 26px; } .hud-sound span { display: none; }
  .hud-ca { order: 4; flex: 1 1 55%; min-width: 0; justify-content: space-between; padding: 6px 9px; } .hud-ca .t { display: inline; } .hud-ca .a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hud-buy { order: 5; padding: 7px 10px; }
  .hud-count { display: inline-flex; order: 6; flex-basis: 100%; justify-content: center; border: 0; padding: 0; font-size: 10px; }
  .gate { top: calc(var(--hud-h) + var(--safe-t) + 24px); }
  .gate-title { font-size: 26px; margin-bottom: 14px; }
  .gate-field input { font-size: 22px; width: 8.4ch; } .gate-dollar { font-size: 22px; }
  .bay { left: 0; right: 0; transform: none; bottom: calc(10px + var(--safe-b)); padding: 0 10px; }
  html:not(.live) .bay, .bay.off { transform: translateY(10px); }
  .bay-hint { font-size: 9.5px; letter-spacing: 0.1em; white-space: normal; text-align: center; }
  .bay-keys { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 5px; }
  .bay-keys button { justify-content: flex-start; padding: 8px 8px 8px 6px; font-size: 10px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 56vh; max-height: 56dvh; border-radius: 12px 12px 0 0; border-left: 0; border-right: 0; border-bottom: 0;
    transform: translateY(24px); padding-bottom: var(--safe-b); }
  .panel-body { padding: 14px 16px 18px; }
  .panel-body h2 { font-size: 18px; }
  .panel-head::before { content: ''; position: absolute; left: 50%; top: 6px; width: 36px; height: 3px; margin-left: -18px; border-radius: 2px; background: var(--line); }
  .panel-head { position: relative; padding-top: 16px; }
  .jf-toast { bottom: calc(120px + var(--safe-b)); }
  body.panel-open .bay { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { .panel, .gate, .bay, .boot { transition: none; } .lamp.blink, .hud-sound i { animation: none !important; } }
