/* ============================================
   THE CREATORS CLUB — PORTFOLIO
   CRT power-on + lock screen + desktop
   ============================================ */

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

:root {
  --red: #ff2b2b;
  --red-glow: rgba(255, 43, 43, 0.6);
  --red-dim: #661515;
  --red-dark: #3a0a0a;
  --gold: #ffaa00;
  --cream: #ead9b8;
  --black: #000;
  --dark: #0a0a0a;
  --mono: Consolas, 'Courier New', monospace;
  --display: 'Michroma', var(--mono);
  --transition-speed: 0.5s;
  --transition-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--black);
  color: var(--red);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: none;
  /* Custom CRT crosshair cursor */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cline x1='12' y1='0' x2='12' y2='10' stroke='%23ff2b2b' stroke-width='1'/%3E%3Cline x1='12' y1='14' x2='12' y2='24' stroke='%23ff2b2b' stroke-width='1'/%3E%3Cline x1='0' y1='12' x2='10' y2='12' stroke='%23ff2b2b' stroke-width='1'/%3E%3Cline x1='14' y1='12' x2='24' y2='12' stroke='%23ff2b2b' stroke-width='1'/%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='%23ff2b2b' stroke-width='1'/%3E%3C/svg%3E") 12 12, crosshair;
  --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cline x1='12' y1='0' x2='12' y2='10' stroke='%23ff5555' stroke-width='1'/%3E%3Cline x1='12' y1='14' x2='12' y2='24' stroke='%23ff5555' stroke-width='1'/%3E%3Cline x1='0' y1='12' x2='10' y2='12' stroke='%23ff5555' stroke-width='1'/%3E%3Cline x1='14' y1='12' x2='24' y2='12' stroke='%23ff5555' stroke-width='1'/%3E%3Ccircle cx='12' cy='12' r='3' fill='%23ff2b2b' stroke='%23ff5555' stroke-width='1'/%3E%3C/svg%3E") 12 12, pointer;
  --cursor-grab: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cline x1='12' y1='2' x2='12' y2='10' stroke='%23ff2b2b' stroke-width='1'/%3E%3Cline x1='12' y1='14' x2='12' y2='22' stroke='%23ff2b2b' stroke-width='1'/%3E%3Cline x1='2' y1='12' x2='10' y2='12' stroke='%23ff2b2b' stroke-width='1'/%3E%3Cline x1='14' y1='12' x2='22' y2='12' stroke='%23ff2b2b' stroke-width='1'/%3E%3Crect x='9' y='9' width='6' height='6' fill='none' stroke='%23ff2b2b' stroke-width='1'/%3E%3C/svg%3E") 12 12, grab;
}

/* ── CRT OVERLAY EFFECTS ── */
.scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 1px, transparent 2px);
  pointer-events: none; z-index: 9000;
}
.sweep-line {
  position: fixed; left: 0; right: 0; height: 4px;
  background: linear-gradient(to bottom, transparent, rgba(255,43,43,0.12), rgba(255,255,255,0.03), transparent);
  pointer-events: none; z-index: 9001;
  will-change: transform;
  animation: sweep 6s linear infinite;
}
@keyframes sweep { 0% { transform: translateY(-2vh); } 100% { transform: translateY(102vh); } }

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: url('/assets/img/grain.png') repeat;
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 999;
  will-change: transform;
  animation: grain-shift 0.3s steps(3) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, -3%); }
  66% { transform: translate(3%, 1%); }
  100% { transform: translate(-1%, 2%); }
}

/* ══════════════════════════════════════════
   CRT POWER-ON ANIMATION
   ══════════════════════════════════════════ */
.crt-poweron {
  position: fixed; inset: 0; z-index: 200;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}

.poweron-line {
  width: 0;
  height: 2px;
  background: #991a1a;
  box-shadow: 0 0 20px rgba(153,26,26,0.6), 0 0 60px rgba(153,26,26,0.3), 0 0 120px rgba(153,26,26,0.15);
  border-radius: 1px;
}

.crt-poweron.phase-line .poweron-line {
  animation: poweron-hline 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes poweron-hline {
  0%   { width: 0; height: 2px; opacity: 1; }
  100% { width: 100vw; height: 2px; opacity: 1; }
}

.crt-poweron.phase-expand .poweron-line {
  width: 100vw;
  animation: poweron-expand 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes poweron-expand {
  0%   { height: 2px; opacity: 1; }
  60%  { height: 100vh; opacity: 1; }
  100% { height: 100vh; opacity: 1; }
}

.crt-poweron.phase-flash {
  animation: poweron-flash 0.5s ease-out forwards;
}
@keyframes poweron-flash {
  0%   { background: #991a1a; opacity: 1; }
  30%  { background: #991a1a; opacity: 0.6; }
  50%  { background: rgba(255,43,43,0.3); opacity: 0.4; }
  70%  { background: #0a0a0a; opacity: 0.3; }
  100% { background: #0a0a0a; opacity: 0; }
}

/* ══════════════════════════════════════════
   LOCK SCREEN
   ══════════════════════════════════════════ */
.lock-screen {
  position: fixed; inset: 0; z-index: 100;
  background: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s ease;
}
.lock-screen.dismissed { opacity: 0; pointer-events: none; }

/* ACCESS DENIED flash */
.lock-screen.access-denied-flash {
  animation: access-denied 0.4s ease;
}
@keyframes access-denied {
  0%, 100% { background: #0a0a0a; }
  15% { background: rgba(255,0,0,0.15); }
  30% { background: #0a0a0a; }
  45% { background: rgba(255,0,0,0.1); }
  60% { background: #0a0a0a; }
}

.crt-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0px, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px);
  pointer-events: none; z-index: 2;
}

.lock-content {
  position: relative; z-index: 1; text-align: center;
  font-family: var(--mono); color: var(--red);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  gap: 0;
}

.lock-avatar {
  width: 200px;
  height: 200px;
  border: 2px solid rgba(255, 90, 90, 0.75);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(255,80,80,0.45), 0 0 70px rgba(255,43,43,0.2);
  background: rgba(0,0,0,0.5);
}

.lock-ascii {
  font-size: 3.2px;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0;
  color: var(--red);
  text-shadow:
    0 0 4px rgba(255,43,43,0.95),
    0 0 10px rgba(255,43,43,0.9),
    0 0 22px rgba(255,43,43,0.75),
    0 0 45px rgba(255,43,43,0.5),
    0 0 90px rgba(255,43,43,0.3);
  animation: crtTextFlicker 3s infinite;
}

.lock-username {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--red);
  margin-top: 20px;
  text-shadow: 0 0 8px rgba(255,43,43,0.5);
}

.lock-password-row {
  margin-top: 16px;
}

.lock-password-field {
  display: inline-flex;
  align-items: center;
  width: 200px;
  height: 32px;
  border: 1px solid rgba(255, 43, 43, 0.3);
  border-radius: 2px;
  padding: 0 12px;
  background: rgba(0,0,0,0.6);
  box-shadow: inset 0 0 10px rgba(255,43,43,0.05);
}

.password-dots {
  font-size: 16px;
  letter-spacing: 5px;
  color: var(--red);
  text-shadow: 0 0 6px rgba(255,43,43,0.5);
}

.password-cursor {
  color: var(--red);
  text-shadow: 0 0 8px var(--red-glow);
  animation: blink 0.6s step-end infinite;
  font-size: 14px;
  margin-left: 1px;
}
.password-cursor.hidden { display: none; }

.lock-hint {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--red);
  opacity: 0;
  min-height: 1.5em;
  text-shadow: 0 0 4px rgba(255,43,43,0.3);
  transition: opacity 0.3s ease;
}
.lock-hint.visible { opacity: 0.5; }

/* Brand name + app purpose on the lock screen. Visible on first paint and
   present in static HTML so Google's OAuth brand reviewer/crawler can read
   the app name (matching the OAuth consent screen) and what the app does. */
.lock-title {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--red);
  margin: 22px 0 0;
  text-shadow: 0 0 10px rgba(255,43,43,0.6);
}
.lock-purpose {
  max-width: 360px;
  margin: 10px auto 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.5px;
  color: var(--red);
  opacity: 0.6;
  text-shadow: 0 0 4px rgba(255,43,43,0.3);
}

.lock-content .launch-prompt {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: calc(50% + 180px);
  bottom: auto;
  white-space: nowrap;
  transition: opacity 0.4s ease;
}

.crt-flicker {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none; animation: crtFlicker 0.08s infinite; background: transparent;
}

.crt-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
}

@keyframes crtTextFlicker {
  0%, 100% { opacity: 1; }
  4% { opacity: 0.85; }
  8% { opacity: 1; }
  42% { opacity: 0.95; }
  44% { opacity: 0.7; }
  45% { opacity: 1; }
  76% { opacity: 0.9; }
  77% { opacity: 1; }
}

@keyframes crtFlicker {
  0% { opacity: 0.01; background: rgba(255,43,43,0.01); }
  50% { opacity: 0; background: transparent; }
  100% { opacity: 0.02; background: rgba(255,43,43,0.015); }
}

/* ── DESKTOP ── */
.desktop { position: fixed; inset: 0; background: var(--black); }

.desktop-bg-video {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}

/* Darken desktop chrome when any app window is open. Each dim-able element
   gets its own opacity/brightness transition — no overlay div, so there's
   no z-index fight that could ever bleed onto the active window. Windows
   themselves are untouched by these rules. */
.desktop-dim { display: none; }

.desktop-bg-video,
.desktop-icons,
.taskbar,
.crt-scanlines,
.crt-grain,
.crt-sweep,
.scanlines,
.sweep-line,
.grain {
  transition: opacity 0.35s ease, filter 0.35s ease;
}

body.has-open-window .desktop-bg-video { filter: brightness(0.3) blur(1.5px); }
body.has-open-window .desktop-icons    { opacity: 0.28; filter: brightness(0.6); }
/* Taskbar stays at full brightness — identity, system status, and the open
   windows themselves are all anchored to it now, so it must stay readable. */
/* Atmospheric layers — defaults are already low (.grain=0.12, .scanlines
   uses rgba(0,0,0,.18) bands). Drop them further so they don't intensify
   when a window opens. */
body.has-open-window .scanlines,
body.has-open-window .crt-scanlines    { opacity: 0.4; }
body.has-open-window .crt-grain,
body.has-open-window .grain            { opacity: 0.04; }
body.has-open-window .crt-sweep,
body.has-open-window .sweep-line       { opacity: 0.18; }
body.has-open-window .site-footer      { opacity: 0.2; }
.desktop-bg-video .bg-video,
.desktop-bg-video .bg-image {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
/* Soft red layer blended with original colors */
.desktop-bg-video .bg-image {
  position: absolute; top: 0; left: 0;
}
.desktop-bg-video .bg-image.bg-tint {
  filter: url(#red-tint);
  opacity: 0.8;
  mix-blend-mode: normal;
}
.desktop-bg-video .bg-logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 14vw;
  height: auto;
  pointer-events: none;
  opacity: 0.32;
  animation: logo-pulse 5s ease-in-out infinite;
  mix-blend-mode: screen;
}
@keyframes logo-pulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 8px  rgba(255,43,43,0.55))
      drop-shadow(0 0 22px rgba(255,43,43,0.4))
      drop-shadow(0 0 55px rgba(255,43,43,0.22))
      drop-shadow(0 0 110px rgba(255,43,43,0.1));
    opacity: 0.9;
  }
  50% {
    filter:
      drop-shadow(0 0 16px rgba(255,80,80,0.95))
      drop-shadow(0 0 40px rgba(255,43,43,0.75))
      drop-shadow(0 0 90px rgba(255,43,43,0.5))
      drop-shadow(0 0 180px rgba(255,43,43,0.25));
    opacity: 1;
  }
}
.desktop-bg-video .bg-ascii {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 4px;
  line-height: 1;
  letter-spacing: 0;
  color: #1a0a0a; /* dark red for "0" */
  background: #000;
  overflow: hidden;
  white-space: pre;
  user-select: none;
  pointer-events: none;
}
.desktop-bg-video .bg-ascii .c1 {
  color: #ff3333;
  text-shadow: 0 0 2px rgba(255,43,43,0.5);
}

/* ── SELECTION BOX (click + drag on desktop) ── */
.selection-box {
  position: fixed;
  z-index: 450;
  border: 1px solid var(--red);
  background: rgba(255, 43, 43, 0.15);
  box-shadow: 0 0 6px rgba(255, 43, 43, 0.3);
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.selection-box.fading {
  opacity: 0;
}

.desktop-icons {
  position: absolute;
  /* Clear the 32px taskbar at the top + a little breathing room. */
  top: 50px;
  left: 32px; z-index: 10;
  display: flex; flex-direction: column; gap: 28px;
}

/* Site footer — persistent app name + purpose + privacy link along the
   bottom edge. Sits ABOVE the lock screen (z-index 100) so brand-verification
   reviewers see the name, purpose, and a working privacy link in every state.
   Dims with the rest of the desktop chrome when a window opens. */
.site-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 6px 18px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--red);
  text-shadow: 0 0 6px var(--red-glow);
  background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0));
  transition: opacity 0.25s ease;
  /* The strip is click-through so it never blocks desktop selection;
     only the privacy link re-enables pointer events. */
  pointer-events: none;
}
.site-footer .sf-name    { font-weight: 600; letter-spacing: 1px; }
.site-footer .sf-sep     { opacity: 0.5; }
.site-footer .sf-purpose { opacity: 0.75; max-width: 64ch; }

