/* ================================================================
   EDIFREAK — phosphor & plastic
   ================================================================ */
:root {
  --bg: #04070a;
  --bg2: #0a1210;
  --green: #00ff41;
  --green-dim: #0a7a2f;
  --green-glow: rgba(0, 255, 65, .55);
  --amber: #ffb000;
  --pink: #ff2e88;
  --cyan: #00e5ff;
  --text: #b8ffcf;
  --muted: #5c8a6b;
  --font-pixel: 'Press Start 2P', monospace;
  --font-term: 'VT323', monospace;
  --font-mono: 'Share Tech Mono', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  overflow-x: hidden;
  cursor: crosshair;
}
a, button, input, .cab-overlay { cursor: pointer; }
input { cursor: text; }
/* no double-tap-to-zoom on anything interactive — that's the iOS "zooming
   in-out" while poking the EDITRON. Pinch zoom stays available. */
a, button, input, .cab-overlay, .monitor-screen { touch-action: manipulation; }
::selection { background: var(--green); color: #000; }

body::before { /* deep vignette base */
  content: ''; position: fixed; inset: 0; z-index: -3;
  background: radial-gradient(ellipse at 50% 30%, #0a1a10 0%, var(--bg) 70%);
}

/* ================= scrollbar ================= */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #030503; }
::-webkit-scrollbar-thumb { background: var(--green-dim); border: 2px solid #030503; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ================================================================
   BOOT SCREEN
   ================================================================ */
#boot {
  position: fixed; inset: 0; z-index: 1000; background: #000;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 8vh 8vw; transition: opacity .3s;
}
#boot.off { animation: crt-off .45s forwards; pointer-events: none; }
@keyframes crt-off {
  0%   { opacity: 1; transform: scaleY(1); filter: brightness(1); }
  60%  { opacity: 1; transform: scaleY(.006); filter: brightness(6); }
  100% { opacity: 0; transform: scaleY(.006) scaleX(0); filter: brightness(10); }
}
#boot-text {
  font-family: var(--font-term); font-size: clamp(15px, 2.2vw, 22px);
  color: #9fff9f; text-shadow: 0 0 8px rgba(0,255,65,.6);
  white-space: pre-wrap; min-height: 40vh;
}
#boot-bar {
  width: min(420px, 70vw); height: 18px; border: 2px solid #9fff9f; margin-top: 18px; padding: 2px;
}
#boot-bar i { display: block; height: 100%; width: 0; background: #9fff9f; transition: width .12s steps(8); }
#boot-skip {
  margin-top: 26px; font-family: var(--font-term); color: #4a7a4a;
  animation: blink 1.2s steps(1) infinite; font-size: 18px;
}

/* ================================================================
   GLOBAL CRT FX
   ================================================================ */
#matrix { position: fixed; inset: 0; z-index: -2; opacity: .16; }
.crt-overlay {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: multiply;
}
.crt-scanband-clip { /* clips the traveling band so it can never extend the page */
  position: fixed; inset: 0; z-index: 901; pointer-events: none; overflow: hidden;
}
.crt-scanband {
  position: absolute; left: 0; right: 0; top: 0; height: 110px;
  background: linear-gradient(180deg, transparent, rgba(0,255,65,.035), transparent);
  animation: scanband 7s linear infinite;
}
@keyframes scanband { from { transform: translateY(-120px); } to { transform: translateY(100vh); } }
#cursor-glow {
  position: fixed; width: 340px; height: 340px; z-index: -1; pointer-events: none;
  border-radius: 50%; left: 0; top: 0; opacity: 0;
  background: radial-gradient(circle, rgba(0,255,65,.09) 0%, transparent 65%);
  transform: translate(-50%, -50%); transition: opacity .5s;
}

@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
.blink-slow { animation: blink 2s steps(1) infinite; }

