/* ── tokens (cliamp.stream aesthetic) ────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #0b0c0d;
  --panel: #0e1012;
  --panel-2: #121517;
  --panel-3: #15181a;
  --line: #23282b;
  --line-2: #1c2124;
  --line-3: #16191b;
  --line-hi: #2b3134;
  --fg: #e9ece9;
  --fg-2: #98a09f;
  --mute: #6a7273;
  --mute-2: #8a9291;
  --accent: var(--st-accent, #74e08c);
  --accent-hi: var(--st-accent-hi, #a9f0b8);
  --warm: var(--st-warm, #e9b455);
  --purple: #c39ad9;
  --rose: #d99a8f;
  --blue: #8fb3d9;
  --eq-neg: #3a4145;
  --viz-bg: #0a0c0d;
  --top-bg: rgba(11, 12, 13, 0.85);
  --sans: 'Space Grotesk', system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1240px;
  --pad: clamp(16px, 3vw, 32px);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hi);
  text-decoration: underline;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

input[type="range"] {
  accent-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0;
}

h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.1;
}

.sub {
  color: var(--fg-2);
  margin: 10px 0 0;
  font-size: 16px;
  max-width: 62ch;
}

.sub code, .keys p code {
  font-family: var(--mono);
  color: var(--fg);
  font-size: 0.92em;
}

/* ── background canvas & CRT scanlines ───────────────────────────── */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
  opacity: 0.52;
  transition: opacity 0.9s ease;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 45;
  opacity: 0;
  transition: opacity 0.25s ease;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.34) 50%, transparent 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
  background-size: 100% 4px, 6px 100%;
}

body.crt-on .scanlines {
  opacity: 1;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ── header ──────────────────────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--top-bg);
  border-bottom: 1px solid var(--line);
}

.top-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px var(--pad);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 14.5px;
  letter-spacing: 0.14em;
  color: var(--fg);
}

.brand:hover {
  text-decoration: none;
  color: var(--fg);
}

.brand .logo {
  width: 22px;
  height: 22px;
  display: block;
}

.brand b {
  color: var(--accent);
  font-weight: 600;
}

.brand .role-tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--mute);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12.5px;
  margin-left: auto;
}

.nav a,
.nav button.nav-toggle {
  all: unset;
  cursor: pointer;
  color: var(--fg-2);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.nav a:hover,
.nav button.nav-toggle:hover {
  color: var(--fg);
  background: var(--panel-3);
  text-decoration: none;
}

.nav button.nav-toggle.active {
  color: var(--accent);
  background: var(--panel-2);
  border: 1px solid var(--line-hi);
}

.nav a.cta {
  color: var(--bg);
  background: var(--accent);
  padding: 6px 12px;
  font-weight: 500;
}

.nav a.cta:hover {
  background: var(--accent-hi);
  color: var(--bg);
}

@media (max-width: 860px) {
  .nav a.opt,
  .brand .role-tag {
    display: none;
  }
}

/* ── sections ────────────────────────────────────────────────────── */
section {
  padding: clamp(40px, 5vw, 72px) 0;
  border-top: 1px solid var(--line-3);
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.link-btn {
  font-family: var(--mono);
  font-size: 12.5px;
  border: 1px solid var(--line-hi);
  border-radius: 4px;
  padding: 8px 13px;
  color: var(--fg);
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}

.link-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ── hero ────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 48px);
  border-top: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--mute);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-size: clamp(44px, 7vw, 84px);
  line-height: 0.94;
  margin: 18px 0 0;
}

.tagline {
  font-family: var(--mono);
  font-size: clamp(16px, 2vw, 20px);
  color: var(--fg);
  margin: 16px 0 0;
  line-height: 1.4;
}

.tagline em {
  color: var(--warm);
  font-style: italic;
}

.lede {
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--fg-2);
  margin: 18px 0 0;
  max-width: 56ch;
  text-wrap: pretty;
}

.lede b {
  color: var(--fg);
  font-weight: 500;
}

.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 14px;
}

.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 5px;
  border: 1px solid var(--line-hi);
  color: var(--fg);
  cursor: pointer;
  background: transparent;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.2;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.btn.go {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}

.btn.go:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  color: var(--bg);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
}

.chips span {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 9px;
}

/* ── terminal player (.tty) ──────────────────────────────────────── */
.tty-cap {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
  display: flex;
  justify-content: space-between;
  padding: 0 4px 8px;
  gap: 10px;
}