.privacy-link {
  pointer-events: auto;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 1px;
  color: var(--red);
  text-decoration: none;
  text-shadow: 0 0 6px var(--red-glow);
  opacity: 0.85;
  transition: opacity 0.25s ease, text-shadow 0.25s ease;
  user-select: none;
}
.privacy-link:hover {
  opacity: 1;
  text-shadow: 0 0 11px var(--red-glow);
}
.privacy-link .pl-bracket { opacity: 0.55; }
.desktop-icon {
  display: flex; flex-direction: column; align-items: center;
  cursor: var(--cursor-pointer); opacity: 0.7; transition: opacity 0.2s, transform 0.15s;
}
.desktop-icon:hover { opacity: 1; transform: scale(1.08); }
.icon-art {
  font-size: 16px; line-height: 1.2; color: var(--cream);
  text-shadow: 0 0 8px rgba(255,255,255,0.3), 0 0 20px rgba(255,255,255,0.1);
  text-align: center;
}
.desktop-icon:hover .icon-art {
  text-shadow: 0 0 12px rgba(255,255,255,0.5), 0 0 30px rgba(255,255,255,0.2);
}
.icon-label {
  font-size: 12px; color: var(--cream); letter-spacing: 1.5px; margin-top: 6px;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}
.desktop-icon:hover .icon-label { color: var(--cream); text-shadow: 0 0 8px rgba(255,255,255,0.3); }
.icon-floppy {
  width: 48px;
  height: 48px;
  background: var(--red-dark);
  border: 1px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(255,43,43,0.3), inset 0 0 12px rgba(255,43,43,0.2);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: box-shadow 0.2s, transform 0.15s;
}
.icon-floppy img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.desktop-icon:hover .icon-floppy {
  box-shadow: 0 0 14px rgba(255,43,43,0.6), inset 0 0 18px rgba(255,43,43,0.35);
  border-color: #ff5555;
}

/* "Look at me" attention state — applied to the portfolio icon until first click */
.desktop-icon.attention .icon-floppy {
  animation: icon-attention-pulse 1.4s ease-in-out infinite;
  border-color: #ff7777;
}
.desktop-icon.attention .icon-label {
  animation: icon-attention-label 1.4s ease-in-out infinite;
}
@keyframes icon-attention-pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255,43,43,0.35), inset 0 0 12px rgba(255,43,43,0.2);
    transform: translateY(0) scale(1);
  }
  50% {
    box-shadow: 0 0 22px rgba(255,80,80,0.85), 0 0 36px rgba(255,43,43,0.45), inset 0 0 22px rgba(255,80,80,0.55);
    transform: translateY(-3px) scale(1.06);
  }
}
@keyframes icon-attention-label {
  0%, 100% { color: var(--cream); text-shadow: 0 0 4px rgba(255,255,255,0.15); }
  50%      { color: var(--cream);          text-shadow: 0 0 10px rgba(255,120,120,0.9); }
}

.launch-prompt {
  position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); z-index: 60;
  font-family: var(--mono); font-size: 14px; color: var(--red); letter-spacing: 2px;
  text-shadow: 0 0 8px var(--red-glow); animation: prompt-pulse 2s ease-in-out infinite;
}
.prompt-cursor { animation: blink 0.6s step-end infinite; }
@keyframes prompt-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }

/* ── TERMINAL WINDOW ── */
.terminal {
  position: absolute; width: 85%; max-width: 1920px; height: calc(80% - 32px); top: calc(8% + 32px);
  left: 0; right: 0; margin: 0 auto;
  display: flex; flex-direction: column;
  border: 2px solid rgba(255, 110, 110, 0.95); border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255,200,200,0.45),
    inset 0 -1px 0 rgba(20,0,0,0.85),
    inset 1px 0 0 rgba(255,180,180,0.25),
    inset -1px 0 0 rgba(20,0,0,0.7),
    0 0 8px rgba(255,60,60,0.18),
    8px 8px 0 rgba(0,0,0,1),
    14px 14px 0 rgba(0,0,0,0.85),
    20px 20px 0 rgba(0,0,0,0.55);
  z-index: 100; opacity: 0; transform: scale(0.6); transform-origin: center center;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.terminal.spawned {
  opacity: 1;
  transform: scale(1);
  /* Force into its own stacking context with a positive z-index so it
     always paints above the .desktop-dim backdrop (z-index 9500) even
     when nested ancestors don't create clean contexts. App.bringToFront
     still overrides via inline style to handle focus ordering. */
  z-index: 10000;
  isolation: isolate;
}

/* Floppy window: tall + narrow. Shows only the floppy stack (drive + queued
   floppies), full column from the start, clipped to a 20px gutter each side
   (see .floppy-window .fn-stage). The section content lives in a separate
   window (#sectionWindow) that grows out of the drive. */
.floppy-window {
  width: clamp(220px, 22vw, 320px);
  max-width: none;
  height: calc(82% - 32px);
  top: calc(6% + 32px);
  /* override the default centering so it sits toward the left, leaving room
     for the section window that grows out to its right. JS may reposition. */
  left: 6%;
  right: auto;
  margin: 0;
}

/* Floppy window body — plain dark stage; the stack fills it. */
.terminal-body.about-body {
  position: relative;
  display: block;
  width: 100%;
  height: calc(100% - 32px);
  padding: 0;
  background: #0a0303;
  overflow: hidden;
  color: #ead9b8;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.65;
}

/* Left column — holds loader window (top-left) + content card. Both windows
   visually maximise out of the floppy drive (right column) on chapter swap;
   that animation is driven by JS transforms in about-scroll.js. */
.about-content-col {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  overflow: visible;
}

/* Right column — full-height floppy nav. Top-anchored so the stack hugs the
   top of about-body. The stack maintains 16:9 (matches 1920×1080 renders).
   JS sizes the stack each resize to whichever of width/height is constraining,
   so the whole frame is always visible. */
.about-floppy-col {
  position: relative;
  flex: 0 0 46%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
}
.about-floppy-stack {
  position: relative;
  /* JS sets explicit pixel width/height (height-driven: stack fills col
     height, width follows 16:9; overflow on the col crops horizontally). */
  height: 100%;
  width: auto;
  aspect-ratio: 16 / 9;
  pointer-events: auto;
}
.about-floppy-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: filter 120ms linear;
  background: transparent;
}
/* z-order: Drive at back, Mission at front. JS bumps active floppy to z:10
   during a cycle so it draws above the others when overlapping the drive. */
#layer-Drive,    #layer-Drive-b    { z-index: 0; }
#layer-the_team, #layer-the_team-b { z-index: 1; }
#layer-work,     #layer-work-b     { z-index: 2; }
#layer-Origins,  #layer-Origins-b  { z-index: 3; }
#layer-Mission,  #layer-Mission-b  { z-index: 4; }
.dots-loop::after {
  content: '';
  animation: dotsLoop 1.5s steps(4, end) infinite;
}
@keyframes dotsLoop {
  0%  { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* Loader window — top-left. Source rect for the chapter-card maximise. */
.about-loader-window {
  position: absolute;
  top: 12px;
  left: 12px;
  width: min(28%, 320px);
  min-height: 130px;
  z-index: 4;
  background: rgba(15, 4, 4, 0.92);
  border: 1px solid rgba(255, 80, 80, 0.5);
  box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.05), 0 0 12px rgba(255, 43, 43, 0.15);
  overflow: hidden;
}
.about-loader-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  background: linear-gradient(180deg, rgba(74,16,16,0.9) 0%, rgba(42,8,8,0.9) 100%);
  border-bottom: 1px solid rgba(255, 80, 80, 0.35);
}
.about-loader-title {
  font-family: Consolas, monospace;
  font-size: 10px;
  color: #ff9090;
  letter-spacing: 1px;
}
.about-loader-dots { display: flex; gap: 5px; }
.about-loader-dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 80, 80, 0.35);
}
.about-loader-window .about-ascii-boot {
  margin: 0;
  padding: 8px 12px;
  font-family: Consolas, monospace;
  font-size: 10px;
  line-height: 1.45;
  color: #ff8080;
  white-space: pre;
}

/* Content card — fills the bottom portion of the left column below the
   loader. Maximises into view from the floppy drive (in the right column)
   on every chapter swap; the source rect is computed at runtime from the
   drive's screen position. */
.about-scroll {
  position: absolute;
  top: 160px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  margin: 0;
  overflow: hidden;
  z-index: 10;
  padding: 0;
  border: 1px solid rgba(255, 80, 80, 0.5);
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 0 30px rgba(255, 0, 0, 0.03),
    0 0 8px rgba(255, 43, 43, 0.1);
}
.about-scroll.spawned { opacity: 1; }
.about-scroll.maximizing { will-change: transform, opacity; z-index: 20; }

/* Scanline glow that leads the reveal */
.about-scroll-glow {
  position: absolute;
  left: 0; right: 0;
  height: 8px;
  z-index: 50;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(255,43,43,0.8) 0%,
    rgba(255,30,30,0.4) 40%,
    transparent 100%
  );
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.15s;
}
.about-scroll-glow.active { opacity: 1; }

/* Sub-CLI chrome titlebar */
.sub-cli-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  background: linear-gradient(180deg, rgba(74,16,16,0.9) 0%, rgba(42,8,8,0.9) 100%);
  border-bottom: 1px solid rgba(255,80,80,0.35);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.sub-cli-title {
  font-family: Consolas, monospace;
  font-size: 10px;
  color: #ff9090;
  letter-spacing: 1px;
}
.sub-cli-status {
  font-family: Consolas, monospace;
  font-size: 9px;
  color: #ff7070;
  letter-spacing: 1px;
  opacity: 0.7;
}
.sub-cli-dots { display: flex; gap: 5px; }
.sub-cli-dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,80,80,0.35);
}

/* Scrollable inner content area */
.about-scroll-inner {
  flex: 1;
  overflow: hidden;
  padding: 0 32px 20px;
}

/* Scroll prompt at bottom of sub-CLI */
.about-scroll-prompt {
  text-align: center;
  font-family: Consolas, monospace;
  font-size: 11px;
  letter-spacing: 4px;
  color: #ff5050;
  text-shadow: 0 0 8px rgba(255,43,43,0.5);
  padding: 14px 0 18px;
  opacity: 0;
  transition: opacity 0.5s ease;
  flex-shrink: 0;
}
.about-scroll-prompt.visible { opacity: 1; }
.about-scroll-prompt:not(.visible) { display: none; }
.about-scroll-prompt .scroll-arrow {
  display: inline-block;
  animation: scrollArrowPulse 1.2s ease-in-out infinite;
}
@keyframes scrollArrowPulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(3px); }
}

.about-scroll::-webkit-scrollbar { width: 10px; }
.about-scroll::-webkit-scrollbar-track { background: rgba(30,0,0,0.4); }
.about-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,43,43,0.5);
  border: 1px solid rgba(255,43,43,0.3);
}
.about-ascii-boot {
  margin: 0;
  font-family: Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #ff8080;
  white-space: pre;
  text-shadow:
    0 0 2px #ff2b2b,
    0 0 8px rgba(255,43,43,0.8),
    0 0 20px rgba(255,43,43,0.4),
    0 0 40px rgba(255,43,43,0.15);
}
.about-ascii-boot .boot-green {
  color: #39ff14;
  text-shadow:
    0 0 2px #39ff14,
    0 0 8px rgba(57,255,20,0.8),
    0 0 20px rgba(57,255,20,0.4),
    0 0 40px rgba(57,255,20,0.15);
}
.about-ascii-boot .boot-dots {
  color: #ffaa00;
  text-shadow:
    0 0 2px #ffaa00,
    0 0 8px rgba(255,170,0,0.8),
    0 0 20px rgba(255,170,0,0.4);
}