/* ================================================================
   GLITCH TEXT
   ================================================================ */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; overflow: hidden;
  clip-path: inset(50% 0 50% 0); opacity: 0;
}
.glitch::before { color: var(--cyan); z-index: -1; }
.glitch::after  { color: var(--pink); z-index: -2; }
.glitch:hover::before, .glitch.glitching::before { opacity: .9; animation: glitch-a 380ms steps(2) infinite; }
.glitch:hover::after,  .glitch.glitching::after  { opacity: .9; animation: glitch-b 290ms steps(2) infinite; }
@keyframes glitch-a {
  0%   { clip-path: inset(12% 0 58% 0); transform: translate(-4px, -2px); }
  25%  { clip-path: inset(64% 0 6% 0);  transform: translate(4px, 2px); }
  50%  { clip-path: inset(38% 0 42% 0); transform: translate(-3px, 1px); }
  75%  { clip-path: inset(80% 0 4% 0);  transform: translate(3px, -1px); }
  100% { clip-path: inset(22% 0 66% 0); transform: translate(-4px, 2px); }
}
@keyframes glitch-b {
  0%   { clip-path: inset(70% 0 10% 0); transform: translate(4px, 1px); }
  33%  { clip-path: inset(10% 0 74% 0); transform: translate(-4px, -2px); }
  66%  { clip-path: inset(46% 0 30% 0); transform: translate(3px, 2px); }
  100% { clip-path: inset(4% 0 82% 0);  transform: translate(-3px, -1px); }
}

