/* Opt-in nostalgia (plan 2.4). Every effect hangs off a class on <html>
   so a toggle is one class, and nothing here uses a raw color. */

/* CRT: scanlines over everything and a soft phosphor glow on text. */
html.crt body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    var(--vga-0) 2px,
    var(--vga-0) 3px
  );
  opacity: 0.22;
}

html.crt main.screen,
html.crt .status {
  text-shadow: 0 0 2px currentColor;
}

html.crt pre.art {
  text-shadow: none;
}

/* Typewriter: the script reveals [data-typewriter] text; the cursor block
   blinks at the end while it types. */
html.typewriter .typing::after {
  content: "\2588";
  color: var(--accent);
  animation: blink 0.6s steps(1) infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  html.typewriter .typing::after {
    animation: none;
  }
}

/* The "loading door" interstitial on the first menu of a visit. */
.door {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  color: var(--fg);
  padding: 15vh var(--gutter) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s;
}
.door[hidden] {
  display: none;
}
.door.gone {
  opacity: 0;
}

/* Vaporwave (the Konami code). The palette itself is swapped in
   palette.css; this is only the flourish on top of it. */
/* The bar is dark so its text stays legible; a neon edge keeps it loud. */
html.vapor .status {
  border-bottom: 2px solid var(--accent);
}

html.vapor .status .brand {
  background: linear-gradient(90deg, var(--vga-13), var(--vga-11));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vapor-toast {
  position: fixed;
  left: 50%;
  top: 40vh;
  transform: translateX(-50%);
  z-index: 60;
  padding: 12px 24px;
  background: var(--status-bg);
  color: var(--bright);
  border: 1px solid var(--accent-2);
  white-space: nowrap;
  transition: opacity 0.4s;
}
.vapor-toast.gone {
  opacity: 0;
}

/* The Konami scene shares the font and grid metrics of every other scene. */
.vapor-only { display: none; }
html.vapor .vapor-only { display: block; }

/* Tiny pixel details need a clean silhouette even when the UI glows. */
html.crt .art-frame { text-shadow: none; }
