/* ───────────────────────── themes ───────────────────────── */
:root, [data-theme="green"] {
  --fg: #33ff66;
  --fg-dim: #1c9e3f;
  --fg-faint: #0f5a24;
  --accent: #b6ffcb;
  --err: #ff5f56;
  --bg: #010401;
  --glow: rgba(51, 255, 102, .55);
}
[data-theme="amber"] {
  --fg: #ffb000; --fg-dim: #a87400; --fg-faint: #5a3e00; --accent: #ffe2a3;
  --bg: #050300; --glow: rgba(255, 176, 0, .5);
}
[data-theme="cyan"] {
  --fg: #00e5ff; --fg-dim: #0094a6; --fg-faint: #00505a; --accent: #c4f8ff;
  --bg: #000405; --glow: rgba(0, 229, 255, .5);
}
[data-theme="white"] {
  --fg: #e6e6e6; --fg-dim: #8a8a8a; --fg-faint: #444; --accent: #ffffff;
  --bg: #050505; --glow: rgba(230, 230, 230, .35);
}
[data-theme="kali"] {
  --fg: #d6deeb; --fg-dim: #7f8ea3; --fg-faint: #34405a; --accent: #3d8bff;
  --err: #ff4d4d; --bg: #070a12; --glow: rgba(61, 139, 255, .35);
}
[data-theme="red"] {
  --fg: #ff3b3b; --fg-dim: #a32020; --fg-faint: #561010; --accent: #ffc2c2;
  --bg: #050000; --glow: rgba(255, 59, 59, .5);
}

/* ───────────────────────── font ─────────────────────────
 * "Px437/WebPlus IBM VGA 8x16" from The Ultimate Oldschool PC Font Pack
 * by VileR, https://int10h.org/oldschool-pc-fonts/ (CC BY-SA 4.0)        */
@font-face {
  font-family: "IBM VGA";
  src: url("fonts/WebPlus_IBM_VGA_8x16.woff") format("woff");
  font-display: block;
}

/* ───────────────────────── base ───────────────────────── */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM VGA", "JetBrains Mono", "Fira Code", "Cascadia Mono", "SF Mono", Menlo,
               Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-size: 16px;
  line-height: 1.3;
  min-height: 100vh;
  min-height: 100dvh;
  text-shadow: 0 0 5px var(--glow);
  overflow-x: hidden;
  transition: background .4s;
}

::selection { background: var(--fg); color: var(--bg); text-shadow: none; }

a { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; }
a:hover, a:focus-visible { background: var(--fg); color: var(--bg); text-shadow: none; outline: none; }

/* ───────────────────────── effects ───────────────────────── */
#rain {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: .14;
  pointer-events: none;
  transition: opacity .6s;
}
#rain.full { opacity: 1; z-index: 50; }

.crt {
  position: fixed; inset: 0;
  z-index: 40;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.22) 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.65) 100%);
  animation: flicker 6s infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: .85; }
  94% { opacity: 1; }
  97% { opacity: .92; }
}

/* ───────────────────────── terminal ───────────────────────── */
#term {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) clamp(12px, 3vw, 36px) 30vh;
}

.intro-mode #term {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 16px;
}

.line { white-space: pre-wrap; word-break: break-word; min-height: 1.3em; }

@media (min-width: 1500px) and (min-height: 900px) {
  body { font-size: 24px; }
}

.intro {
  font-size: clamp(24px, 4vw, 48px);
  letter-spacing: .04em;
}

.dim    { color: var(--fg-dim); }
.faint  { color: var(--fg-faint); }
.accent { color: var(--accent); }
.err    { color: var(--err); text-shadow: 0 0 5px rgba(255, 95, 86, .5); }
.ok     { color: var(--fg); font-weight: bold; }
.echo   { margin-top: .6em; }

.banner {
  margin: .4em 0 .2em;
  line-height: 1.02;
  white-space: pre;
  overflow: hidden;
  color: var(--fg);
  text-shadow: 0 0 6px var(--glow), 0 0 18px var(--glow);
  animation: glitch 7s infinite;
  padding-right: 6px;
}
@keyframes glitch {
  0%, 96%, 100% { transform: none; filter: none; }
  96.5% { transform: translateX(-2px) skewX(-4deg); filter: hue-rotate(40deg); }
  97%   { transform: translateX(3px); }
  97.5% { transform: none; }
}