/* Sections — each has a colored strip that wipes in behind the text */
.about-section {
  position: relative;
  padding: 26px 22px 26px 22px;
  margin: 0 0 18px;
}
.section-strip {
  position: absolute;
  inset: 0;
  z-index: 0;
  transform-origin: top left;
  pointer-events: none;
  opacity: 0;
}
.about-section[data-strip="a"] .section-strip {
  background: #ff2b2b;
}
.about-section[data-strip="b"] .section-strip {
  background: #ead9b8;
}
.about-section[data-strip="blue"] .section-strip {
  background: linear-gradient(180deg, #1e4a8a 0%, #143569 100%);
}
.about-section[data-strip="green"] .section-strip {
  background: linear-gradient(180deg, #1f6a3a 0%, #0f4524 100%);
}
/* animate the strip in as a set of line-high bands */
.about-section.strip-in .section-strip {
  opacity: 1;
  animation: strip-wipe 0.75s steps(12, end) forwards;
}
@keyframes strip-wipe {
  0%   { clip-path: inset(0 0 100% 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* Mission banner — big 3D ascii at the very top */
.mission-banner-wrap {
  display: flex;
  justify-content: center;
  margin: 10px 0 18px;
  overflow: visible;
  /* Hidden by default; chapter scroll machinery adds .visible when mission
     is the active chapter so it can be cleanly hidden when origins is up. */
  opacity: 0;
  transition: opacity 0.5s ease;
}
.mission-banner-wrap.visible { opacity: 1; }
/* When the wrap is the inactive chapter's, collapse it out of layout so the
   active chapter's content sits directly under the nav. */
.mission-banner-wrap:not(.visible) { display: none; }

.mission-banner {
  margin: 0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.05;
  color: #ff4040;
  white-space: pre;
  text-shadow:
    0 0 2px #ff2b2b,
    0 0 6px rgba(255,43,43,0.9),
    0 0 15px rgba(255,43,43,0.6);
  filter:
    drop-shadow(0 0 4px rgba(255,0,0,0.9))
    drop-shadow(0 0 12px rgba(255,0,0,0.7))
    drop-shadow(0 0 30px rgba(255,0,0,0.45))
    drop-shadow(0 0 60px rgba(255,0,0,0.2));
  letter-spacing: 0;
  padding: 10px 0;
  animation: missionFloat 2s ease-in-out infinite;
}
@keyframes missionFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Each mission sub-section gets its ASCII heading in a separate centered block
   above its colored strip */
.heading-block {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px 10px 10px;
  margin: 6px 0 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.heading-block.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ASCII video-game section heading — now sits in its own centered block */
.section-ascii-heading {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 9px;
  line-height: 1.05;
  color: #ffe4c2;
  white-space: pre;
  letter-spacing: 0;
  text-align: left;
  text-shadow:
    0 0 4px rgba(0,0,0,0.95),
    0 0 10px rgba(255,43,43,0.45);
}
.section-ascii-heading[data-strip="blue"] {
  color: #cfe8ff;
  text-shadow:
    0 0 4px rgba(0,0,0,0.9),
    0 0 10px rgba(60,140,255,0.7),
    0 0 20px rgba(60,140,255,0.35);
}
.section-ascii-heading[data-strip="green"] {
  color: #d3ffd8;
  text-shadow:
    0 0 4px rgba(0,0,0,0.9),
    0 0 10px rgba(60,220,130,0.7),
    0 0 20px rgba(60,220,130,0.35);
}
/* CLI-themed nav at the top of the scroll column */
.about-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0 14px;
  border-bottom: 1px dashed rgba(255,43,43,0.3);
  margin: 0 0 14px;
}
.about-nav .nav-prompt {
  font-size: 11px;
  letter-spacing: 1px;
  color: #ff7070;
  opacity: 0.85;
  margin-right: 4px;
  text-shadow: 0 0 6px rgba(255,43,43,0.5);
}
.about-nav .nav-btn {
  font-family: Consolas, monospace;
  font-size: 11px;
  padding: 4px 10px 4px 8px;
  background: rgba(20,0,0,0.55);
  color: #ead9b8;
  border: 1px solid rgba(255,43,43,0.35);
  border-radius: 2px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, text-shadow 0.15s;
}
.about-nav .nav-btn:hover {
  background: rgba(80,10,10,0.75);
  border-color: rgba(255,120,120,0.7);
  color: #fff3dc;
  text-shadow: 0 0 8px rgba(255,43,43,0.6);
}
.about-nav .nav-btn.active {
  background: rgba(140,20,20,0.75);
  border-color: rgba(255,160,160,0.85);
  color: #fff3dc;
  box-shadow: 0 0 10px rgba(255,43,43,0.4) inset;
}
.about-nav .nav-cmd {
  color: #ff7070;
  margin-right: 4px;
  opacity: 0.85;
}

/* Section text body */
.section-text {
  position: relative;
  z-index: 2;
  color: #ead9b8;
  font-size: 13px;
  line-height: 1.75;
}
.about-section[data-strip="a"] .section-text { color: #fff3dc; }
.about-section[data-strip="b"] .section-text { color: #200202; }

.section-text p { margin: 0 0 14px; }
.section-text .accent { color: #ff2b2b; font-weight: bold; }
.about-section[data-strip="a"] .section-text .accent { color: #200202; }
.about-section[data-strip="b"] .section-text .accent { color: #a31010; }

/* Per-line reveal: hidden until .revealed, then wipes in from left */
.section-line {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.section-line.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Team grid — tweak for the colored-strip context */
.about-section .team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.about-section .team-card {
  padding: 12px;
  border: 1px dashed rgba(0,0,0,0.35);
  background: rgba(0,0,0,0.12);
}
.about-section[data-strip="a"] .team-card {
  border-color: rgba(0,0,0,0.45);
  background: rgba(0,0,0,0.18);
}
.about-section[data-strip="b"] .team-card {
  border-color: rgba(60,0,0,0.45);
  background: rgba(0,0,0,0.05);
}
.about-section .team-card .role {
  font-size: 9px;
  letter-spacing: 2px;
  opacity: 0.75;
  margin-bottom: 4px;
}
.about-section .team-card .name {
  font-family: 'Michroma', Consolas, monospace;
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.about-section .team-card .bio {
  font-size: 10px;
  line-height: 1.55;
  opacity: 0.85;
}

/* Contact block within colored strip */
.about-section .contact-block {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed rgba(0,0,0,0.4);
  background: rgba(0,0,0,0.12);
}
.about-section[data-strip="b"] .contact-block {
  border-color: rgba(60,0,0,0.5);
}
.about-section .contact-row {
  display: flex;
  padding: 6px 0;
  border-bottom: 1px dotted rgba(0,0,0,0.25);
}
.about-section .contact-row:last-child { border-bottom: none; }
.about-section .contact-label {
  width: 110px;
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.75;
}
.about-section .contact-value {
  font-size: 12px;
  color: inherit;
  text-decoration: none;
}
.about-section .contact-value:hover {
  text-shadow: 0 0 8px rgba(255,43,43,0.7);
}

/* ── Chapter transitions ── */
.chapter-divider {
  height: 1px;
  background: rgba(255,43,43,0.25);
  margin: 30px 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.chapter-divider.visible { opacity: 1; }
/* Chapters now never coexist — kill the divider entirely so origins doesn't
   have an orphan rule above it. */
.chapter-divider { display: none !important; }

.chapter-banner-wrap {
  display: flex;
  justify-content: center;
  margin: 10px 0 18px;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.chapter-banner-wrap.visible { opacity: 1; }
.chapter-banner-wrap:not(.visible) { display: none; }

.chapter-banner {
  margin: 0;
  /* Force a strictly-monospace font + kill all glyph substitution so the
     ASCII's column alignment stays pixel-perfect at this size. */
  font-family: 'Consolas', 'Courier New', monospace;
  font-variant-ligatures: none;
  font-kerning: none;
  font-feature-settings: "kern" 0, "liga" 0;
  text-rendering: geometricPrecision;
  /* 20px so the 5-row ORIGINS figlet matches the visual height of the
     7-row MISSION figlet at 14px (5×20 ≈ 7×14). line-height 1.05 matches
     mission so `_` rows don't bleed into the `/\` row below them. */
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: 0;
  color: #ff4040;
  white-space: pre;
  text-shadow:
    0 0 2px #ff2b2b,
    0 0 6px rgba(255,43,43,0.9),
    0 0 15px rgba(255,43,43,0.6);
  filter:
    drop-shadow(0 0 4px rgba(255,0,0,0.9))
    drop-shadow(0 0 12px rgba(255,0,0,0.7))
    drop-shadow(0 0 30px rgba(255,0,0,0.45));
  letter-spacing: 0;
  padding: 10px 0;
  animation: missionFloat 2s ease-in-out infinite;
}

.chapter-scroll-prompt {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.chapter-scroll-prompt.visible { opacity: 1; }

/* ── Origins section ── */
.origins-section {
  margin-top: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.origins-section.visible {
  opacity: 1;
  transform: translateY(0);
}
.origins-divider {
  font-family: Consolas, monospace;
  font-size: 11px;
  color: #ff5050;
  text-shadow: 0 0 6px rgba(255,43,43,0.4);
  margin-bottom: 20px;
  opacity: 0.5;
}
.origins-heading {
  margin: 0 0 24px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.1;
  color: #ff4040;
  white-space: pre;
  text-shadow:
    0 0 2px #ff2b2b,
    0 0 6px rgba(255,43,43,0.8),
    0 0 14px rgba(255,43,43,0.4);
  filter:
    drop-shadow(0 0 4px rgba(255,0,0,0.6))
    drop-shadow(0 0 10px rgba(255,0,0,0.3));
}
.origins-body {
  padding: 0;
}
.origins-block {
  margin-bottom: 22px;
  padding-left: 16px;
  border-left: 2px solid rgba(255,43,43,0.25);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.origins-block.revealed {
  opacity: 1;
  transform: translateX(0);
}
.origins-label {
  font-family: Consolas, monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #ff5050;
  margin-bottom: 8px;
  text-shadow: 0 0 4px rgba(255,43,43,0.4);
}
.origins-text {
  margin: 0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #ead9b8;
}

/* Timeline */
.origins-timeline {
  margin-top: 24px;
  padding-left: 16px;
  border-left: 2px solid rgba(255,43,43,0.25);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.origins-timeline.revealed {
  opacity: 1;
  transform: translateX(0);
}
.timeline-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-family: Consolas, monospace;
  font-size: 11px;
}
.timeline-year {
  min-width: 40px;
  color: #ff7070;
  letter-spacing: 1px;
}
.timeline-dot {
  color: #ff5050;
  font-size: 8px;
  text-shadow: 0 0 4px rgba(255,43,43,0.5);
}
.timeline-desc {
  color: #ead9b8;
}
.timeline-now .timeline-year {
  color: #39ff14;
  text-shadow: 0 0 4px rgba(57,255,20,0.5);
}
.timeline-now .timeline-dot {
  color: #39ff14;
  text-shadow: 0 0 6px rgba(57,255,20,0.6);
  font-size: 10px;
}
.timeline-now .timeline-desc {
  color: #39ff14;
  text-shadow: 0 0 4px rgba(57,255,20,0.3);
}

.about-footer {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255,43,43,0.55);
  text-align: left;
  margin-top: 14px;
  padding-left: 12px;
  display: none;
}
.about-footer.visible {
  display: block;
}

/* ── Mission stack: accumulating flow layout ── */
.mission-stack {
  position: relative;
  width: 100%;
  margin: 14px 0 10px;
}

/* Both chapters use the "newest item at top" stacking pattern. Items sit in
   DOM order (m1, m2, m3, m4) but flex order is reversed so the most-recently
   revealed item always lands at the TOP, pushing older ones down. Items
   collapse via max-height/padding/margin/border so reveal + recede animate
   smoothly in BOTH directions (scroll down grows content; scroll up recedes). */
#missionStack,
#originsStack {
  display: flex;
  flex-direction: column;
}

/* Shared transition on every item (visible or not) — covers both directions.
   max-height 700px is generous headroom for any item's natural content.
   Duration intentionally long + soft ease so the items below visibly and
   smoothly slide as the stack grows or collapses. */
#missionStack > .mission-item,
#originsStack > .mission-item {
  max-height: 700px;
  overflow: hidden;
  transition:
    max-height 0.95s cubic-bezier(.25,.85,.3,1),
    margin-top 0.95s cubic-bezier(.25,.85,.3,1),
    margin-bottom 0.95s cubic-bezier(.25,.85,.3,1),
    padding-top 0.95s cubic-bezier(.25,.85,.3,1),
    padding-bottom 0.95s cubic-bezier(.25,.85,.3,1),
    border-top-width 0.95s cubic-bezier(.25,.85,.3,1),
    border-bottom-width 0.95s cubic-bezier(.25,.85,.3,1),
    opacity 0.55s ease,
    transform 0.7s cubic-bezier(.25,.85,.3,1),
    box-shadow 0.55s ease;
}

/* Collapsed (not yet revealed OR scrolled back past). Zero vertical rhythm. */
#missionStack > .mission-item:not(.visible),
#originsStack > .mission-item:not(.visible) {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
  opacity: 0;
  transform: translateY(-10px);
  box-shadow: none;
  pointer-events: none;
}

/* Hide non-active chapter stacks entirely. */
.mission-stack.chapter-hidden {
  display: none !important;
}

.mission-item {
  opacity: 0;
  transform: translateY(20px);
  max-height: 0;
  overflow: hidden;
  transition:
    opacity 0.45s cubic-bezier(0.77, 0, 0.175, 1),
    transform 0.45s cubic-bezier(0.77, 0, 0.175, 1),
    max-height 0.5s ease;
  margin: 0;
}
.mission-item.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 600px;
  overflow: visible;
  margin: 0 0 16px;
}
.item-frame {
  position: relative;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #ff9090;
  padding: 34px 28px 34px 28px;
  background: rgba(12, 0, 0, 0.35);
}
.item-title { display: none; }

/* ASCII borders for each mission — same char set as portfolio vid-border-* */
.item-border-top,
.item-border-bottom {
  position: absolute;
  left: 0; right: 0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  line-height: 1;
  color: #ff5050;
  white-space: nowrap;
  overflow: hidden;
  text-shadow: 0 0 6px rgba(255,43,43,0.5);
  pointer-events: none;
  z-index: 3;
}
.item-border-top { top: 0; }
.item-border-bottom { bottom: 0; }
/* Scroll-driven draw-in: horizontal borders clip from right,
   vertical borders clip from bottom.  --border-prog is set per active
   section by about-scroll.js based on sub-progress (0..1). */
.item-border-top,
.item-border-bottom {
  clip-path: inset(0 calc((1 - var(--border-prog, 0)) * 100%) 0 0);
}
.item-border-top .border-label,
.item-border-bottom .border-label {
  color: #ffd0d0;
  text-shadow: 0 0 6px rgba(255,255,255,0.3);
  letter-spacing: 1px;
}
.item-border-left,
.item-border-right {
  position: absolute;
  top: 7px; bottom: 7px;
  width: 7px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  line-height: 0.75;
  color: #ff5050;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: hidden;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(255,43,43,0.4);
  z-index: 3;
}
.item-border-left  { left: 0; }
.item-border-right { right: 0; text-align: right; }
.item-border-left,
.item-border-right {
  clip-path: inset(0 0 calc((1 - var(--border-prog, 0)) * 100%) 0);
}

/* Alternating column layout per section */
.item-cols {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.mission-item[data-layout="left"]  .item-cols { flex-direction: row; }
.mission-item[data-layout="right"] .item-cols { flex-direction: row-reverse; }
.item-text-col { flex: 1 1 auto; min-width: 0; }
.item-art-col {
  flex: 0 0 auto;
  width: 38%;
  min-width: 110px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 0;
}
.item-art {
  margin: 0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 10px;
  line-height: 1.05;
  color: #ffb080;
  white-space: pre;
  opacity: 0;
  transform: scale(0.94);
  transform-origin: center;
  transition:
    opacity 0.5s cubic-bezier(0.77,0,0.175,1),
    transform 0.5s cubic-bezier(0.77,0,0.175,1);
  text-shadow: 0 0 4px rgba(255,43,43,0.35);
}
.mission-item.visible .item-art {
  opacity: 0.95;
  transform: scale(1);
}

.item-prompt {
  font-size: 11px;
  color: #ff9090;
  opacity: 0.85;
  margin-bottom: 10px;
}
.item-prompt .prompt-user { color: #ffc8c8; }

.item-line {
  margin: 0 0 8px;
  color: #ead9b8;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.35s cubic-bezier(0.2, 0.6, 0.2, 1),
    transform 0.35s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.item-line.revealed {
  opacity: 1;
  transform: translateX(0);
}
.item-line .accent {
  color: #ff5050;
  font-weight: bold;
}
.item-status {
  margin-top: 12px;
  font-size: 11px;
  color: #66ff88;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.item-status.revealed {
  opacity: 1;
  text-shadow: 0 0 8px rgba(80,255,120,0.45);
}

/* Narrow windows: collapse to vertical stack — floppy on top, content below.
   The right-floppy/left-content split only makes sense on wider viewports. */
@media (max-width: 820px) {
  .about-body { flex-direction: column; }
  .about-floppy-col { flex: 0 0 38%; width: 100%; }
  .about-content-col { flex: 1 1 auto; width: 100%; }
  .about-scroll { top: 140px; left: 8px; right: 8px; bottom: 8px; }
  .about-loader-window { width: min(46%, 240px); top: 8px; left: 8px; }
  .about-loader-window .about-ascii-boot { font-size: 9px; padding: 6px 8px; }
  .about-scroll-inner { padding: 0 18px 20px; }
}

.terminal-chrome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px;
  background: linear-gradient(180deg,
    #b42a2a 0%,
    #901414 10%,
    #700d0d 50%,
    #500707 85%,
    #340303 100%);
  border-bottom: 1px solid rgba(255, 160, 160, 0.35);
  flex-shrink: 0; cursor: var(--cursor-grab); user-select: none;
}
.terminal-chrome:active { cursor: var(--cursor-grab); }
.terminal-title {
  font-family: var(--mono); font-size: 11px; color: var(--cream); letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255,255,255,0.3);
  transition: color 0.1s, text-shadow 0.1s;
}
.terminal-title.glitching {
  color: var(--red);
  text-shadow: 0 0 10px var(--red-glow), 2px 0 #0ff, -2px 0 #f0f;
}
.terminal-dots, .preview-dots { display: flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--red-dim); background: rgba(255,43,43,0.15); transition: border-color 0.3s, background 0.3s, box-shadow 0.3s; }
.dot-close { background: var(--red); border-color: var(--red); box-shadow: 0 0 4px var(--red-glow); }

/* Portfolio window close button — same 8px as siblings, with a hit-area pad
   so it's easy to click, plus a hover dim for affordance */
.terminal-chrome .dot-close {
  position: relative;
  cursor: var(--cursor-pointer);
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}
.terminal-chrome .dot-close::before {
  /* invisible hit area — expands clickable region without changing visual size */
  content: '';
  position: absolute;
  inset: -8px;
}
.terminal-chrome .dot-close:hover {
  background: #ff7070;
  opacity: 0.7;
  box-shadow: 0 0 8px rgba(255,80,80,0.9), 0 0 18px rgba(255,43,43,0.5);
}
.terminal-chrome .dot-close:active {
  transform: scale(0.88);
  opacity: 0.5;
}
.dot-rec { animation: rec-pulse 1.5s ease-in-out infinite; }
@keyframes rec-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--red-glow); }
  50% { opacity: 0.3; box-shadow: 0 0 2px rgba(255,43,43,0.2); }
}

.terminal-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--black); position: relative; }

/* ── METRICS OVERLAY ── */
.terminal-metrics {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--red);
  text-shadow: 0 0 4px rgba(255,43,43,0.3);
  text-align: right;
  line-height: 1.6;
  pointer-events: none;
  white-space: nowrap;
}

/* ── CATEGORY TABS ── */
.term-categories {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: var(--dark); border-bottom: 1px solid var(--red-dark);
  flex-shrink: 0; height: 38px; overflow-x: auto; scrollbar-width: none;
}
.term-categories::-webkit-scrollbar { display: none; }
.cat-tab {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; color: #888;
  padding: 5px 12px; cursor: var(--cursor-pointer); white-space: nowrap;
  border: 1px solid var(--red-dim); background: none; border-radius: 0;
  transition: color 0.2s, text-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.cat-tab:hover {
  color: #ccc; border-color: var(--red-dim);
  background: rgba(255,43,43,0.05);
  text-shadow: none;
}
.cat-tab.active {
  color: var(--cream); border-color: var(--red);
  text-shadow: 0 0 8px rgba(255,255,255,0.4);
  background: rgba(255,43,43,0.08);
  box-shadow: 0 0 6px rgba(255,43,43,0.15);
}
.cat-tab.disabled {
  color: var(--red-dark); border-color: rgba(255,43,43,0.1);
  cursor: inherit; font-style: italic;
}
.cat-tab.disabled:hover { color: var(--red-dark); background: none; border-color: rgba(255,43,43,0.1); }

/* ── VIDEO LIST (single column strips) ── */
.video-list {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin; scrollbar-color: var(--red-dim) var(--black);
  position: relative;
}
.video-list::-webkit-scrollbar { width: 4px; }
.video-list::-webkit-scrollbar-track { background: var(--black); }
.video-list::-webkit-scrollbar-thumb {
  background: var(--red-dim);
  border-radius: 0;
}
.video-list::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

/* Screen tear on category switch */
.video-list.screen-tear {
  animation: screenTear 0.2s steps(1) forwards;
}
@keyframes screenTear {
  0%   { transform: none; }
  10%  { transform: translateX(3px); }
  20%  { transform: translateX(-2px); }
  30%  { transform: skewX(0.5deg); }
  40%  { transform: translateX(1px) skewX(-0.3deg); }
  50%  { transform: translateX(-3px); }
  60%  { transform: skewX(0.4deg); }
  70%  { transform: translateX(2px); }
  80%  { transform: none; }
  100% { transform: none; }
}

/* ── VIDEO ITEM ── */
.vid-item {
  position: relative;
  cursor: var(--cursor-pointer);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.vid-item.hidden { display: none; }

.vid-border-top,
.vid-border-bottom {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--red);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  padding: 0;
  text-shadow: 0 0 6px var(--red-glow);
  transition: text-shadow 0.3s;
  position: relative;
  z-index: 10;
}
.vid-border-top .border-label,
.vid-border-bottom .border-label {
  color: var(--cream);
  text-shadow: 0 0 6px rgba(255,255,255,0.3);
}
.vid-item:hover .vid-border-top,
.vid-item:hover .vid-border-bottom {
  text-shadow: 0 0 10px var(--red-glow), 0 0 25px rgba(255,43,43,0.25);
}
.vid-item:hover .border-label {
  text-shadow: 0 0 10px rgba(255,255,255,0.5), 0 0 25px rgba(255,255,255,0.2);
}

.vid-viewport {
  position: relative;
  height: calc((80vh - 120px) / 2.3);
  overflow: hidden;
  margin: -4px 4.5px;
  transition: height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, border-color 0.3s ease;
  box-shadow:
    inset 0 0 20px rgba(255,43,43,0.04),
    0 0 4px rgba(255,43,43,0.1);
}
.vid-item.vid-loaded:hover .vid-viewport {
  box-shadow:
    inset 0 0 80px rgba(255,43,43,0.25),
    0 0 25px rgba(255,43,43,0.7),
    0 0 60px rgba(255,43,43,0.4),
    0 0 120px rgba(255,43,43,0.2),
    0 0 200px rgba(255,43,43,0.1);
}

/* ── ANIMATED SIDE BORDERS (ASCII vertical lines) ── */
.vid-border-left,
.vid-border-right {
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 7px;
  z-index: 10;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 0.75;
  color: var(--red);
  text-shadow: 0 0 6px var(--red-glow);
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-all;
  pointer-events: none;
}
.vid-border-left { left: 0; }
.vid-border-right { right: 0; text-align: right; }
.vid-item:hover .vid-border-left,
.vid-item:hover .vid-border-right {
  text-shadow: 0 0 10px var(--red-glow), 0 0 25px rgba(255,43,43,0.25);
}

/* ── REVEAL FRAME (pre-rendered first frame image) ── */
.reveal-frame {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 6;
  pointer-events: none;
  filter: url(#red-tint);
}

/* ── REVEAL GLOW (follows typewriter cursor) ── */
.reveal-glow {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  background: linear-gradient(to left,
    rgba(255, 43, 43, 0.7) 0%,
    rgba(255, 30, 30, 0.4) 30%,
    rgba(255, 20, 20, 0.15) 60%,
    transparent 100%
  );
  mix-blend-mode: screen;
}

/* ── DUAL VIDEO LAYERS ── */
/* ASCII video (hidden) */
.vid-viewport .vid-ascii {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

/* Pixelated video (hidden — no longer used as default) */
.vid-viewport .vid-pixel {
  display: none;
}

/* Normal video — red-tinted (always) */
.vid-viewport .vid-normal {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  z-index: 2;
  filter: url(#red-tint);
}

/* Clean (unfiltered) hover layer — canvas mirrors the already-decoded vid-normal
   frames, bypassing the SVG red-tint. Zero extra decode = no freeze. */
.vid-viewport .vid-clean {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  filter: blur(4.5px) brightness(1.05);
  transition: opacity 0.4s ease;
}
.vid-item.vid-loaded:hover .vid-viewport .vid-clean {
  opacity: 1;
}

/* Other items dim when any item is hovered */
.video-list:has(.vid-item.vid-loaded:hover) .vid-item:not(:hover) {
  opacity: 0.65;
  transition: opacity 0.4s ease;
}
.video-list:has(.vid-item.vid-loaded:hover) .vid-item:not(:hover) .vid-viewport {
  filter: brightness(0.75);
  transition: filter 0.4s ease;
}
.vid-item {
  transition: opacity 0.4s ease;
}


/* ── TIMECODE (frame counter on hover) ── */
.vid-timecode {
  position: absolute;
  top: 4px; right: 6px;
  z-index: 4;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--red);
  text-shadow: 0 0 4px rgba(255,43,43,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ── AUDIO LEVEL METERS ── */
.level-meter {
  position: absolute;
  bottom: 4px; right: 6px;
  z-index: 4;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.4;
  color: var(--red);
  text-shadow: 0 0 3px rgba(255,43,43,0.4);
  opacity: 0.4;
  pointer-events: none;
}
.vid-item:hover .level-meter {
  opacity: 0.7;
}

/* (scanline reveal is now canvas-based in JS) */

/* ── SCROLL PROMPT ── */
.scroll-prompt {
  position: absolute;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 50;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--cream);
  text-shadow: 0 0 8px rgba(255,255,255,0.4);
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.scroll-prompt.hidden { opacity: 0; }
.scroll-prompt-text { margin-bottom: 4px; }
.scroll-chevrons {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  line-height: 1;
}
.scroll-chevron {
  animation: chevronBounce 1.5s ease-in-out infinite;
  font-size: 14px;
}
.scroll-chevron:nth-child(2) {
  animation-delay: 0.15s;
  opacity: 0.6;
}
@keyframes chevronBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* ── CLI OVERLAY ── */
.vid-cli {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  font-family: var(--mono);
  font-size: 13px;
  pointer-events: none;
  padding: 8px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.vid-item.vid-loaded:hover .vid-cli {
  opacity: 1;
}

.cli-line {
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.6;
}
.cli-line.cli-cmd { color: var(--red); text-shadow: 0 0 8px var(--red-glow); }
.cli-line.cli-dim { color: var(--red-dim); }
.cli-line.cli-info { color: var(--red); text-shadow: 0 0 5px var(--red-glow); }
.cli-line.cli-project { color: var(--cream); text-shadow: 0 0 6px rgba(255,255,255,0.3); font-size: 14px; }

.cli-cursor {
  color: var(--red);
  text-shadow: 0 0 8px var(--red-glow);
  animation: blink 0.5s step-end infinite;
}

/* ── REVEAL ── */
.vid-item.pending .vid-border-top,
.vid-item.pending .vid-border-bottom,
.vid-item.pending .vid-border-left,
.vid-item.pending .vid-border-right,
.vid-item.pending .vid-viewport { visibility: hidden; }

/* ── FLOATING PREVIEW WINDOW ── */
.preview-window {
  position: fixed;
  width: 380px; height: 260px;
  z-index: 11000;
  display: flex; flex-direction: column;
  border: 2px solid rgba(255, 43, 43, 0.8); border-radius: 3px;
  box-shadow:
    0 0 15px rgba(255,43,43,0.6),
    0 0 40px rgba(255,43,43,0.35),
    0 0 80px rgba(255,43,43,0.15),
    0 0 120px rgba(255,43,43,0.08),
    0 8px 30px rgba(0,0,0,0.8);
  pointer-events: none;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.preview-window.visible { opacity: 1; transform: scale(1); }

.preview-chrome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(255,43,43,0.25);
  flex-shrink: 0; height: 26px;
}
.preview-title {
  font-family: var(--mono); font-size: 10px; color: var(--red);
  text-shadow: 0 0 4px var(--red-glow); letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.preview-body { flex: 1; position: relative; overflow: hidden; background: var(--black); }
.preview-body canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-body .preview-reveal-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}

/* ── DETAIL WINDOW ── */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.detail-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.detail-window {
  position: absolute;
  width: 70%;
  max-width: 1200px;
  height: 85%;
  top: 7.5%;
  left: 50%;
  margin-left: min(-600px, -35%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 43, 43, 0.5);
  border-radius: 3px;
  box-shadow:
    0 0 20px rgba(255,43,43,0.3),
    0 0 60px rgba(255,43,43,0.1),
    0 8px 40px rgba(0,0,0,0.8);
  transform: scale(0.6);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Scoped CRT overlays inside the detail window — sit below the opaque iframe
   so the Vimeo player stays clean while the chrome gets the scanline + grain look. */
.detail-window::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
    rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px,
    transparent 1px, transparent 2px);
  pointer-events: none;
  z-index: 50;
}
.detail-window::after {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: url('/assets/img/grain.png') repeat;
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 50;
  animation: grain-shift 0.3s steps(3) infinite;
}
.detail-overlay.visible .detail-window {
  transform: scale(1);
}

.detail-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: linear-gradient(180deg, #3d0e0e 0%, #2a0808 100%);
  border-bottom: 1px solid rgba(255, 43, 43, 0.35);
  flex-shrink: 0;
  cursor: var(--cursor-grab);
  user-select: none;
}
.detail-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cream);
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255,255,255,0.3);
}
.detail-close {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--red);
  cursor: var(--cursor-pointer);
  background: none;
  border: none;
  text-shadow: 0 0 6px var(--red-glow);
  padding: 0 4px;
  transition: color 0.2s, text-shadow 0.2s;
}
.detail-close:hover {
  color: #ff6666;
  text-shadow: 0 0 12px var(--red-glow);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  background: var(--black);
  scrollbar-width: thin;
  scrollbar-color: var(--red-dim) var(--black);
}
.detail-body::-webkit-scrollbar { width: 6px; }
.detail-body::-webkit-scrollbar-track { background: var(--black); }
.detail-body::-webkit-scrollbar-thumb { background: var(--red-dim); }

/* Vimeo embed */
.detail-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  border-bottom: 2px solid var(--red);
  box-shadow: 0 2px 10px rgba(255,43,43,0.2);
  z-index: 51; /* above .detail-window scanline/grain pseudos so iframe stays clean */
}
.detail-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* Project info section */
.detail-info {
  padding: 20px 24px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--red-dark);
}

.detail-meta-item {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
}
.detail-meta-label {
  color: var(--red);
  text-shadow: 0 0 4px rgba(255,43,43,0.3);
  letter-spacing: 1px;
  font-size: 9px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.detail-meta-value {
  color: var(--cream);
  text-shadow: 0 0 4px rgba(255,255,255,0.2);
}

/* Description */
.detail-description {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  color: #999;
  margin-bottom: 24px;
  max-width: 700px;
}
.detail-description p {
  margin-bottom: 12px;
}

/* Section headers */
.detail-section-header {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--red);
  text-shadow: 0 0 6px rgba(255,43,43,0.3);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--red-dark);
}

/* BTS gallery */
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.detail-gallery img {
  width: 100%;
  border: 1px solid var(--red-dark);
  filter: brightness(0.8) saturate(0.8);
  transition: filter 0.3s, border-color 0.3s;
}
.detail-gallery img:hover {
  filter: brightness(1) saturate(1);
  border-color: var(--red);
}

/* Tags */
.detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.detail-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--red);
  border: 1px solid var(--red-dark);
  padding: 3px 10px;
  text-shadow: 0 0 4px rgba(255,43,43,0.2);
}

/* ══════════════════════════════════════════
   TASKBAR (Win98 style)
   ══════════════════════════════════════════ */
.taskbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 32px;
  z-index: 500;
  display: flex;
  align-items: center;
  /* Y2K glossy red: bright top highlight → saturated mid → deep shadow */
  background: linear-gradient(180deg,
    #b42a2a 0%,
    #901414 10%,
    #700d0d 50%,
    #500707 85%,
    #340303 100%);
  border-bottom: 1px solid rgba(255, 160, 160, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,160,160,0.22),
    0 2px 10px rgba(0,0,0,0.5);
  font-family: var(--mono);
  font-size: 11px;
  padding: 0 2px;
  gap: 2px;
}

.taskbar-start {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 12px;
  height: 26px;
  background: linear-gradient(180deg,
    #c24040 0%,
    #9e2222 15%,
    #7a1313 55%,
    #610c0c 100%);
  border: 1px solid;
  border-color: rgba(255,170,170,0.5) rgba(35,5,5,0.6) rgba(35,5,5,0.6) rgba(255,170,170,0.5);
  box-shadow: inset 0 1px 0 rgba(255,180,180,0.28);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: var(--cursor-pointer);
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}
.taskbar-start:hover {
  background: linear-gradient(180deg, #f04b4b 0%, #c02828 50%, #9a1818 100%);
}
.taskbar-start:active {
  border-color: rgba(60,10,10,0.6) rgba(255,200,200,0.6) rgba(255,200,200,0.6) rgba(60,10,10,0.6);
}
.start-icon {
  color: var(--cream);
  text-shadow: 0 0 6px rgba(255,200,200,0.6);
  font-size: 12px;
}

.taskbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,180,180,0.3);
  margin: 0 2px;
}

.taskbar-items {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.taskbar-items::-webkit-scrollbar { display: none; }

/* Unselected taskbar item — slightly raised button look */
.taskbar-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  height: 26px;
  min-width: 120px;
  max-width: 180px;
  background: linear-gradient(180deg,
    #a52424 0%,
    #841414 15%,
    #620d0d 70%,
    #4d0707 100%);
  border: 1px solid;
  border-color: rgba(255,160,160,0.35) rgba(35,5,5,0.5) rgba(35,5,5,0.5) rgba(255,160,160,0.35);
  box-shadow: inset 0 1px 0 rgba(255,170,170,0.18);
  color: #ffcece;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  cursor: var(--cursor-pointer);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}
.taskbar-item:hover {
  color: var(--cream);
  background: linear-gradient(180deg, #d83838 0%, #a82020 100%);
}
/* Selected/active — sunken look with dark red inner + highlight rim */
.taskbar-item.active {
  background: linear-gradient(180deg, #6b0e0e 0%, #4a0808 100%);
  border-color: rgba(60,10,10,0.7) rgba(255,200,200,0.5) rgba(255,200,200,0.5) rgba(60,10,10,0.7);
  color: var(--cream);
  text-shadow: 0 0 4px rgba(255,200,200,0.5);
  box-shadow:
    inset 1px 1px 2px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,180,180,0.15);
}
.taskbar-item-icon {
  color: #ffddaa;
  text-shadow: 0 0 4px rgba(255,200,150,0.5);
  font-size: 9px;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 26px;
  background: linear-gradient(180deg, #7a0e0e 0%, #4f0606 100%);
  border-left: 1px solid rgba(255,180,180,0.3);
  box-shadow: inset 1px 0 0 rgba(30,0,0,0.6);
  margin-left: auto;
}

/* ── START MENU (drops down from top taskbar) ── */
.start-menu {
  position: fixed;
  top: 32px;
  left: 0;
  z-index: 501;
  display: flex;
  min-width: 220px;
  border: 1px solid;
  border-color: rgba(255,200,200,0.5) rgba(50,5,5,0.6) rgba(50,5,5,0.6) rgba(255,200,200,0.5);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 15px rgba(255,43,43,0.15);
}

.start-menu-sidebar {
  width: 24px;
  background: linear-gradient(180deg, #4f0606 0%, #b01d1d 50%, #4f0606 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}
.start-menu-sidebar-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #ffdddd;
  text-shadow: 0 0 6px rgba(255,180,180,0.5);
}

.start-menu-items {
  flex: 1;
  background: linear-gradient(180deg, #2a0a0a 0%, #1a0505 100%);
  padding: 4px 0;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: #ffebeb;
  letter-spacing: 0.5px;
  cursor: var(--cursor-pointer);
  transition: background 0.1s;
}
.start-menu-item:hover {
  background: linear-gradient(180deg, #c82828 0%, #8a1414 100%);
  color: var(--cream);
  text-shadow: 0 0 6px rgba(255,200,200,0.5);
}
.smi-icon {
  width: 16px;
  text-align: center;
  color: #ffddaa;
  text-shadow: 0 0 4px rgba(255,200,150,0.5);
}
.start-menu-sep {
  height: 1px;
  background: rgba(255,43,43,0.15);
  margin: 4px 12px 4px 36px;
}
.start-menu-shutdown {
  color: #999;
}
.start-menu-shutdown:hover {
  color: #ff6666;
}

/* ── EVENT LOG ── */
/* Metrics window (sits just under the top taskbar) */
.status-metrics-win {
  position: fixed;
  top: 40px; right: 8px;
  z-index: 1;
  padding: 4px 10px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,43,43,0.2);
  pointer-events: none;
}
/* Event log window (below metrics) */
.status-log-win {
  position: fixed;
  top: 72px; right: 8px;
  z-index: 1;
  padding: 4px 10px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,43,43,0.2);
  pointer-events: none;
  min-width: 240px;
}
.event-log {
  padding: 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--red);
  line-height: 1.6;
  pointer-events: none;
  text-align: right;
  max-width: 320px;
}
.event-log-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--red);
  opacity: 0.4;
  transition: opacity 0.3s ease;
}
.event-log-line:last-child {
  opacity: 1;
  color: var(--red);
  text-shadow: 0 0 4px rgba(255,43,43,0.3);
}
.event-log-line:nth-last-child(2) { opacity: 0.85; }
.event-log-line:nth-last-child(3) { opacity: 0.7; }
.event-log-line:nth-last-child(4) { opacity: 0.55; }
.event-log-line:nth-last-child(5) { opacity: 0.4; }
.event-log-cursor {
  display: inline;
  color: var(--red);
  animation: blink 0.6s step-end infinite;
}

/* ── SCROLL POSITION INDICATOR ── */
.scroll-indicator {
  flex: 1;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--red);
  text-shadow: 0 0 4px rgba(255,43,43,0.3);
  pointer-events: none;
  padding: 0 16px 0 8px; /* right padding aligns with video border inset */
  line-height: 38px;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  text-align: right;
  padding: 2px 6px;
}

/* ── PHOSPHOR DECAY TRAILS ── */
.phosphor-ghost {
  position: fixed;
  width: 380px; height: 260px;
  border: 1px solid rgba(255, 43, 43, 0.2);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(255,43,43,0.15);
  pointer-events: none;
  z-index: 199;
  opacity: 0.3;
  transition: opacity 0.4s ease;
}
.phosphor-ghost.fading {
  opacity: 0;
}

/* ══════════════════════════════════════════
   RIGHT-CLICK CONTEXT MENU
   ══════════════════════════════════════════ */
.ctx-menu {
  position: fixed;
  z-index: 12500;
  min-width: 200px;
  background: #0a0a0a;
  border: 1px solid rgba(255,43,43,0.4);
  box-shadow: 0 0 12px rgba(255,43,43,0.2), 0 4px 20px rgba(0,0,0,0.8);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 0;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ctx-menu.visible {
  opacity: 1;
  transform: scale(1);
}

.ctx-item {
  padding: 6px 16px;
  color: var(--red);
  cursor: var(--cursor-pointer);
  transition: background 0.1s, color 0.1s;
  text-shadow: 0 0 4px rgba(255,43,43,0.3);
}
.ctx-item:hover {
  background: rgba(255,43,43,0.1);
  color: var(--cream);
  text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.ctx-item.ctx-disabled {
  color: var(--red-dark);
  cursor: inherit;
  text-shadow: none;
}
.ctx-item.ctx-disabled:hover {
  background: none;
  color: var(--red-dark);
  text-shadow: none;
}

.ctx-item.ctx-danger {
  color: #ff5555;
}
.ctx-item.ctx-danger:hover {
  background: rgba(255,0,0,0.15);
  color: #ff8888;
}

.ctx-sep {
  height: 1px;
  background: rgba(255,43,43,0.15);
  margin: 4px 12px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .terminal { width: 96%; height: calc(88% - 32px); top: calc(6% + 32px); left: 2%; }
  .desktop-icons { top: 44px; left: 12px; gap: 14px; }
  .icon-art { font-size: 9px; }
  .term-categories { height: 24px; padding: 0 6px; }
  .cat-tab { font-size: 8px; padding: 4px 8px; letter-spacing: 1px; }
  .vid-viewport { height: 18vh; }
  .vid-cli { font-size: 11px; }
  .preview-window { width: 260px; height: 190px; }
  .lock-avatar { width: 150px; height: 150px; }
  .lock-ascii { font-size: 2.4px; }
  .lock-username { font-size: 11px; letter-spacing: 4px; }
}

/* ══════════════════════════════════════════
   CONTACT WINDOW — Interactive CLI
   ══════════════════════════════════════════ */
.contact-window {
  width: 620px;
  max-width: 90%;
  height: calc(65% - 32px);
  top: calc(10% + 32px);
}
.contact-body {
  padding: 0;
  overflow: hidden;
}
.ct-terminal {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #ead9b8;
  background: #000;
}
.ct-output {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 6px;
  scrollbar-width: thin;
  scrollbar-color: #ff2b2b transparent;
}
.ct-output::-webkit-scrollbar { width: 8px; }
.ct-output::-webkit-scrollbar-track { background: transparent; }
.ct-output::-webkit-scrollbar-thumb { background: rgba(255,43,43,0.4); }
.ct-line {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.55em;
}
.ct-echo {
  margin-top: 4px;
}
.ct-echo .ct-prompt-text {
  color: #ff7070;
  text-shadow: 0 0 6px rgba(255,43,43,0.5);
}
.ct-green {
  color: #39ff14;
  text-shadow: 0 0 4px rgba(57,255,20,0.6), 0 0 10px rgba(57,255,20,0.2);
}
.ct-red {
  color: #ff4040;
  text-shadow: 0 0 4px rgba(255,43,43,0.7);
}
.ct-gold {
  color: #ffaa00;
  text-shadow: 0 0 4px rgba(255,170,0,0.5);
}
.ct-cmd {
  color: #80c0ff;
  text-shadow: 0 0 4px rgba(128,192,255,0.4);
}
.ct-arg {
  color: #c8ff80;
}
.ct-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 14px;
  border-top: 1px solid rgba(255,43,43,0.15);
  flex-shrink: 0;
}
.ct-prompt-text {
  color: #ff7070;
  font-size: 12px;
  text-shadow: 0 0 6px rgba(255,43,43,0.5);
  flex-shrink: 0;
}
.ct-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ead9b8;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  caret-color: transparent;
  padding: 0;
}
.ct-cursor {
  color: #ff4040;
  animation: cursorBlink 1s steps(2) infinite;
  text-shadow: 0 0 6px rgba(255,43,43,0.6);
  font-size: 12px;
}
@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.ct-glitch {
  animation: ctGlitch 0.3s steps(4) !important;
}
@keyframes ctGlitch {
  0% { transform: scale(1) translate(0, 0); filter: none; }
  20% { transform: scale(1) translate(-3px, 1px); filter: hue-rotate(90deg); }
  40% { transform: scale(1.01) translate(2px, -1px); filter: hue-rotate(-90deg) brightness(1.3); }
  60% { transform: scale(0.99) translate(-1px, 2px); filter: hue-rotate(180deg); }
  80% { transform: scale(1) translate(3px, -1px); filter: hue-rotate(-45deg) brightness(0.8); }
  100% { transform: scale(1) translate(0, 0); filter: none; }
}

/* ══════════════════════════════════════════
   FILES WINDOW
   ══════════════════════════════════════════ */
.files-window {
  width: 80%;
  max-width: 1100px;
  height: calc(72% - 32px);
  top: calc(10% + 32px);
}
.files-body {
  padding: 0;
  overflow: hidden;
}
.files-browser {
  display: flex;
  height: 100%;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  color: var(--cream);
}

/* Sidebar — category folders */
.files-sidebar {
  width: 220px;
  min-width: 180px;
  border-right: 1px solid rgba(255,43,43,0.3);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.files-sidebar-header,
.files-sidebar-footer {
  padding: 8px 14px;
  font-size: 10px;
  color: #ff5050;
  letter-spacing: 1px;
  opacity: 0.6;
  flex-shrink: 0;
}
.files-sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,43,43,0.15); }
.files-folder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,43,43,0.08);
}
.files-folder:hover { background: rgba(255,43,43,0.08); }
.files-folder.active {
  background: rgba(255,43,43,0.15);
  border-left: 2px solid var(--red);
}
.files-folder-disabled {
  opacity: 0.3;
  pointer-events: none;
}
.files-folder-icon {
  color: var(--gold);
  font-size: 10px;
  width: 12px;
}
.files-folder-name {
  flex: 1;
  color: var(--cream);
  font-size: 12px;
}
.files-folder-count {
  font-size: 10px;
  color: #ff7070;
  opacity: 0.6;
}

/* Middle — file listing */
.files-listing {
  flex: 1;
  min-width: 240px;
  border-right: 1px solid rgba(255,43,43,0.3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.files-listing-header,
.files-listing-footer {
  padding: 8px 14px;
  font-size: 10px;
  color: #ff5050;
  letter-spacing: 1px;
  opacity: 0.6;
  flex-shrink: 0;
}
.files-listing-footer { margin-top: auto; border-top: 1px solid rgba(255,43,43,0.15); }
.files-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,43,43,0.06);
}
.files-file:hover { background: rgba(255,43,43,0.06); }
.files-file.active {
  background: rgba(255,43,43,0.14);
  border-left: 2px solid var(--red);
}
.files-file-icon {
  color: var(--red);
  font-size: 9px;
  opacity: 0.7;
}
.files-file-info { flex: 1; min-width: 0; }
.files-file-name {
  font-size: 12px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.files-file-meta {
  font-size: 10px;
  color: #ff7070;
  opacity: 0.6;
  margin-top: 2px;
}

/* Right — file preview */
.files-preview {
  width: 300px;
  min-width: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.files-preview-header,
.files-preview-footer {
  padding: 8px 14px;
  font-size: 10px;
  color: #ff5050;
  letter-spacing: 1px;
  opacity: 0.6;
  flex-shrink: 0;
}
.files-preview-footer { margin-top: auto; border-top: 1px solid rgba(255,43,43,0.15); }
.files-preview-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: #0a0000;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,43,43,0.2);
  flex-shrink: 0;
}
.files-preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.files-preview-meta {
  padding: 12px 14px 8px;
}
.files-meta-row {
  display: flex;
  gap: 10px;
  margin: 4px 0;
  font-size: 11px;
}
.files-meta-label {
  min-width: 70px;
  color: #ff5050;
  font-size: 10px;
  letter-spacing: 1px;
  opacity: 0.7;
}
.files-meta-value { color: var(--cream); }
.files-preview-desc {
  padding: 8px 14px;
  font-size: 11px;
  color: #bbb;
  line-height: 1.5;
  border-top: 1px dashed rgba(255,43,43,0.15);
}
.files-preview-tags {
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.files-tag {
  font-size: 9px;
  letter-spacing: 1px;
  padding: 3px 8px;
  border: 1px solid rgba(255,43,43,0.3);
  color: #ff7070;
  background: rgba(255,43,43,0.06);
}
.files-open-btn {
  display: block;
  margin: 12px 14px;
  padding: 8px 16px;
  font-family: Consolas, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--red);
  border: 1px solid var(--red);
  background: rgba(255,43,43,0.06);
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, box-shadow 0.2s;
}
.files-open-btn:hover {
  background: rgba(255,43,43,0.18);
  box-shadow: 0 0 12px rgba(255,43,43,0.3);
}
.files-empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 11px;
  color: #ff5050;
  opacity: 0.4;
}

/* ══════════════════════════════════════════
   TASKBAR TRAY ITEMS (sign-in, user widget, date, clock)
   These live inside .taskbar-tray at the top of the screen.
   ══════════════════════════════════════════ */
.tb-sep {
  color: rgba(255, 180, 180, 0.45);
  font-size: 10px;
}

/* Session / sign-in prompt when logged out */
.tb-session {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--cream);
  letter-spacing: 1px;
}
.tb-session-label {
  color: #ffaa00;
  text-shadow: 0 0 4px rgba(255,170,0,0.4);
}
.tb-session-name {
  color: #ffd5d5;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}
.tb-signin {
  background: linear-gradient(180deg, #c24040 0%, #9e2222 15%, #7a1313 55%, #610c0c 100%);
  border: 1px solid;
  border-color: rgba(255,170,170,0.5) rgba(35,5,5,0.6) rgba(35,5,5,0.6) rgba(255,170,170,0.5);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 2px 10px;
  height: 20px;
  cursor: var(--cursor-pointer);
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,180,180,0.28);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.tb-signin:hover {
  background: linear-gradient(180deg, #f04b4b 0%, #c02828 50%, #9a1818 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,180,180,0.28), 0 0 10px rgba(255, 90, 90, 0.5);
}
.tb-signin:active {
  border-color: rgba(60,10,10,0.6) rgba(255,200,200,0.6) rgba(255,200,200,0.6) rgba(60,10,10,0.6);
}

/* Signed-in user widget */
.tb-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  cursor: var(--cursor-pointer);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.tb-user:hover {
  background: rgba(255, 43, 43, 0.08);
  border-color: rgba(255, 43, 43, 0.3);
}
.tb-user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  border: 1px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0000;
  overflow: hidden;
  box-shadow: 0 0 6px rgba(255, 43, 43, 0.3);
}
.tb-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tb-user-initial {
  font-family: var(--display);
  font-size: 11px;
  color: var(--red);
  text-shadow: 0 0 4px var(--red-glow);
}
.tb-user-name {
  font-size: 11px;
  color: var(--cream);
  letter-spacing: 0.5px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-user-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--black);
  border: 1px solid var(--red);
  box-shadow: 0 0 12px rgba(255, 43, 43, 0.35), 4px 4px 0 rgba(0,0,0,0.9);
  min-width: 140px;
  padding: 4px;
  z-index: 9000;
}
.tb-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-align: left;
  cursor: var(--cursor-pointer);
  transition: background 0.12s, color 0.12s;
}
.tb-menu-item:hover {
  background: rgba(255, 43, 43, 0.15);
  color: var(--red);
  text-shadow: 0 0 4px var(--red-glow);
}

