@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #0b1020;
  --bg-raised: #131a2e;
  --border: #25304d;
  --text: #e6eaf2;
  --text-muted: #9aa5bd;
  --accent: #3dd6c6;
  --accent-dim: rgba(61, 214, 198, 0.15);
  --danger: #ff5d6c;
  --danger-dim: rgba(255, 93, 108, 0.12);
  --amber: #fbbf24;
  --green: #4ade80;
  --radius: 4px;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: var(--mono);
  --bezel: 14px;
  --bezel-bottom: 26px;
  --taskbar: 40px;
}

@media (max-width: 640px) {
  :root {
    --bezel: 6px;
    --bezel-bottom: 14px;
    --taskbar: 44px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(14px, 10px + 0.5vw, 19px);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bezel) + 8px);
}

body {
  margin: 0;
  padding: var(--bezel) var(--bezel) calc(var(--bezel-bottom) + var(--taskbar));
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 0.75em;
}

h2 {
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  color: var(--accent);
}

h3 {
  font-size: 0.8rem;
}

p {
  margin: 0 0 1em;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--accent);
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 1.5rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--amber);
  color: var(--bg);
  z-index: 100;
}

.skip-link:focus {
  top: 1.5rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.85em;
}

/* 8-bit low poly background */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  image-rendering: pixelated;
  background: radial-gradient(ellipse at 50% 80%, #1d2a5a 0%, var(--bg) 70%);
}

/* CRT monitor frame drawn over the whole page */
.crt {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.crt::before {
  content: "";
  position: absolute;
  inset: var(--bezel) var(--bezel) var(--bezel-bottom);
  border-radius: 18px;
  box-shadow:
    0 0 0 100vmax #1a1c22,
    inset 0 0 0 2px #2b2e36,
    inset 0 0 90px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.3s;
}

body.crt-alert .crt::before {
  box-shadow:
    0 0 0 100vmax #1a1c22,
    inset 0 0 0 2px #ff5d6c,
    inset 0 0 120px rgba(255, 60, 80, 0.45);
}

.crt::after {
  content: "";
  position: absolute;
  inset: var(--bezel) var(--bezel) var(--bezel-bottom);
  border-radius: 18px;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
  animation: flicker 6s infinite steps(1);
}

@keyframes flicker {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
  52% { opacity: 0.8; }
}

.crt-brand {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel);
  font-size: 9px;
  color: #6b6f7a;
  letter-spacing: 0.2em;
}

.crt-led {
  position: absolute;
  bottom: 9px;
  right: 28px;
  width: 8px;
  height: 4px;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

@media (max-width: 640px) {
  .crt-brand,
  .crt-led {
    display: none;
  }
}

/* Boot screen */
.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  padding: calc(var(--bezel) + 2rem);
  background: #000;
  color: #b8f5c8;
  font-family: var(--pixel);
  font-size: clamp(0.55rem, 1.4vw, 0.8rem);
  line-height: 2.2;
  white-space: pre-wrap;
  cursor: pointer;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.boot-skip {
  position: absolute;
  right: calc(var(--bezel) + 1.5rem);
  bottom: calc(var(--bezel-bottom) + 1.5rem);
  color: #6b6f7a;
}

/* Retro windows */
.section {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 3rem) clamp(0.6rem, 3vw, 3.5rem);
}

.window {
  background: rgba(13, 19, 36, 0.96);
  border: 2px solid var(--accent);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
}

.window-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--pixel);
  font-size: 0.6rem;
}

.window-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-buttons {
  display: flex;
  gap: 4px;
}

.window-buttons span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 16px;
  background: var(--bg);
  color: var(--accent);
  font-size: 0.5rem;
}

.window-body {
  padding: 1.5rem;
}

.lead {
  max-width: none;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.1rem;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--pixel);
  font-size: 0.65rem;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
}

/* Intro with ID badge */
.intro {
  padding-top: 2rem;
}