pre.block {
  margin: 0;
  font: inherit;
  white-space: pre;
  line-height: 1.25;
  overflow-x: auto;
}

/* prompt */
#prompt {
  position: relative;
  margin-top: .6em;
  word-break: break-all;
  white-space: normal;
}
#prompt .typed { white-space: pre-wrap; }
#prompt.busy { opacity: 0; }
.ps1 { color: var(--accent); }
.ps1 { margin-right: 1ch; }

#cursor {
  background: var(--fg);
  color: var(--bg);
  text-shadow: none;
  box-shadow: 0 0 8px var(--glow);
  animation: blink 1.05s steps(1) infinite;
}
#cmd:not(:focus) ~ .typed #cursor,
#prompt:not(:focus-within) #cursor { background: transparent; outline: 1px solid var(--fg); color: var(--fg); }
@keyframes blink { 50% { background: transparent; color: var(--fg); box-shadow: none; } }

#cmd {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  border: 0; padding: 0; margin: 0;
  font-size: 16px; /* stops iOS zooming in */
  background: transparent;
  color: transparent;
  caret-color: transparent;
}

/* clickable commands */
.cmd { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: .5em; margin: .8em 0 .4em; }
.chip {
  font: inherit;
  color: var(--fg);
  background: rgba(0,0,0,.4);
  border: 1px solid var(--fg-dim);
  padding: .3em .8em;
  text-decoration: none;
  text-shadow: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chip::before { content: "> "; color: var(--fg-dim); }
.chip:hover, .chip:focus-visible { background: var(--fg); color: var(--bg); text-shadow: none; outline: none; }
.chip:hover::before { color: var(--bg); }

/* help grid */
.grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .1em 2em;
  margin: .4em 0;
}
.grid > :nth-child(odd) { color: var(--accent); }
.grid > :nth-child(even) { color: var(--fg-dim); }
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; gap: 0; }
  .grid > :nth-child(even) { margin-bottom: .45em; padding-left: 1.5em; }
}

/* neofetch */
.fetch { display: flex; flex-wrap: wrap; gap: .5em 2.5em; align-items: flex-start; margin: .4em 0; }
.fetch .k { color: var(--accent); font-weight: bold; }
.swatch { display: inline-block; width: 1.6em; height: 1em; vertical-align: middle; }
.sw-fg { background: var(--fg); }
.sw-fg-dim { background: var(--fg-dim); }
.sw-fg-faint { background: var(--fg-faint); }
.sw-accent { background: var(--accent); }
.sw-err { background: var(--err); }

/* project / timeline cards */
.item { margin: .55em 0; padding-left: 1em; border-left: 1px dashed var(--fg-faint); }
.item .title { color: var(--accent); font-weight: bold; }

#skip-hint {
  position: fixed;
  left: 0; right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 16px;
  color: var(--fg-dim);
  z-index: 45;
  animation: blink 1.6s steps(1) infinite;
  pointer-events: none;
}
#skip-hint.gone { display: none; }

.noscript { padding: 2em; color: #33ff66; }

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--fg-faint); }

@media (prefers-reduced-motion: reduce) {
  .crt, .banner, #cursor, #skip-hint { animation: none; }
}

/* ═════════════════════ DOS contact dialog ═════════════════════
 * Classic 16-colour CGA/VGA palette, like an old setup screen.   */
.dos-overlay {
  --dos-blue: #0000aa; --dos-cyan: #00aaaa; --dos-grey: #aaaaaa;
  --dos-white: #ffffff; --dos-yellow: #ffff55; --dos-black: #000000;
  --dos-red: #aa0000; --dos-green: #00aa00; --dos-ltcyan: #55ffff;
  position: fixed; inset: 0;
  z-index: 30;
  display: flex; flex-direction: column;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,170,.55) 0 2px, rgba(0,0,0,.75) 2px 4px);
  text-shadow: none;
  font-size: 16px;
  line-height: 1.25;
  animation: dos-in .18s steps(3);
}
.dos-overlay[hidden] { display: none; }
@keyframes dos-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

.dos-menubar, .dos-statusbar {
  background: var(--dos-grey); color: var(--dos-black);
  display: flex; gap: 2.5ch; padding: 0 1ch; white-space: nowrap; overflow: hidden;
}
.dos-menubar u, .dos-label u { color: var(--dos-red); text-decoration: none; }
.dos-menubar .dos-clock { margin-left: auto; }
.dos-statusbar { margin-top: auto; }
.dos-statusbar b { color: var(--dos-red); font-weight: normal; }