.tty-cap b {
  color: var(--accent);
  font-weight: 400;
}

.tty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.tty-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

.dots {
  display: flex;
  gap: 5px;
}

.dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-hi);
}

.tty-bar .brandline {
  margin-left: auto;
  letter-spacing: 0.24em;
  color: var(--accent);
}

.tty-body {
  padding: 16px;
  font-family: var(--mono);
}

.t-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.t-title .note {
  color: var(--warm);
}

#t-name {
  font-size: clamp(15px, 1.7vw, 19px);
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#t-meta {
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 6px;
  min-height: 15px;
}

.t-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--fg-2);
}

#t-elapsed {
  color: var(--accent);
}

#t-state {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 7px;
  color: var(--mute);
}

#t-live {
  margin-left: auto;
  color: var(--mute);
}

#t-live.live {
  color: var(--accent);
}

#viz {
  width: 100%;
  height: 92px;
  display: block;
  margin-top: 14px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--viz-bg);
}

.t-eqvol {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--mute);
  flex-wrap: wrap;
}

.t-eqvol .eq-btn {
  all: unset;
  cursor: pointer;
  color: var(--mute);
}

.t-eqvol .eq-btn:hover .lab {
  color: var(--accent);
}

.t-eqvol .lab {
  color: var(--warm);
}

#eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  cursor: pointer;
}

#eq span {
  width: 4px;
  border-radius: 1px;
  display: block;
  background: var(--accent);
  transition: height 0.2s ease;
}

#eq span.neg {
  background: var(--eq-neg);
}

.vol {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vol input {
  width: 88px;
  height: 3px;
}

#voldb {
  color: var(--fg-2);
  min-width: 30px;
}

.t-ctl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.tbtn {
  font-family: var(--mono);
  background: var(--panel-3);
  color: var(--fg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 12px;
}

.tbtn:hover {
  color: var(--fg);
  border-color: var(--line-hi);
}

.tbtn.play {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  min-width: 96px;
}

.tbtn.play:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  color: var(--bg);
}

.t-src {
  margin-left: auto;
  font-size: 11px;
  color: var(--mute);
}

.t-src b {
  color: var(--fg-2);
  font-weight: 400;
}

.t-plhead {
  margin-top: 14px;
  border-top: 1px solid var(--line-2);
  padding-top: 10px;
  font-size: 11px;
  color: var(--mute);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#t-list {
  max-height: 190px;
  overflow-y: auto;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-hi) transparent;
}

.st {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-2);
  box-sizing: border-box;
  width: 100%;
}

.st:hover {
  background: var(--panel-3);
}

.st:focus-visible {
  outline: 2px solid var(--accent);
}

.st.on {
  background: var(--panel-3);
  color: var(--fg);
}

.st .mark {
  color: var(--mute-2);
  width: 10px;
}

.st.on .mark {
  color: var(--accent);
}

.st .num {
  color: var(--mute-2);
  min-width: 20px;
}

.st .nm {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st .tag {
  color: var(--fg-2);
  font-size: 11.5px;
  margin-left: 6px;
  white-space: nowrap;
}

.st .cnt {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}

.st .fav {
  color: var(--mute-2);
  padding: 0 2px;
  font-size: 13px;
}

.st .fav.on {
  color: var(--warm);
}

.tty-hint {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 4px;
}

.tty-hint code {
  color: var(--fg-2);
  font-family: inherit;
  word-break: break-all;
}

.tty-hint code .p {
  color: var(--accent);
}

/* ── quick dispatch / copy-cards ─────────────────────────────────── */
.g-install {
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}

.copy-card {
  all: unset;
  cursor: pointer;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  background: var(--panel);
  box-sizing: border-box;
  transition: border-color 0.15s, transform 0.15s;
}

.copy-card:hover {
  border-color: var(--accent);
}

.copy-card:focus-visible {
  outline: 2px solid var(--accent);
}

.cc-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.14em;
}

.cc-head [data-copylabel],
.cc-head .cc-act {
  color: var(--accent);
}

.cc-cmd {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  margin-top: 10px;
  word-break: break-all;
}

.note-line {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--mute);
  margin: 16px 0 0;
  line-height: 1.8;
}

.note-line b {
  color: var(--accent);
  font-weight: 400;
}

.note-line i {
  color: var(--fg-2);
  font-style: normal;
}

/* ── skills / sources grid ───────────────────────────────────────── */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
}

