/* jarlings.xyz: the night-shift laboratory.
   Loaded after site.css. One committed look: a dark tiled lab wall, riveted steel panels, brass nameplates, pipes
   between the bays, keycap buttons, green phosphor for anything live, and the 5x7 machine font (JarPixel, the same
   letters the mining machine stamps) for every label, button and readout. Body copy stays Bricolage for reading. */
@font-face { font-family: 'JarPixel'; src: url('../fonts/JarPixel.woff') format('woff'); font-display: swap; }

:root, :root[data-theme='light'], :root[data-theme='dark'] {
  --paper: #0f1312;      /* the lab wall */
  --surface: #1b2120;    /* steel panels */
  --sunk: #090c0b;       /* recesses, specimen windows */
  --ink: #ece6d6;        /* cream enamel lettering */
  --ink-2: #98a39d;
  --line: #2a3330;
  --accent: #4fe39a;     /* phosphor green: anything live, lit or yours */
  --accent-ink: #062014;
  --accent-soft: #123222;
  --accent-text: #7dffb0;
  --brass: #c9a14b; --brass-hi: #f2d58c; --brass-lo: #7d5e21; --brass-ink: #3a2a0c;
  --steel: #2a3231; --steel-hi: #4a5553; --steel-lo: #141918;
  --hazard: #f2c230;
  --danger: #ff6a52; --danger-soft: #3a1a14; --focus: #ffd23a;
  --pixel: 'JarPixel', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r-img: 3px; --r-card: 4px;
  --shadow: 0 2px 0 #000, 0 14px 34px rgba(0, 0, 0, 0.5);
  --r-unc: #7fd69a; --r-unc-bg: #1d3526; --r-rare: #8db4ff; --r-rare-bg: #1c2a44; --r-epic: #c9a0ff; --r-epic-bg: #2e2142;
  --r-leg: #f2c164; --r-leg-bg: #3a2d12; --r-myth: #ff8aa8; --r-myth-bg: #3e1a24;
  /* four corner rivets, layered over any panel background */
  --rivets: radial-gradient(circle at 9px 9px, #9aa4ad 0 1px, #39423f 1.6px, #0b0e0d 2.4px, transparent 3px),
            radial-gradient(circle at calc(100% - 9px) 9px, #9aa4ad 0 1px, #39423f 1.6px, #0b0e0d 2.4px, transparent 3px),
            radial-gradient(circle at 9px calc(100% - 9px), #9aa4ad 0 1px, #39423f 1.6px, #0b0e0d 2.4px, transparent 3px),
            radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #9aa4ad 0 1px, #39423f 1.6px, #0b0e0d 2.4px, transparent 3px);
  --plate: linear-gradient(180deg, #252e2c, #1a201f);
  color-scheme: dark;
}
body {
  background-color: var(--paper);
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 28px 28px;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { color: var(--ink); }
.lede { color: var(--ink-2); }
a { color: var(--ink); }

/* ------------------------------------------------------------------ the machine font */
.px-font, .nav a, .btn, .plate, .tag, .rar, .stat span, .facts dt, .kpi > span, .field, .traits dt, .summary dt, .inv-label,
.foot-nav h2, .tlabel, .pc-head h2, .supplies-head h2, .modes a, .pill, .dur span, .cap, .meta, .check, .have, .close, .navtoggle,
.kicker, .legend-kicker, .extinct-kicker, .drops, .needs, .odds, .live-status, .eyebrow {
  font-family: var(--pixel); letter-spacing: 0; font-stretch: 100%; text-transform: uppercase; -webkit-font-smoothing: none;
}

/* ------------------------------------------------------------------ the control strip (header) */
.top { position: sticky; top: 0; z-index: 30; background: linear-gradient(180deg, #232b2a, #171d1c); backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 0; box-shadow: 0 1px 0 #000, 0 6px 18px rgba(0, 0, 0, 0.45); }
.top::after { content: ''; display: block; height: 4px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 7px, #18181a 7px 14px); border-top: 1px solid #000; }
.top .wrap { min-height: 64px; gap: 18px; flex-wrap: wrap; }
.mark { font-family: var(--font); font-size: 1.7rem; font-weight: 800; font-stretch: 72%; color: var(--ink); text-transform: none; letter-spacing: -0.01em; gap: 10px; }
.mark img { width: 32px; height: 32px; image-rendering: pixelated; }
.nav { gap: 6px; align-items: center; }
.nav a { font-size: 12px; line-height: 1; color: #c9d1cc; padding: 9px 9px 8px; border-radius: 3px; background: linear-gradient(180deg, #2c3533, #1f2625); border: 1px solid #0a0d0c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 #050706; position: relative; }
.nav a:hover { color: #fff; background: linear-gradient(180deg, #34403d, #252d2b); }
.nav a:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.nav a[aria-current='page'] { color: var(--accent-text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 #050706, inset 0 -2px 0 var(--accent); border-radius: 3px; }
.nav a[aria-current='page']::before { content: ''; position: absolute; top: 4px; right: 4px; width: 4px; height: 4px; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.navtoggle { font-size: 16px; color: var(--ink); background: linear-gradient(180deg, #2c3533, #1f2625); border: 1px solid #0a0d0c; border-radius: 3px; box-shadow: 0 2px 0 #050706; }
@media (max-width: 1080px) {
  .nav { top: 68px; align-items: stretch; background: #171d1c; border-bottom: 4px solid var(--hazard); box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5); gap: 6px; padding: 12px 16px 16px; }
  .nav a[aria-current='page'] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 #050706, inset 3px 0 0 var(--accent); border-radius: 3px; }
}
@media (max-width: 1080px) { .nav a { font-size: 16px; padding: 10px 12px 9px; } }

/* ------------------------------------------------------------------ keycap buttons */
.btn { font-size: 16px; line-height: 1; padding: 11px 16px 10px; border-radius: 3px; border: 1px solid #050706; border-bottom-width: 4px;
  background: linear-gradient(180deg, #3a4442, #29312f); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); transition: transform 0.06s, border-bottom-width 0.06s, filter 0.15s; }
.btn:hover { background: linear-gradient(180deg, #44504d, #303937); filter: brightness(1.05); }
.btn:active { transform: translateY(3px); border-bottom-width: 1px; }
.btn.goo { background: linear-gradient(180deg, #5ff0a8, #2fbf78); color: #05200f; border-color: #0b3a22; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 18px rgba(79, 227, 154, 0.25); }
.btn.goo:hover { background: linear-gradient(180deg, #7dffbd, #3fd08a); }
.btn.brass, .wallet-btn { background: linear-gradient(180deg, var(--brass-hi), var(--brass)) !important; color: var(--brass-ink) !important; border-color: #3a2a0c !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn.brass:hover, .wallet-btn:hover { filter: brightness(1.08); }
.btn.ghost, .btn.ghost.light { background: linear-gradient(180deg, #232b29, #181e1d); color: var(--ink); border-color: #050706; }
.btn.ghost:hover { background: linear-gradient(180deg, #2c3533, #1f2625); border-color: #050706; }
.btn.danger { background: linear-gradient(180deg, #ff7a5c, #d23a26); color: #fff; border-color: #4a0e06; }
.btn.small { font-size: 16px; padding: 8px 12px 7px; }
.btn[disabled] { opacity: 0.45; transform: none; border-bottom-width: 4px; }

/* ------------------------------------------------------------------ steel panels */
.box, .summary, .empty, .kpi, .panel-card, .supplies, .craft, .dur, .tree, .titem, .demo-note, .drawer, .moment-card, .hammer, .odds-table div,
.inv-item, .firsts a, .live-status, .feed:not(ol), .sim-note, .tickets .ticket-x {
  background: var(--rivets), var(--plate); border: 1px solid #050706; border-radius: var(--r-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 2px 0 #000;
}
.box, .summary, .kpi, .panel-card, .supplies, .craft, .tree { padding: 18px 20px; }
.empty { border-style: solid; }
.inv-item, .firsts a, .live-status, .hammer { background: var(--plate); }
.inv-item { border-radius: 3px; }
.inv-item img, .hammer img, .odds img, .needs img, .drops img, .ico, .craft-head img, .feed img { border-radius: 2px; image-rendering: pixelated; }
.drawer { border-radius: 0; border-left: 4px solid var(--brass-lo); background: var(--rivets), linear-gradient(180deg, #1e2524, #151a19); }
.scrim { background: rgba(3, 6, 5, 0.66); }
.moment { background: rgba(3, 6, 5, 0.72); }
.moment-card { border-top: 4px solid var(--brass); }
.dur[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(79, 227, 154, 0.18); background: var(--rivets), linear-gradient(180deg, #17352a, #10261e); }
.hint { background: #0e241a; border: 1px solid #1f5a3d; border-radius: 3px; color: #c8f5dc; }
.warn { color: var(--danger); }
.demo-note { color: var(--ink-2); }
.demo-note button { color: var(--accent-text); font-family: var(--pixel); font-size: 16px; text-transform: uppercase; }

/* readouts: stats and counters glow like the nixie tubes on the machine */
.stat { border-left: 3px solid var(--steel-hi); }
.stat.goo { border-left-color: var(--accent); }
.stat b { font-family: var(--pixel); font-size: 32px; font-weight: 400; letter-spacing: 0; color: #ffab4a; text-shadow: 0 0 10px rgba(255, 140, 50, 0.45); }
.stat span { font-size: 16px; color: var(--ink-2); }
.kpi b { font-family: var(--pixel); font-weight: 400; font-size: 32px; color: #ffab4a; text-shadow: 0 0 10px rgba(255, 140, 50, 0.4); }
.kpi.big b { font-size: 48px; }
.kpi b.up { color: var(--accent-text); text-shadow: 0 0 10px rgba(79, 227, 154, 0.4); }
.kpi > span { font-size: 16px; }
.kpi .bar { background: #050706; border-radius: 0; height: 10px; box-shadow: inset 0 1px 2px #000; }
.kpi .bar i { border-radius: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 8px); }

/* ------------------------------------------------------------------ specimens: a window in the cabinet + a brass plate */
.cubby img, .cubby .sheet-thumb, .cubby .placeholder { border-radius: 2px; background-color: var(--sunk); box-shadow: 0 0 0 3px #2c3533, 0 0 0 4px #050706, 0 3px 0 4px #050706; }
.cubby::after { content: ''; position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1; pointer-events: none; border-radius: 2px;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.08) 0 18%, transparent 18% 30%, rgba(255, 255, 255, 0.04) 30% 34%, transparent 34%); }
.plate { display: block; width: fit-content; max-width: 100%; margin-top: 11px; font-size: 16px; line-height: 1; padding: 4px 6px 3px; color: var(--brass-ink); border-radius: 2px;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass)); box-shadow: inset 0 -1px 0 var(--brass-lo), 0 1px 0 #000; }
.plate small { color: #5a4416; font-weight: 400; }
.hero-cab .plate, .shelf-row .plate { font-size: 12px; }
.grid.small .plate, .tlist .plate { font-size: 12px; }
.recipe .plate { color: var(--brass-ink); }
.slot .plate.muted { color: var(--ink-2); background: linear-gradient(180deg, #2c3533, #1f2625); box-shadow: 0 1px 0 #000; }
.card:hover .cubby img, .card:hover .cubby .sheet-thumb { box-shadow: 0 0 0 3px var(--brass), 0 0 0 4px #050706, 0 3px 0 4px #050706; }
.card[aria-pressed='true'] .cubby img, .slot[aria-pressed='true'] .cubby img, .slot[aria-pressed='true'] .placeholder { box-shadow: 0 0 0 3px var(--accent), 0 0 0 4px #050706, 0 0 22px rgba(79, 227, 154, 0.35); }
.slot .placeholder { border: 0; color: var(--ink-2); font-family: var(--pixel); text-transform: uppercase; font-size: 16px;
  background: repeating-linear-gradient(-45deg, #0c100f 0 10px, #101514 10px 20px); }
.slot .placeholder .ph-plus { background: #1f2625; color: var(--accent-text); border-radius: 3px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 0 #000; }
.tag { border-radius: 2px; font-size: 16px; line-height: 1; padding: 3px 5px 2px; background: #0b0e0d; color: var(--ink); box-shadow: 0 0 0 1px #000; backdrop-filter: none; }
.tag.new { background: var(--accent); color: var(--accent-ink); }
.meta { font-size: 12px; }
.meta .g { color: var(--accent-text); }
.cap { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.cubby.legendary img, .cubby.legendary .sheet-thumb { box-shadow: 0 0 0 3px #ffd23f, 0 0 0 4px #050706, 0 0 24px rgba(255, 210, 63, 0.35); }
@keyframes legend-glow { 50% { box-shadow: 0 0 0 3px #8ad8ff, 0 0 0 4px #050706, 0 0 24px rgba(138, 216, 255, 0.35); } }
.cubby img[src$='-shadow.png'] { background: #050706; }

/* the rarity chip is an enamel label */
.rar { border-radius: 2px; font-size: 12px; padding: 3px 5px 2px; }
.traits { border-top: 1px solid var(--line); }
.traits dt { font-size: 16px; color: var(--ink-2); }
.traits dd { color: var(--ink); }
.summary dt { font-size: 16px; }

/* inputs: little recessed screens */
select, input[type='number'], input[type='text'], input[type='search'] { background: #070a09; color: var(--accent-text); border: 1px solid #000; border-radius: 3px;
  box-shadow: inset 0 2px 4px #000, 0 1px 0 rgba(255, 255, 255, 0.06); font-family: var(--font); }
select:hover, input:hover { border-color: #000; box-shadow: inset 0 2px 4px #000, 0 0 0 1px var(--steel-hi); }
.field { font-size: 16px; color: var(--ink-2); }
.check { font-size: 16px; }
input[type='checkbox'], input[type='range'] { accent-color: var(--accent); }

/* ------------------------------------------------------------------ bays and pipes */
.band { border-top: 0; position: relative; padding: 84px 0 72px; }
.band.panel { background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.1)); }
/* a pipe runs along the top of every bay, with a flange joint every so often */
.band::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px; border-top: 1px solid #000; border-bottom: 1px solid #000;
  background: repeating-linear-gradient(90deg, transparent 0 236px, #0b0e0d 236px 237px, #5c6765 237px 239px, #2a3231 239px 250px, #0b0e0d 250px 251px, transparent 251px 488px),
    linear-gradient(180deg, #59625f 0, #8c9693 3px, #4a5351 7px, #2a3130 11px, #1b2120 14px); }
.band-head { gap: 14px; }
.band-head h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); }
.band-head h2::before { content: ''; display: block; width: 48px; height: 6px; margin-bottom: 16px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 5px, #18181a 5px 10px); box-shadow: 0 0 0 1px #000; }
.page-head .ph::before { content: ''; display: block; width: 48px; height: 6px; margin-bottom: 14px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 5px, #18181a 5px 10px); box-shadow: 0 0 0 1px #000; }
.sh { font-size: 1.6rem; padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.sh .muted { font-family: var(--pixel); font-size: 16px; text-transform: uppercase; }

/* shelves: a row of specimens stands on a steel shelf with brass brackets */
.shelf-row { position: relative; padding-bottom: 18px; }
.shelf-row::after { content: ''; position: absolute; left: -10px; right: -10px; bottom: 0; height: 10px; border: 1px solid #000; border-radius: 1px;
  background: radial-gradient(circle at 20px 5px, var(--brass-hi) 0 1.5px, var(--brass-lo) 2px, transparent 2.5px), radial-gradient(circle at calc(100% - 20px) 5px, var(--brass-hi) 0 1.5px, var(--brass-lo) 2px, transparent 2.5px),
    linear-gradient(180deg, #7d8894 0, #4c5560 4px, #2c333b 10px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45); }

/* ------------------------------------------------------------------ the landing page */
.hero { position: relative; padding: 52px 0 76px; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero-copy h1 { font-size: clamp(2.8rem, 6vw, 5rem); text-shadow: 0 3px 0 #000; }
.hero-copy h1 .glow { color: var(--accent-text); text-shadow: 0 0 22px rgba(79, 227, 154, 0.45), 0 3px 0 #000; }
.hero-copy .eyebrow { font-size: 16px; color: var(--brass-hi); display: inline-flex; gap: 10px; align-items: center; }
.hero-copy .eyebrow::before { content: ''; width: 10px; height: 10px; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: lamp 1.6s steps(2) infinite; }
@keyframes lamp { 50% { opacity: 0.25; } }
.lab-bg { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: 0.9; pointer-events: none; }
/* the hero cabinet: a steel specimen cabinet with a nameplate */
.hero-cab { position: relative; padding: 34px 18px 22px; border: 1px solid #000; border-radius: 4px; gap: 18px 14px;
  background: var(--rivets), linear-gradient(180deg, #252d2b, #161b1a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 0 #000, 0 30px 60px rgba(0, 0, 0, 0.5); }
.hero-cab::before { content: 'SPECIMEN CABINET  GENESIS'; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 12px/1 var(--pixel); color: var(--brass-ink); padding: 3px 8px 2px; border-radius: 2px; background: linear-gradient(180deg, var(--brass-hi), var(--brass)); box-shadow: 0 1px 0 #000; }
/* the four facts are nixie counters */
.facts { gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 520px; }
.facts div { background: linear-gradient(180deg, #1a1410, #0e0a08); border: 1px solid #000; border-radius: 3px; padding: 10px 12px 9px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 0 #000; }
.facts dd { font-family: var(--pixel); font-weight: 400; font-size: 24px; letter-spacing: 0; color: #ffab4a; text-shadow: 0 0 10px rgba(255, 140, 50, 0.55); }
.facts dt { font-size: 12px; color: #c98a4a; margin-top: 6px; }
@media (max-width: 520px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hero .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 44px; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }
/* how the lab works: the three steps ride a conveyor */
.steps { position: relative; padding-bottom: 34px; }
.steps::after { content: ''; position: absolute; left: -8px; right: -8px; bottom: 0; height: 18px; border: 1px solid #000; border-radius: 9px;
  background: radial-gradient(circle at 9px 9px, #8c96a3 0 3px, #2c333b 3.5px, transparent 4px) 0 0 / 32px 18px repeat-x, linear-gradient(180deg, #3a3f47, #1d2126);
  box-shadow: inset 0 3px 0 #2b2c30, 0 6px 14px rgba(0, 0, 0, 0.5); animation: belt 1.6s linear infinite; }
@keyframes belt { to { background-position: 32px 0, 0 0; } }
.step h3::before { border-radius: 3px; font-family: var(--pixel); font-size: 16px; background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--brass-ink); box-shadow: 0 2px 0 #000; }
.step .cubby { width: 180px; }
/* the treasure pool is a vault readout */
.pool-card { background: var(--rivets), linear-gradient(160deg, #2a2110, #171005); border: 1px solid #000; border-radius: 4px; border-top: 4px solid var(--brass); }
.pool-card b { font-family: var(--pixel); font-weight: 400; font-size: 48px; text-shadow: 0 0 16px rgba(255, 210, 63, 0.45); }
.pool-card span { font-family: var(--pixel); text-transform: uppercase; font-size: 16px; }
.pool-strip, .treasure-note { background: #241c0c !important; border-color: #4a3a14 !important; color: #f0dc9a !important; border-radius: 3px; }
.pool-strip b { color: #ffd23f !important; }

/* ------------------------------------------------------------------ pages */
.page-head { padding-bottom: 18px; border-bottom: 2px solid var(--line); }
.ph { text-shadow: 0 3px 0 #000; }
.recycle-bar { background: var(--rivets), linear-gradient(180deg, #2a3231, #171d1c); border: 1px solid #000; border-radius: 4px; color: var(--ink); }
.recycle-bar .btn.ghost { color: var(--ink); border-color: #050706; }
.toast { background: #0b0e0d; color: var(--accent-text); border: 1px solid #000; border-radius: 3px; font-family: var(--pixel); font-size: 16px; text-transform: uppercase; box-shadow: 0 0 0 2px #2c3533, var(--shadow); }
.toast.err { background: #2a0e0a; color: #ffb4a6; border-radius: 3px; }
.legend-box { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, #ffd23f, #ff9ad5, #8ad8ff) border-box; }
.extinct-box { background: color-mix(in srgb, #e0a040 10%, var(--surface)); }
.extinct-kicker { color: #f0b860; }
.tag.extinct { background: #c98a2e; color: #1a1006; }
.tree { background: var(--rivets), var(--plate); }
.couple::after, .couple::before { border-color: var(--brass-lo); }
.couple::before { background: var(--brass-lo); }
.tnode.unknown .cubby { background: var(--sunk); }
.live-status .pulse { border-radius: 0; }
.chart .line { stroke: var(--accent); }
.chart .dot { stroke: var(--surface); }
.leaders .jars i { border-radius: 1px; }
.sim-note { color: #f0dc9a; }
.unveil { background: #0b0e0d; border-radius: 3px; }
.scene { border-radius: 3px; }
.have { border-radius: 2px; font-size: 12px; }
.firsts a { font-family: var(--pixel); font-size: 12px; text-transform: uppercase; }

/* ------------------------------------------------------------------ footer: the maker's plate */
.foot { border-top: 0; position: relative; padding: 60px 0 64px; background: linear-gradient(180deg, #151a19, #0c0f0e); color: var(--ink-2); }
.foot::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 7px, #18181a 7px 14px); border-bottom: 1px solid #000; }
.foot-brand { background: var(--rivets), linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--brass-ink); padding: 18px 22px; border-radius: 3px; border: 1px solid #000; box-shadow: inset 0 -2px 0 var(--brass-lo), 0 3px 0 #000; max-width: 380px; }
.foot-brand .mark { color: var(--brass-ink); }
.foot-brand p { color: #4a3812; }
.foot-nav h2 { font-size: 16px; color: var(--brass-hi); }
.foot-nav a { color: var(--ink-2); }
.foot-nav a:hover { color: var(--accent-text); }

@media (prefers-reduced-motion: reduce) { .steps::after, .hero-copy .eyebrow::before { animation: none; } }
.cubby .sheet-thumb { background-image: url('../art/genesis-sheet.png'); background-size: 4000% 2500%; image-rendering: pixelated; }
.pill { background: #0b0e0d; color: var(--ink-2); border-radius: 2px; font-size: 16px; padding: 5px 8px 4px; box-shadow: 0 0 0 1px #000; }
.pill.practice { background: #2e2410; color: #ffd23a; }
.pill.live { background: #12301f; color: #7dffb0; }
.machine .ctl { box-shadow: none !important; background: transparent !important; border: 0 !important; color: transparent !important; }
.pop-steps { max-width: none; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pop-steps dd { font-size: 16px; line-height: 1.3; }
@media (max-width: 760px) { .pop-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.page .hint + .summary { margin-top: 14px; }

/* ---- break-the-jar game: tap counter pips, sound switch */
.scene-wrap.smash { position: relative; }
.scene-wrap.smash .scene { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.scene-wrap.smash .scene:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.smash-sound { position: absolute; top: 8px; right: 8px; font: 11px/1 var(--pixel); letter-spacing: 0.04em; color: var(--ink-2);
  background: rgba(9, 12, 11, 0.75); border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px 5px; cursor: pointer; }
.smash-sound:hover { color: var(--ink); }
.smash-meter { display: flex; gap: 6px; justify-content: center; padding: 8px 10px; background: var(--sunk); border: 1px solid var(--line); border-radius: 3px; }
.smash-meter i { width: 18px; height: 12px; border-radius: 2px; background: #16211c; box-shadow: inset 0 0 0 1px #000; transition: background 0.08s; }
.smash-meter i.on { background: var(--accent); box-shadow: inset 0 0 0 1px #000, 0 0 8px rgba(79, 227, 154, 0.7); }
.smash-meter.full i { background: var(--hazard); box-shadow: inset 0 0 0 1px #000, 0 0 10px rgba(242, 194, 48, 0.8); animation: smash-pulse 0.5s ease-in-out infinite alternate; }
@keyframes smash-pulse { to { opacity: 0.55; } }
.smash-row { gap: 8px; }
@media (max-width: 420px) { .smash-meter i { width: 14px; } }

/* ---- the control room on the home page: population gauge + lab log */
.control-room { padding-top: 28px; padding-bottom: 28px; }
.control-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: stretch; }
@media (max-width: 860px) { .control-grid { grid-template-columns: 1fr; } }
.ctl-panel { background: var(--rivets), var(--plate); border: 1px solid #000; border-radius: 4px; padding: 20px 20px 18px; box-shadow: var(--shadow); min-width: 0; }
.ctl-title { font: 16px/1 var(--pixel); text-transform: uppercase; letter-spacing: 0.04em; color: var(--brass-hi); margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.live-dot { font: 11px/1 var(--pixel); color: var(--accent-text); display: inline-flex; align-items: center; gap: 6px; }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: live-blink 1.6s steps(2, start) infinite; }
@keyframes live-blink { to { opacity: 0.25; } }
.pop-count { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pop-count .nixie { font: 400 56px/1 var(--pixel); color: #ffab4a; text-shadow: 0 0 18px rgba(255, 140, 50, 0.6); background: linear-gradient(180deg, #1a1410, #0e0a08); border: 1px solid #000; border-radius: 3px; padding: 10px 14px 6px; }
.pop-count span { font: 14px var(--pixel); color: #c98a4a; text-transform: uppercase; }
.gauge { position: relative; height: 22px; background: #0a0d0c; border: 1px solid #000; border-radius: 2px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7); margin: 6px 0 30px; }
.gauge-fill { position: absolute; inset: 2px auto 2px 2px; max-width: calc(100% - 4px); background: repeating-linear-gradient(90deg, var(--accent) 0 6px, #2fb877 6px 8px); box-shadow: 0 0 10px rgba(79, 227, 154, 0.55); border-radius: 1px; }
.gauge-held { position: absolute; top: 2px; bottom: 2px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 4px, #6b5410 4px 8px); }
.gauge .tick { position: absolute; top: -4px; bottom: -4px; width: 0; }
.gauge .tick i { position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--danger); }
.gauge .tick em { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font: normal 11px var(--pixel); color: var(--danger); }
.pop-read { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.pop-read div { background: var(--sunk); border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; }
.pop-read dt { font: 11px var(--pixel); text-transform: uppercase; color: var(--ink-2); }
.pop-read dd { margin: 4px 0 0; font: 15px var(--pixel); color: var(--accent-text); }
.pop-panel .cap { margin: 12px 0 0; }

.lab-log { list-style: none; margin: 0; padding: 6px; background: var(--sunk); border: 1px solid #000; border-radius: 3px; max-height: 360px; overflow-y: auto; display: grid; gap: 4px; }
.lab-log li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 8px; border-radius: 2px; font-size: 0.93rem; color: var(--ink); background: rgba(255, 255, 255, 0.02); }
.lab-log li.big { background: rgba(255, 255, 255, 0.05); }
.lab-log li.gold { background: rgba(242, 194, 48, 0.09); }
.lab-log li.legend { background: linear-gradient(90deg, rgba(255, 210, 63, 0.14), rgba(255, 154, 213, 0.12), rgba(138, 216, 255, 0.12)); }
.lab-log li.first { background: rgba(79, 227, 154, 0.1); }
.lab-log li.new { animation: log-in 1.4s ease-out; }
@keyframes log-in { from { background: rgba(255, 255, 255, 0.28); transform: translateX(-6px); } }
.lab-log .log-empty { display: block; color: var(--ink-2); padding: 14px 10px; }
.log-tag { font: 10px/1 var(--pixel); text-transform: uppercase; padding: 4px 6px 3px; border-radius: 2px; background: #1f2826; color: var(--ink-2); white-space: nowrap; }
.big .log-tag { color: var(--ink); background: #2c3836; }
.gold .log-tag { color: #3a2a0c; background: var(--hazard); }
.legend .log-tag { color: #241a33; background: linear-gradient(90deg, #ffd23f, #ff9ad5, #8ad8ff); }
.first .log-tag { color: var(--accent-ink); background: var(--accent); }
.lab-log time { font: 11px var(--pixel); color: var(--ink-2); white-space: nowrap; }
.lab-log a, .ticker a { color: var(--accent-text); }
.who { font-weight: 700; }
@media (max-width: 520px) { .lab-log li { grid-template-columns: minmax(0, 1fr) auto; } .lab-log .log-tag { grid-column: 1 / -1; justify-self: start; } }

/* ---- the ticker tape under the header, on every page */
.ticker { position: relative; z-index: 5; display: flex; align-items: center; gap: 0; height: 32px; overflow: hidden;
  background: #070a09; border-bottom: 1px solid #000; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); font: 12px/1 var(--pixel); color: var(--ink-2); }
.ticker[hidden] { display: none; }
.tk-pop { flex: none; height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #1a1410; color: #c98a4a; text-transform: uppercase; border-right: 1px solid #000; }
.tk-pop b { color: #ffab4a; font-weight: 400; text-shadow: 0 0 8px rgba(255, 140, 50, 0.6); }
.tk-run { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.tk-track { display: inline-flex; white-space: nowrap; animation: tk-run 60s linear infinite; padding-left: 16px; }
.tk-track:hover { animation-play-state: paused; }
.tk-dup { display: inline-flex; }
.tk-item { display: inline-flex; align-items: baseline; gap: 6px; margin-right: 34px; color: var(--ink); font-family: inherit; }
.tk-item em { font-style: normal; color: var(--accent-text); text-transform: uppercase; }
.tk-item.gold em { color: var(--hazard); } .tk-item.legend em { color: #ff9ad5; }
.tk-item b { font-weight: 400; }
@keyframes tk-run { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tk-track { animation: none; } .tk-dup { display: none; } }

/* ---- discoverers: the board, and "first ever" on a Jarling */
.board { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 6px; max-width: 560px; }
.board li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 12px; background: var(--plate); border: 1px solid #000; border-radius: 3px; }
.board li:first-child { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass-lo), 0 0 14px rgba(242, 194, 48, 0.2); }
.board li.me { background: linear-gradient(90deg, rgba(79, 227, 154, 0.16), transparent), var(--plate); }
.board .rank { font: 20px var(--pixel); color: #ffab4a; text-align: center; }
.board .n { font: 13px var(--pixel); color: var(--accent-text); }
.first-box { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, #4fe39a, #f2c230) border-box; border: 2px solid transparent; }
.first-kicker { font: 12px var(--pixel); text-transform: uppercase; color: var(--accent-text); margin: 0 0 4px; }
.first-banner { background: var(--sunk); border: 2px solid var(--accent); border-radius: 4px; padding: 12px 16px; text-align: center; box-shadow: 0 0 18px rgba(79, 227, 154, 0.25); }
.first-banner h3 { margin: 0 0 6px; font-size: 1.4rem; }
.first-banner p:last-child { margin: 0; color: var(--ink-2); }

/* ---- the staff door at the back of the lab (a teaser: no words beyond what's on the door) */
.staff-band { padding-top: 40px; padding-bottom: 48px; background: linear-gradient(180deg, transparent, #070a09 70%); }
.staff-door { display: grid; justify-items: center; gap: 10px; }
.staff-door-cv { display: block; width: min(720px, 100%); height: auto; aspect-ratio: 240 / 150; image-rendering: pixelated; border: 1px solid #000; border-radius: 3px; box-shadow: var(--shadow); touch-action: manipulation; }
.staff-door-cv:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.staff-status { margin: 0; font: 12px var(--pixel); letter-spacing: 0.04em; color: #8b9693; text-transform: uppercase; text-align: center; min-height: 1.4em; }

/* ---- little secrets (js/eggs.js) */
.knockable { cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; }
.knockable.tap img { animation: egg-tap 0.14s ease-out; }
.knockable.rattle img { animation: egg-rattle 0.55s ease-in-out; }
@keyframes egg-tap { 30% { transform: translate(1px, -1px); } 70% { transform: translate(-1px, 0); } }
@keyframes egg-rattle { 10%, 50%, 90% { transform: translate(-3px, 0) rotate(-2deg); } 30%, 70% { transform: translate(3px, 0) rotate(2deg); } }
.speech { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 3; white-space: nowrap; pointer-events: none;
  font: 11px/1 var(--pixel); color: #1d1620; background: #f4efe2; border: 2px solid #1d1620; border-radius: 3px; padding: 6px 8px 5px;
  animation: speech-in 2.6s ease both; }
.speech::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -4px; border: 4px solid transparent; border-top-color: #1d1620; }
@keyframes speech-in { 0% { opacity: 0; transform: translate(-50%, 6px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
body.lights-out { filter: brightness(0.62) contrast(1.25) sepia(1) hue-rotate(62deg) saturate(2.4); }
body.lights-out::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 99;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.65) 100%); }
.lights-note { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 100; pointer-events: none; opacity: 0;
  font: 14px/1 var(--pixel); color: #7dffb0; background: #050807; border: 1px solid #1f4a30; border-radius: 3px; padding: 9px 12px 8px; }
.lights-note.show { animation: note-show 2.2s ease both; }
@keyframes note-show { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
body.night-shift .hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: #000; opacity: 0; animation: flicker 11s steps(1) infinite; }
@keyframes flicker { 0%, 90% { opacity: 0; } 91% { opacity: 0.45; } 92% { opacity: 0.05; } 93% { opacity: 0.35; } 94%, 100% { opacity: 0; } }
.night-ghost { position: fixed; top: 22vh; left: -60px; width: 44px; height: 44px; z-index: 40; pointer-events: none; opacity: 0;
  image-rendering: pixelated; filter: drop-shadow(0 0 8px rgba(200, 255, 240, 0.6)); animation: ghost-drift 50s linear infinite 6s; }
.night-ghost svg { width: 100%; height: 100%; display: block; animation: ghost-bob 2.4s ease-in-out infinite; }
@keyframes ghost-drift { 0% { left: -60px; opacity: 0; } 2% { opacity: 0.55; } 34% { left: calc(100vw + 60px); opacity: 0.55; } 35%, 100% { left: calc(100vw + 60px); opacity: 0; } }
@keyframes ghost-bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .knockable.tap img, .knockable.rattle img, body.night-shift .hero::after { animation: none; } }

/* ---- the lost-specimen page (404) */
.lost { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 40px 0 70px; }
.lost-art { width: min(560px, 92vw); height: auto; image-rendering: pixelated; }
.lost h1 { margin: 0; }
.lost .lede { max-width: 46ch; margin: 0 auto; }

/* ---- the lab terminal (js/terminal.js): drops down over the mining page */
.jar-term { position: fixed; left: 0; right: 0; top: 0; height: min(52vh, 420px); z-index: 120; display: grid; grid-template-rows: 1fr auto;
  background: rgba(4, 10, 7, 0.97); border-bottom: 2px solid #1f6b45; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  transform: translateY(-105%); transition: transform 0.22s ease; font: 14px/1.5 var(--pixel); color: #7dffb0; }
.jar-term.open { transform: none; }
.jar-term::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.25) 0 1px, transparent 1px 3px); }
.term-out { overflow-y: auto; padding: 14px 18px 6px; white-space: pre-wrap; text-shadow: 0 0 6px rgba(79, 227, 154, 0.55); }
.term-line.dim { color: #3f9a6a; } .term-line.echo { color: #e6fff0; }
.term-in { display: flex; gap: 10px; align-items: center; padding: 10px 18px 14px; border-top: 1px solid #12301f; }
.term-in span { color: #e6fff0; }
.term-in input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #e6fff0; font: inherit; text-transform: uppercase; caret-color: #7dffb0; }
@media (prefers-reduced-motion: reduce) { .jar-term { transition: none; } }