.tb-date {
  font-family: var(--mono);
  font-size: 10px;
  color: #ffcccc;
  opacity: 0.85;
  letter-spacing: 1px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}
.tb-clock {
  font-family: var(--mono);
  font-size: 11px;
  color: #ffebeb;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  min-width: 64px;
  text-align: right;
}

/* ══════════════════════════════════════════
   MEMBERS WINDOW (iframes /members/)
   ══════════════════════════════════════════ */
.members-window {
  width: min(920px, 92vw);
  height: min(640px, 82vh);
  top: calc(8% + 32px);
}
.members-body {
  padding: 0;
  background: var(--black);
  overflow: hidden;
}
.members-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: block;
}

/* Loading card — overlays the iframe while /members/ + Firebase SDK
   finish downloading. Gives the user immediate visual feedback instead
   of a blank black window. */
.members-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0a0303, #060101);
  font-family: var(--mono);
  color: var(--cream);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.members-loading.off { opacity: 0; }
.members-loading-inner {
  min-width: 280px;
  padding: 24px 28px;
  border: 1px solid rgba(255, 43, 43, 0.4);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 20px rgba(255, 43, 43, 0.2),
              inset 0 0 14px rgba(255, 43, 43, 0.07);
  text-align: center;
}
.members-loading-title {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--red);
  text-shadow: 0 0 8px var(--red-glow);
  margin-bottom: 14px;
}
.members-loading-line {
  font-size: 12px;
  color: var(--cream);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  opacity: 0.85;
}
.members-loading-dots::after {
  content: '';
  animation: mdots 1.2s steps(4, end) infinite;
}
@keyframes mdots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}
.members-loading-bar {
  height: 3px;
  width: 100%;
  background: rgba(255, 43, 43, 0.15);
  overflow: hidden;
  position: relative;
}
.members-loading-bar > span {
  position: absolute;
  left: -30%;
  top: 0; bottom: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  box-shadow: 0 0 10px var(--red-glow);
  animation: mbar 1.4s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes mbar {
  from { left: -30%; }
  to   { left: 100%; }
}

/* ══════════════════════════════════════════
   SIGN-IN WINDOW (signin.app — standalone, not iframed)
   Inline auth UI rendered on the desktop. Uses the same .terminal /
   .terminal-chrome chrome the other windows use; the body styles live
   here under .signin-* to stay isolated from any other .auth-* rules.
   ══════════════════════════════════════════ */
.signin-window {
  width: min(440px, 92vw);
  height: auto;
  max-height: min(620px, 86vh);
  top: calc(8% + 32px);
}
.signin-body {
  position: relative;
  padding: 30px 34px 26px;
  background: var(--black);
  font-family: var(--mono);
  color: var(--cream);
  min-height: 380px;
}

.signin-banner {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--red);
  text-shadow: 0 0 6px var(--red-glow);
  text-align: center;
  margin-bottom: 8px;
  opacity: 0.85;
}
.signin-heading {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: 2px;
  color: var(--red);
  text-align: center;
  text-shadow: 0 0 10px var(--red-glow), 0 0 20px rgba(255,43,43,0.4);
  margin-bottom: 8px;
}
.signin-sub {
  font-size: 12px;
  text-align: center;
  color: var(--cream);
  opacity: 0.78;
  margin-bottom: 18px;
  line-height: 1.55;
}
.signin-sub strong { color: var(--gold); }
.signin-hint {
  font-size: 11px;
  text-align: center;
  color: var(--cream);
  opacity: 0.6;
  margin-bottom: 16px;
  line-height: 1.5;
  letter-spacing: 0.3px;
}
.signin-hint strong { color: var(--gold); opacity: 1; }

.signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 9px;
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: var(--cursor-pointer);
  text-shadow: 0 0 4px var(--red-glow);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.signin-btn:hover {
  background: rgba(255, 43, 43, 0.12);
  box-shadow: 0 0 12px rgba(255, 43, 43, 0.4), inset 0 0 8px rgba(255, 43, 43, 0.15);
  color: #ff6a6a;
}
.signin-btn:active { transform: translateY(1px); }
.signin-btn[disabled] { opacity: 0.4; pointer-events: none; }

.signin-btn-icon {
  display: inline-flex;
  width: 22px; height: 22px;
  align-items: center; justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
  font-size: 11px;
}
.signin-btn-google {
  border-color: #ffaa00;
  color: #ffaa00;
  text-shadow: 0 0 4px rgba(255,170,0,0.5);
}
.signin-btn-google:hover {
  background: rgba(255,170,0,0.1);
  box-shadow: 0 0 12px rgba(255,170,0,0.4);
  color: #ffc24d;
}
.signin-btn-facebook {
  border-color: #6aaaff;
  color: #6aaaff;
  text-shadow: 0 0 4px rgba(106,170,255,0.5);
}
.signin-btn-facebook:hover {
  background: rgba(106,170,255,0.1);
  box-shadow: 0 0 12px rgba(106,170,255,0.4);
  color: #9cc4ff;
}
.signin-btn-primary {
  background: rgba(255, 43, 43, 0.15);
  margin-top: 6px;
}
.signin-btn-primary:hover {
  background: rgba(255, 43, 43, 0.3);
}
.signin-btn-ghost {
  border-color: rgba(255, 43, 43, 0.4);
  color: var(--cream);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: none;
  padding: 9px 12px;
}
.signin-btn-ghost:hover { color: var(--red); }

