@font-face {
  font-family: Terminal;
  src: url("fonts/vt323/VT323-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  --screen: #050403;
  --ink: #ffad62;
  --bright: #ffc88c;
  --dim: #ca925c;
  --glow: #ff8f354d;
  --soft-glow: #ff8f3508;
  --edge: #8c542c;
  color-scheme: dark;
  color: var(--ink);
  background: var(--screen);
  font-family: Terminal, "Courier New", monospace;
}
:root[data-phosphor="green"] { --screen: #030704; --ink: #8de7a0; --bright: #c4ffd0; --dim: #76b984; --glow: #66ff994d; --soft-glow: #66ff9908; --edge: #3f794d; }
:root[data-phosphor="ice"] { --screen: #040608; --ink: #a4d6f4; --bright: #d2eeff; --dim: #83b0cc; --glow: #89cdff4d; --soft-glow: #89cdff08; --edge: #476a83; }
* { box-sizing: border-box; }
html { min-height: 100%; scrollbar-gutter: stable; }
body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: clamp(20px, 3.5vw, 52px) clamp(20px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 48% 45%, var(--soft-glow), transparent 68%), var(--screen);
  font-size: clamp(1.25rem, 1.8vw, 1.65rem);
  line-height: 1.05;
  text-shadow: 0 0 7px var(--glow);
}
body::after { content: ""; position: fixed; z-index: 5; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, #0004 0, #0004 1px, transparent 1px, transparent 3px); opacity: .45; box-shadow: inset 0 0 130px 30px #0007; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--ink); color: var(--screen); }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 5px; }
.skip-link { position: fixed; top: 0; left: 20px; z-index: 10; padding: 10px; color: var(--screen); background: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.terminal-surface { width: min(1180px, 100%); min-width: 0; transform: perspective(1800px) rotateX(1deg); }
.terminal-header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; letter-spacing: .06em; }
.terminal-header a { text-decoration: none; }
.terminal-header a:hover { color: var(--bright); }
.wordmark { font-style: italic; }
.local-clock { display: inline-block; min-width: 8ch; flex-shrink: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.welcome-band { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 25px; align-items: center; margin-bottom: 24px; }
.pixel-mark { font-size: clamp(4rem, 8vw, 7.5rem); line-height: .85; letter-spacing: -.12em; color: var(--bright); }
.pixel-mark span { color: var(--ink); }
.welcome-band h1 { margin: 0; padding: 10px 14px; background: var(--ink); color: var(--screen); box-shadow: 0 0 18px var(--glow); border-radius: 50% 50% 50% 50% / 3% 3% 3% 3%; font-size: clamp(1.35rem, 2vw, 1.9rem); line-height: .99; font-weight: 400; letter-spacing: .035em; text-shadow: none; }
.welcome-band h1 span { opacity: .8; }
.terminal-main { display: grid; grid-template-columns: minmax(0, 2.7fr) minmax(245px, 1fr); gap: clamp(30px, 5vw, 75px); padding-top: 10px; border-top: 3px dotted var(--edge); }
.exhibit { min-width: 0; }
.scene-heading { display: flow-root; min-height: var(--scene-heading-height, 3.15em); }
.scene-heading h2 { margin: 0; font-size: inherit; font-weight: 400; }
.scene-heading p { margin: 3px 0 0; color: var(--dim); }
.ascii-stage { position: relative; height: clamp(260px, 34svh, 360px); margin: 6px 0 8px; }
#ascii-field { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; filter: drop-shadow(0 0 3px var(--glow)); }
#ascii-field:active { cursor: grabbing; }
.ascii-fallback { position: absolute; inset: 0; display: grid; align-content: center; justify-content: center; margin: 0; overflow: hidden; font: 1rem/1.15 "Courier New", monospace; white-space: pre; }
body:not(.ascii-ready) #ascii-field { visibility: hidden; }
.ascii-ready .ascii-fallback { display: none; }
.scene-details { display: flow-root; min-height: var(--scene-details-height, 8em); }
.layout-measure { position: fixed; left: -100000px; top: 0; visibility: hidden; pointer-events: none; }
.scene-caption { margin: 0 0 8px; max-width: 62ch; white-space: pre-line; }
.scene-action { display: inline-block; padding: 3px 0; text-decoration: none; border-bottom: 1px solid var(--ink); }
.scene-action:hover { color: var(--bright); }
.scene-action::after { content: "▌"; display: inline-block; margin-left: .45ch; animation: action-cursor 1.3s step-end infinite; }
.scene-action:hover::after, .scene-action:focus-visible::after { animation: none; opacity: 1; }
@keyframes action-cursor { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
.printer-status { margin: 8px 0 0; color: var(--dim); }
.terminal-menu { padding-top: 5px; }
.menu-title { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 3px dotted var(--edge); }
.menu-items { display: grid; gap: 7px; }
.menu-item { display: block; width: 100%; min-height: 36px; padding: 4px 8px; border: 0; background: transparent; color: var(--ink); text-decoration: none; text-align: left; white-space: nowrap; line-height: 1.1; touch-action: manipulation; }
.menu-item span { margin-right: 11px; }
.menu-item.is-selected { color: var(--screen); background: var(--ink); text-shadow: none; box-shadow: 0 0 12px var(--glow); }
.menu-item:hover, .menu-item:focus-visible { color: var(--screen); background: var(--bright); text-shadow: none; }
.menu-hint { margin: 20px 0 24px; color: var(--dim); }
.text-control { display: block; margin: 13px 0; padding: 0; color: var(--ink); border: 0; background: transparent; text-decoration: none; text-align: left; line-height: 1.1; }
.text-control:hover { color: var(--bright); text-decoration: underline; text-underline-offset: 4px; }
.command-area { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--edge); }
.command-output { margin: 0 0 14px; min-height: 1.05em; white-space: pre-line; overflow-wrap: anywhere; }
.command-line { display: flex; align-items: center; gap: 18px; }
.command-line label { flex-shrink: 0; }
.command-line input { min-width: 0; width: 0; flex: 1; padding: 3px 0; border: 0; border-bottom: 3px dotted var(--edge); border-radius: 0; color: var(--bright); background: transparent; caret-color: var(--bright); text-transform: uppercase; }
.command-line input::placeholder { color: var(--dim); opacity: .75; }
.command-line input:focus { outline: 0; border-color: var(--bright); }
.inverse-control { flex-shrink: 0; padding: 3px 14px; border: 0; color: var(--screen); background: var(--ink); }
.inverse-control:hover { background: var(--bright); }
.noscript-note { margin-top: 20px; }
.display-settings { width: min(460px, calc(100% - 36px)); max-height: calc(100svh - 36px); overflow-y: auto; padding: 24px; border: 1px solid var(--ink); color: var(--ink); background: var(--screen); font: inherit; box-shadow: 0 0 0 6px var(--screen), 0 0 0 7px var(--edge), 0 0 40px var(--glow); }
.display-settings::backdrop { background: #000c; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--edge); }
.settings-heading h2 { font: inherit; margin: 0; }
.settings-heading button { width: 34px; height: 34px; border: 1px solid var(--edge); background: transparent; color: var(--ink); font-size: 1.6rem; }
.phosphor-options { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; padding: 0; border: 0; }
.phosphor-options legend { padding-bottom: 15px; color: var(--dim); }
.phosphor-options label, .setting-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.setting-toggle { min-height: 45px; }
.display-settings input { width: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
.crt-disabled, .crt-disabled .terminal-surface { text-shadow: none; }
.crt-disabled::after { display: none; }
.crt-disabled #ascii-field { filter: none; }
.crt-disabled .welcome-band h1, .crt-disabled .menu-item.is-selected { box-shadow: none; }
.crt-disabled .terminal-surface { transform: none; }
@media (max-width: 900px) {
  body { font-size: 1.35rem; padding: 25px; }
  .terminal-main { grid-template-columns: minmax(0, 1fr) 220px; gap: 25px; }
  .welcome-band { grid-template-columns: 80px minmax(0, 1fr); gap: 15px; }
  .ascii-stage { height: 300px; }
}
@media (max-width: 620px) {
  body { display: block; padding: 22px 18px; font-size: 1.2rem; }
  .terminal-surface { transform: none; }
  .terminal-header { font-size: 1rem; gap: 15px; }
  .welcome-band { grid-template-columns: 54px minmax(0, 1fr); gap: 13px; margin-bottom: 20px; }
  .pixel-mark { font-size: 3.7rem; }
  .welcome-band h1 { font-size: 1.15rem; padding: 8px 10px; line-height: 1.1; }
  .terminal-main { display: flex; flex-direction: column; gap: 25px; }
  .ascii-stage { height: 260px; }
  .terminal-menu { display: flex; flex-wrap: wrap; gap: 8px 20px; }
  .menu-title { width: 100%; margin: 0; padding-bottom: 6px; }
  .menu-items { width: 100%; grid-template-columns: 1fr 1fr; gap: 7px 10px; }
  .menu-item { min-height: 40px; font-size: 1.1rem; padding: 8px 5px; }
  .menu-item span { margin-right: 6px; }
  .menu-hint { display: none !important; }
  .text-control { margin: 7px 0 0; font-size: 1.05rem; }
  .command-area { margin-top: 22px; }
  .command-line { gap: 10px; }
  .command-line label { font-size: 1.05rem; }
  .inverse-control { padding: 6px 9px; font-size: 1.1rem; }
  .setting-toggle { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