.intro-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 720px) {
  .intro-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.badge {
  margin: 0;
  width: clamp(180px, 16vw, 320px);
  padding: 0 0 1rem;
  background: #e8e1cf;
  color: #1b1d24;
  border: 3px solid #1b1d24;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  text-align: center;
  transform: rotate(-2deg);
}

.badge-top {
  margin: 0 0 1rem;
  padding: 0.5rem;
  background: #1d3a9e;
  color: #fff;
  font-family: var(--pixel);
  font-size: 0.55rem;
}

.badge-photo {
  display: block;
  width: 64%;
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 0.75rem;
  border: 3px solid #1b1d24;
  image-rendering: pixelated;
  background: #3dd6c6;
}

.badge figcaption {
  display: grid;
  gap: 0.35rem;
  font-family: var(--pixel);
  font-size: clamp(0.45rem, 0.6vw, 0.7rem);
}

.badge-name {
  font-size: 1.3em;
}

.badge-barcode {
  display: block;
  height: 22px;
  margin: 0.9rem 1.2rem 0;
  background: repeating-linear-gradient(90deg, #1b1d24 0 2px, transparent 2px 4px, #1b1d24 4px 7px, transparent 7px 8px, #1b1d24 8px 9px, transparent 9px 12px);
}

.prompt {
  font-family: var(--pixel);
  font-size: 0.65rem;
  color: var(--green);
}

.cursor {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.intro h1 {
  font-size: clamp(1.4rem, 4vw, 4.2rem);
  margin-bottom: 0.5rem;
}

.intro-role {
  color: var(--amber);
  font-family: var(--pixel);
  font-size: 0.65rem;
  line-height: 1.8;
}

.intro-pitch {
  max-width: none;
  color: var(--text-muted);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0 1.25rem;
}

.intro-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  font-family: var(--pixel);
  font-size: 0.6rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--bg-raised);
  border: 2px solid var(--border);
  padding: 1.25rem;
}

.card h3 {
  color: var(--accent);
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

/* Pipeline */
.pipeline-wrap {
  position: relative;
  margin-top: 2rem;
}

.pipeline-line {
  position: absolute;
  left: 1.2rem;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  background: var(--accent);
  transform-origin: top;
}

.pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.stage {
  position: relative;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.stage-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  z-index: 1;
}

.stage h3 {
  margin-top: 0.35rem;
}

.stage p {
  margin: 0;
  color: var(--text-muted);
}

/* Attack story */
.story-intro {
  padding-bottom: 1rem;
}

.story-stage {
  max-width: 1760px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.story.is-animated .story-stage {
  min-height: 100vh;
  padding-top: calc(var(--bezel) + 1rem);
  padding-bottom: calc(var(--bezel-bottom) + var(--taskbar) + 0.5rem);
}

.story-window {
  width: min(100%, calc(60vh * 16 / 9));
  margin: 0 auto;
  border: 2px solid var(--accent);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
}

.story-viewport {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b1020;
}

@media (max-width: 640px) {
  .story-window {
    width: min(100%, calc(56vh * 4 / 5));
  }

  .story-viewport {
    aspect-ratio: 4 / 5;
  }
}

.story.no-webgl .story-window {
  display: none;
}

.story.is-static .hud {
  display: none;
}

#story-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* 8-bit HUD drawn over the 3D scene */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: "Press Start 2P", var(--mono);
  color: var(--text);
  font-size: clamp(0.45rem, 1.1vw, 0.7rem);
  font-size: clamp(0.45rem, 1.25cqw, 1.05rem);
  line-height: 1.6;
}

.hud-tag {
  position: absolute;
  top: 4%;
  left: 3%;
  margin: 0;
  padding: 0.3em 0.6em;
  background: rgba(6, 16, 31, 0.85);
  border: 2px solid var(--text);
  color: var(--amber);
}

.hud-caption {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.5em 1em;
  background: rgba(6, 16, 31, 0.9);
  border: 2px solid var(--text);
  text-align: center;
  white-space: nowrap;
}

.hud-caption span {
  display: block;
}

.hud-yellow {
  color: var(--amber);
}

.hud-labels {
  position: absolute;
  inset: 0;
}

.hud-label {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
}

.hud-device {
  padding: 0.25em 0.5em;
  background: rgba(6, 16, 31, 0.85);
  border: 2px solid var(--text);
  font-size: 0.85em;
}

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

.hud-bubble {
  padding: 0.35em 0.6em;
  background: #fff;
  color: #111;
  border: 2px solid #111;
  font-size: 0.8em;
}

.hud-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: #fff;
  border-right: 2px solid #111;
  border-bottom: 2px solid #111;
  transform: rotate(45deg);
}

.hud-callout {
  color: var(--amber);
  font-size: 1.9em;
  text-shadow:
    3px 0 #000, -3px 0 #000, 0 3px #000, 0 -3px #000,
    3px 3px #000, -3px -3px #000, 3px -3px #000, -3px 3px #000;
}

.hud-callout.is-popping {
  animation: pop 0.35s steps(4) both;
}

@keyframes pop {
  0% { transform: translate(-50%, -100%) scale(0.3); }
  70% { transform: translate(-50%, -100%) scale(1.25); }
  100% { transform: translate(-50%, -100%) scale(1); }
}

.hud-bottom {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 4%;
  display: flex;
  align-items: flex-end;
  gap: 3%;
}

.hud-strip {
  flex: 1;
  padding: 0.5em 0.7em;
  background: rgba(6, 16, 31, 0.85);
  border: 2px solid var(--text);
}

.hud-bars {
  display: flex;
  gap: 2px;
  height: 1.6em;
  margin-top: 0.4em;
}

.hud-bars span {
  flex: 1;
  background: #1d2540;
}

.hud-counter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.5em 0.7em;
  background: rgba(6, 16, 31, 0.9);
  border: 2px solid var(--text);
}

