/* Shareholders — one stylesheet for the splash and HQ.
   The look: square-edged blocks on a strict grid. No rounded corners, no shadows, no gradients. */

@font-face { font-family: 'Inter'; font-weight: 900; font-display: swap; src: url('/fonts/inter-900.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 400; font-display: swap; src: url('/fonts/plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 500; font-display: swap; src: url('/fonts/plex-mono-500.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 700; font-display: swap; src: url('/fonts/plex-mono-700.woff2') format('woff2'); }

:root {
  /* the collection's own colours */
  --ink: #0a0d0c;
  --spruce: #11241f;
  --moss: #23322e;
  --teal: #1f4540;
  --forest: #264e37;
  --emerald: #3b6e50;
  --gold: #a8843a;
  /* interface */
  --paper: #e9e4d2;
  --dim: #8fa69a;
  --line: #2f4a40;
  --up: #7fcf9c;
  --down: #e0685c;
  --gap: 10px;
  --mono: 'Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --heavy: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }
html { background: var(--ink); color: var(--paper); font: 400 13px/1.45 var(--mono); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
img.px { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; background: var(--spruce); }

.caps { text-transform: uppercase; letter-spacing: .08em; }
.dim { color: var(--dim); }
.gold { color: var(--gold); }
.up { color: var(--up); }
.down { color: var(--down); }
.heavy { font-family: var(--heavy); font-weight: 900; letter-spacing: -.01em; text-transform: uppercase; line-height: .95; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border: 1px solid var(--paper); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.btn:hover { background: var(--paper); color: var(--ink); }
.btn.solid { background: var(--paper); color: var(--ink); }
.btn.solid:hover { background: var(--gold); border-color: var(--gold); }
.btn.quiet { border-color: var(--line); color: var(--dim); }
.btn.quiet:hover { background: var(--moss); color: var(--paper); }
.btn[disabled] { border-color: var(--line); color: var(--dim); cursor: default; background: none; }

/* ---------- splash ---------- */
.splash { position: relative; height: 100dvh; overflow: hidden; display: grid; place-items: center; background: var(--spruce); }
.splash .wall { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(max(72px, 5vw), 1fr)); align-content: start; opacity: .34; }
.splash .wall img { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.splash .card { position: relative; width: min(560px, calc(100vw - 32px)); background: var(--ink); border: 1px solid var(--paper); padding: 10px; }
.splash .card-in { border: 1px solid var(--line); padding: clamp(24px, 6vw, 48px) clamp(16px, 5vw, 40px); text-align: center; display: grid; gap: 28px; justify-items: center; }
.splash h1 { font-size: clamp(28px, 8vw, 52px); }
.splash .lines { min-height: 4.4em; font-weight: 700; font-size: 14px; }
.splash .cursor::after { content: '█'; animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.splash .btn { width: 100%; min-height: 52px; font-size: 14px; }
.splash .note { font-size: 11px; }

/* ---------- HQ frame ---------- */
.app { height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: var(--gap); padding: var(--gap); }
.bar { display: grid; grid-template-columns: 250px minmax(0, 1fr) 250px; gap: var(--gap); }
.brand, .status { border: 1px solid var(--line); background: var(--spruce); display: flex; align-items: center; padding: 0 14px; min-height: 48px; }
.brand { gap: 10px; }
.brand b { font-family: var(--heavy); font-weight: 900; font-size: 17px; text-transform: uppercase; }
.brand i { font-style: normal; background: var(--paper); color: var(--ink); font-weight: 700; padding: 1px 6px; font-size: 12px; }
.status { justify-content: space-between; font-size: 11px; }
.status .dev { color: var(--gold); border: 1px solid var(--gold); padding: 1px 6px; }
.nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--spruce); }
.nav a { display: grid; place-items: center; text-align: center; min-height: 46px; padding: 0 6px; font-size: 11px; font-weight: 700; color: var(--dim); border-left: 1px solid var(--line); }
.nav a:first-child { border-left: 0; }
.nav a:hover { color: var(--paper); background: var(--moss); }
.nav a[aria-current] { background: var(--paper); color: var(--ink); }

.tape { border: 1px solid var(--line); background: var(--ink); overflow: hidden; white-space: nowrap; height: 30px; display: flex; align-items: center; font-size: 12px; }
.tape .run { display: inline-flex; animation: tape 60s linear infinite; }
.tape span { padding: 0 22px; border-right: 1px solid var(--line); }
.tape b { font-weight: 700; margin-right: 8px; }
@keyframes tape { to { transform: translateX(-50%); } }

.foot { display: flex; justify-content: space-between; gap: 16px; font-size: 10px; color: var(--dim); padding: 0 2px; }
main { min-height: 0; overflow: auto; }

/* ---------- panels ---------- */
.panel { border: 1px solid var(--line); background: var(--spruce); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 30px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--moss); font-size: 11px; font-weight: 700; flex: none; }
.panel > header .tag { font-weight: 500; color: var(--gold); }
.panel > header a:hover { color: var(--gold); }
.panel > .body { padding: 12px; flex: 1; min-height: 0; overflow: auto; }
.panel > .body.flush { padding: 0; }
.cells { display: grid; gap: 1px; background: var(--line); }
.cells > * { background: var(--spruce); }

.kv { display: grid; grid-template-columns: auto 1fr; }
.kv > * { padding: 5px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--dim); padding-right: 16px; }
.kv dd { text-align: right; }

.tier { display: inline-block; border: 1px solid currentColor; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.tier.t-controlling-interest { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.tier.t-board-seat { color: var(--gold); }
.tier.t-preferred-stock { color: var(--up); }

.meter { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.meter i { aspect-ratio: 1; background: var(--moss); border: 1px solid var(--line); }
.meter i.on { background: var(--up); border-color: var(--up); }
.meter.plain i.on { background: var(--paper); border-color: var(--paper); }

.spark { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; align-items: end; height: 100%; min-height: 36px; }
.spark i { background: var(--emerald); }
.spark.up i { background: var(--up); }
.spark.down i { background: var(--down); }
.spark.plain i { background: var(--paper); }

/* ---------- overview ---------- */
.overview { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr) minmax(0, 1fr); grid-template-areas: 'mine mood learn' 'mine index learn' 'reg reg reg'; }
.o-mine { grid-area: mine; } .o-mood { grid-area: mood; } .o-index { grid-area: index; } .o-learn { grid-area: learn; } .o-reg { grid-area: reg; }

.mine-id { padding: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.mine-id h2 { font: 700 16px/1.2 var(--mono); }
.mine-traits { padding: 4px 12px 12px; }

.mood { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 100%; }
.mood > div { padding: 14px; display: flex; flex-direction: column; gap: 10px; justify-content: space-between; min-width: 0; }
.word { font-size: clamp(22px, 2.3vw, 44px); }
.mk { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: end; }
.mk .spark { grid-column: 1 / -1; height: 30px; min-height: 30px; }
.states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.states figure { border: 1px solid var(--line); }
.states figure.on { border-color: var(--paper); }
.states figcaption { font-size: 10px; text-align: center; padding: 3px 0; border-top: 1px solid var(--line); }
.states figure.on figcaption { background: var(--paper); color: var(--ink); border-color: var(--paper); font-weight: 700; }

.baskets { grid-template-columns: repeat(4, minmax(0, 1fr)); height: 100%; }
.basket:hover { background: var(--moss); }
.basket { padding: 14px; display: grid; grid-template-rows: auto auto minmax(36px, 1fr); gap: 8px; min-width: 0; }
.basket .num { font: 700 22px/1 var(--mono); }

.steps { counter-reset: step; }
.steps li { list-style: none; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 0 12px 0 0; border-bottom: 1px solid var(--line); min-height: 40px; }
.steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: grid; place-items: center; height: 100%; min-height: 40px; border-right: 1px solid var(--line); color: var(--dim); font-weight: 700; }
.steps .s-done::before { background: var(--emerald); color: var(--paper); }
.steps .s-next::before { background: var(--paper); color: var(--ink); }
.steps em { font-style: normal; font-size: 10px; color: var(--dim); }
.steps .s-next em { color: var(--gold); }
.sub { padding: 7px 12px; background: var(--moss); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; color: var(--dim); }
.rows > div { padding: 8px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 1px; }
.rows b { font-weight: 700; }

.reg { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; }
.reg > * { border-left: 1px solid var(--line); }
.reg > :first-child { border-left: 0; }
.reg .big { padding: 10px 18px; display: grid; align-content: center; }
.reg .big b { font-family: var(--heavy); font-weight: 900; font-size: 44px; line-height: 1; }
.reg .tiers { display: grid; grid-template-columns: repeat(4, 108px); }
.reg .tiers a { padding: 10px 12px; display: grid; align-content: center; gap: 2px; border-left: 1px solid var(--line); font-size: 10px; }
.reg .tiers a:first-child { border-left: 0; }
.reg .tiers a:hover { background: var(--moss); }
.reg .tiers b { font: 700 22px/1 var(--mono); }
.reg .strip { display: flex; overflow: hidden; }
.reg .strip a { flex: none; width: 76px; border-right: 1px solid var(--ink); }
.reg .strip a:hover { outline: 2px solid var(--paper); outline-offset: -2px; }
.reg .all { display: grid; place-items: center; padding: 0 22px; font-weight: 700; font-size: 11px; }
.reg .all:hover { background: var(--paper); color: var(--ink); }

/* On a roomy screen the overview fills the window exactly, with no page scroll. */
@media (min-width: 1180px) and (min-height: 720px) {
  .overview { height: 100%; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto; }
}

/* ---------- gallery ---------- */
.gallery { display: grid; gap: var(--gap); grid-template-columns: 250px minmax(0, 1fr); min-height: 100%; align-items: start; }
.filters { position: sticky; top: 0; }
.filters input { width: 100%; height: 38px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--ink); }
.filters input::placeholder { color: var(--dim); }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.opts.one { grid-template-columns: 1fr; }
.opts button { background: var(--spruce); min-height: 32px; padding: 4px 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; text-align: left; }
.opts button span { color: var(--dim); }
.opts button:hover { background: var(--moss); }
.opts button[aria-pressed='true'] { background: var(--paper); color: var(--ink); font-weight: 700; }
.opts button[aria-pressed='true'] span { color: var(--ink); }
.opts button i { width: 12px; height: 12px; border: 1px solid var(--paper); flex: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.tiles a { background: var(--spruce); display: block; }
.tiles a span { display: flex; justify-content: space-between; padding: 3px 7px; font-size: 10px; border-top: 1px solid var(--line); color: var(--dim); }
.tiles a:hover span { background: var(--paper); color: var(--ink); }
.tiles .none { grid-column: 1 / -1; padding: 40px 12px; text-align: center; color: var(--dim); background: var(--spruce); }

/* ---------- one character ---------- */
.record { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; max-width: 1280px; margin: 0 auto; }
.record .head { padding: 14px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.record h1 { font-size: clamp(26px, 3.2vw, 44px); }
.record .acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.record .acts .btn { border: 0; background: var(--spruce); min-height: 44px; }
.record .acts .btn:hover { background: var(--paper); color: var(--ink); }
.record .side { display: grid; gap: var(--gap); }

/* ---------- section pages ---------- */
.page { display: grid; gap: var(--gap); grid-template-columns: repeat(6, minmax(0, 1fr)); align-content: start; }
.page > .panel { grid-column: span 2; }
.page > .w3 { grid-column: span 3; }
.page > .w4 { grid-column: span 4; }
.page > .w6 { grid-column: span 6; }
.lede { padding: 18px 14px; display: grid; gap: 10px; }
.lede h1 { font-size: clamp(30px, 4.6vw, 64px); }
.lede p { max-width: 62ch; color: var(--dim); }
.days { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; }
.days i { aspect-ratio: 1; background: var(--moss); border: 1px solid var(--line); }
.days i.b1 { background: var(--up); border-color: var(--up); }
.days i.b-1 { background: var(--down); border-color: var(--down); }
.slots li { list-style: none; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; min-height: 30px; border-bottom: 1px solid var(--line); padding-right: 12px; font-size: 12px; }
.slots li b { display: grid; place-items: center; height: 100%; border-right: 1px solid var(--line); color: var(--dim); }
.eps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.eps div { background: var(--ink); aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; font-size: 10px; color: var(--dim); }
.big-num { font: 700 30px/1 var(--mono); }
.btn.open { border: 0; border-top: 1px solid var(--line); width: 100%; min-height: 44px; }
.lede a:hover { color: var(--paper); }
.facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts > div { padding: 14px; display: grid; gap: 4px; align-content: start; }
.facts b { font: 700 20px/1.2 var(--mono); }
.facts span:last-child { font-size: 11px; }
.fng { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.6fr); gap: 24px; }
.fng > div { display: grid; gap: 10px; align-content: start; min-width: 0; }
.fng .word { font-size: clamp(40px, 6vw, 84px); }
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.tbl th, .tbl td { padding: 7px 12px; text-align: right; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 10px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; background: var(--moss); }
.tbl .l { text-align: left; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; background: var(--ink); }

/* ---------- smaller screens ---------- */
@media (max-width: 1179px) {
  .app { height: auto; min-height: 100dvh; }
  main { overflow: visible; }
  .bar { grid-template-columns: 1fr 1fr; }
  .nav { grid-column: 1 / -1; grid-row: 2; }
  .overview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'mood mood' 'index index' 'mine learn' 'reg reg'; }
  .reg { grid-template-columns: auto minmax(0, 1fr); }
  .reg .strip { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .reg .all { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); min-height: 44px; }
  .reg .tiers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .page > .panel, .page > .w3, .page > .w4 { grid-column: span 3; }
  .page > .w6 { grid-column: span 6; }
  .filters { position: static; }
}
@media (max-width: 719px) {
  :root { --gap: 8px; }
  .bar { grid-template-columns: 1fr auto; }
  .status .clock { display: none; }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav a { border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: -1px 0 0 -1px; }
  .overview { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'mine' 'mood' 'index' 'learn' 'reg'; }
  .mood, .baskets, .fng { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reg { grid-template-columns: minmax(0, 1fr); }
  .reg > * { border-left: 0; border-top: 1px solid var(--line); }
  .reg > :first-child { border-top: 0; }
  .gallery, .record { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page > .panel, .page > .w3, .page > .w4, .page > .w6 { grid-column: span 6; }
  .eps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .days { grid-template-columns: repeat(15, minmax(0, 1fr)); }
  .foot { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .tape .run, .splash .cursor::after { animation: none; }
}