.signin-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
  color: var(--red);
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.6;
}
.signin-divider::before,
.signin-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,43,43,0.4), transparent);
}

.signin-toggle {
  margin-top: 14px;
  font-size: 11px;
  text-align: center;
  color: var(--cream);
  opacity: 0.7;
}
.signin-toggle a {
  color: #39ff14;
  margin-left: 6px;
  text-decoration: none;
  text-shadow: 0 0 4px rgba(57,255,20,0.5);
  border-bottom: 1px dashed rgba(57,255,20,0.4);
  cursor: var(--cursor-pointer);
}
.signin-toggle a:hover { color: #7dff5c; }

.signin-back {
  background: none;
  border: none;
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: var(--cursor-pointer);
  margin-bottom: 10px;
  text-shadow: 0 0 4px var(--red-glow);
}
.signin-back:hover { color: #ff6a6a; }

.signin-label {
  display: block;
  margin-bottom: 11px;
}
.signin-label > span {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #ffaa00;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.signin-label input {
  width: 100%;
  padding: 10px 12px;
  background: #0a0000;
  border: 1px solid rgba(255, 43, 43, 0.4);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.signin-label input:focus {
  border-color: var(--red);
  box-shadow: 0 0 10px rgba(255,43,43,0.3), inset 0 0 4px rgba(255,43,43,0.1);
}

.signin-error {
  min-height: 18px;
  font-size: 11px;
  color: #ff6a6a;
  text-shadow: 0 0 4px rgba(255,106,106,0.4);
  margin-bottom: 6px;
}

.signin-sent-icon {
  font-size: 46px;
  color: var(--red);
  text-align: center;
  margin: 18px 0 10px;
  text-shadow: 0 0 14px var(--red-glow), 0 0 28px rgba(255,43,43,0.4);
  animation: signinIconPulse 2s ease-in-out infinite;
}
.signin-blocked-icon { color: #ffaa00; text-shadow: 0 0 14px rgba(255,170,0,0.7), 0 0 28px rgba(255,170,0,0.3); }
@keyframes signinIconPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.06); }
}

.signin-loading {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
}
.signin-spinner {
  width: 40px; height: 40px;
  border: 2px solid rgba(255,43,43,0.25);
  border-top-color: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255,43,43,0.4);
  animation: signinSpin 0.8s linear infinite;
}
@keyframes signinSpin { to { transform: rotate(360deg); } }
.signin-loading-label {
  font-size: 11px;
  color: var(--red);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 6px var(--red-glow);
}