.filters button {
  all: unset;
  cursor: pointer;
  padding: 6px 11px;
  border-radius: 4px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
}

.filters button:hover {
  color: var(--fg);
  border-color: var(--line-hi);
}

.filters button:focus-visible {
  outline: 2px solid var(--accent);
}

.filters button.on {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 500;
}

.g-sources {
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.src {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 15px 16px;
  background: var(--panel);
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.src:hover {
  border-color: var(--c);
}

.src-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.src-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  flex: 0 0 auto;
}

.lvl-blocks {
  display: flex;
  gap: 3px;
  align-items: center;
}

.lvl-blocks i {
  width: 8px;
  height: 8px;
  border-radius: 1.5px;
  background: var(--line-2);
  border: 1px solid var(--line-hi);
  display: inline-block;
}

.lvl-blocks i.on {
  background: var(--c);
  border-color: var(--c);
}

.src-note {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--fg-2);
  line-height: 1.45;
}

.src-cmd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  margin-top: auto;
  padding-top: 4px;
}

/* ── features & stats counters ───────────────────────────────────── */
.big {
  display: flex;
  gap: 24px;
  font-family: var(--mono);
  flex-wrap: wrap;
}

.big .n {
  font-size: clamp(24px, 3vw, 34px);
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.big .n.fg {
  color: var(--fg);
}

.big .n.warm {
  color: var(--warm);
}

.big .l {
  font-size: 11px;
  color: var(--fg-2);
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.g-feat {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.feat {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  background: var(--panel);
  transition: border-color 0.15s;
}

.feat:hover {
  border-color: var(--line-hi);
}

.feat-k {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.feat-k.alt {
  color: var(--purple);
}

.feat-k.warm {
  color: var(--warm);
}

.feat p {
  color: var(--fg-2);
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
}

.feat p b {
  color: var(--fg);
  font-weight: 500;
}

kbd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ── specs / plugins TOML + API layout ───────────────────────────── */
.g-plug {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 24px;
  align-items: start;
}

.code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}

.card-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-2);
  background: var(--panel-2);
}

.card-bar b {
  color: var(--accent);
  font-weight: 400;
  white-space: nowrap;
}

.card-bar .mute {
  color: var(--mute);
}

.card-bar button {
  all: unset;
  cursor: pointer;
  color: var(--accent);
  font-size: 11px;
  font-family: var(--mono);
}

.card-bar button:hover {
  color: var(--accent-hi);
}

.code pre {
  margin: 0;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--fg-2);
  overflow-x: auto;
}

.code .c {
  color: var(--mute);
}

.code .k {
  color: var(--accent);
}

.code .s {
  color: var(--warm);
}

.code .p {
  color: var(--purple);
}

.api {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-i {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  background: var(--panel);
}

.api-i:hover {
  border-color: var(--line-hi);
}

.api-i .sig {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.api-i .sig span {
  color: var(--accent);
}

.api-i .d {
  color: var(--mute-2);
  font-size: 13.5px;
  margin-top: 5px;
  line-height: 1.5;
}

/* ── family crew (.g-ch radio card style) ────────────────────────── */
.g-ch {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.ch {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s;
}

.ch:hover,
.ch.on {
  border-color: var(--c);
}

.ch-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ch-sprite {
  font-size: 20px;
  line-height: 1;
}

.ch-name {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--fg);
  font-weight: 500;
}

.ch-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--c);
  margin-left: auto;
  white-space: nowrap;
  border: 1px solid var(--line-hi);
  padding: 2px 7px;
  border-radius: 3px;
}

.ch-rel {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--warm);
}

.ch-desc {
  font-size: 14.5px;
  color: var(--fg-2);
  line-height: 1.58;
  margin: 0;
}

.ch-foot {
  display: flex;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.ch-foot .cnt {
  margin-left: auto;
  color: var(--mute);
  font-size: 11.5px;
  white-space: nowrap;
}

.mini {
  all: unset;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 11px;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 11.5px;
}

.mini:hover {
  color: var(--fg);
  border-color: var(--line-hi);
}

.mini.pri {
  background: var(--panel-3);
  border-color: var(--line-hi);
  color: var(--fg);
}

.mini.pri:hover {
  border-color: var(--c);
  color: var(--c);
}

/* ── arcade deck & canvas games ──────────────────────────────────── */
.arcade-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  margin-top: 24px;
  align-items: stretch;
}

@media (max-width: 920px) {
  .arcade-layout {
    grid-template-columns: 1fr;
  }
}