.hud-count {
  font-size: 2.4em;
  line-height: 1.2;
  color: var(--green);
}

.hud-count[data-level="mid"] {
  color: var(--amber);
}

.hud-count[data-level="high"] {
  color: var(--danger);
}

.hud-small {
  font-size: 0.75em;
  color: var(--text-muted);
}

.story-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.story-dot {
  width: 0.6rem;
  height: 0.6rem;
  background: var(--border);
}

.story-dot.is-done {
  background: var(--accent);
}

.story.is-static .story-dots {
  display: none;
}

.story-steps {
  list-style: none;
  width: min(100%, calc(60vh * 16 / 9));
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.story-step {
  background: rgba(13, 19, 36, 0.96);
  border: 2px solid var(--border);
  border-left: 6px solid var(--accent);
  padding: 0.9rem 1.25rem;
}

.story-step h3 {
  font-size: 0.7rem;
  color: var(--accent);
}

.story-step p {
  margin-bottom: 0.4rem;
}

.story-wazuh {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.story.is-animated .story-step {
  display: none;
  min-height: 7.5rem;
}

.story.is-animated .story-step.is-active {
  display: block;
}

/* Projects */
.projects {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.project {
  flex: 1 1 min(100%, 360px);
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
    padding: 1.5rem;
}

.project-featured {
  flex-basis: 100%;
  border-color: var(--accent);
}

.project-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.project h3 {
  font-size: 0.75rem;
  line-height: 1.7;
}

.project > ul:not(.tags) {
  padding-left: 1.2rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.project > ul:not(.tags) li + li {
  margin-top: 0.35rem;
}

.tags {
  list-style: none;
  padding: 0;
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags li {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.project-link {
  margin-top: 1rem;
  font-weight: 600;
}

/* Resume */
.resume-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.resume-head h2 {
  margin: 0;
}

.resume-note {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.statement {
  max-width: none;
  color: var(--text-muted);
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0 2rem;
}

.resume-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.resume-block {
  flex: 1 1 min(100%, 320px);
  background: var(--bg-raised);
  border: 1px solid var(--border);
    padding: 1.5rem;
}

.resume-col {
  flex: 1 1 min(100%, 320px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resume-col .resume-block {
  flex: 1 1 auto;
}

.resume-wide {
  flex-basis: 100%;
}

.resume-block h3 {
  font-size: 0.65rem;
  color: var(--accent);
}

.resume-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.resume-sub {
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.resume-date {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.resume-block ul {
  margin: 0;
  padding-left: 1.2rem;
}

.resume-block li + li {
  margin-top: 0.4rem;
}

/* SOC dashboard */
.soc-window.is-alert {
  border-color: var(--danger);
  animation: alert-border 0.5s steps(2) 2;
}

.soc-window.is-alert .window-bar {
  background: var(--danger);
}

@keyframes alert-border {
  50% { box-shadow: 0 0 0 4px var(--danger), 6px 6px 0 rgba(0, 0, 0, 0.55); }
}

.dash {
  position: relative;
  margin-top: 1.5rem;
}

.dash-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 40%), 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tile {
  display: grid;
  gap: 0.4rem;
  padding: 0.9rem;
  background: #060b18;
  border: 2px solid var(--border);
}

.tile-label {
  font-family: var(--pixel);
  font-size: 0.5rem;
  color: var(--text-muted);
}

.tile-value {
  font-family: var(--pixel);
  font-size: 1.1rem;
  color: var(--green);
}

.tile-fw.is-attacked {
  border-color: var(--danger);
  background: #2a0a12;
}

.tile-fw.is-attacked .tile-value {
  color: var(--danger);
}

.dash-main {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0.75rem;
}

.dash-main .term {
  grid-column: 1 / -1;
}

@media (min-width: 1300px) {
  .dash-main {
    grid-template-columns: 1.25fr 0.9fr 1.25fr;
  }

  .dash-main .term {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .dash-main {
    grid-template-columns: 1fr;
  }
}

.dash-panel {
  padding: 1rem;
  background: #060b18;
  border: 2px solid var(--border);
  min-width: 0;
}

.dash-panel h3 {
  font-size: 0.6rem;
  color: var(--accent);
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 19rem;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.5;
}

.feed li {
  padding: 0.2rem 0;
  border-bottom: 1px dashed #1b2440;
  color: #9fe8b4;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed li.is-warn {
  color: var(--amber);
}

.feed li.is-bad {
  color: var(--danger);
  background: rgba(255, 93, 108, 0.08);
}

.fw-diagram {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-family: var(--pixel);
  font-size: 0.5rem;
}

.fw-node {
  padding: 0.5rem 0.4rem;
  border: 2px solid var(--text-muted);
}

.fw-wall {
  border-color: var(--amber);
  color: var(--amber);
}

.fw-wall.is-attacked {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
}

.fw-link {
  flex: 1;
  height: 2px;
  background: var(--border);
}

.fw-link.is-attacked {
  background: var(--danger);
}

.fw-last {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
  font-size: 0.8rem;
}

.fw-last div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.fw-last dt {
  color: var(--text-muted);
}

.fw-last dd {
  margin: 0;
  text-align: right;
}

.sources {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.sources li {
  display: grid;
  grid-template-columns: 9.5rem 1fr 1.5rem;
  align-items: center;
  gap: 0.5rem;
}

.source-bar {
  height: 0.6rem;
  background: var(--danger);
}

.dash-toast {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--danger);
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 6px 6px 0 #000;
  font-family: var(--pixel);
  font-size: clamp(0.55rem, 1.6vw, 0.8rem);
  text-align: center;
  white-space: nowrap;
}

/* DEFEND.CMD shell */
.term {
  display: flex;
  flex-direction: column;
  background: #000;
  border-color: #6b7280;
}

.term h3 {
  color: #e5e7eb;
}

.term-mission {
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 2px dashed var(--amber);
  color: var(--amber);
  font-family: var(--pixel);
  font-size: 0.55rem;
  line-height: 1.8;
}

.term-mission.is-done {
  border-color: var(--green);
  color: var(--green);
}

.term-out {
  flex: 1;
  min-height: 14rem;
  max-height: 19rem;
  overflow-y: auto;
  color: #d1d5db;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-out .is-cmd {
  color: #fff;
}

.term-out .is-ok {
  color: var(--green);
}

.term-out .is-warn {
  color: var(--amber);
}

.term-out .is-bad {
  color: var(--danger);
}

.term-out .is-real {
  color: var(--accent);
}

.term-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #374151;
}

.term-prompt {
  color: #fff;
  font-size: 0.8rem;
  white-space: nowrap;
}

.term-input {
  flex: 1;
  min-width: 0;
  padding: 0.3rem 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  caret-color: var(--green);
}

.term-input:focus {
  outline: none;
}

.term-form:focus-within {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.term-chips button {
  padding: 0.45rem 0.6rem;
  border: 2px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.term-chips button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.feed li.is-blocked {
  color: var(--accent);
}

/* Taskbar */
.taskbar {
  position: fixed;
  left: var(--bezel);
  right: var(--bezel);
  bottom: var(--bezel-bottom);
  z-index: 40;
  height: var(--taskbar);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem 0 1rem;
  background: #0d1324;
  border-top: 2px solid var(--accent);
  font-family: var(--pixel);
  font-size: 0.55rem;
}

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

.start {
  padding: 0.45rem 0.6rem;
  background: var(--accent);
  color: var(--bg) !important;
  box-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}

.taskbar ul {
  list-style: none;
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.taskbar li a {
  display: block;
  padding: 0.45rem 0.6rem;
  border: 2px solid var(--border);
  white-space: nowrap;
}

.taskbar li a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tray {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  padding: 0.45rem 0.6rem;
  border: 2px solid var(--border);
  white-space: nowrap;
}

.lamp {
  width: 10px;
  height: 10px;
  background: var(--green);
}

.lamp.is-alert {
  background: var(--danger);
  animation: blink 0.5s steps(1) 4;
}

@media (max-width: 640px) {
  .start,
  .tray {
    display: none;
  }

  .taskbar {
    padding: 0 0.5rem;
  }
}

/* Footer */
.footer {
  text-align: center;
  font-family: var(--pixel);
  font-size: 0.55rem;
  line-height: 2;
}

.footer .muted {
  font-family: var(--mono);
  font-size: 0.75rem;
  max-width: 60ch;
  margin: 0 auto;
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Wide screens: the replay fills the height and the captions sit beside it */
.story-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1100px) and (min-aspect-ratio: 4/3) {
  .story.is-animated .story-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(16rem, 24vw, 30rem);
    align-content: center;
    align-items: center;
    column-gap: 1.5rem;
  }

  .story.is-animated .story-window {
    width: min(100%, calc((100vh - var(--bezel) - var(--bezel-bottom) - var(--taskbar) - 5rem) * 16 / 9));
  }

  .story.is-animated .story-dots {
    justify-content: flex-start;
  }

  .story.is-animated .story-steps {
    width: 100%;
  }
}