.dos-win {
  position: relative;
  width: min(66ch, calc(100vw - 3ch));
  max-height: calc(100dvh - 5em);
  overflow-y: auto;
  margin: auto;
  background: var(--dos-blue);
  color: var(--dos-white);
  border: 6px double var(--dos-white);
  outline: .5ch solid var(--dos-blue);
  padding: 1.25em 2ch 1em;
  box-shadow: 2ch 1.2em 0 rgba(0,0,0,.9);
}
.dos-title {
  position: absolute; top: -.85em; left: 50%; transform: translateX(-50%);
  background: var(--dos-blue); color: var(--dos-yellow);
  padding: 0 1ch; white-space: nowrap;
}
.dos-intro { margin: 0 0 1em; color: var(--dos-ltcyan); }
.dos-row { display: flex; align-items: flex-start; gap: 1ch; margin-bottom: .6em; }
.dos-label { flex: 0 0 auto; color: var(--dos-white); padding-top: .1em; }
.dos-field {
  flex: 1; min-width: 0;
  font: inherit; font-size: 16px; line-height: 1.25;
  background: var(--dos-cyan); color: var(--dos-black);
  border: 0; border-radius: 0; padding: .1em .5ch;
  caret-color: var(--dos-black);
  resize: vertical;
}
.dos-field:focus { background: var(--dos-black); color: var(--dos-yellow); caret-color: var(--dos-yellow); outline: none; }
.dos-field.bad { background: var(--dos-red); color: var(--dos-white); }
.dos-row-msg { flex-direction: column; gap: .3em; }
.dos-row-msg .dos-field { width: 100%; min-height: 6.5em; }
.dos-count { text-align: right; color: var(--dos-ltcyan); font-size: 16px; margin-top: -.3em; }
.dos-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.dos-progress p { margin: .4em 0; }
.dos-bar { color: var(--dos-yellow); white-space: pre; overflow: hidden; }

.dos-error {
  margin: .8em 0 0; padding: .2em 1ch;
  background: var(--dos-red); color: var(--dos-white);
}
.dos-error::before { content: "\25BA  "; color: var(--dos-yellow); }

.dos-buttons { display: flex; justify-content: center; gap: 4ch; margin-top: 1.1em; flex-wrap: wrap; }
.dos-btn {
  font: inherit; font-size: 16px;
  background: var(--dos-green); color: var(--dos-black);
  border: 0; border-radius: 0; padding: .1em 1ch;
  box-shadow: 1ch .5em 0 var(--dos-black);
  cursor: pointer;
}
.dos-btn:focus-visible, .dos-btn:hover { background: var(--dos-ltcyan); color: var(--dos-black); outline: none; }
.dos-btn:active { transform: translate(1ch, .5em); box-shadow: none; }
.dos-btn[disabled] { background: var(--dos-grey); cursor: wait; }

@media (max-width: 520px) {
  .dos-row { flex-direction: column; gap: .2em; }
  .dos-field { width: 100%; }
  .dos-win { box-shadow: 1ch .6em 0 rgba(0,0,0,.9); }
  .dos-statusbar span:nth-child(2) { display: none; }
}