.arcade-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.arcade-stage {
  position: relative;
  min-height: 420px;
  background: var(--viz-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#arcade-canvas {
  background: #070809;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  display: block;
}

.arcade-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 12, 13, 0.86);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-family: var(--mono);
}

.arcade-overlay.hidden {
  display: none;
}

.arcade-overlay h3 {
  font-family: var(--mono);
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 8px;
}

.arcade-overlay p {
  color: var(--fg-2);
  font-size: 13px;
  margin: 4px 0;
  max-width: 42ch;
}

.score-input-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.score-input-row input {
  background: var(--panel-2);
  border: 1px solid var(--line-hi);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  padding: 7px 11px;
  border-radius: 4px;
  width: 160px;
}

/* Sprite generator tools */
.sprite-tools {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.sprite-tools.active {
  display: flex;
}

#sprite-canvas {
  border: 1px solid var(--line-hi);
  cursor: crosshair;
  background: #000;
  image-rendering: pixelated;
  max-width: 100%;
}

.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.pal-swatch {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  border: 2px solid var(--line-hi);
  cursor: pointer;
  padding: 0;
}

.pal-swatch.on {
  border-color: var(--fg);
  transform: scale(1.12);
}

.arcade-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--mono);
}

.side-h {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-2);
  letter-spacing: 0.12em;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.score-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12.5px;
}

.row .nm {
  color: var(--fg);
  display: flex;
  justify-content: space-between;
}

.row .bar {
  height: 4px;
  background: var(--line-2);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.row .bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.row .v {
  color: var(--accent);
  min-width: 48px;
  text-align: right;
}

/* ── interactive MS-DOS 6.22 terminal (#terminal) ────────────────── */
.dos-body {
  padding: 16px;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--viz-bg);
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dos-line {
  line-height: 1.55;
  color: var(--fg-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.dos-line.cmd {
  color: var(--fg);
}

.dos-line.cmd .prompt {
  color: var(--accent);
  margin-right: 8px;
}

.dos-line.err {
  color: var(--rose);
}

.dos-line.hi {
  color: var(--accent);
}

.dos-line.warm {
  color: var(--warm);
}

.dos-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel-2);
  border-top: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 13px;
}

.dos-input-bar .prompt {
  color: var(--accent);
  white-space: nowrap;
}

#dos-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
}

.dos-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ── keys ────────────────────────────────────────────────────────── */
.keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(24px, 4vw, 48px);
}

.keys p {
  line-height: 1.6;
  max-width: 46ch;
}

.keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-content: start;
}

.key {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px 13px;
  background: var(--panel);
}

.key .k {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

.key .d {
  font-size: 13px;
  color: var(--fg-2);
  margin-top: 4px;
}

/* ── contact / transmission portal ───────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.form-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.form-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-2);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line-hi);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.tx-status {
  font-family: var(--mono);
  font-size: 12.5px;
  min-height: 18px;
}

.tx-status.ok {
  color: var(--accent);
}

.tx-status.err {
  color: var(--rose);
}

.danger-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
}

.danger-box h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--rose);
}

.btn.danger {
  border-color: var(--rose);
  color: var(--rose);
}

.btn.danger:hover {
  background: var(--rose);
  color: var(--bg);
}

/* ── shutdown modal ──────────────────────────────────────────────── */
.shutdown-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #060708;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  padding: 24px;
  text-align: center;
}

.shutdown-modal.active {
  display: flex;
}

.shutdown-bar-wrap {
  width: 100%;
  max-width: 380px;
  height: 8px;
  background: var(--panel-3);
  border: 1px solid var(--line-hi);
  border-radius: 4px;
  overflow: hidden;
  margin: 18px 0;
}

.shutdown-bar {
  height: 100%;
  width: 0%;
  background: var(--rose);
  transition: width 0.1s linear;
}

/* ── cta & footer ────────────────────────────────────────────────── */
.cta-sec {
  text-align: center;
  padding: clamp(44px, 6vw, 80px) 0;
}

.cta-sec h2 {
  font-size: clamp(28px, 4vw, 46px);
}

.cta-sec .btns {
  justify-content: center;
  margin-top: 26px;
}

footer {
  border-top: 1px solid var(--line-3);
  padding: 26px 0 44px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  align-items: center;
}

footer .fb {
  display: flex;
  align-items: center;
  gap: 9px;
}

footer .fb .logo {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

footer .fl {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

footer a {
  color: var(--fg-2);
}