/* Responsive — let the window grow on narrow screens */
@media (max-width: 540px) {
  .signin-window {
    width: 94vw;
  }
  .signin-body { padding: 24px 22px 22px; }
}

/* ══════════════════════════════════════════
   VOTE MODE — inline styles for finalists on the desktop
   (mirrors /vote/vote.css so the vote flow works without loading that page)
   ══════════════════════════════════════════ */
.vote-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 400;
}
.vote-stage.active {
  display: block !important;
  pointer-events: none;
}

.finalist {
  position: absolute;
  width: 300px;
  height: 260px;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(255, 110, 110, 0.95);
  border-radius: 2px;
  background: var(--black);
  box-shadow:
    inset 0 1px 0 rgba(255,200,200,0.45),
    inset 0 -1px 0 rgba(20,0,0,0.85),
    0 0 8px rgba(255,60,60,0.18),
    6px 6px 0 rgba(0,0,0,1),
    12px 12px 0 rgba(0,0,0,0.6);
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.6);
  transform-origin: center center;
  transition:
    opacity 0.35s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.6s ease,
    box-shadow 0.6s ease,
    left 0.8s ease,
    top 0.8s ease;
}
.finalist.spawned { opacity: 1; transform: scale(1); }
.finalist.dismissed {
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  filter: blur(6px);
}
.finalist.winner {
  z-index: 500;
  transform: scale(1.06);
  border-color: #ff5555;
  box-shadow:
    inset 0 1px 0 rgba(255,220,220,0.6),
    inset 0 -1px 0 rgba(40,0,0,0.9),
    0 0 24px rgba(255,80,80,0.9),
    0 0 48px rgba(255,43,43,0.6),
    0 0 96px rgba(255,43,43,0.3),
    6px 6px 0 rgba(0,0,0,1);
  animation: winner-pulse 2.2s ease-in-out infinite;
}
@keyframes winner-pulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255,220,220,0.6),
      inset 0 -1px 0 rgba(40,0,0,0.9),
      0 0 24px rgba(255,80,80,0.9),
      0 0 48px rgba(255,43,43,0.6),
      0 0 96px rgba(255,43,43,0.3),
      6px 6px 0 rgba(0,0,0,1);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255,220,220,0.7),
      inset 0 -1px 0 rgba(40,0,0,1),
      0 0 32px rgba(255,100,100,1),
      0 0 64px rgba(255,43,43,0.8),
      0 0 128px rgba(255,43,43,0.45),
      6px 6px 0 rgba(0,0,0,1);
  }
}
.finalist.winner .finalist-media img,
.finalist.winner .finalist-media video,
.finalist.winner .finalist-media iframe {
  filter: brightness(1.25) contrast(1.05);
}
.finalist-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: linear-gradient(180deg,
    #b42a2a 0%, #901414 10%, #700d0d 50%, #500707 85%, #340303 100%);
  border-bottom: 1px solid rgba(255, 160, 160, 0.35);
  flex-shrink: 0;
  cursor: var(--cursor-grab);
}
.finalist-title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cream);
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255,255,255,0.3);
}
.finalist-dots { display: flex; gap: 6px; }
.finalist-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--black);
  overflow: hidden;
  min-height: 0;
}
.finalist-media {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0a0000;
  min-height: 0;
}
.finalist-media img,
.finalist-media video,
.finalist-media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.finalist-footer {
  flex-shrink: 0;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255, 60, 60, 0.35);
  background: #0a0000;
}
.finalist-artist {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cream);
  text-align: center;
  margin-bottom: 6px;
}
.finalist-artist-name {
  color: var(--red);
  text-shadow: 0 0 6px var(--red-glow);
}
/* Brand-styled button used throughout the vote flow — finalist tiles,
   transmission.log, auth prompts, yes/no IG gate. */
.vote-btn {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--red);
  border-radius: 0;
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: var(--cursor-pointer);
  text-shadow: 0 0 4px var(--red-glow);
  box-shadow: inset 0 0 0 1px rgba(255,43,43,0.08);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
  -webkit-appearance: none;
  appearance: none;
}
.vote-btn:hover {
  background: rgba(255, 43, 43, 0.15);
  box-shadow: 0 0 12px rgba(255, 43, 43, 0.45), inset 0 0 8px rgba(255, 43, 43, 0.15);
  color: #ff6a6a;
}
.vote-btn:active { transform: translateY(1px); }
.vote-btn[disabled] { opacity: 0.4; pointer-events: none; }

/* Slightly tighter sizing when inside a finalist tile footer */
.finalist .vote-btn { padding: 7px 10px; }

/* Vote terminal + share card spawned during the flow */
.vote-mode-terminal {
  position: fixed;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  width: min(560px, 90vw);
  background: var(--black);
  border: 2px solid rgba(255, 110, 110, 0.95);
  box-shadow:
    0 0 12px rgba(255,60,60,0.25),
    6px 6px 0 rgba(0,0,0,1);
  z-index: 600;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.4s ease;
}
.vote-mode-terminal.visible { opacity: 1; }
.vote-mode-terminal .vote-terminal-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: linear-gradient(180deg,
    #b42a2a 0%, #901414 10%, #700d0d 50%, #500707 85%, #340303 100%);
  border-bottom: 1px solid rgba(255, 160, 160, 0.35);
  color: var(--cream);
  font-size: 11px;
}
.vote-mode-terminal .vote-terminal-body {
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cream);
  line-height: 1.65;
}
.vote-line { margin-bottom: 8px; }
.vote-line .prompt-caret { color: var(--red); margin-right: 6px; }
.vote-line a.ig-link {
  color: #39ff14;
  text-decoration: none;
  text-shadow: 0 0 6px rgba(57,255,20,0.6);
  border-bottom: 1px dashed rgba(57,255,20,0.4);
}
.vote-line a.ig-link:hover { color: #7dff5c; }
.vote-buttons { display: flex; gap: 10px; margin-top: 10px; }
.vote-buttons .vote-btn { flex: 1; }
.vote-progress {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--red);
  text-shadow: 0 0 4px var(--red-glow);
  letter-spacing: 2px;
}

.vote-share-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  width: 280px;
  background: var(--black);
  border: 2px solid rgba(255, 110, 110, 0.95);
  box-shadow:
    0 0 20px rgba(255, 43, 43, 0.5),
    0 0 48px rgba(255, 43, 43, 0.25),
    6px 6px 0 rgba(0,0,0,1);
  z-index: 800;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.vote-share-card.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.vote-share-card .share-card-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--red);
  text-shadow: 0 0 6px var(--red-glow);
  letter-spacing: 3px;
  margin-bottom: 14px;
  text-align: center;
}
.vote-share-card .share-card-qr {
  width: 200px; height: 200px;
  margin: 0 auto;
  background: #fff;
  padding: 10px;
}
.vote-share-card .share-card-qr img { width: 100%; height: 100%; display: block; }
.vote-share-card .share-card-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cream);
  opacity: 0.65;
  letter-spacing: 1.5px;
  margin-top: 12px;
  text-align: center;
}