/* ═════════════════════ signal glitch ═════════════════════ */
body.glitching #term {
  animation: sig-jitter .32s steps(2) infinite;
  text-shadow: -2px 0 rgba(255,0,60,.8), 2px 0 rgba(0,240,255,.8), 0 0 6px var(--glow);
}
body.glitching #rain { opacity: .45; }
body.glitching .crt {
  background:
    linear-gradient(to bottom, transparent 0, transparent var(--bar, 40%), rgba(255,255,255,.09) var(--bar, 40%), rgba(255,255,255,.09) calc(var(--bar, 40%) + 6%), transparent calc(var(--bar, 40%) + 6%)),
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.3) 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.65) 100%);
}
@keyframes sig-jitter {
  0%   { transform: translate(0, 0) skewX(0); filter: none; }
  25%  { transform: translate(-4px, 1px) skewX(-2deg); filter: hue-rotate(60deg) contrast(1.4); }
  50%  { transform: translate(5px, -1px); filter: saturate(2.5) brightness(1.3); }
  75%  { transform: translate(-2px, 0) skewX(3deg); filter: invert(.08) hue-rotate(-40deg); }
  100% { transform: translate(0, 0); filter: none; }
}
.glitch-layer {
  position: absolute;
  z-index: 35;
  pointer-events: none;
  margin: 0 !important;
  mix-blend-mode: screen;
  overflow: hidden;
}
.glitch-layer.r { color: #ff1744 !important; }
.glitch-layer.c { color: #00e5ff !important; }
.glitch-layer * { color: inherit !important; text-shadow: none !important; background: transparent !important; box-shadow: none !important; border-color: currentColor !important; }

/* ═════════════════════ kali prompt ═════════════════════ */
.kb { color: #3d8bff; }
.kr { color: #ff4d4d; font-weight: bold; }
.kg { color: #4dff88; font-weight: bold; }

/* ═════════════════════ arcade ═════════════════════ */
.arcade {
  position: fixed; inset: 0; z-index: 30;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4em;
  text-shadow: none;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.arcade[hidden], .synth[hidden] { display: none; }
.arcade-bar, .arcade-screen canvas { width: min(100vw - 8px, (100dvh - 3.5em) * 4 / 3); }
.arcade-bar { display: flex; justify-content: space-between; gap: 2ch; color: var(--fg-dim); padding: 0 .5ch; white-space: nowrap; overflow: hidden; }
.arc-title { color: var(--fg); }
.arcade-screen canvas {
  display: block;
  aspect-ratio: 4 / 3;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid var(--fg-faint);
  filter: drop-shadow(0 0 3px var(--glow));
}
.arcade-pad { display: none; }
@media (pointer: coarse) {
  .arcade { justify-content: flex-start; padding-top: max(6px, env(safe-area-inset-top)); }
  .arcade-bar, .arcade-screen canvas { width: min(100vw - 8px, (100dvh - 15em) * 4 / 3); }
  .arc-keys { display: none; }
  .arcade-pad {
    display: flex; justify-content: space-between; align-items: center;
    width: min(100vw - 16px, 520px); margin-top: auto; margin-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .pad-dir { display: grid; grid-template-columns: repeat(3, 3.6em); grid-template-rows: repeat(3, 3.6em); }
  .pad-dir .pu { grid-area: 1 / 2; } .pad-dir .pl { grid-area: 2 / 1; } .pad-dir .pr { grid-area: 2 / 3; } .pad-dir .pd { grid-area: 3 / 2; }
  .pad-act { display: flex; flex-direction: column; gap: .8em; align-items: center; }
  .arcade-pad button {
    font: inherit; color: var(--fg); background: rgba(255,255,255,.03);
    border: 2px solid var(--fg-dim); border-radius: 10px;
    touch-action: none;
  }
  .arcade-pad .pf { width: 5.5em; height: 5.5em; border-radius: 50%; font-size: 15px; }
  .arcade-pad .pe { width: 5em; height: 2.4em; font-size: 13px; border-radius: 6px; color: var(--fg-dim); }
  .arcade-pad button.on { background: var(--fg); color: #000; }
}

/* ═════════════════════ synth ═════════════════════ */
.synth {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  overflow-y: auto;
}
.synth-win {
  width: min(72ch, 100%);
  border: 4px double var(--fg-dim);
  background: var(--bg);
  padding: 1.2em 1.5ch 1em;
  position: relative;
  margin: auto;
}
.synth-title {
  position: absolute; top: -.75em; left: 50%; transform: translateX(-50%);
  background: var(--bg); color: var(--accent); padding: 0 1ch; white-space: nowrap;
}
.synth-scope { display: block; width: 100%; height: 4.5em; border: 1px solid var(--fg-faint); background: #000; margin-bottom: .7em; }
.synth-ctrl { display: flex; flex-wrap: wrap; gap: .5em 1ch; margin-bottom: .8em; align-items: center; }
.synth-ctrl button {
  font: inherit; color: var(--fg); background: transparent;
  border: 1px solid var(--fg-dim); padding: .15em .8ch; cursor: pointer; text-shadow: inherit;
}
.synth-ctrl button:hover, .synth-ctrl button.on { background: var(--fg); color: var(--bg); text-shadow: none; }
.syn-tempo { display: inline-flex; align-items: center; white-space: nowrap; }
.synth-grid {
  display: grid;
  grid-template-columns: 6ch repeat(16, minmax(0, 1fr));
  gap: 2px;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.syn-label { color: var(--fg-dim); font-size: 14px; line-height: 1.6em; white-space: nowrap; overflow: hidden; }
.syn-label.drum { color: var(--accent); }
.syn-label.gap, .syn-cell.gap { margin-top: 6px; }
.syn-cell {
  font: inherit; padding: 0; height: 1.6em; min-width: 0;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--fg-faint);
  cursor: pointer;
}
.syn-cell.beat { border-left-color: var(--fg-dim); }
.syn-cell.on { background: var(--fg); border-color: var(--fg); box-shadow: 0 0 6px var(--glow); }
.syn-cell.drum.on { background: var(--accent); border-color: var(--accent); }
.syn-cell.now { border-color: var(--accent); }
.syn-cell.now.on { filter: brightness(1.6); }
.syn-head { text-align: center; color: var(--fg-faint); font-size: 14px; }
.syn-head.now { color: var(--accent); }
.synth-keys { display: flex; flex-wrap: wrap; gap: .3em 2ch; margin-top: .9em; color: var(--fg-dim); font-size: 14px; }
.synth-keys b { color: var(--fg); font-weight: normal; }
.syn-note { color: var(--accent); min-width: 6ch; }
@media (pointer: coarse) { .synth-keys span:nth-child(-n+2) { display: none; } }

.banner.hackbanner { color: var(--err); text-shadow: 0 0 6px rgba(255, 60, 60, .7), 0 0 20px rgba(255, 60, 60, .45); }

/* ═════════════════════ Kubrick ═════════════════════ */
.hal-eye { line-height: 1.05; text-shadow: none; animation: hal-pulse 2.6s ease-in-out infinite; display: inline-block; }
.hal-eye .h-rim  { color: #9a9a9a; }
.hal-eye .h-dark { color: #3a0000; }
.hal-eye .h-red  { color: #b30000; text-shadow: 0 0 6px rgba(255,0,0,.5); }
.hal-eye .h-hot  { color: #ff2a00; text-shadow: 0 0 10px rgba(255,40,0,.8); }
.hal-eye .h-core { color: #ffd24a; text-shadow: 0 0 14px rgba(255,200,60,.9); }
@keyframes hal-pulse { 50% { filter: brightness(1.35) saturate(1.2); } }
.hal-eye.dying { animation: hal-die 20s linear forwards; }
@keyframes hal-die { 0% { filter: brightness(1); } 85% { filter: brightness(.35); } 100% { filter: brightness(0); } }
.daisy { letter-spacing: .02em; }
.mirror { display: inline-block; transform: scaleX(-1); font-size: 1.6em; letter-spacing: .15em; }
.jack {
  margin: .6em 0; padding: .8em 2ch;
  background: #e9e4d4; color: #1a1a1a; text-shadow: none;
  max-width: 72ch;
  box-shadow: 0 0 0 1px #000, 6px 6px 0 rgba(0,0,0,.6);
}
.jack-line { white-space: pre-wrap; word-break: break-word; min-height: 1.3em; }
.monolith { line-height: 1.05; color: var(--fg); }

/* ═════════════════════ the crate ═════════════════════ */
.crate { display: flex; flex-wrap: wrap; gap: .6em 1.5ch; margin: .6em 0; }
.sleeve { color: var(--accent); animation: sleeve-in .45s steps(4) both; white-space: pre; }
@keyframes sleeve-in { from { transform: translateY(-1em); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═════════════════════ spray wall ═════════════════════ */
.spray { position: fixed; inset: 0; z-index: 30; background: #0c0c0c; touch-action: none; text-shadow: none; }
.spray[hidden] { display: none; }
.spray canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.spray-bar {
  position: absolute; left: 50%; top: max(8px, env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; gap: .4em 1ch; justify-content: center; align-items: center;
  width: max-content; max-width: calc(100vw - 16px);
  background: rgba(0,0,0,.8); border: 1px solid var(--fg-faint); padding: .35em 1ch;
}
.spray-title { color: var(--accent); margin-right: 1ch; }
.spray-bar button {
  font: inherit; color: var(--fg); background: transparent; border: 1px solid var(--fg-dim);
  padding: .1em .8ch; cursor: pointer;
}
.spray-bar button:hover { background: var(--fg); color: var(--bg); }
.sp-sizer { display: inline-flex; align-items: center; white-space: nowrap; }
.spray-hint {
  position: absolute; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom));
  text-align: center; color: var(--fg-dim); font-size: 14px; pointer-events: none;
}
@media (pointer: coarse) { .spray-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .hal-eye, .sleeve { animation: none; } }

/* ═════════════════════ travel map ═════════════════════ */
.worldmap { line-height: 1.15; margin: .5em 0; overflow: hidden; }
.worldmap .m-land { color: var(--fg-faint); text-shadow: none; }
.worldmap .m-path { color: var(--accent); }
.worldmap .m-path.old { color: var(--fg-dim); }
.worldmap .m-pin { color: #ffd24a; text-shadow: 0 0 6px rgba(255,210,74,.9); animation: blinkop 1.2s steps(1) infinite; }
.worldmap .m-home { color: var(--err); font-weight: bold; }
.blink { animation: blinkop 1s steps(1) infinite; }
@keyframes blinkop { 50% { opacity: 0; } }
.wopr-map { display: block; margin: .5em 0; background: #000; border: 1px solid #1d4f7a; box-shadow: 0 0 14px rgba(63,169,255,.25), inset 0 0 30px rgba(63,169,255,.08); }
.help-h { color: var(--accent); display: block; margin-top: .7em; border-bottom: 1px dashed var(--fg-faint); max-width: 40ch; }

/* ═════════════════════ groovebox ═════════════════════ */
.synth-win { width: min(84ch, 100%); }
.syn-sep { color: var(--fg-dim); font-size: 14px; margin-left: 1ch; }
.synth-tabs { display: flex; flex-wrap: wrap; gap: .4em; margin: .2em 0 .7em; }
.synth-tabs button {
  font: inherit; color: var(--fg-dim); background: transparent; cursor: pointer;
  border: 1px solid var(--fg-faint); border-bottom-width: 3px; padding: .2em 1ch;
}
.synth-tabs button small { font-size: 12px; opacity: .8; }
.synth-tabs button.on { color: var(--bg); background: var(--fg); border-color: var(--fg); text-shadow: none; }
.synth-tabs button[data-tab="lead"].on { background: #00e5ff; border-color: #00e5ff; }
.synth-tabs button[data-tab="drums"].on { background: #ffb000; border-color: #ffb000; }
.synth-panel[hidden] { display: none; }
.knobs { display: flex; flex-wrap: wrap; gap: .6em 1.6ch; margin-bottom: .8em; }
.knob { display: flex; flex-direction: column; align-items: center; gap: .25em; min-width: 6ch; }
.knob-dial {
  width: 38px; height: 38px; border-radius: 50%; position: relative; cursor: ns-resize; touch-action: none;
  background: radial-gradient(circle at 35% 30%, #4a4a4a, #161616 70%);
  border: 2px solid #050505; box-shadow: 0 0 0 1px var(--fg-faint), 0 3px 0 #000;
}
.knob-dial:focus-visible, .knob-dial.on { box-shadow: 0 0 0 2px var(--fg), 0 3px 0 #000; outline: none; }
.knob-ptr { position: absolute; left: 50%; top: 3px; width: 3px; height: 13px; margin-left: -1.5px; background: var(--fg); border-radius: 2px; box-shadow: 0 0 6px var(--glow); }
.knob-l { font-size: 12px; color: var(--fg-dim); white-space: nowrap; }
.syn-wave-btn { font: inherit; font-size: 14px; width: 5ch; height: 38px; color: var(--fg); background: #111; border: 1px solid var(--fg-dim); cursor: pointer; }
[data-panel="lead"] .knob-ptr { background: #00e5ff; }
[data-panel="drums"] .knob-ptr { background: #ffb000; }
[data-panel="lead"] .syn-cell.on { background: #00e5ff; border-color: #00e5ff; box-shadow: 0 0 6px rgba(0,229,255,.6); }
[data-panel="drums"] .syn-cell.on { background: #ffb000; border-color: #ffb000; box-shadow: 0 0 6px rgba(255,176,0,.6); }
.syn-cell.sharp { background: rgba(0,0,0,.35); }
.syn-label.sharp { color: var(--fg-faint); }
.syn-cell.flag.on { background: var(--accent); border-color: var(--accent); }
.syn-label.flag { color: var(--accent); }
[data-panel="bass"] .syn-cell { height: 1.25em; }
[data-panel="bass"] .syn-label { line-height: 1.25em; font-size: 12px; }

/* ═════════════════════ film club ═════════════════════ */
.pi { letter-spacing: .05em; word-break: break-all; }
body.flash #term { filter: invert(1) contrast(1.6); }
body.flash { background: #fff; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: .6em 0; }
.split .pane { border: 1px solid var(--fg-dim); min-height: 5em; display: flex; align-items: center; justify-content: center; font-size: 1.4em; letter-spacing: .1em; }
.split.cut .pane { background: var(--fg); color: var(--bg); text-shadow: none; }
body.cold #term { filter: saturate(0) brightness(.55) blur(.6px); transition: filter 1.5s; }
body.shake #term { animation: shake .07s infinite; }
@keyframes shake {
  0% { transform: translate(0, 0); filter: none; }
  25% { transform: translate(-4px, 2px) rotate(-.4deg); filter: blur(1px); }
  50% { transform: translate(3px, -3px) rotate(.5deg); }
  75% { transform: translate(-2px, -2px); filter: blur(2px) brightness(1.3); }
}
.vibrate { display: inline-block; animation: vib .04s infinite; filter: blur(1.5px); }
@keyframes vib { 50% { transform: translate(3px, -2px) rotate(3deg) scaleX(1.06); } }
.floorpiano { position: relative; display: flex; height: 10em; max-width: 60ch; margin: .6em 0; user-select: none; -webkit-user-select: none; touch-action: none; }
.fp-w { flex: 1; background: #e8e8e8; border: 1px solid #000; border-radius: 0 0 4px 4px; position: relative; cursor: pointer; box-shadow: inset 0 -6px 0 #bbb; }
.fp-w span { position: absolute; bottom: .5em; left: 0; right: 0; text-align: center; color: #333; text-shadow: none; font-size: 12px; white-space: pre; }
.fp-w.on { background: var(--fg); box-shadow: 0 0 18px var(--glow); }
.fp-b { width: 0; position: relative; z-index: 2; }
.fp-b span { position: absolute; left: -1.2em; width: 2.4em; height: 6em; background: #111; border: 1px solid #000; border-radius: 0 0 3px 3px; cursor: pointer; color: #888; font-size: 11px; text-align: center; padding-top: 4.4em; box-sizing: border-box; text-shadow: none; }
.fp-b.on span { background: var(--fg); color: #000; }
.fp-ctl { display: flex; gap: .6em; margin-bottom: .4em; }
@media (prefers-reduced-motion: reduce) { body.shake #term, .vibrate { animation: none; } }
.spectro { display: block; margin: .5em 0; background: #000; border: 1px solid var(--fg-faint); box-shadow: 0 0 12px var(--glow); }
.ladder { color: var(--err); line-height: 1.1; }
.icebath { color: var(--fg); line-height: 1.1; }
body.frost .crt { box-shadow: inset 0 0 120px 30px rgba(200, 240, 255, .35), inset 0 0 40px 8px rgba(255, 255, 255, .25); transition: box-shadow 3s; }
body.frost #term { animation: shiver .12s infinite; }
@keyframes shiver { 50% { transform: translateX(1px); } }
@media (prefers-reduced-motion: reduce) { body.frost #term { animation: none; } }
.devils { color: var(--err); line-height: 1.1; text-shadow: 0 0 8px rgba(255,40,40,.8); }
.angels { color: #fff8e1; line-height: 1.15; text-shadow: 0 0 10px #fff, 0 0 26px rgba(255,220,120,.9); }
body.heaven #term { filter: brightness(1.25); transition: filter 2s; }
body.heaven .crt { box-shadow: inset 0 0 160px 40px rgba(255, 245, 220, .35); transition: box-shadow 2s; }
.bio-p { max-width: 76ch; margin: 0 0 .8em; white-space: normal; }

/* ═════════════════════ SEO / accessibility ═════════════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sitefoot {
  position: relative; z-index: 2;
  max-width: 1100px; margin: -26vh auto 0; padding: 1em clamp(12px, 3vw, 36px) 3em;
  color: var(--fg-dim); font-size: 13px; line-height: 1.5;
  border-top: 1px dashed var(--fg-faint);
}
.sitefoot p { margin: 0 0 .5em; max-width: 90ch; }
.sitefoot a { color: var(--fg-dim); }
.sitefoot a:hover { color: var(--bg); }
.intro-mode .sitefoot { display: none; }

/* phones: show a hint on the prompt while the keyboard is down */
.taphint { display: none; color: var(--fg-faint); font-size: .9em; }
@media (pointer: coarse) {
  #prompt:not(:focus-within):not(.busy) .taphint { display: inline; }
}