/* ================================================================
   NAV
   ================================================================ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 950;
  display: flex; align-items: center; gap: 24px; padding: 12px 24px;
  background: rgba(3, 6, 4, .82); backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,255,65,.18);
  transform: translateY(-100%); animation: nav-in .6s .2s forwards;
}
@keyframes nav-in { to { transform: translateY(0); } }
.nav-logo {
  font-family: var(--font-pixel); font-size: 14px; color: var(--green);
  text-decoration: none; text-shadow: 0 0 12px var(--green-glow); letter-spacing: 1px;
}
.nav-links { display: flex; gap: 20px; flex: 1; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px; letter-spacing: 2px;
  position: relative; padding: 4px 2px; transition: color .2s, text-shadow .2s;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--green); box-shadow: 0 0 8px var(--green-glow); transition: width .25s;
}
.nav-links a:hover { color: var(--green); text-shadow: 0 0 10px var(--green-glow); }
.nav-links a:hover::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 14px; }
#countdown { font-family: var(--font-term); font-size: 18px; color: var(--amber); text-shadow: 0 0 8px rgba(255,176,0,.5); }
#sound-toggle {
  background: none; border: 1px solid var(--green-dim); color: var(--green);
  font-family: var(--font-mono); font-size: 12px; padding: 5px 10px; transition: all .2s;
}
#sound-toggle:hover { background: rgba(0,255,65,.1); box-shadow: 0 0 12px rgba(0,255,65,.25); }
#sound-toggle.muted { color: var(--muted); border-color: #274232; }
#install-btn {
  background: none; border: 1px solid var(--amber); color: var(--amber);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px;
  padding: 5px 10px; transition: all .2s; white-space: nowrap;
}
#install-btn:hover { background: rgba(255,176,0,.12); box-shadow: 0 0 12px rgba(255,176,0,.3); }
#install-btn[hidden] { display: none; }

/* ================================================================
   HERO
   ================================================================ */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; padding: 110px 6vw 40px; position: relative;
}
.hero-inner {
  display: flex; gap: 6vw; align-items: center; justify-content: center;
  flex-wrap: wrap; max-width: 1200px;
}
.hero-text { max-width: 620px; }
.hero-pre { color: var(--pink); font-size: 14px; letter-spacing: 1px; margin-bottom: 18px; }
h1.big {
  font-family: var(--font-pixel); color: var(--green);
  font-size: clamp(34px, 7vw, 84px); letter-spacing: 2px;
  text-shadow: 0 0 24px var(--green-glow), 0 0 80px rgba(0,255,65,.25);
  margin-bottom: 20px;
}
.hero-sub { font-family: var(--font-term); font-size: clamp(20px, 3vw, 30px); color: var(--cyan); margin-bottom: 14px; }
.hero-sub .caret { animation: blink 1s steps(1) infinite; color: var(--cyan); }
.hero-desc { color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 54ch; }
.hero-desc b { color: var(--amber); }
.hero-desc small { display: block; margin-top: 6px; opacity: .6; font-size: 11px; }
.hero-cta { display: flex; gap: 16px; margin-top: 30px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-pixel); font-size: 11px; text-decoration: none;
  padding: 15px 22px; border: 2px solid; position: relative; overflow: hidden;
  transition: transform .12s, box-shadow .2s; display: inline-block;
}
.btn:active { transform: translate(2px, 2px); }
.btn::before {
  content: ''; position: absolute; inset: 0; transform: translateX(-101%);
  transition: transform .25s;
}
.btn:hover::before { transform: translateX(0); }
.btn > * , .btn { z-index: 1; }
.btn small { display: block; font-family: var(--font-mono); font-size: 10px; margin-top: 6px; opacity: .75; text-transform: lowercase; }
.btn-green { color: var(--green); border-color: var(--green); box-shadow: 0 0 18px rgba(0,255,65,.15), inset 0 0 18px rgba(0,255,65,.06); }
.btn-green::before { background: var(--green); }
.btn-green:hover { color: #000; box-shadow: 0 0 34px var(--green-glow); }
.btn-green:hover small { opacity: 1; }
.btn-amber { color: var(--amber); border-color: var(--amber); box-shadow: 0 0 18px rgba(255,176,0,.15), inset 0 0 18px rgba(255,176,0,.06); }
.btn-amber::before { background: var(--amber); }
.btn-amber:hover { color: #000; box-shadow: 0 0 34px rgba(255,176,0,.55); }
.btn span, .btn small { position: relative; }
.btn:hover { -webkit-text-fill-color: currentcolor; }
.btn { isolation: isolate; }
.btn::before { z-index: -1; }

.hero-avatar { /* fixed width so a longer tag line can never shift the frame */
  text-align: center; user-select: none; -webkit-user-select: none;
  width: min(340px, 90vw); flex: 0 0 auto;
}
.avatar-tag { overflow-wrap: break-word; }
.hero-avatar img { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
.holo-frame { cursor: pointer; }
.holo-frame {
  position: relative; width: min(280px, 60vw); aspect-ratio: 1; margin: 0 auto;
  border: 3px solid var(--green); padding: 10px; background: rgba(0, 20, 8, .5);
  box-shadow: 0 0 30px rgba(0,255,65,.35), inset 0 0 30px rgba(0,255,65,.12);
  animation: float 5s ease-in-out infinite;
  image-rendering: pixelated;
}
.holo-frame::before, .holo-frame::after {
  content: ''; position: absolute; width: 26px; height: 26px; border: 3px solid var(--amber);
}
.holo-frame::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.holo-frame::after { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
#avatar {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: pixelated; filter: saturate(1.1);
  transition: filter .2s;
}
.holo-frame:hover #avatar { filter: saturate(1.4) contrast(1.1); }
.holo-frame.hit { animation: float 5s ease-in-out infinite, avatar-glitch .3s steps(3); }
@keyframes avatar-glitch {
  0% { transform: translate(3px, -2px) skewX(3deg); filter: hue-rotate(90deg); }
  50% { transform: translate(-4px, 2px) skewX(-4deg); filter: hue-rotate(-60deg); }
  100% { transform: none; filter: none; }
}
.holo-frame.timeshift { animation: float 5s ease-in-out infinite, timeshift .9s steps(12); }
@keyframes timeshift {
  0%   { filter: none; clip-path: none; }
  10%  { filter: invert(1) hue-rotate(90deg); clip-path: inset(10% 0 40% 0); transform: translate(6px, -3px); }
  25%  { filter: contrast(3) saturate(0); clip-path: inset(60% 0 5% 0); transform: translate(-7px, 2px) skewX(6deg); }
  40%  { filter: invert(1); clip-path: inset(30% 0 30% 0); transform: translate(5px, 4px); }
  55%  { filter: hue-rotate(-120deg) brightness(2); clip-path: inset(0 40% 0 10%); transform: translate(-5px, -4px) skewX(-7deg); }
  70%  { filter: saturate(4); clip-path: inset(75% 0 2% 0); transform: translate(4px, 1px); }
  85%  { filter: invert(1) brightness(1.6); clip-path: inset(5% 0 80% 0); transform: translate(-3px, 3px); }
  100% { filter: none; clip-path: none; transform: none; }
}
.holo-scan {
  position: absolute; left: 10px; right: 10px; height: 34px; top: 10px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0,255,65,.22), transparent);
  animation: holo-scan 3.2s linear infinite;
}
@keyframes holo-scan { from { top: 4%; } to { top: 84%; } }
.avatar-tag { margin-top: 16px; font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.rainbow {
  background: linear-gradient(90deg, #ff2e88, #ffb000, #00ff41, #00e5ff, #ff2e88);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbow-slide 3s linear infinite; font-weight: bold;
}
@keyframes rainbow-slide { to { background-position: 300% 0; } }
.hero-scrollhint {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: var(--muted); font-family: var(--font-term); font-size: 18px;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ================================================================
   TICKER
   ================================================================ */
.ticker {
  border-top: 1px solid rgba(0,255,65,.25); border-bottom: 1px solid rgba(0,255,65,.25);
  background: rgba(0, 12, 5, .8); overflow: hidden; white-space: nowrap; padding: 10px 0;
}
.ticker-track {
  display: inline-block; font-family: var(--font-term); font-size: 20px; color: var(--green);
  text-shadow: 0 0 8px var(--green-glow); animation: ticker 40s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ================================================================
   SECTIONS
   ================================================================ */
.section { padding: 110px 6vw; max-width: 1200px; margin: 0 auto; }
.section-title {
  font-family: var(--font-pixel); color: var(--green); font-size: clamp(16px, 3vw, 28px);
  text-shadow: 0 0 18px var(--green-glow); margin-bottom: 16px; letter-spacing: 1px;
}
.section-sub { color: var(--muted); font-size: 16px; line-height: 1.7; margin-bottom: 44px; max-width: 72ch; }
.section-sub b { color: var(--amber); }

.reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ================================================================
   MONITOR / TERMINAL
   ================================================================ */
.monitor {
  max-width: 860px; margin: 0 auto;
  background: linear-gradient(180deg, #2a2620, #1b1815 60%, #14110e);
  border-radius: 18px 18px 26px 26px; padding: 18px 22px 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.7), inset 0 2px 0 rgba(255,255,255,.07),
              inset 0 -6px 18px rgba(0,0,0,.6);
  border: 1px solid #0c0a08;
}
.monitor-top {
  display: flex; justify-content: space-between; align-items: baseline; padding: 2px 6px 12px;
}
.monitor-brand { font-family: var(--font-pixel); font-size: 12px; color: #d8cbb0; letter-spacing: 2px; }
.monitor-brand span { color: var(--amber); }
.monitor-model { font-size: 10px; color: #6b6154; letter-spacing: 2px; }
.monitor-screen-wrap {
  background: #060505; border-radius: 14px; padding: 16px;
  box-shadow: inset 0 0 24px #000, inset 0 0 4px #000;
}
.monitor-screen {
  position: relative; border-radius: 60px / 34px; overflow: hidden;
  background: radial-gradient(ellipse at center, #06180b 0%, #030d06 75%, #020703 100%);
  box-shadow: inset 0 0 80px rgba(0, 40, 12, .9), inset 0 0 14px rgba(0,255,65,.12),
              0 0 24px rgba(0,255,65,.12);
  animation: screen-flicker 4s infinite;
}
@keyframes screen-flicker {
  0%, 100% { filter: brightness(1); }
  97.8% { filter: brightness(1); }
  98% { filter: brightness(1.15); }
  98.4% { filter: brightness(.92); }
  98.8% { filter: brightness(1.06); }
}
.monitor-screen::after { /* screen scanlines, above content */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px);
  border-radius: inherit;
}
.screen-glare {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse 42% 22% at 26% 12%, rgba(190,255,210,.10), transparent 70%);
}
.screen-inner {
  position: relative; height: clamp(340px, 52vh, 460px); padding: 22px 26px;
  display: flex; flex-direction: column;
  font-family: var(--font-term); font-size: clamp(17px, 2vw, 21px); line-height: 1.35;
  color: #7dff9e; text-shadow: 0 0 6px rgba(0,255,65,.55);
}
#term-out {
  flex: 1; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  overscroll-behavior: contain;
  /* phosphor scrollbar — standard properties (Chrome 121+, Firefox) */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 65, .45) rgba(0, 40, 15, .35);
}
/* older WebKit fallback (ignored by browsers using scrollbar-color above) */
#term-out::-webkit-scrollbar { width: 8px; }
#term-out::-webkit-scrollbar-track { background: rgba(0, 40, 15, .35); }
#term-out::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 65, .45);
  box-shadow: 0 0 8px rgba(0, 255, 65, .5);
}
#term-out .t-sys { color: #3f9f5f; }
#term-out .t-you { color: #d3ffe2; }
#term-out .t-edi { color: #7dff9e; }
#term-out .t-err { color: #ff7a7a; text-shadow: 0 0 6px rgba(255,60,60,.5); }
#term-input-row { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.term-prompt { color: #46d97b; white-space: nowrap; }
#term-input {
  flex: 1; background: transparent; border: 0; outline: 0; color: #d3ffe2;
  font-family: inherit; font-size: inherit; text-shadow: inherit; caret-color: transparent;
  min-width: 40px;
}
.term-caret { animation: blink 1s steps(1) infinite; margin-left: -6px; }
#term-input:disabled ~ .term-caret { opacity: .3; animation: none; }

.monitor-bottom { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px; }
.monitor-knobs { display: flex; gap: 10px; }
.monitor-knobs i {
  width: 16px; height: 16px;
  background: radial-gradient(circle at 35% 30%, #4d453a, #221e18 70%);
  border-radius: 50%; box-shadow: inset 0 -2px 3px #000; display: block;
}
.monitor-plate { font-size: 9px; color: #5d5346; letter-spacing: 2px; text-align: center; }
.monitor-led-wrap { display: flex; align-items: center; gap: 7px; }
.monitor-led-wrap label { font-size: 9px; color: #6b6154; letter-spacing: 1px; }
.led {
  width: 10px; height: 10px; border-radius: 50%; background: #113311; display: inline-block;
  transition: all .3s;
}
.led.on { background: var(--green); box-shadow: 0 0 10px var(--green-glow); animation: led-breathe 2.2s ease-in-out infinite; }
.led.busy { background: var(--amber); box-shadow: 0 0 10px rgba(255,176,0,.6); animation: blink .5s steps(1) infinite; }
@keyframes led-breathe { 50% { box-shadow: 0 0 3px var(--green-glow); opacity: .6; } }

.term-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.term-chips button {
  background: rgba(0, 30, 12, .5); color: var(--green); border: 1px solid var(--green-dim);
  padding: 8px 14px; font-family: var(--font-mono); font-size: 13px;
  transition: all .18s;
}
.term-chips button:hover {
  background: var(--green); color: #000; box-shadow: 0 0 18px var(--green-glow);
  transform: translateY(-2px);
}

/* ================================================================
   FULLSCREEN CHAT MODE — tap the EDITRON on mobile, chat like it's 2054
   ================================================================ */
/* EJECT's visibility is the [hidden] attribute, toggled by chat-mode JS —
   deliberately NOT display rules here, so even a stale cached stylesheet can
   never make it appear on desktop. CSS only dresses it. */
#term-eject {
  background: none; border: 1px solid var(--amber); color: var(--amber);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
  padding: 4px 10px; white-space: nowrap;
}

body.term-max { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
body.term-max .monitor {
  position: fixed; inset: 0; z-index: 970; /* over nav (950), under toast (990) */
  max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0;
  height: 100vh; height: 100dvh; height: var(--vvh, 100dvh); /* --vvh tracks the keyboard */
  display: flex; flex-direction: column;
  transform: none !important; opacity: 1 !important; transition: none;
}
body.term-max .monitor-top { padding: 10px 12px; align-items: center; }
body.term-max .monitor-bottom { display: none; }
body.term-max .monitor-screen-wrap {
  flex: 1; min-height: 0; display: flex; padding: 8px; border-radius: 0;
}
body.term-max .monitor-screen { flex: 1; display: flex; border-radius: 14px; }
body.term-max .screen-inner {
  flex: 1; height: auto; min-height: 0; width: 100%;
  padding: 14px 14px calc(10px + env(safe-area-inset-bottom));
}
body.term-max.kb-open .screen-inner { padding-bottom: 10px; } /* keyboard covers the home bar */
body.term-max #term-input-row { gap: 10px; padding-top: 10px; }
body.term-max .tp-host { display: none; } /* prompt shrinks to `$` */
/* the retro block caret stays in chat mode — it IS the terminal */
/* god-mode hue-rotates every body child; a filtered ancestor would re-anchor the
   fixed monitor to the section, so pause the party while the chat is fullscreen */
body.godmode.term-max > * { animation: none; }

/* ================================================================
   ARCADE
   ================================================================ */
.cabinets { display: flex; gap: 34px; justify-content: center; flex-wrap: wrap; }
.cabinet {
  width: min(400px, 92vw);
  background: linear-gradient(180deg, #191423, #0e0b16 70%, #0a0810);
  border: 1px solid #2a2140; border-radius: 10px 10px 4px 4px;
  padding: 0 14px 16px; position: relative;
  transition: transform .25s, box-shadow .25s;
}
.cabinet:hover { transform: translateY(-8px); box-shadow: 0 26px 60px rgba(0,0,0,.65), 0 0 40px rgba(0,255,65,.07); }
.cab-marquee {
  margin: 0 -14px; padding: 16px 8px; text-align: center; border-radius: 10px 10px 0 0;
  font-family: var(--font-pixel); font-size: 13px; letter-spacing: 1px; position: relative; overflow: hidden;
}
.cab-marquee::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  transform: translateX(-120%); animation: marquee-shine 5s ease-in-out infinite;
}
@keyframes marquee-shine { 12% { transform: translateX(120%); } 100% { transform: translateX(120%); } }
.cab-green { background: linear-gradient(180deg, #003b16, #001d0b); color: var(--green); text-shadow: 0 0 12px var(--green-glow); border-bottom: 3px solid var(--green); }
.cab-cyan  { background: linear-gradient(180deg, #00323b, #00181d); color: var(--cyan);  text-shadow: 0 0 12px rgba(0,229,255,.6); border-bottom: 3px solid var(--cyan); }
.cab-amber { background: linear-gradient(180deg, #3b2a00, #1d1500); color: var(--amber); text-shadow: 0 0 12px rgba(255,176,0,.6); border-bottom: 3px solid var(--amber); }
.cab-pink  { background: linear-gradient(180deg, #3b0022, #1d0011); color: var(--pink);  text-shadow: 0 0 12px rgba(255,46,136,.6); border-bottom: 3px solid var(--pink); }
.cab-hi {
  text-align: center; font-family: var(--font-term); font-size: 18px; color: var(--amber);
  padding: 8px 0 2px; letter-spacing: 3px; text-shadow: 0 0 8px rgba(255,176,0,.5);
}
.cab-screen {
  position: relative; margin: 8px auto 0; background: #000; border-radius: 8px;
  border: 10px solid #05030a; outline: 1px solid #2a2140;
  box-shadow: inset 0 0 30px rgba(0,255,65,.06), inset 0 0 10px #000;
  overflow: hidden;
}
.cab-screen canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.cab-screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
}
.cab-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(0, 0, 0, .78); font-family: var(--font-pixel);
  color: var(--green); font-size: 12px; line-height: 1.9; padding: 10px;
  transition: opacity .25s; z-index: 2;
}
.cab-overlay.hidden { opacity: 0; pointer-events: none; }
.cab-overlay .ov-title { font-size: 15px; text-shadow: 0 0 14px var(--green-glow); }
.cab-overlay .ov-blink { animation: blink 1s steps(1) infinite; font-size: 10px; }
.cab-overlay .ov-score { color: var(--amber); font-size: 13px; }
.cab-overlay table { font-family: var(--font-term); font-size: 17px; border-collapse: collapse; color: var(--text); }
.cab-overlay table td { padding: 0 10px; }
.cab-overlay table tr.me td { color: var(--amber); text-shadow: 0 0 8px rgba(255,176,0,.6); }
.cab-overlay input.initials {
  background: #000; border: 2px solid var(--green); color: var(--green);
  font-family: var(--font-pixel); font-size: 18px; width: 5.2ch; text-align: center;
  padding: 6px 2px; letter-spacing: 6px; text-transform: uppercase; outline: none;
}
.cab-overlay button.ov-btn {
  background: var(--green); border: 0; color: #000; font-family: var(--font-pixel);
  font-size: 10px; padding: 10px 16px; margin-top: 4px; transition: all .15s;
}
.cab-overlay button.ov-btn:hover { box-shadow: 0 0 18px var(--green-glow); transform: scale(1.05); }
.cab-panel {
  display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 0 8px;
}
.cab-joy {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #443a5c, #171223 70%);
  position: relative; box-shadow: inset 0 -3px 5px #000;
}
.cab-joy::after {
  content: ''; position: absolute; left: 50%; top: -12px; transform: translateX(-50%);
  width: 8px; height: 20px; background: #2a2140; border-radius: 3px;
}
.cab-joy::before {
  content: ''; position: absolute; left: 50%; top: -20px; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff5b5b, #7a1010);
}
.cab-help { font-size: 10px; color: #55496e; letter-spacing: 1px; }
.cab-btns { display: flex; gap: 8px; }
.cab-btns i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 -3px 4px rgba(0,0,0,.7); }
.b-red { background: radial-gradient(circle at 35% 30%, #ff6b6b, #8a1515); }
.b-yellow { background: radial-gradient(circle at 35% 30%, #ffd76b, #8a6a15); }

/* ================================================================
   DOSSIER
   ================================================================ */
.dossier-file {
  position: relative; max-width: 760px; margin: 0 auto;
  background: repeating-linear-gradient(0deg, rgba(0,255,65,.02) 0 2px, transparent 2px 4px), rgba(2, 14, 6, .75);
  border: 1px solid var(--green-dim); padding: 40px 42px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), inset 0 0 40px rgba(0,255,65,.04);
  /* the stamp animates in from scale(3); without this its oversized intro state
     widens the page ~135px, and mobile Safari/Chrome shrink-to-fit the WHOLE
     page (~0.75x) — which is what made the terminal look broken on phones.
     Clipping to the file keeps the "stamp slams onto the dossier" effect. */
  overflow: hidden;
}
.dossier-stamp {
  position: absolute; top: 22px; right: 20px; transform: rotate(12deg) scale(3); opacity: 0;
  border: 3px solid var(--pink); color: var(--pink); font-family: var(--font-pixel);
  font-size: 11px; padding: 8px 12px; text-align: center; line-height: 1.8; letter-spacing: 2px;
  transition: transform .3s cubic-bezier(.2, 2.4, .4, 1), opacity .25s;
}
.reveal.in .dossier-stamp { transform: rotate(12deg) scale(1); opacity: .9; transition-delay: .5s; }
.dossier-row {
  display: flex; gap: 18px; padding: 11px 0; border-bottom: 1px dashed rgba(0,255,65,.15);
  font-size: 15px; flex-wrap: wrap;
}
.dossier-row span { color: var(--muted); min-width: 190px; letter-spacing: 1px; }
.dossier-row b { color: var(--text); font-weight: normal; }
.redact {
  background: #000; color: transparent; padding: 0 6px; user-select: none;
  box-shadow: 0 0 0 1px rgba(0,255,65,.2); transition: color .3s, background .3s;
}
.redact:hover { background: rgba(0,255,65,.1); color: var(--amber); text-shadow: 0 0 8px rgba(255,176,0,.5); }
.skills { margin-top: 34px; display: grid; gap: 18px; }
.skill label { font-size: 12px; color: var(--muted); letter-spacing: 2px; display: block; margin-bottom: 6px; }
.bar { height: 14px; border: 1px solid var(--green-dim); padding: 2px; }
.bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--green) 0 8px, transparent 8px 12px); box-shadow: 0 0 10px var(--green-glow); transition: width 1.4s cubic-bezier(.2,.8,.2,1) .3s; }
.reveal.in .bar i { width: var(--w); }

/* ================================================================
   CONTACT + FOOTER
   ================================================================ */
.contact-links { display: flex; gap: 26px; flex-wrap: wrap; }
.big-btn { font-size: 13px; padding: 22px 28px; }
footer { text-align: center; padding: 60px 20px 30px; color: #3d5c49; font-size: 13px; }
.footer-hint { margin-top: 12px; opacity: .45; font-family: var(--font-term); font-size: 15px; letter-spacing: 3px; }

/* ================================================================
   TOAST + GOD MODE
   ================================================================ */
#toast {
  position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 250%);
  visibility: hidden;
  background: #000; border: 2px solid var(--amber); color: var(--amber);
  font-family: var(--font-pixel); font-size: 11px; padding: 14px 22px; z-index: 990;
  box-shadow: 0 0 30px rgba(255,176,0,.4);
  transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), visibility 0s .35s;
  text-align: center; line-height: 1.8; max-width: 90vw;
}
#toast.show { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
/* hue-rotate each child, never <body> itself: a filter on body would turn all
   fixed-position elements (nav, overlays, toast) into page-anchored ones and
   let off-screen bits extend the scroll height */
body.godmode > * { animation: god-hue 4s linear infinite; }
@keyframes god-hue { to { filter: hue-rotate(360deg); } }

/* ================================================================
   WAR FLASH — 2033 in 2.5 seconds
   ================================================================ */
#warflash { /* lives INSIDE the EDITRON screen — the uplink shows you 2033 */
  position: absolute; inset: 0; z-index: 5; background: #000;
  border-radius: inherit; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#warflash canvas {
  width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated;
}
#warflash::after { /* heavy scanlines on top of the low-res feed */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.4) 0 2px, transparent 2px 5px);
}
#warflash.out { animation: crt-off .3s forwards; }

/* ================================================================
   DOOM ON THE EDITRON
   ================================================================ */
#doomwrap {
  position: absolute; inset: 0; z-index: 6; background: #000;
  border-radius: inherit; overflow: hidden;
}
#doomwrap canvas {
  width: 100%; height: 100%; display: block;
  image-rendering: pixelated;
}
#doomwrap .cab-overlay { border-radius: inherit; }

/* ================================================================
   SECRET BASEMENT — god mode only
   ================================================================ */
#basement { text-align: center; }
#basement .section-title { color: var(--pink); text-shadow: 0 0 18px rgba(255,46,136,.6); }
.mario-wrap {
  display: inline-block; margin: 0 auto; background: #000; border-radius: 8px;
  border: 10px solid #05030a; outline: 1px solid #2a2140; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 40px rgba(255,46,136,.12);
  max-width: 92vw;
}
.mario-wrap canvas {
  display: block; width: min(640px, 88vw); height: auto; image-rendering: pixelated;
}
.mario-wrap::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
}
#basement .cab-help { margin-top: 14px; color: #7a5c8e; }

/* ================================================================
   RESPONSIVE + MOTION
   ================================================================ */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .hero-scrollhint { display: none; }
  .monitor-model { display: none; }
  #countdown { font-size: 15px; }
  /* keep the nav on one line when the amber INSTALL button is present: tighten
     spacing and collapse the button to its ⊕ glyph so nothing spills off-screen */
  #nav { gap: 16px; padding: 12px 16px; }
  .nav-right { gap: 10px; }
  #install-btn { padding: 5px 9px; font-size: 15px; line-height: 1; }
  #install-btn .ib-label { display: none; }
  .hero-inner { gap: 40px; }
  .section { padding: 80px 5vw; }
  .screen-inner { padding: 16px; height: 52vh; }
  .dossier-file { padding: 28px 20px; }
  .dossier-row span { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .reveal.in .bar i { width: var(--w); }
}