/* ── Skip-to-content link (a11y) ── */
.skip-link { position:absolute; left:-9999px; top:0; }
.skip-link:focus { left:0; top:0; z-index:9999; padding:8px 12px; background:#000; color:#39ff14; outline:2px solid #39ff14; }

/* ── Reduced motion gate ──
   Suppress idle/decorative loops (scanlines, grain, flicker, sweep) but
   leave intentional state transitions (window open/close, floppy slide,
   fades) alone — those are functional, not motion-sickness triggers. */
@media (prefers-reduced-motion: reduce) {
  .scanlines, .sweep-line, .grain, .crt-flicker { animation: none !important; opacity: 0 !important; }
  html { scroll-behavior: auto !important; }
}

/* ============================================================================
   ABOUT — floppy nav v2 (driven by js/about-floppy-nav.js)
   ============================================================================
   Self-contained .fn-* layer. Replaces the legacy .about-floppy* / .about-
   scroll / .about-content-col rules without touching them. Layout:
     - .fn-stage fills .about-body
     - .fn-floppy-frame is centered, transformable for the zoom-in/out lifecycle
     - 4 corner slots (.fn-tl/.fn-tr/.fn-bl/.fn-br) hold section windows
     - .fn-loader-readout is a top-right plain console (no chrome)
     - .fn-section-window is a per-corner content window themed in the
       active chapter's colour
   The legacy .about-* CSS is now dead and can be pruned later. */

/* Per-chapter palette. Section window borders, glows, and floppy hover use
   these. Mission deliberately reads as a "stock" floppy grey. */
.fn-chapter-mission  { --fn-chapter-color: #d8d8d8; --fn-chapter-bg: rgba(40, 40, 44, 0.92);  --fn-chapter-glow: rgba(216, 216, 216, 0.45); }
.fn-chapter-origins  { --fn-chapter-color: #66ff88; --fn-chapter-bg: rgba(8, 24, 14, 0.92);   --fn-chapter-glow: rgba(102, 255, 136, 0.45); }
.fn-chapter-our-work { --fn-chapter-color: #bb88ff; --fn-chapter-bg: rgba(20, 8, 32, 0.92);   --fn-chapter-glow: rgba(187, 136, 255, 0.45); }
.fn-chapter-the-team { --fn-chapter-color: #ff5050; --fn-chapter-bg: rgba(34, 6, 6, 0.92);    --fn-chapter-glow: rgba(255, 80, 80, 0.45); }

/* Stage — fills the floppy-window body but inset 20px left/right so the
   centered floppy column reads with a clean 20px gutter on either side.
   overflow:hidden clips the (wider, height-driven) stack to this region. */
.fn-stage {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  right: 20px;
  overflow: hidden;
  background: #0a0303;
  font-family: Consolas, 'Courier New', monospace;
}

/* Hidden template — chapter section markup lives here for JS to clone. */
.fn-template { display: none !important; }

/* ── Floppy frame ─────────────────────────────────────────────────────────
   Top-anchored: drive's top edge sits at the top of the about-window so
   the floppy queue (drive + 4 floppies stacked below) fills the available
   vertical space. transform-origin at top-centre means scaling preserves
   that anchor — zoom in/out grows/shrinks downward from the drive. */
.fn-floppy-frame {
  position: absolute;
  top: 0;
  left: 50%;
  /* JS sets: translateX(-50%) scale(S). */
  transform: translateX(-50%) scale(1);
  transform-origin: 50% 0%;            /* drive's top sits ~here */
  transition: transform 850ms cubic-bezier(0.45, 0, 0.2, 1);
  pointer-events: auto;
  will-change: transform;
}
.fn-floppy-stack {
  position: relative;
  /* JS sizes height to stage height, width to height*16/9 (overflow
     horizontally is OK — stage clips). Fallback before JS runs. */
  width: 1422px;
  height: 800px;
}
.fn-floppy-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Explicit initial transform so the first inline-style transform
     change animates cleanly (some browsers skip the transition when
     going from implicit `none` to an explicit value). */
  transform: translateY(0);
  transition: filter 140ms linear,
              transform 520ms cubic-bezier(0.45, 0, 0.2, 1);
  background: transparent;
  user-select: none;
  will-change: transform;
}
/* z-order matches sandbox: Drive at back, Mission at front. JS bumps active
   floppy to z:10 during a switch so it draws above the others. */
#fn-layer-Drive,    #fn-layer-Drive-b    { z-index: 0; }
#fn-layer-the_team, #fn-layer-the_team-b { z-index: 1; }
#fn-layer-work,     #fn-layer-work-b     { z-index: 2; }
#fn-layer-Origins,  #fn-layer-Origins-b  { z-index: 3; }
#fn-layer-Mission,  #fn-layer-Mission-b  { z-index: 4; }

/* Idle pulse — gently breathing drop-shadow on each non-active floppy so
   they read as interactive even before hover. Disabled while the active
   floppy is being switched/intro'd (JS toggles a class on the stack). */
.fn-floppy-stack:not(.fn-busy) #fn-layer-Mission,
.fn-floppy-stack:not(.fn-busy) #fn-layer-Origins,
.fn-floppy-stack:not(.fn-busy) #fn-layer-work,
.fn-floppy-stack:not(.fn-busy) #fn-layer-the_team {
  animation: fnFloppyPulse 2.6s ease-in-out infinite;
}
@keyframes fnFloppyPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 230, 200, 0.10)); }
  50%      { filter: drop-shadow(0 0 18px rgba(255, 230, 200, 0.32)); }
}

/* ── Loader readout (top-right console) ─────────────────────────────────── */
.fn-loader-readout {
  position: absolute;
  top: 14px;
  right: 16px;
  margin: 0;
  padding: 0;
  max-width: 320px;
  font-family: Consolas, monospace;
  font-size: 10px;
  line-height: 1.45;
  color: #ff8080;
  text-shadow: 0 0 6px rgba(255, 80, 80, 0.5);
  white-space: pre;
  text-align: right;
  pointer-events: none;
  opacity: 0;
  z-index: 30;
  transition: opacity 600ms ease;
}
.fn-loader-readout.fn-visible { opacity: 1; }

/* ── Section window — a standalone draggable terminal, themed by chapter ──
   It carries both `.terminal` (base chrome/border/position) and
   `.fn-section-window`. JS sets its width/height/left/top inline (≈500px,
   70% of the floppy window's height, to the floppy window's right) and
   plays the grow/shrink-from-drive transform via the spawn classes below.
   These rules (later in the file, same specificity as `.terminal`) win, so
   the themed border + drive-spawn pose override the base terminal. */
.fn-section-window {
  z-index: 9000;
  background: var(--fn-chapter-bg, rgba(20, 20, 24, 0.92));
  border: 1px solid var(--fn-chapter-color, #ff5050);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.4),
    0 0 16px var(--fn-chapter-glow, rgba(255, 80, 80, 0.35)),
    8px 8px 0 rgba(0, 0, 0, 0.85);
  transform-origin: center center;
  overflow: hidden;
  color: #ead9b8;
  font-size: 12px;
  line-height: 1.55;
  /* Default pose mirrors .fn-spawning so a freshly-shown window is already
     at the drive position (no flash at its resting rect). */
  opacity: 0;
  transform: translate(var(--fn-spawn-from-x, 0), var(--fn-spawn-from-y, 0)) scale(0.05);
}
/* Initial pose: pinned at drive position, no transition so the first
   computed style takes effect instantly. */
.fn-section-window.fn-spawning {
  transform: translate(var(--fn-spawn-from-x, 0), var(--fn-spawn-from-y, 0)) scale(0.05);
  opacity: 0;
  transition: none;
}
/* Final pose: natural slot rect, full opacity. JS swaps from .fn-spawning
   to this on a double-rAF, so the transition declared here runs. */
.fn-section-window.fn-spawned {
  transform: translate(0, 0) scale(1);
  opacity: 1;
  transition:
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 380ms ease;
}
/* Despawning: shrink+fade back to the drive. JS sets transform vars
   freshly each call so this works regardless of the slot. */
.fn-section-window.fn-despawning {
  transform: translate(var(--fn-spawn-from-x, 0), var(--fn-spawn-from-y, 0)) scale(0.05);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 400ms cubic-bezier(0.4, 0, 1, 1),
    opacity 360ms ease;
}

/* ── Win98-style growth/shrink trails ──────────────────────────────────── */
/* A short series of wireframe ghosts left behind along the drive↔slot
   path. Each ghost gets a JS-set transform putting it at a fractional
   position along the path, then fades out via the .fn-trail-fade class. */
.fn-section-trail {
  position: absolute;
  inset: 0;
  z-index: 1;                          /* below the live window (z:2) */
  border: 1px solid var(--fn-chapter-color, #ff5050);
  background: transparent;
  box-shadow: 0 0 6px var(--fn-chapter-glow, rgba(255, 80, 80, 0.35));
  opacity: 0.55;
  pointer-events: none;
  transform-origin: center center;
  transition: opacity 380ms ease-out;
}
.fn-section-trail.fn-trail-fade { opacity: 0; }

/* Chrome (base .terminal-chrome) tinted to the active chapter colour. */
.fn-section-window .terminal-chrome {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--fn-chapter-color) 30%, rgba(0,0,0,0.8)) 0%,
    color-mix(in srgb, var(--fn-chapter-color) 12%, rgba(0,0,0,0.9)) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--fn-chapter-color) 60%, transparent);
}
.fn-section-window .fn-section-title {
  color: var(--fn-chapter-color);
  text-shadow: 0 0 4px var(--fn-chapter-glow);
}

/* Body — scrollable list of paragraph blocks. */
.fn-section-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px 18px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--fn-chapter-color, #ff5050) transparent;
}
.fn-section-body::-webkit-scrollbar { width: 8px; }
.fn-section-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--fn-chapter-color) 55%, transparent);
  border-radius: 4px;
}

/* ── Big ASCII section heading (figlet, scramble-decoded by JS) ──────────── */
.fn-sec-heading {
  margin: 2px 0 0;
  min-height: 1em;
}
.fn-sec-banner {
  margin: 0;
  white-space: pre;
  font-family: Consolas, 'Courier New', monospace;
  /* clamp so the widest figlet banner (OUR WORK / THE TEAM) still fits a
     ~500px window without horizontal scroll. */
  font-size: clamp(5px, 1.35vw, 9px);
  line-height: 1.05;
  color: var(--fn-chapter-color);
  text-shadow: 0 0 6px var(--fn-chapter-glow);
  overflow: hidden;
}
.fn-sec-rule {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.1;
  color: color-mix(in srgb, var(--fn-chapter-color) 70%, transparent);
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: 1px;
}
.fn-sec-rule + .fn-sec-rule { margin-bottom: 10px; }
/* The cloned .mission-item sits here. The legacy `.mission-item` rule
   sets opacity:0 + max-height:0 + overflow:hidden so the item stays
   collapsed until a `.visible` class is added by the old reveal logic
   (which we no longer run). Override every collapse-related property so
   the cloned content is visible inside our window. */
.fn-section-body .mission-item {
  position: static;
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 1;
  transform: none;
  transition: none;
}
.fn-section-body .item-frame {
  background: transparent;
  border: none;
  padding: 0;
  position: relative;
  color: var(--fn-chapter-color);
}
/* Legacy rule sets `.item-title { display: none }`. Bring it back. */
.fn-section-body .item-title {
  display: block;
  color: var(--fn-chapter-color);
  text-shadow: 0 0 4px var(--fn-chapter-glow);
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.fn-section-body .item-cols {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.fn-section-body .item-text-col { flex: 1 1 60%; min-width: 0; }
.fn-section-body .item-art-col  { flex: 0 0 40%; opacity: 0.85; }
/* Paragraphs are always visible now (the window scrolls); no progressive
   reveal. Each cloned .mission-item is one sub-section block. */
.fn-section-body .mission-item { margin-bottom: 16px; }
.fn-section-body .item-line {
  font-size: 11px;
  margin: 2px 0;
  opacity: 1;
  transform: none;
}
.fn-section-body .item-line .accent { color: var(--fn-chapter-color); font-weight: bold; }
.fn-section-body .item-status {
  margin-top: 8px;
  font-size: 10px;
  color: #66ff88;
  letter-spacing: 1px;
  opacity: 1;
}
.fn-section-body .item-art {
  font-size: 8px;
  line-height: 1.2;
  white-space: pre;
  color: var(--fn-chapter-color);
  text-shadow: 0 0 3px var(--fn-chapter-glow);
  opacity: 0.7;
  margin: 0;
}
/* Suppress the legacy section borders inside our windows. */
.fn-section-body .item-border-top,
.fn-section-body .item-border-bottom,
.fn-section-body .item-border-left,
.fn-section-body .item-border-right { display: none; }

/* Cursor + hover state on the floppy stack */
.fn-floppy-stack[data-hover="1"] { cursor: pointer; }

