@font-face {
  font-family: 'Zpix';
  src: url('https://cdn.jsdelivr.net/gh/SolidZORO/zpix-pixel-font@master/dist/zpix.ttf') format('truetype');
  font-display: swap;
}
/* ===== DESIGN TOKENS ===== */
:root {
  --bg: #08080a;
  --surface: #0d0d12;
  --surface-elevated: #12121a;
  --neon: #00ff41;
  --neon-dim: rgba(0, 255, 65, 0.15);
  --neon-glow: rgba(0, 255, 65, 0.4);
  --blue: #0ea5e9;
  --blue-dim: rgba(14, 165, 233, 0.15);
  --blue-glow: rgba(14, 165, 233, 0.4);
  --warm: #fbbf24;
  --text: #e0e0e0;
  --text-strong: #ffffff;
  --text-muted: #666;
  --hairline: #1a1a22;
  --font-pixel: 'Press Start 2P', monospace;
  --font-pixel-cjk: 'Zpix', 'Press Start 2P', monospace;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: auto;
  background: var(--bg);
  -ms-overflow-style: none;
  scrollbar-width: none;
  height: 100%;
  overflow: hidden;
}
@supports (scroll-snap-type: y proximity) {
  html {
    scroll-snap-type: none;
  }
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none;
  cursor: auto;
}
input,
button,
textarea,
select,
.cta-chip,
.terminal-cmd,
a,
#terminal-input,
#cta-input,
#cta-submit,
#terminal-body {
  cursor: auto;
}
a {
  color: var(--neon);
  text-decoration: none;
}

/* ===== OUTER SLIDE DECK ===== */
#reakh-slide-deck {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: transparent;
}
#reakh-slide-track {
  position: relative;
  width: 100%;
  height: 100%;
  transform: none;
  transition: none;
  backface-visibility: hidden;
}
#reakh-slide-track.is-instant,
#reakh-slide-track.is-instant > #scene1-stage,
#reakh-slide-track.is-instant > #scene2,
#reakh-slide-track.is-instant > #scene2-5,
#reakh-slide-track.is-instant > #scene3 {
  transition: none !important;
}
#reakh-slide-track > #scene1-stage,
#reakh-slide-track > #scene2,
#reakh-slide-track > #scene2-5,
#reakh-slide-track > #scene3 {
  position: absolute;
  inset: 0;
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  scroll-snap-align: none;
  backface-visibility: hidden;
  transform: translate3d(0, 100%, 0);
  transition: transform 720ms var(--ease-out-expo);
  will-change: transform;
}
#reakh-slide-track > #scene1-stage {
  z-index: 1;
  transform: translate3d(0, 0, 0);
}
#reakh-slide-track > #scene2,
#reakh-slide-track > #scene2-5,
#reakh-slide-track > #scene3 {
  z-index: 2;
  pointer-events: none;
}
#reakh-slide-track > #scene1-stage.is-active-slide,
#reakh-slide-track > #scene2.is-active-slide,
#reakh-slide-track > #scene2-5.is-active-slide,
#reakh-slide-track > #scene3.is-active-slide {
  pointer-events: auto;
}

/* ===== CUSTOM CURSOR ===== */
#custom-cursor {
  display: none;
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s;
}
#custom-cursor .crosshair {
  width: 24px;
  height: 24px;
  position: relative;
}
#custom-cursor .crosshair::before,
#custom-cursor .crosshair::after {
  content: '';
  position: absolute;
  background: var(--neon);
}
#custom-cursor .crosshair::before {
  width: 2px;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}
#custom-cursor .crosshair::after {
  height: 2px;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
}
#custom-cursor .dot {
  width: 4px;
  height: 4px;
  background: var(--neon);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ===== BACKGROUND PARTICLES (GLOBAL) ===== */
#bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.72;
  filter: saturate(1.1) brightness(1);
  transition:
    opacity 360ms ease,
    filter 360ms ease;
}
body[data-active-slide]:not([data-active-slide='0']) #bg-particles {
  opacity: 1;
  filter: saturate(1.28) brightness(1.24);
}

/* ===== PIXEL NAV INDICATOR ===== */
#pixel-nav {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.pixel-dot {
  width: 6px;
  height: 6px;
  position: relative;
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    6px 0 0 rgba(255, 255, 255, 0.15),
    0 6px 0 rgba(255, 255, 255, 0.15),
    6px 6px 0 rgba(255, 255, 255, 0.15);
  image-rendering: pixelated;
  transition:
    background 0.35s,
    box-shadow 0.35s;
  cursor: pointer !important;
}
.pixel-dot::before {
  content: '';
  position: absolute;
  inset: -8px;
}
.pixel-dot:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow:
    6px 0 0 rgba(255, 255, 255, 0.35),
    0 6px 0 rgba(255, 255, 255, 0.35),
    6px 6px 0 rgba(255, 255, 255, 0.35);
}
.pixel-dot.active {
  background: var(--neon);
  box-shadow:
    6px 0 0 var(--neon),
    0 6px 0 var(--neon),
    6px 6px 0 var(--neon),
    0 0 12px var(--neon-glow),
    0 0 4px var(--neon-dim);
}

#locale-switcher {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(0, 255, 65, 0.28);
  background: rgba(5, 8, 10, 0.78);
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.1);
  backdrop-filter: blur(8px);
}
#locale-switcher button {
  min-width: 36px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}
#locale-switcher button.is-active {
  color: var(--neon);
  background: rgba(0, 255, 65, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 65, 0.24);
}
#locale-switcher button:focus-visible {
  outline: 1px solid var(--neon);
  outline-offset: 2px;
}

/* ===== SCENE 0: LOADING ===== */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.6s var(--ease-out-expo),
    visibility 0.6s;
}
#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#loading-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.15) 2px, rgba(0, 0, 0, 0.15) 4px);
  pointer-events: none;
}
#loading-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
#loading-terminal {
  font-family: var(--font-mono);
  color: var(--neon);
  text-align: center;
  z-index: 1;
  transition: opacity 0.3s;
}
#loading-title {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--neon);
  margin-bottom: 24px;
  min-height: 20px;
  letter-spacing: 2px;
}
#loading-bar-track {
  width: 280px;
  height: 2px;
  background: rgba(0, 255, 65, 0.15);
  margin: 0 auto 16px;
  position: relative;
  overflow: hidden;
}
#loading-bar-fill {
  height: 100%;
  background: var(--neon);
  width: 0%;
  box-shadow: 0 0 10px var(--neon-glow);
  transition: width 0.05s linear;
}
#loading-bar-scan {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: barScan 0.8s linear infinite;
}
@keyframes barScan {
  0% {
    left: -30px;
  }
  100% {
    left: 100%;
  }
}
#loading-brand {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
}
#loading-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ===== SCENE 1: PARTICLE UNIVERSE ===== */
#scene1-stage {
  position: relative;
  height: 100svh;
  min-height: 100svh;
  z-index: 1;
  scroll-snap-align: start;
}
#scene1 {
  position: relative;
  top: 0;
  left: 0;
  height: 100svh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}
#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 1;
  transition: opacity 360ms ease;
}
#scene1-content {
  position: relative;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}
#scene1-logo {
  font-family: var(--font-pixel);
  font-size: clamp(40px, 8vw, 72px);
  color: var(--text-strong);
  letter-spacing: 4px;
  margin-bottom: 16px;
  animation: logoPulse 3s ease-in-out infinite;
  text-shadow:
    0 0 40px var(--neon-glow),
    0 0 80px var(--neon-dim);
}
@keyframes logoPulse {
  0%,
  100% {
    text-shadow:
      0 0 40px var(--neon-glow),
      0 0 80px var(--neon-dim);
  }
  50% {
    text-shadow:
      0 0 60px var(--neon-glow),
      0 0 120px var(--neon-dim),
      0 0 160px rgba(0, 255, 65, 0.1);
  }
}
#scene1-subtitle {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 3px;
}
#scene1-cta-btn {
  position: absolute;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  height: 44px;
  padding: 0 18px;
  font-family: var(--font-pixel-cjk);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--neon);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 3px),
    linear-gradient(180deg, #1a2731 0%, #0d1218 100%);
  border: 1px solid rgba(0, 255, 65, 0.4);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 16px rgba(0, 255, 65, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-decoration: none;
  cursor: pointer;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.28);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
  animation: scene1CtaPulse 2.2s ease-in-out infinite;
}
#scene1-cta-btn::before,
#scene1-cta-btn::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--neon);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.38);
}
#scene1-cta-btn::before {
  left: 8px;
}
#scene1-cta-btn::after {
  right: 8px;
}
#scene1-cta-btn:hover {
  color: #d9ffe6;
  border-color: rgba(0, 255, 65, 0.85);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 26px rgba(0, 255, 65, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateX(-50%) translateY(-2px);
}
#scene1-cta-btn:active {
  transform: translateX(-50%) translateY(0);
}
@keyframes scene1CtaPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.55),
      0 0 14px rgba(0, 255, 65, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.55),
      0 0 24px rgba(0, 255, 65, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
}
#scene1-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  animation: scrollHint 2s ease-in-out infinite;
  cursor: pointer !important;
  pointer-events: auto;
}
#scene1-scroll-hint * {
  cursor: pointer !important;
}
#scene1-scroll-hint.global-scroll-next {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 9998;
}
#scene1-scroll-hint.global-scroll-next.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body[data-slide-at-end='true'] #scene1-scroll-hint.global-scroll-next {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
@keyframes scrollHint {
  0%,
  100% {
    opacity: 0.4;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(8px);
  }
}
#scene1-scroll-hint span {
  display: block;
  font-family: var(--font-pixel-cjk);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
#scene1-scroll-hint .arrow {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--neon);
  filter: drop-shadow(0 0 8px rgba(0, 255, 65, 0.45));
  margin: 0 auto;
}

body[data-active-slide]:not([data-active-slide='0']) #scene1-content,
body[data-active-slide]:not([data-active-slide='0']) #scene1-cta-btn,
body[data-active-slide]:not([data-active-slide='0']) #scene1-scroll-hint:not(.global-scroll-next) {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none !important;
}
body[data-active-slide]:not([data-active-slide='0']) #particle-canvas {
  opacity: 0;
  pointer-events: none;
}

/* ===== TRANSITION ZONE ===== */
#transition-zone {
  position: absolute;
  top: 100vh;
  left: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
}

/* ===== SCENE 2: DUAL PANEL BUILD ===== */
#scene2 {
  position: relative;
  min-height: 100svh;
  padding: 42px 28px 72px;
  z-index: 6;
  background: transparent;
  scroll-snap-align: start;
}
#dual-panel {
  max-width: 1220px;
  margin: 0 auto;
  display: flex;
  gap: 36px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  --etch-x: 50%;
  --etch-y: 50%;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 20px;
  box-shadow: none;
  backdrop-filter: none;
}
#scene2-etch-logo {
  display: none;
}
#dual-panel.prebuild {
  max-width: 980px;
}
#dual-panel.preview-open {
  max-width: 1360px;
}
#browser-frame {
  width: auto;
  flex: 0 0 68%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  background: #0a0a0f;
  position: sticky;
  top: 68px;
  transition:
    flex-basis 0.8s var(--ease-out-expo),
    opacity 0.6s ease,
    transform 0.8s var(--ease-out-expo),
    border-color 0.4s ease,
    box-shadow 0.4s ease;
  z-index: 1;
}
#browser-titlebar {
  background: #16161e;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--hairline);
}
.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.browser-dot.red {
  background: #ff5f57;
}
.browser-dot.yellow {
  background: #febc2e;
}
.browser-dot.green {
  background: #28c840;
}
#browser-url {
  flex: 1;
  background: #0d0d14;
  border-radius: 6px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--hairline);
}
#browser-content {
  padding: 0;
  min-height: 640px;
  position: relative;
  overflow: hidden;
}
#mini-webview-wrap {
  min-height: 640px;
  background: #07070b;
  opacity: 0;
  transform: none;
  transition: opacity 0.45s ease;
}
#mini-webview {
  width: 100%;
  min-height: 640px;
  border: 0;
  display: block;
  background: #07070b;
  opacity: 0;
  transition: opacity 0.45s ease;
}
#browser-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 40%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 60%,
    transparent 100%
  );
  animation: glareSweep 7s ease-in-out infinite;
}
@keyframes glareSweep {
  0%,
  100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
}

/* Chat Panel */
#chat-panel {
  flex: 0 0 30%;
  max-width: 30%;
  min-width: 0;
  --chat-lane-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition:
    flex-basis 0.8s var(--ease-out-expo),
    max-width 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
  z-index: 1;
}
#chat-panel.chat-panel-instant .chat-message,
#chat-panel.chat-panel-instant .chat-message.user,
#chat-panel.chat-panel-instant .chat-message.ai {
  transition: none !important;
}
#chat-replay-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 10, 15, 0.38);
  color: rgba(220, 232, 255, 0.76);
  font-family: var(--font-pixel-cjk);
  font-size: 10px;
  letter-spacing: 0.02em;
  cursor: pointer;
  z-index: 3;
  opacity: 0.56;
  transition:
    opacity 0.24s ease,
    border-color 0.24s ease,
    background 0.24s ease,
    transform 0.24s ease;
  backdrop-filter: blur(4px);
}
#chat-replay-btn:hover {
  opacity: 0.92;
  border-color: rgba(0, 255, 65, 0.4);
  background: rgba(8, 10, 15, 0.6);
  transform: translateY(-1px);
}
#chat-replay-btn:active {
  transform: translateY(0);
}
.chat-replay-icon {
  font-size: 11px;
  line-height: 1;
  color: rgba(109, 255, 140, 0.9);
}
.chat-replay-text {
  line-height: 1;
}
#dual-panel.prebuild #browser-frame {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  opacity: 0;
  transform: translateX(-36px);
  border-color: transparent;
  box-shadow: none;
  pointer-events: none;
}
#dual-panel.prebuild #chat-panel {
  flex: 1 1 100%;
  max-width: 100%;
  --chat-lane-width: min(100%, clamp(920px, 64vw, 1280px));
  padding-inline: clamp(0px, 1vw, 18px);
  transform: translateX(0);
}
#dual-panel.preview-opening #mini-webview-wrap {
  opacity: 0.35;
  transform: none;
}
#dual-panel.preview-open #mini-webview-wrap {
  opacity: 1;
  transform: none;
}
#dual-panel.webview-ready #mini-webview {
  opacity: 1;
}
.chat-message {
  width: var(--chat-lane-width);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.85s var(--ease-out-expo),
    transform 0.85s var(--ease-out-expo);
}
.chat-message.visible {
  opacity: 1;
  transform: translateY(0);
}
.chat-message.user {
  text-align: right;
  transform: translateX(30px);
}
.chat-message.user.visible {
  transform: translateX(0);
}
.chat-message.ai {
  text-align: left;
  transform: translateX(-30px);
}
.chat-message.ai.visible {
  transform: translateX(0);
}
.chat-bubble {
  display: inline-block;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: left;
}
#dual-panel.prebuild .chat-bubble {
  max-width: min(82%, 820px);
}
.chat-message.user .chat-bubble {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
.chat-message.ai .chat-bubble {
  background: var(--surface-elevated);
  border: 1px solid var(--hairline);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  border-left: 2px solid var(--neon);
}
.chat-bubble.surprise {
  border-color: rgba(0, 255, 65, 0.65);
  box-shadow:
    0 0 0 1px rgba(0, 255, 65, 0.3),
    0 0 16px rgba(0, 255, 65, 0.25);
  animation: surprisePulse 1.2s ease-in-out 2;
}
@keyframes surprisePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}
.chat-code {
  margin-top: 10px;
  padding: 10px;
  background: #0a0a0f;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: #9dd7ff;
  white-space: pre-wrap;
}
.chat-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a5e4ff;
  text-decoration: none;
  border: 1px solid rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.12);
  padding: 7px 10px;
  border-radius: 6px;
  transition: all 0.25s ease;
  cursor: pointer;
}
.chat-preview-link:hover {
  color: #d9f4ff;
  border-color: rgba(14, 165, 233, 0.75);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.25);
  transform: translateY(-1px);
}
.chat-compare {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.chat-compare-card {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 8px;
  background: #0a0a0f;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.chat-compare-card.after {
  border-color: rgba(0, 255, 65, 0.35);
  color: #9cf2b0;
}
.chat-compare-card .label {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: 9px;
  letter-spacing: 1px;
}
.chat-timestamp {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 1px;
}
.chat-message.user .chat-timestamp {
  text-align: right;
}
.chat-thinking {
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid rgba(0, 255, 65, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.4s var(--ease-out-expo),
    opacity 0.3s,
    padding 0.3s;
  opacity: 0;
}
.chat-thinking.expanded {
  max-height: 200px;
  opacity: 1;
  padding: 10px 14px;
}
.chat-form-option {
  display: inline-block;
  padding: 6px 12px;
  margin: 4px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.2s;
}
.chat-form-option.selected {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(0, 255, 65, 0.08);
}
.chat-confirm-btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--neon);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  border: none;
  border-radius: 4px;
  margin-top: 8px;
  font-weight: 700;
  animation: btnPulse 2s ease-in-out infinite;
}
@keyframes btnPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 255, 65, 0);
  }
}
.chat-loading-dots {
  display: flex;
  gap: 4px;
  padding: 10px 0;
}
.chat-loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--neon);
  border-radius: 50%;
  animation: dotBounce 0.6s ease-in-out infinite;
}
.chat-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.chat-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes dotBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* ===== SCENE 2.5: CRT TELEVISION ===== */
#scene2-5 {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: 120px 0 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
}

/* ---- TV Shell (body) ---- */
#crt-tv {
  position: relative;
  width: 920px;
  max-width: 94vw;
  opacity: 0;
  transform: translateY(60px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}
#crt-tv.powered {
  opacity: 1;
  transform: translateY(0);
}
#crt-shell {
  background: linear-gradient(175deg, #1a1a28 0%, #14141f 40%, #0e0e18 100%);
  border-radius: 28px;
  padding: 26px 26px 22px;
  box-shadow:
    0 0 0 3px #2a2a38,
    0 0 0 8px #0c0c14,
    0 0 0 10px #1c1c2a,
    0 35px 70px rgba(0, 0, 0, 0.65),
    inset 0 2px 0 rgba(255, 255, 255, 0.04);
  position: relative;
}
/* corner screws */
#crt-shell::before {
  content: '';
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 12px 12px, #1a1a28 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 12px) 12px, #1a1a28 3px, transparent 4px),
    radial-gradient(circle at 12px calc(100% - 12px), #1a1a28 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #1a1a28 3px, transparent 4px);
}
/* brand badge */
#crt-shell::after {
  content: 'REAKH';
  position: absolute;
  bottom: 86px;
  right: 32px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: rgba(255, 255, 255, 0.12);
  letter-spacing: 2px;
  pointer-events: none;
}

/* Top Label */
#crt-label {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: 5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* ---- Screen Bezel ---- */
#crt-bezel {
  background: linear-gradient(180deg, #11111a 0%, #0d0d16 100%);
  border-radius: 16px;
  padding: 16px;
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.7),
    0 3px 6px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  position: relative;
}
/* power LED */
#crt-power-led {
  position: absolute;
  bottom: 18px;
  left: 22px;
  width: 5px;
  height: 5px;
  background: #330000;
  border-radius: 50%;
  z-index: 2;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.5);
  transition:
    background 0.3s,
    box-shadow 0.3s;
}
#crt-tv.powered #crt-power-led {
  background: #00ff41;
  box-shadow:
    0 0 6px rgba(0, 255, 65, 0.6),
    0 0 12px rgba(0, 255, 65, 0.2);
  animation: ledGlow 3s ease-in-out infinite;
}
@keyframes ledGlow {
  0%,
  100% {
    box-shadow: 0 0 4px rgba(0, 255, 65, 0.4);
  }
  50% {
    box-shadow:
      0 0 10px rgba(0, 255, 65, 0.8),
      0 0 18px rgba(0, 255, 65, 0.3);
  }
}

/* ---- CRT Screen ---- */
#crt-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 500px;
  background: #050508;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
  background-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.4) 100%);
}

/* ---- Screen Overlays ---- */
#crt-scanlines {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.12) 2px, rgba(0, 0, 0, 0.12) 4px);
}
#crt-vignette {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
}
#crt-phosphor {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.07;
  background: radial-gradient(ellipse at center, rgba(0, 255, 65, 0.4) 0%, transparent 70%);
}
#crt-rgb-stripes {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0.02;
  background: repeating-linear-gradient(90deg, #ff0000 0px, #ff0000 1px, #00ff00 1px, #00ff00 2px, #0000ff 2px, #0000ff 3px);
}
#crt-snow-canvas {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}
#crt-snow-canvas.active {
  opacity: 1;
}

/* ---- Signal Jitter ---- */
@keyframes crtJitter {
  0%,
  99.6%,
  100% {
    transform: translateX(0);
  }
  99.7% {
    transform: translateX(2px);
  }
  99.8% {
    transform: translateX(-1px);
  }
  99.9% {
    transform: translateX(1px);
  }
}
#crt-tv.powered #crt-screen {
  animation: crtJitter 14s linear infinite;
}

/* ---- Channel Content ---- */
#crt-channel-content {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crt-channel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 32px 36px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.crt-channel.current {
  opacity: 1;
  pointer-events: auto;
}
.crt-channel-icon {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--neon);
  margin-bottom: 14px;
  letter-spacing: 1px;
}
.crt-channel-title {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 10px;
}
.crt-channel-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  max-width: 42%;
}
.crt-channel-desc.prompt-focus {
  display: inline-block;
  font-family: var(--font-pixel-cjk);
  font-size: 15px;
  color: var(--neon);
  line-height: 1.7;
  letter-spacing: 0.8px;
  max-width: 42%;
  padding: 8px 10px;
  border: 1px solid rgba(0, 255, 65, 0.4);
  background: linear-gradient(180deg, rgba(0, 255, 65, 0.14), rgba(0, 255, 65, 0.05)), rgba(4, 8, 6, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 16px rgba(0, 255, 65, 0.16);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.35);
}
.crt-channel-preview {
  position: absolute;
  right: 32px;
  top: 32px;
  bottom: 32px;
  width: 52%;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.crt-preview-media {
  width: 100%;
  height: 100%;
}
.crt-preview-media img,
.crt-preview-media iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: cover;
}
.crt-channel[data-channel='2'] .crt-channel-preview {
  align-items: stretch;
  justify-content: stretch;
}
.crt-data-preview {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(4px, 0.7vw, 8px);
  padding: clamp(4px, 0.7vw, 8px);
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.crt-data-preview img {
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100% !important;
  object-fit: contain !important;
  background: rgba(5, 10, 8, 0.55);
}
.crt-channel[data-channel='0'] .crt-channel-preview {
  display: block;
  align-items: initial;
  justify-content: initial;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  --ppt-scroll-progress: 0;
  background:
    linear-gradient(to bottom, rgba(0, 255, 65, 0.76) calc(var(--ppt-scroll-progress) * 100%), rgba(255, 255, 255, 0.11) 0) right 7px top 8px / 3px
      calc(100% - 16px) no-repeat,
    rgba(0, 0, 0, 0.35);
}
.crt-channel[data-channel='0'] .crt-channel-preview::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.crt-channel[data-channel='0'] .crt-channel-preview:not(.is-scrollable) {
  background: rgba(0, 0, 0, 0.35);
}
.crt-channel[data-channel='0'] .crt-preview-media {
  height: auto;
  min-height: 100%;
  overflow: visible;
}
.crt-channel[data-channel='0'] .crt-preview-media iframe {
  display: none !important;
  height: 0;
  min-height: 0;
  pointer-events: none;
  overflow: hidden;
}
.ppt-inline-preview {
  display: block;
  width: 100%;
  min-height: calc(100% + 1px);
  padding: clamp(8px, 4vw, 18px);
  background: #05070a;
  color: #eaffef;
  font-family: var(--font-body);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.ppt-inline-preview .ppt-deck {
  display: grid;
  gap: clamp(10px, 3vw, 16px);
}
.ppt-inline-preview .ppt-slide {
  min-height: clamp(180px, 52vh, 280px);
  border: 1px solid rgba(0, 255, 65, 0.36);
  background:
    linear-gradient(90deg, rgba(0, 255, 65, 0.05) 1px, transparent 1px), linear-gradient(rgba(0, 255, 65, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 78% 20%, rgba(14, 165, 233, 0.18), transparent 32%), #080c10;
  background-size:
    18px 18px,
    18px 18px,
    auto,
    auto;
  box-shadow:
    inset 0 0 28px rgba(0, 255, 65, 0.08),
    0 0 24px rgba(0, 255, 65, 0.08);
  padding: clamp(14px, 4vw, 22px);
  position: relative;
  overflow: hidden;
}
.ppt-inline-preview .ppt-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.18) 3px, rgba(0, 0, 0, 0.18) 4px);
}
.ppt-inline-preview .ppt-kicker {
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: clamp(10px, 3vw, 12px);
  letter-spacing: clamp(1px, 0.5vw, 2px);
  margin-bottom: clamp(14px, 4vw, 24px);
}
.ppt-inline-preview h1,
.ppt-inline-preview h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}
.ppt-inline-preview h1 {
  max-width: 620px;
  font-size: clamp(28px, 11vw, 68px);
}
.ppt-inline-preview h2 {
  font-size: clamp(22px, 9vw, 46px);
}
.ppt-inline-preview p {
  max-width: 620px;
  color: #a5b4c3;
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1.55;
}
.ppt-inline-preview .ppt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 12px;
  margin-top: 24px;
}
.ppt-inline-preview .ppt-tile {
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.32);
  padding: 14px;
}
.ppt-inline-preview .ppt-tile strong {
  display: block;
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 8px;
}
.ppt-inline-preview .ppt-tile span {
  color: #a5b4c3;
  font-size: 14px;
  line-height: 1.4;
}
.ppt-inline-preview .ppt-bars {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}
.ppt-inline-preview .ppt-bar {
  height: 28px;
  border: 1px solid rgba(0, 255, 65, 0.28);
  background: rgba(255, 255, 255, 0.05);
  position: relative;
}
.ppt-inline-preview .ppt-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: linear-gradient(90deg, var(--neon), var(--blue));
  box-shadow: 0 0 14px rgba(0, 255, 65, 0.25);
}
.ppt-inline-preview .ppt-caption {
  margin-top: 8px;
  color: #7dd3fc;
  font-family: var(--font-mono);
  font-size: 13px;
}
.crt-ppt-card {
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  margin: 10px;
  border: 1px solid rgba(0, 255, 65, 0.28);
  background: linear-gradient(160deg, rgba(0, 255, 65, 0.08), rgba(14, 165, 233, 0.08));
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.crt-ppt-name {
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.5;
  color: var(--neon);
  text-shadow: 0 0 8px var(--neon-glow);
}
.crt-ppt-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid rgba(0, 255, 65, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}

/* ---- Channel Switch Animation ---- */
@keyframes crtSquashIn {
  0% {
    transform: scaleY(1);
    filter: brightness(1) blur(0);
  }
  35% {
    transform: scaleY(0.02);
    filter: brightness(3) blur(1px);
  }
  100% {
    transform: scaleY(0.02);
    filter: brightness(4) blur(2px);
  }
}
@keyframes crtExpandOut {
  0% {
    transform: scaleY(0.02);
    filter: brightness(3) blur(1px);
  }
  65% {
    transform: scaleY(1);
    filter: brightness(1) blur(0);
  }
  100% {
    transform: scaleY(1);
    filter: brightness(1) blur(0);
  }
}
#crt-channel-content.switching-out {
  animation: crtSquashIn 0.18s var(--ease-out-expo) forwards;
}
#crt-channel-content.switching-in {
  animation: crtExpandOut 0.28s var(--ease-out-expo) forwards;
}

@keyframes rgbSplit {
  0% {
    filter: brightness(2.5) blur(2px);
  }
  50% {
    filter: brightness(2) blur(0.5px) hue-rotate(15deg);
  }
  100% {
    filter: brightness(1) blur(0) hue-rotate(0deg);
  }
}
#crt-screen.rgb-realign #crt-channel-content {
  animation: rgbSplit 0.22s ease-out;
}

/* ---- OSD ---- */
#crt-osd {
  position: absolute;
  top: 16px;
  right: 26px;
  z-index: 15;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--neon);
  opacity: 0;
  letter-spacing: 2px;
  text-shadow: 0 0 8px var(--neon-glow);
  transition: opacity 0.2s;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 3px;
}
#crt-osd.visible {
  opacity: 1;
}

/* ---- Bottom Control Panel ---- */
#crt-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 10px 6px;
}
/* LED Channel Display */
#crt-channel-display {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  color: #ff3300;
  background: #0a0000;
  border: 1px solid #330000;
  border-radius: 5px;
  padding: 5px 14px;
  text-shadow: 0 0 12px rgba(255, 51, 0, 0.65);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
  letter-spacing: 3px;
  min-width: 58px;
  text-align: center;
  transition: color 0.15s;
}
#crt-channel-display.scrambling {
  animation: ledScramble 0.15s steps(3) infinite;
}
@keyframes ledScramble {
  0% {
    color: #ff3300;
  }
  33% {
    color: #ff6600;
  }
  66% {
    color: #cc0000;
  }
  100% {
    color: #ff3300;
  }
}

/* Speaker Grille */
#crt-speaker-grille {
  flex: 1;
  height: 40px;
  background: repeating-linear-gradient(0deg, transparent 0px, transparent 3px, rgba(0, 0, 0, 0.5) 3px, rgba(0, 0, 0, 0.5) 5px);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ---- Channel Knob ---- */
#crt-knob-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
#crt-knob {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at 55% 40%, #2e2e3e, #181826 55%, #0c0c14 100%);
  border-radius: 50%;
  position: relative;
  cursor: grab;
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.03),
    inset 0 2px 2px rgba(255, 255, 255, 0.04);
  transition:
    transform 0.15s var(--ease-out-back),
    box-shadow 0.15s;
  user-select: none;
}
#crt-knob::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
#crt-knob:active {
  cursor: grabbing;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(0, 255, 65, 0.2);
}
#crt-knob::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 16px;
  background: var(--neon);
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center center;
  box-shadow: 0 0 8px var(--neon-glow);
  transition: transform 0.1s linear;
}
#crt-knob-notch {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
}
/* knob tick marks */
#crt-knob-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
}
#crt-knob-ticks::before,
#crt-knob-ticks::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  left: 50%;
  transform: translateX(-50%);
}
#crt-knob-ticks::before {
  top: 8px;
}
#crt-knob-ticks::after {
  bottom: 8px;
}

/* ---- Arcade Channel Buttons ---- */
#crt-channel-btns {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 0;
}
.crt-arcade-btn {
  all: unset;
  position: relative;
  width: 42px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--neon);
  cursor: pointer;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0px, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 3px),
    linear-gradient(180deg, #272f3f 0%, #161c2a 52%, #0f1320 100%);
  border: 1px solid #3a4964;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px #090b12,
    0 2px 0 #07090f,
    0 0 10px rgba(0, 255, 65, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.68);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    filter 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}
.crt-arcade-btn::after {
  content: '';
  position: absolute;
  inset: 3px 4px;
  border: 1px solid rgba(0, 255, 65, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.crt-arcade-btn:hover {
  filter: brightness(1.08) saturate(1.05);
  box-shadow:
    0 0 0 1px #090b12,
    0 2px 0 #07090f,
    0 0 14px rgba(0, 255, 65, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72);
}
.crt-arcade-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 0 0 1px #090b12,
    0 1px 0 #07090f,
    0 0 7px rgba(0, 255, 65, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(0, 0, 0, 0.72);
}
.crt-arcade-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  filter: grayscale(0.35);
}
.crt-btn-arrow {
  font-size: 12px;
  font-family: var(--font-pixel);
  line-height: 1;
  transform: translateY(0);
  text-shadow: 0 0 6px var(--neon-glow);
}

/* ---- Power-On Animation ---- */
#crt-screen.powering-on {
  animation: crtPowerOn 1.6s var(--ease-out-expo) forwards;
}
@keyframes crtPowerOn {
  0% {
    filter: brightness(0);
    box-shadow: inset 0 0 0 rgba(0, 255, 65, 0);
  }
  8% {
    filter: brightness(0);
    box-shadow: inset 0 0 0 rgba(0, 255, 65, 0);
  }
  12% {
    filter: brightness(8);
    box-shadow: inset 0 0 120px rgba(0, 255, 65, 0.6);
  }
  18% {
    filter: brightness(2);
    box-shadow: inset 0 0 40px rgba(0, 255, 65, 0.3);
  }
  28% {
    filter: brightness(1.5) blur(1px);
    box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.2);
  }
  100% {
    filter: brightness(1) blur(0);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
  }
}
#crt-tv.powering-on #crt-snow-canvas {
  opacity: 1;
}
#crt-tv.powering-on.power-phase2 #crt-snow-canvas {
  opacity: 0.4;
}
#crt-tv.powering-on.power-phase3 #crt-snow-canvas {
  opacity: 0;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  #crt-tv {
    width: 92vw;
  }
  .crt-channel {
    padding: 18px;
  }
  .crt-channel-desc {
    max-width: 100%;
  }
  .crt-channel-preview {
    position: relative;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    height: 190px;
    margin-top: 12px;
  }
  .crt-preview-media img,
  .crt-preview-media iframe {
    object-fit: contain;
    background: #070a10;
  }
  #crt-screen {
    max-height: 380px;
  }
  #crt-knob {
    width: 44px;
    height: 44px;
  }
  #crt-knob::after {
    height: 13px;
  }
  #crt-channel-btns {
    gap: 6px;
  }
  .crt-arcade-btn {
    width: 38px;
    height: 24px;
  }
  .crt-btn-arrow {
    font-size: 11px;
  }
  #crt-channel-display {
    font-size: 26px;
    padding: 4px 10px;
  }
  #crt-speaker-grille {
    height: 32px;
  }
}
@media (max-width: 640px) {
  #scene2-5 {
    padding: 88px 0 112px;
  }
  #crt-shell {
    padding: 16px 16px 14px;
    border-radius: 20px;
  }
  #crt-bezel {
    padding: 10px;
    border-radius: 12px;
  }
  #crt-screen {
    max-height: none;
    min-height: 360px;
  }
  .crt-channel {
    padding: 14px;
  }
  .crt-channel-icon {
    font-size: 9px;
  }
  .crt-channel-title {
    font-size: 16px;
  }
  .crt-channel-desc {
    font-size: 11px;
  }
  .crt-channel-desc.prompt-focus {
    font-size: 12px;
    letter-spacing: 0.4px;
    padding: 6px 8px;
    max-width: 100%;
  }
  .crt-channel-preview {
    height: auto;
    min-height: 280px;
    max-height: 430px;
    margin-top: 10px;
    border-radius: 6px;
    overflow: auto;
  }
  .crt-channel[data-channel='0'] .crt-preview-media iframe {
    width: 128%;
    height: 520px;
    min-height: 0;
    transform: scale(0.78);
    transform-origin: top left;
  }
  .crt-channel[data-channel='0'] .crt-preview-media {
    width: 100%;
    height: 405px;
    overflow: hidden;
  }
  .crt-channel[data-channel='0'] .crt-channel-preview {
    min-height: 0;
    max-height: 420px;
    overflow: auto;
  }
  .crt-channel[data-channel='1'] .crt-preview-media iframe {
    min-height: 360px;
  }
  .crt-channel[data-channel='1'] .crt-preview-media {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .crt-channel[data-channel='2'] .crt-preview-media {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    padding: 6px !important;
  }
  .crt-channel[data-channel='2'] .crt-preview-media img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    background: #070a10;
  }
  #crt-knob {
    width: 38px;
    height: 38px;
  }
  #crt-knob::after {
    height: 11px;
  }
  #crt-channel-display {
    font-size: 22px;
    padding: 3px 8px;
    min-width: 48px;
  }
  #crt-osd {
    font-size: 10px;
    top: 8px;
    right: 12px;
  }
  #crt-speaker-grille {
    height: 26px;
  }
  #crt-controls {
    display: grid;
    grid-template-columns: auto minmax(42px, 1fr) auto;
    gap: 8px;
    padding: 12px 2px 4px;
  }
  #crt-knob-wrap {
    min-width: 0;
    gap: 6px;
  }
  #crt-channel-btns {
    gap: 5px;
  }
  .crt-arcade-btn {
    width: 34px;
    height: 22px;
  }
  .crt-btn-arrow {
    font-size: 10px;
  }
}

/* ---- CRT Helper Classes ---- */
@keyframes obstacleMove {
  from {
    right: -30px;
  }
  to {
    right: 110%;
  }
}
.gallery-ppt-slide {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0d0d14, #12121f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-muted);
  position: relative;
}
.gallery-game-area {
  width: 100%;
  height: 100%;
  background: #0a0a0f;
  position: relative;
  overflow: hidden;
}

/* ===== SCENE 3: CTA + TERMINAL ===== */
#scene3 {
  position: relative;
  z-index: 5;
  min-height: 100svh;
  padding: 80px 40px 40px;
  text-align: center;
  scroll-snap-align: start;
}
#cta-heading {
  font-family: var(--font-pixel-cjk);
  font-size: clamp(24px, 5vw, 40px);
  color: var(--text-strong);
  margin-bottom: 28px;
  letter-spacing: 3px;
  line-height: 1.4;
  text-shadow: 0 0 24px rgba(0, 255, 65, 0.12);
}
#cta-heading .neon {
  color: var(--neon);
  text-shadow: 0 0 30px var(--neon-glow);
}
#cta-input-wrap {
  position: relative;
  max-width: 760px;
  margin: 0 auto 30px;
  border: 2px solid #1c2432;
  background: linear-gradient(180deg, rgba(10, 12, 16, 0.9), rgba(8, 10, 13, 0.9));
  box-shadow:
    0 0 0 2px rgba(5, 7, 11, 0.95),
    0 0 22px rgba(0, 255, 65, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 12px;
}
#cta-input-label {
  font-family: var(--font-pixel-cjk);
  font-size: 10px;
  letter-spacing: 1px;
  text-align: left;
  color: #8eb49a;
  margin-bottom: 10px;
}
#cta-input {
  width: 100%;
  height: 56px;
  background: #0d1218;
  border: 2px solid #27354a;
  border-radius: 0;
  padding: 0 64px 0 16px;
  font-family: var(--font-pixel-cjk), var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
  animation: inputPulse 2.6s ease-in-out infinite;
}
#cta-input::placeholder {
  color: #6a7784;
  font-family: var(--font-pixel-cjk), var(--font-mono);
  letter-spacing: 0.6px;
}
@keyframes inputPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.1);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(0, 255, 65, 0.08);
  }
}
#cta-input:focus {
  border-color: var(--neon);
  box-shadow:
    0 0 0 1px rgba(0, 255, 65, 0.25),
    0 0 20px var(--neon-dim);
  animation: none;
}
#cta-submit {
  position: absolute;
  right: 18px;
  top: calc(50% + 11px);
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  background: #0f1622;
  border: 2px solid #2c4157;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}
#cta-submit:hover {
  border-color: var(--neon);
  box-shadow: 0 0 14px var(--neon-glow);
}
#cta-submit svg {
  width: 16px;
  height: 16px;
  stroke: var(--neon);
}
#cta-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}
.cta-chip {
  padding: 8px 18px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
}
.cta-chip:hover {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(0, 255, 65, 0.05);
}
#cta-logo {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
#cta-logo img {
  display: block;
  width: min(250px, 46vw);
  height: auto;
  margin: 0 auto;
  opacity: 0.78;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#cta-slogan {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* Terminal Footer */
#terminal-footer {
  width: 100%;
  margin: 24px 0 0;
  text-align: left;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Scene 3 entrance */
#scene3:not(.scene3-entered) #cta-heading,
#scene3:not(.scene3-entered) #cta-input-wrap,
#scene3:not(.scene3-entered) #cta-chips,
#scene3:not(.scene3-entered) #cta-logo,
#scene3:not(.scene3-entered) #cta-slogan,
#scene3:not(.scene3-entered) #terminal-footer {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
}
#scene3 #cta-heading,
#scene3 #cta-input-wrap,
#scene3 #cta-chips,
#scene3 #cta-logo,
#scene3 #cta-slogan,
#scene3 #terminal-footer {
  transition:
    opacity 0.75s var(--ease-out-expo),
    transform 0.85s var(--ease-out-expo);
}
#scene3.scene3-entered #cta-heading,
#scene3.scene3-entered #cta-input-wrap,
#scene3.scene3-entered #cta-chips,
#scene3.scene3-entered #cta-logo,
#scene3.scene3-entered #cta-slogan,
#scene3.scene3-entered #terminal-footer {
  opacity: 1;
  transform: translateY(0) scale(1);
}
#scene3 #cta-input-wrap {
  transition-delay: 0.08s;
}
#scene3 #cta-chips {
  transition-delay: 0.15s;
}
#scene3 #cta-logo,
#scene3 #cta-slogan {
  transition-delay: 0.22s;
}
#scene3 #terminal-footer {
  transition-delay: 0.3s;
}
#terminal-titlebar {
  background: #16161e;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--hairline);
}
#terminal-title {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
#terminal-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
#terminal-body {
  padding: 20px 24px;
  min-height: 220px;
  height: clamp(260px, 28svh, 360px);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
#terminal-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.06) 2px, rgba(0, 0, 0, 0.06) 4px);
  pointer-events: none;
}
#terminal-output {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 120px;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}
#terminal-output .line {
  padding: 1px 0;
}
#terminal-output .line.green {
  color: var(--neon);
}
#terminal-output .line.blue {
  color: var(--blue);
}
#terminal-output .line.dim {
  color: var(--text-muted);
}
#terminal-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
#terminal-prompt {
  color: var(--neon);
  white-space: nowrap;
}
#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  caret-color: var(--neon);
}
#terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--neon);
  animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
.terminal-cmd {
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-right: 16px;
}
.terminal-cmd:hover {
  color: var(--neon);
}
#terminal-commands {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}
#terminal-status {
  padding: 8px 24px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.5px;
}
#terminal-status a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
#terminal-status a:hover,
#terminal-status a:visited,
#terminal-status a:active {
  color: inherit;
  text-decoration: none;
}
.terminal-qr-line {
  margin-top: 8px;
}
.terminal-qr-image {
  width: 110px;
  height: 110px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid rgba(0, 255, 65, 0.35);
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.16);
}
#terminal-doc-viewer {
  position: absolute;
  inset: 42px 14px 44px;
  z-index: 4;
  border: 1px solid rgba(0, 255, 65, 0.25);
  background: rgba(7, 10, 12, 0.96);
  display: none;
  flex-direction: column;
}
#terminal-doc-viewer.visible {
  display: flex;
}
#terminal-doc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 255, 65, 0.18);
  color: var(--neon);
}
#terminal-doc-title {
  font-size: 11px;
  letter-spacing: 1px;
}
#terminal-doc-close {
  all: unset;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
}
#terminal-doc-close:hover {
  color: var(--neon);
}
#terminal-doc-content {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  padding: 10px;
  font-size: 11px;
  line-height: 1.7;
  color: #b8bec7;
}

/* ===== KEYBOARD SHORTCUT HINT ===== */
#shortcut-hint {
  position: fixed;
  bottom: 20px;
  left: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.15);
  z-index: 50;
  pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 1600px) {
  #scene2 {
    padding: 56px 36px 88px;
  }
  #dual-panel {
    max-width: 1360px;
  }
  #chat-panel {
    flex: 0 0 32%;
    max-width: 32%;
  }
  #cta-input-wrap {
    max-width: 860px;
  }
  #terminal-body {
    height: 300px;
  }
}
@media (max-width: 1440px) and (min-width: 1025px) {
  #scene1-stage {
    height: 100svh;
    min-height: 100svh;
  }
  #scene1-logo {
    font-size: clamp(34px, 6.2vw, 58px);
    letter-spacing: 3px;
  }
  #scene1-subtitle {
    font-size: 12px;
    letter-spacing: 2px;
  }
  #scene1-cta-btn {
    bottom: 98px;
    min-width: 166px;
    height: 40px;
    font-size: 10px;
  }
  #scene1-scroll-hint {
    bottom: 30px;
  }

  #scene2 {
    min-height: 118vh;
    padding: 30px 18px 50px;
  }
  #dual-panel {
    max-width: 1160px;
    gap: 22px;
    padding: 14px;
    border-radius: 14px;
  }
  #browser-frame {
    top: 44px;
    border-radius: 10px;
  }
  #browser-titlebar {
    padding: 8px 10px;
  }
  #browser-url {
    font-size: 10px;
    padding: 4px 8px;
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 520px;
  }
  #chat-panel {
    flex: 0 0 35%;
    max-width: 35%;
  }
  .chat-message {
    margin-bottom: 14px;
  }
  .chat-bubble {
    padding: 9px 11px;
  }
  .chat-message.user .chat-bubble,
  .chat-message.ai .chat-bubble {
    font-size: 12px;
    line-height: 1.45;
  }
  .chat-code {
    font-size: 10px;
    padding: 8px;
  }
  .chat-timestamp {
    font-size: 9px;
    margin-top: 4px;
  }

  #scene2-5 {
    padding: 72px 0 110px;
  }
  #crt-tv {
    width: 860px;
  }
  #crt-shell {
    padding: 18px 18px 16px;
    border-radius: 22px;
  }
  #crt-screen {
    max-height: 410px;
  }
  .crt-channel {
    padding: 20px 24px;
  }
  .crt-channel-icon {
    font-size: 9px;
    margin-bottom: 10px;
  }
  .crt-channel-title {
    font-size: 16px;
    margin-bottom: 8px;
  }
  .crt-channel-desc {
    font-size: 11px;
  }
  .crt-channel-desc.prompt-focus {
    font-size: 12px;
    padding: 6px 8px;
    letter-spacing: 0.4px;
  }
  .crt-channel-preview {
    right: 22px;
    top: 22px;
    bottom: 22px;
  }
  #crt-osd {
    font-size: 11px;
    top: 12px;
    right: 16px;
    padding: 3px 8px;
  }
  #crt-controls {
    gap: 12px;
    padding: 10px 6px 4px;
  }
  #crt-channel-display {
    font-size: 24px;
    min-width: 50px;
    padding: 4px 10px;
  }
  #crt-speaker-grille {
    height: 32px;
  }
  #crt-knob-wrap {
    gap: 8px;
  }
  #crt-knob {
    width: 42px;
    height: 42px;
  }
  #crt-knob::after {
    height: 13px;
  }
  #crt-channel-btns {
    gap: 6px;
  }
  .crt-arcade-btn {
    width: 38px;
    height: 22px;
  }
  .crt-btn-arrow {
    font-size: 11px;
  }

  #scene3 {
    padding: 60px 18px 30px;
  }
  #cta-heading {
    font-size: clamp(22px, 3.2vw, 30px);
    margin-bottom: 18px;
    letter-spacing: 2px;
  }
  #cta-input-wrap {
    max-width: 680px;
    margin-bottom: 18px;
    padding: 10px;
  }
  #cta-input-label {
    font-size: 9px;
    margin-bottom: 8px;
  }
  #cta-input {
    height: 46px;
    font-size: 10px;
    padding: 0 56px 0 10px;
    letter-spacing: 0.35px;
  }
  #cta-submit {
    width: 32px;
    height: 32px;
    right: 14px;
    top: calc(50% + 9px);
  }
  #cta-submit svg {
    width: 13px;
    height: 13px;
  }
  #cta-chips {
    gap: 8px;
    margin-bottom: 18px;
  }
  .cta-chip {
    font-size: 10px;
    padding: 6px 12px;
  }
  #cta-logo img {
    width: min(210px, 34vw);
  }
  #cta-slogan {
    font-size: 10px;
    letter-spacing: 1px;
  }
  #terminal-footer {
    margin-top: 16px;
  }
  #terminal-titlebar {
    padding: 8px 10px;
  }
  #terminal-title {
    font-size: 10px;
  }
  #terminal-version {
    font-size: 9px;
  }
  #terminal-body {
    height: 180px;
    min-height: 150px;
    font-size: 11px;
    padding: 12px 10px;
  }
  #terminal-output {
    margin-bottom: 8px;
  }
  #terminal-input-line {
    gap: 6px;
  }
  #terminal-prompt,
  #terminal-input {
    font-size: 11px;
  }
  #terminal-status {
    font-size: 8px;
    padding: 6px 10px;
    letter-spacing: 0.2px;
  }
  .terminal-cmd {
    font-size: 10px;
    margin-right: 10px;
  }
  #terminal-doc-viewer {
    inset: 36px 8px 38px;
  }
  #terminal-doc-title,
  #terminal-doc-close,
  #terminal-doc-content {
    font-size: 10px;
  }
}
@media (max-height: 900px) and (min-width: 1025px) {
  #scene1-stage {
    height: 100svh;
    min-height: 100svh;
  }
  #scene2 {
    min-height: 100svh;
    padding-top: 24px;
    padding-bottom: 42px;
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 500px;
  }
  #scene2-5 {
    padding: 64px 0 96px;
  }
  #crt-screen {
    max-height: 390px;
  }
  #scene3 {
    padding-top: 62px;
  }
  #terminal-footer {
    margin-top: 12px;
  }
  #terminal-body {
    height: 196px;
    min-height: 196px;
    padding: 10px 10px;
  }
  #terminal-output {
    min-height: 0;
    margin-bottom: 6px;
  }
  #terminal-commands {
    margin-bottom: 8px;
  }
  #terminal-input-line {
    min-height: 18px;
  }
}
@media (min-width: 1920px) and (max-width: 2199px) and (max-height: 1200px) {
  #pixel-nav {
    right: 26px;
    gap: 22px;
  }
  .pixel-dot {
    width: 8px;
    height: 8px;
    box-shadow:
      8px 0 0 rgba(255, 255, 255, 0.15),
      0 8px 0 rgba(255, 255, 255, 0.15),
      8px 8px 0 rgba(255, 255, 255, 0.15);
  }
  .pixel-dot:hover {
    box-shadow:
      8px 0 0 rgba(255, 255, 255, 0.35),
      0 8px 0 rgba(255, 255, 255, 0.35),
      8px 8px 0 rgba(255, 255, 255, 0.35);
  }
  .pixel-dot.active {
    box-shadow:
      8px 0 0 var(--neon),
      0 8px 0 var(--neon),
      8px 8px 0 var(--neon),
      0 0 16px var(--neon-glow),
      0 0 5px var(--neon-dim);
  }

  #loading-title {
    font-size: 18px;
    letter-spacing: 3px;
  }
  #loading-bar-track {
    width: 360px;
    height: 3px;
    margin-bottom: 20px;
  }
  #loading-brand {
    font-size: 13px;
    letter-spacing: 4px;
  }

  #scene1-logo {
    font-size: clamp(64px, 6.2vw, 122px);
    letter-spacing: 6px;
    margin-bottom: 24px;
  }
  #scene1-subtitle {
    font-size: 18px;
    letter-spacing: 4px;
  }
  #scene1-cta-btn {
    bottom: 124px;
    min-width: 240px;
    height: 54px;
    font-size: 13px;
  }
  #scene1-scroll-hint {
    bottom: 54px;
  }
  #scene1-scroll-hint span {
    font-size: 12px;
    letter-spacing: 3px;
  }
  #scene1-scroll-hint .arrow {
    width: 24px;
    height: 24px;
  }

  #scene2 {
    min-height: 100svh;
    padding: 46px 36px 72px;
  }
  #chat-replay-btn {
    top: 16px;
    left: 16px;
    padding: 7px 11px;
    font-size: 11px;
  }
  #dual-panel {
    max-width: 1480px;
    gap: 30px;
    padding: 20px;
    border-radius: 18px;
  }
  #browser-frame {
    top: 64px;
    border-radius: 12px;
  }
  #browser-titlebar {
    padding: 12px 16px;
    gap: 12px;
  }
  .browser-dot {
    width: 12px;
    height: 12px;
  }
  #browser-url {
    font-size: 13px;
    padding: 7px 12px;
    border-radius: 8px;
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 620px;
  }
  .chat-message {
    margin-bottom: 20px;
  }
  .chat-bubble {
    padding: 12px 15px;
    border-radius: 9px;
  }
  .chat-message.user .chat-bubble,
  .chat-message.ai .chat-bubble {
    font-size: 14px;
    line-height: 1.58;
  }
  .chat-code {
    font-size: 12px;
    padding: 10px;
  }
  .chat-timestamp {
    font-size: 11px;
  }

  #scene2-5 {
    padding: 86px 0;
  }
  #crt-tv {
    width: 940px;
    max-width: 92vw;
    margin: 0 auto;
  }
  #crt-shell {
    border-radius: 26px;
    padding: 22px 22px 18px;
  }
  #crt-screen {
    max-height: 470px;
    border-radius: 8px;
  }
  .crt-channel {
    padding: 26px 30px;
  }
  .crt-channel-title {
    font-size: 20px;
  }
  .crt-channel-desc {
    font-size: 13px;
  }
  .crt-channel-desc.prompt-focus {
    font-size: 14px;
    padding: 8px 9px;
  }
  #crt-osd {
    font-size: 13px;
    padding: 4px 10px;
  }
  #crt-controls {
    gap: 14px;
    padding: 14px 8px 6px;
  }
  #crt-channel-display {
    font-size: 28px;
    min-width: 58px;
    padding: 5px 12px;
  }
  #crt-speaker-grille {
    height: 36px;
  }
  #crt-knob-wrap {
    gap: 10px;
  }
  #crt-knob {
    width: 48px;
    height: 48px;
  }
  #crt-knob::after {
    height: 14px;
  }
  #crt-channel-btns {
    gap: 7px;
  }
  .crt-arcade-btn {
    width: 42px;
    height: 26px;
  }
  .crt-btn-arrow {
    font-size: 12px;
  }

  #scene3 {
    min-height: 100vh;
    padding: 62px 34px 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #cta-heading {
    font-size: clamp(28px, 3.2vw, 42px);
    margin-bottom: 24px;
    letter-spacing: 3px;
  }
  /* 1080p：输入区在 flex 居中布局下需横向拉满，再由 max-width 限制 */
  #cta-input-wrap {
    align-self: stretch;
    max-width: min(1040px, calc(100vw - 80px));
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 24px;
    padding: 12px;
  }
  #cta-input-label {
    font-size: 10px;
    margin-bottom: 10px;
  }
  #cta-input {
    height: 54px;
    font-size: 11px;
    padding: 0 62px 0 14px;
  }
  #cta-submit {
    width: 36px;
    height: 36px;
    right: 16px;
  }
  #cta-submit svg {
    width: 18px;
    height: 18px;
  }
  #cta-chips {
    gap: 10px;
    margin-bottom: 24px;
  }
  .cta-chip {
    font-size: 12px;
    padding: 8px 16px;
  }
  #cta-logo img {
    width: min(320px, 23vw);
  }
  #cta-slogan {
    font-size: 12px;
    letter-spacing: 2px;
  }
  #terminal-footer {
    margin-top: auto;
  }
  #terminal-titlebar {
    padding: 12px 16px;
  }
  #terminal-title {
    font-size: 12px;
  }
  #terminal-version {
    font-size: 11px;
  }
  #terminal-body {
    height: clamp(280px, 30svh, 340px);
    min-height: 240px;
    font-size: 13px;
    padding: 16px 18px;
  }
  #terminal-input,
  #terminal-prompt {
    font-size: 13px;
  }
  #terminal-status {
    font-size: 10px;
    padding: 8px 18px;
  }
  .terminal-cmd {
    font-size: 11px;
    margin-right: 14px;
  }
  #terminal-doc-title,
  #terminal-doc-close {
    font-size: 12px;
  }
  #terminal-doc-content {
    font-size: 12px;
  }
}
@media (min-width: 2200px) {
  #pixel-nav {
    right: 26px;
    gap: 22px;
  }
  .pixel-dot {
    width: 8px;
    height: 8px;
    box-shadow:
      8px 0 0 rgba(255, 255, 255, 0.15),
      0 8px 0 rgba(255, 255, 255, 0.15),
      8px 8px 0 rgba(255, 255, 255, 0.15);
  }
  .pixel-dot:hover {
    box-shadow:
      8px 0 0 rgba(255, 255, 255, 0.35),
      0 8px 0 rgba(255, 255, 255, 0.35),
      8px 8px 0 rgba(255, 255, 255, 0.35);
  }
  .pixel-dot.active {
    box-shadow:
      8px 0 0 var(--neon),
      0 8px 0 var(--neon),
      8px 8px 0 var(--neon),
      0 0 16px var(--neon-glow),
      0 0 5px var(--neon-dim);
  }

  #loading-title {
    font-size: 18px;
    letter-spacing: 3px;
  }
  #loading-bar-track {
    width: 360px;
    height: 3px;
    margin-bottom: 20px;
  }
  #loading-brand {
    font-size: 13px;
    letter-spacing: 4px;
  }

  #scene1-logo {
    font-size: clamp(64px, 6.2vw, 122px);
    letter-spacing: 6px;
    margin-bottom: 24px;
  }
  #scene1-subtitle {
    font-size: 18px;
    letter-spacing: 4px;
  }
  #scene1-cta-btn {
    bottom: 126px;
    min-width: 240px;
    height: 54px;
    font-size: 13px;
  }
  #scene1-scroll-hint {
    bottom: 54px;
  }
  #scene1-scroll-hint span {
    font-size: 12px;
    letter-spacing: 3px;
  }
  #scene1-scroll-hint .arrow {
    width: 24px;
    height: 24px;
  }

  #scene2 {
    min-height: 100svh;
    padding: 72px 52px 110px;
  }
  #chat-replay-btn {
    top: 16px;
    left: 16px;
    padding: 7px 11px;
    font-size: 11px;
  }
  #dual-panel {
    max-width: 1680px;
    gap: 44px;
    padding: 28px;
    border-radius: 22px;
  }
  #browser-frame {
    top: 88px;
    border-radius: 14px;
  }
  #browser-titlebar {
    padding: 12px 16px;
    gap: 12px;
  }
  .browser-dot {
    width: 12px;
    height: 12px;
  }
  #browser-url {
    font-size: 13px;
    padding: 7px 12px;
    border-radius: 8px;
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 760px;
  }
  .chat-message {
    margin-bottom: 28px;
  }
  .chat-bubble {
    padding: 14px 18px;
    border-radius: 10px;
  }
  .chat-message.user .chat-bubble,
  .chat-message.ai .chat-bubble {
    font-size: 16px;
    line-height: 1.68;
  }
  .chat-code {
    font-size: 13px;
    padding: 12px;
  }
  .chat-timestamp {
    font-size: 12px;
  }

  #scene2-5 {
    padding: 150px 0 220px;
  }
  #crt-tv {
    width: 1120px;
  }
  #crt-shell {
    border-radius: 34px;
    padding: 32px 32px 26px;
  }
  #crt-screen {
    max-height: 620px;
    border-radius: 10px;
  }
  .crt-channel {
    padding: 38px 44px;
  }
  .crt-channel-title {
    font-size: 26px;
  }
  .crt-channel-desc {
    font-size: 16px;
  }
  .crt-channel-desc.prompt-focus {
    font-size: 18px;
    padding: 10px 12px;
  }
  #crt-osd {
    font-size: 16px;
    padding: 5px 12px;
  }
  #crt-controls {
    gap: 22px;
    padding: 20px 12px 8px;
  }
  #crt-channel-display {
    font-size: 36px;
    min-width: 70px;
    padding: 6px 16px;
  }
  #crt-speaker-grille {
    height: 48px;
  }
  #crt-knob-wrap {
    gap: 16px;
  }
  #crt-knob {
    width: 60px;
    height: 60px;
  }
  #crt-knob::after {
    height: 18px;
  }
  #crt-channel-btns {
    gap: 10px;
  }
  .crt-arcade-btn {
    width: 50px;
    height: 32px;
  }
  .crt-btn-arrow {
    font-size: 14px;
  }

  #scene3 {
    min-height: 100vh;
    padding: 100px 56px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #cta-heading {
    font-size: clamp(34px, 4vw, 56px);
    margin-bottom: 36px;
    letter-spacing: 4px;
  }
  #cta-input-wrap {
    align-self: stretch;
    max-width: min(1100px, calc(100vw - 112px));
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 36px;
    padding: 14px;
  }
  #cta-input-label {
    font-size: 12px;
    margin-bottom: 12px;
  }
  #cta-input {
    height: 64px;
    font-size: 13px;
    padding: 0 74px 0 18px;
  }
  #cta-submit {
    width: 44px;
    height: 44px;
    right: 20px;
  }
  #cta-submit svg {
    width: 18px;
    height: 18px;
  }
  #cta-chips {
    gap: 12px;
    margin-bottom: 34px;
  }
  .cta-chip {
    font-size: 14px;
    padding: 9px 20px;
  }
  #cta-logo img {
    width: min(420px, 24vw);
  }
  #cta-slogan {
    font-size: 14px;
    letter-spacing: 2.5px;
  }
  #terminal-footer {
    margin-top: auto;
  }
  #terminal-titlebar {
    padding: 12px 16px;
  }
  #terminal-title {
    font-size: 13px;
  }
  #terminal-version {
    font-size: 12px;
  }
  #terminal-body {
    height: clamp(340px, 32svh, 430px);
    min-height: 300px;
    font-size: 15px;
    padding: 24px 28px;
  }
  #terminal-input,
  #terminal-prompt {
    font-size: 15px;
  }
  #terminal-status {
    font-size: 12px;
    padding: 10px 28px;
  }
  .terminal-cmd {
    font-size: 13px;
    margin-right: 20px;
  }
  #terminal-doc-title,
  #terminal-doc-close {
    font-size: 12px;
  }
  #terminal-doc-content {
    font-size: 12px;
  }
}
@media (min-width: 2560px) {
  #pixel-nav {
    right: 34px;
    gap: 28px;
  }
  .pixel-dot {
    width: 10px;
    height: 10px;
    box-shadow:
      10px 0 0 rgba(255, 255, 255, 0.15),
      0 10px 0 rgba(255, 255, 255, 0.15),
      10px 10px 0 rgba(255, 255, 255, 0.15);
  }
  .pixel-dot:hover {
    box-shadow:
      10px 0 0 rgba(255, 255, 255, 0.35),
      0 10px 0 rgba(255, 255, 255, 0.35),
      10px 10px 0 rgba(255, 255, 255, 0.35);
  }
  .pixel-dot.active {
    box-shadow:
      10px 0 0 var(--neon),
      0 10px 0 var(--neon),
      10px 10px 0 var(--neon),
      0 0 20px var(--neon-glow),
      0 0 7px var(--neon-dim);
  }

  #scene1-logo {
    font-size: clamp(78px, 5.4vw, 156px);
    letter-spacing: 8px;
  }
  #scene1-subtitle {
    font-size: 22px;
    letter-spacing: 5px;
  }
  #scene1-cta-btn {
    bottom: 140px;
    min-width: 278px;
    height: 62px;
    font-size: 14px;
  }

  #scene2 {
    min-height: 100svh;
    padding: 92px 80px 136px;
  }
  #dual-panel {
    max-width: 2140px;
    gap: 54px;
    padding: 34px;
    border-radius: 24px;
  }
  #browser-frame {
    top: 96px;
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 940px;
  }
  .chat-message.user .chat-bubble,
  .chat-message.ai .chat-bubble {
    font-size: 18px;
    line-height: 1.72;
  }
  .chat-code {
    font-size: 14px;
  }
  .chat-timestamp {
    font-size: 13px;
  }

  #scene2-5 {
    padding: 180px 0 250px;
  }
  #crt-tv {
    width: 1420px;
  }
  #crt-shell {
    border-radius: 40px;
    padding: 38px 38px 30px;
  }
  #crt-screen {
    max-height: 760px;
  }
  .crt-channel {
    padding: 46px 54px;
  }
  .crt-channel-title {
    font-size: 32px;
  }
  .crt-channel-desc {
    font-size: 18px;
  }
  .crt-channel-desc.prompt-focus {
    font-size: 20px;
    padding: 12px 14px;
  }
  #crt-controls {
    gap: 26px;
    padding-top: 22px;
  }
  #crt-channel-display {
    font-size: 42px;
    min-width: 82px;
  }
  #crt-speaker-grille {
    height: 54px;
  }
  #crt-knob {
    width: 68px;
    height: 68px;
  }
  #crt-knob::after {
    height: 20px;
  }
  .crt-arcade-btn {
    width: 56px;
    height: 36px;
  }
  .crt-btn-arrow {
    font-size: 16px;
  }

  #scene3 {
    min-height: 100vh;
    padding: 120px 84px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #cta-heading {
    font-size: clamp(40px, 3.5vw, 66px);
    margin-bottom: 42px;
  }
  #cta-input-wrap {
    max-width: 1140px;
  }
  #cta-input {
    height: 72px;
    font-size: 14px;
  }
  #cta-submit {
    width: 48px;
    height: 48px;
  }
  .cta-chip {
    font-size: 15px;
    padding: 10px 22px;
  }
  #cta-logo img {
    width: min(520px, 20vw);
  }
  #terminal-footer {
    margin-top: auto;
  }
  #terminal-title {
    font-size: 14px;
  }
  #terminal-version {
    font-size: 13px;
  }
  #terminal-body {
    height: clamp(420px, 34svh, 520px);
    min-height: 360px;
    font-size: 17px;
    padding: 28px 32px;
  }
  #terminal-input,
  #terminal-prompt {
    font-size: 17px;
  }
  #terminal-status {
    font-size: 13px;
    padding: 12px 32px;
  }
  .terminal-cmd {
    font-size: 14px;
    margin-right: 22px;
  }
  #terminal-doc-title,
  #terminal-doc-close,
  #terminal-doc-content {
    font-size: 13px;
  }
}
@media (min-width: 3400px) and (min-height: 1800px) {
  #pixel-nav {
    right: 40px;
    gap: 30px;
  }

  #scene1-logo {
    font-size: clamp(96px, 5.8vw, 186px);
    letter-spacing: 10px;
  }
  #scene1-subtitle {
    font-size: 26px;
    letter-spacing: 6px;
  }
  #scene1-cta-btn {
    bottom: 160px;
    min-width: 320px;
    height: 72px;
    font-size: 16px;
  }
  #scene1-scroll-hint span {
    font-size: 14px;
  }
  #scene1-scroll-hint .arrow {
    width: 28px;
    height: 28px;
  }

  #scene2 {
    min-height: 100svh;
    padding: 116px 120px 160px;
  }
  #dual-panel {
    max-width: 2720px;
    gap: 72px;
    padding: 46px;
    border-radius: 30px;
  }
  #browser-frame {
    top: 124px;
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 1180px;
  }
  .chat-message.user .chat-bubble,
  .chat-message.ai .chat-bubble {
    font-size: 22px;
    line-height: 1.78;
  }
  .chat-code {
    font-size: 16px;
  }
  .chat-timestamp {
    font-size: 15px;
  }

  #scene2-5 {
    padding: 210px 0 290px;
  }
  #crt-tv {
    width: 1760px;
    max-width: 90vw;
  }
  #crt-shell {
    border-radius: 44px;
    padding: 44px 44px 34px;
  }
  #crt-screen {
    max-height: 920px;
  }
  .crt-channel {
    padding: 56px 62px;
  }
  .crt-channel-title {
    font-size: 40px;
  }
  .crt-channel-desc {
    font-size: 22px;
  }
  .crt-channel-desc.prompt-focus {
    font-size: 24px;
    padding: 14px 16px;
  }
  #crt-osd {
    font-size: 20px;
  }
  #crt-controls {
    gap: 30px;
    padding-top: 26px;
  }
  #crt-channel-display {
    font-size: 52px;
    min-width: 100px;
  }
  #crt-speaker-grille {
    height: 62px;
  }
  #crt-knob {
    width: 80px;
    height: 80px;
  }
  #crt-knob::after {
    height: 24px;
  }
  .crt-arcade-btn {
    width: 66px;
    height: 42px;
  }
  .crt-btn-arrow {
    font-size: 18px;
  }

  #scene3 {
    min-height: 100vh;
    padding: 150px 120px 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #cta-heading {
    font-size: clamp(50px, 3.8vw, 84px);
    margin-bottom: 56px;
  }
  #cta-input-wrap {
    max-width: 1500px;
    margin-bottom: 48px;
    padding: 18px;
  }
  #cta-input-label {
    font-size: 14px;
    margin-bottom: 14px;
  }
  #cta-input {
    height: 88px;
    font-size: 18px;
    padding: 0 90px 0 24px;
  }
  #cta-submit {
    width: 60px;
    height: 60px;
    right: 24px;
  }
  #cta-submit svg {
    width: 24px;
    height: 24px;
  }
  #cta-chips {
    gap: 16px;
    margin-bottom: 42px;
  }
  .cta-chip {
    font-size: 18px;
    padding: 12px 26px;
  }
  #cta-logo img {
    width: min(700px, 24vw);
  }
  #cta-slogan {
    font-size: 18px;
    letter-spacing: 3px;
  }
  #terminal-footer {
    margin-top: auto;
  }
  #terminal-title {
    font-size: 18px;
  }
  #terminal-version {
    font-size: 16px;
  }
  #terminal-body {
    height: clamp(540px, 35svh, 700px);
    min-height: 440px;
    font-size: 22px;
    padding: 34px 40px;
  }
  #terminal-input,
  #terminal-prompt {
    font-size: 22px;
  }
  #terminal-status {
    font-size: 15px;
    padding: 14px 40px;
  }
  .terminal-cmd {
    font-size: 18px;
    margin-right: 26px;
  }
  #terminal-doc-title,
  #terminal-doc-close,
  #terminal-doc-content {
    font-size: 16px;
  }
}
@media (max-width: 1280px) {
  #scene2 {
    min-height: 100svh;
    padding: 36px 20px 58px;
  }
  #chat-replay-btn {
    top: 10px;
    left: 10px;
    padding: 5px 9px;
    font-size: 10px;
  }
  #dual-panel {
    gap: 24px;
    padding: 16px;
    border-radius: 14px;
  }
  #browser-frame {
    flex: 0 0 62%;
    top: 48px;
  }
  #chat-panel {
    flex: 0 0 36%;
    max-width: 36%;
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 560px;
  }
  #scene3 {
    padding-top: 76px;
  }
  #cta-input-wrap {
    max-width: 700px;
  }
  #terminal-body {
    height: 210px;
  }
  #terminal-status {
    padding: 8px 14px;
  }
}
@media (max-width: 1024px) {
  #dual-panel {
    flex-direction: column;
    align-items: center;
  }
  #browser-frame {
    width: 100%;
    max-width: 680px;
    position: static;
  }
  #chat-panel {
    width: 100%;
    max-width: 680px;
  }
  #scene3 {
    padding: 50px 20px 30px;
  }
  #cta-input-wrap {
    max-width: 680px;
  }
  #terminal-status {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }
}
@media (max-width: 900px) {
  #scene1-stage {
    height: 100svh;
    min-height: 100svh;
  }
  #scene2 {
    display: none;
  }
  #scene2 {
    padding: 32px 14px 46px;
    min-height: 112vh;
  }
  #scene2-5 {
    padding: 76px 0 118px;
  }
  #crt-screen {
    min-height: 420px;
  }
  #pixel-nav .pixel-dot[data-section='1'] {
    display: none;
  }
  #dual-panel {
    padding: 12px;
    border-radius: 12px;
    gap: 14px;
  }
  #browser-titlebar {
    padding: 8px 10px;
  }
  #browser-url {
    font-size: 10px;
  }
  #scene3 {
    padding-top: 56px;
  }
  #cta-heading {
    letter-spacing: 2px;
  }
  #terminal-input-line {
    display: none;
  }
}
@media (max-width: 640px) {
  #scene2 {
    padding: 40px 12px;
  }
  #scene2-5 {
    padding: 88px 0 112px;
  }
  #dual-panel {
    padding: 12px;
    border-radius: 12px;
  }
  #chat-panel {
    max-height: 74vh;
    overflow-y: auto;
    padding-right: 4px;
  }
  .chat-message {
    margin-bottom: 12px;
  }
  .chat-bubble {
    max-width: 96%;
    padding: 8px 10px;
  }
  .chat-message.user .chat-bubble,
  .chat-message.ai .chat-bubble {
    font-size: 12px;
    line-height: 1.45;
  }
  .chat-code {
    font-size: 10px;
    padding: 8px;
  }
  .chat-timestamp {
    font-size: 9px;
    margin-top: 4px;
  }
  #scene3 {
    padding: 40px 16px 30px;
  }
  #terminal-footer {
    border-radius: 8px;
  }
  #loading-title {
    font-size: 10px;
  }
  #cta-heading {
    font-size: clamp(20px, 7vw, 30px);
    margin-bottom: 20px;
  }
  #cta-input-wrap {
    margin-bottom: 18px;
    padding: 10px;
  }
  #cta-input-label {
    font-size: 9px;
    margin-bottom: 8px;
  }
  #cta-input {
    height: 48px;
    font-size: 16px;
    padding: 0 56px 0 10px;
    letter-spacing: 0.3px;
  }
  #cta-submit {
    width: 32px;
    height: 32px;
    right: 14px;
    top: calc(50% + 9px);
  }
  #cta-submit svg {
    width: 13px;
    height: 13px;
  }
  #cta-chips {
    margin-bottom: 20px;
    gap: 8px;
  }
  .cta-chip {
    font-size: 10px;
    padding: 6px 12px;
  }
  #terminal-body {
    height: 190px;
    padding: 14px 12px;
  }
  #terminal-input-line {
    gap: 6px;
  }
  #terminal-prompt,
  #terminal-input {
    font-size: 16px;
  }
  #terminal-doc-viewer {
    inset: 38px 8px 40px;
  }
  #terminal-doc-title,
  #terminal-doc-close,
  #terminal-doc-content {
    font-size: 10px;
  }
  #terminal-commands {
    margin-bottom: 8px;
  }
}
@media (max-width: 480px) {
  #locale-switcher {
    top: 12px;
    right: 12px;
  }
  #locale-switcher button {
    min-width: 32px;
    height: 26px;
    font-size: 10px;
  }
  #scene1-logo {
    font-size: clamp(28px, 11vw, 44px);
    letter-spacing: 2px;
  }
  #scene1-subtitle {
    font-size: 11px;
    letter-spacing: 2px;
  }
  #scene1-cta-btn {
    bottom: 90px;
    min-width: 146px;
    height: 36px;
    font-size: 8px;
    letter-spacing: 0.8px;
  }
  #scene1-scroll-hint {
    bottom: 22px;
  }
  #scene2 {
    padding: 24px 8px 34px;
  }
  #scene2-5 {
    padding: 92px 0 110px;
  }
  #chat-replay-btn {
    top: 8px;
    left: 8px;
    font-size: 9px;
    opacity: 0.72;
  }
  #dual-panel {
    padding: 8px;
    border-radius: 10px;
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 460px;
  }
  #chat-panel {
    max-height: 70vh;
  }
  .chat-message {
    margin-bottom: 10px;
  }
  .chat-bubble {
    padding: 7px 9px;
  }
  .chat-message.user .chat-bubble,
  .chat-message.ai .chat-bubble {
    font-size: 11px;
    line-height: 1.4;
  }
  #crt-screen {
    min-height: 430px;
  }
  .crt-channel-preview {
    min-height: 250px;
    max-height: 390px;
  }
  .crt-channel[data-channel='0'] .crt-preview-media iframe {
    width: 136%;
    height: 500px;
    min-height: 0;
    transform: scale(0.72);
    transform-origin: top left;
  }
  .crt-channel[data-channel='0'] .crt-preview-media {
    height: 360px;
    overflow: hidden;
  }
  .crt-channel[data-channel='0'] .crt-channel-preview {
    max-height: 360px;
  }
  .crt-channel[data-channel='1'] .crt-preview-media iframe {
    min-height: 330px;
  }
  .crt-channel[data-channel='2'] .crt-preview-media {
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
    padding: 5px !important;
  }
  .crt-channel[data-channel='2'] .crt-preview-media img {
    max-height: 95px;
  }
  #crt-controls {
    grid-template-columns: auto minmax(28px, 1fr) auto;
    gap: 6px;
  }
  #crt-channel-display {
    min-width: 42px;
    font-size: 18px;
    letter-spacing: 2px;
    padding: 3px 6px;
  }
  #crt-speaker-grille {
    height: 22px;
  }
  #crt-knob {
    display: none;
  }
  .crt-arcade-btn {
    width: 30px;
    height: 22px;
  }
  #scene3 {
    padding: 42px 10px 30px;
  }
  #cta-heading {
    font-size: clamp(18px, 8vw, 24px);
    letter-spacing: 1px;
    margin-bottom: 16px;
  }
  #cta-input-wrap {
    padding: 8px;
    max-width: none;
  }
  #cta-input-label {
    font-size: 8px;
  }
  #cta-input {
    font-size: 16px;
    height: 44px;
  }
  #cta-chips {
    margin-bottom: 14px;
    gap: 6px;
  }
  .cta-chip {
    font-size: 9px;
    padding: 5px 10px;
  }
  #cta-logo img {
    width: min(180px, 64vw);
  }
  #terminal-titlebar {
    padding: 8px 10px;
  }
  #terminal-body {
    height: 170px;
    padding: 12px 10px;
  }
  #terminal-status {
    font-size: 8px;
    padding: 6px 10px;
    letter-spacing: 0.2px;
  }
  #shortcut-hint {
    display: none;
  }
}

/* ===== PRESENTATION-GRADE SLIDE FIT ===== */
html,
body {
  overflow: hidden !important;
}
#scene2 {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding-left: clamp(18px, 3vw, 56px) !important;
  padding-right: clamp(18px, 3vw, 56px) !important;
}
#scene2,
#scene2-5,
#scene3 {
  height: 100svh !important;
  min-height: 100svh !important;
  max-height: 100svh !important;
}
#dual-panel,
#terminal-output,
#terminal-doc-content,
#chat-panel {
  overscroll-behavior: contain;
}
#dual-panel {
  width: min(92vw, 1760px);
  max-width: min(92vw, 1760px);
}
#dual-panel.prebuild,
#dual-panel.preview-open {
  width: min(92vw, 1760px);
  max-width: min(92vw, 1760px);
}

@media (min-width: 1600px) {
  #dual-panel,
  #dual-panel.prebuild,
  #dual-panel.preview-open {
    width: min(92vw, 1840px);
    max-width: min(92vw, 1840px);
  }
}

@media (max-width: 900px) {
  #scene2 {
    padding: 76px 12px 24px !important;
  }
  #dual-panel {
    width: min(680px, calc(100vw - 24px));
    height: calc(100svh - 112px);
    max-height: calc(100svh - 112px);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
  }
  #browser-frame,
  #dual-panel.prebuild #browser-frame,
  #dual-panel.preview-opening #browser-frame,
  #dual-panel.preview-open #browser-frame,
  #dual-panel.webview-ready #browser-frame {
    display: block;
    position: static;
    width: 100%;
    max-width: none;
    flex: 0 0 clamp(150px, 34svh, 360px) !important;
    min-height: 0;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    border-color: var(--hairline);
  }
  #browser-content,
  #mini-webview-wrap,
  #mini-webview {
    min-height: 0 !important;
    height: 100%;
  }
  #dual-panel.prebuild #mini-webview-wrap,
  #dual-panel.prebuild #mini-webview,
  #dual-panel.preview-opening #mini-webview-wrap,
  #dual-panel.preview-open #mini-webview-wrap,
  #dual-panel.webview-ready #mini-webview-wrap,
  #dual-panel.preview-opening #mini-webview,
  #dual-panel.preview-open #mini-webview,
  #dual-panel.webview-ready #mini-webview {
    opacity: 1 !important;
    transform: none !important;
  }
  #chat-panel {
    flex: 1 1 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
  }
  #dual-panel.prebuild #chat-panel,
  #dual-panel.preview-open #chat-panel,
  #dual-panel.webview-ready #chat-panel {
    flex: 1 1 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    transform: none;
  }
  .chat-message {
    margin-bottom: 12px;
  }
  .chat-bubble {
    max-width: 98%;
  }
}

@media (max-width: 640px) {
  #scene2 {
    padding: 68px 10px 20px !important;
  }
  #dual-panel {
    width: calc(100vw - 20px);
    height: calc(100svh - 88px);
    max-height: calc(100svh - 88px);
  }
  #dual-panel.preview-open #browser-frame,
  #dual-panel.webview-ready #browser-frame {
    flex-basis: clamp(140px, 30svh, 300px) !important;
  }
  #scene2-5 {
    padding: 48px 0 12px !important;
    justify-content: center;
  }
  #crt-tv {
    width: min(600px, 96vw);
  }
  #crt-shell {
    padding: 12px 12px 10px;
    border-radius: 20px;
  }
  #crt-screen {
    min-height: 0 !important;
    height: min(520px, calc(100svh - 144px));
    max-height: none !important;
    aspect-ratio: auto;
  }
  #scene3 {
    padding: 62px 12px 16px !important;
    justify-content: flex-start;
  }
  #cta-heading {
    margin-bottom: 12px;
  }
  #cta-input-wrap {
    margin-bottom: 12px;
  }
  #cta-chips {
    margin-bottom: 12px;
  }
  #terminal-footer {
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  #scene2 {
    padding: 64px 8px 16px !important;
  }
  #dual-panel {
    width: calc(100vw - 16px);
    height: calc(100svh - 80px);
    max-height: calc(100svh - 80px);
  }
  #dual-panel.preview-open #browser-frame,
  #dual-panel.webview-ready #browser-frame {
    flex-basis: clamp(124px, 28svh, 220px) !important;
  }
  #chat-replay-btn {
    top: 6px;
    left: 6px;
  }
  .chat-message {
    margin-bottom: 9px;
  }
  .chat-bubble {
    padding: 7px 9px;
  }
  #scene2-5 {
    padding: 42px 0 10px !important;
    justify-content: center;
  }
  #crt-tv {
    width: min(430px, 96vw);
  }
  #crt-shell {
    padding: 9px 9px 8px;
    border-radius: 17px;
  }
  #crt-label {
    font-size: 8px;
    top: 7px;
  }
  #crt-screen {
    height: min(500px, calc(100svh - 142px));
  }
  #crt-controls {
    padding: 8px 3px 2px;
  }
  #crt-channel-display {
    min-width: 38px;
    font-size: 16px;
    padding: 3px 5px;
  }
  #crt-speaker-grille {
    height: 18px;
  }
  .crt-arcade-btn {
    width: 28px;
    height: 20px;
  }
  #scene3 {
    padding: 58px 8px 10px !important;
  }
  #cta-heading {
    font-size: clamp(16px, 6.4vw, 22px);
    line-height: 1.25;
    margin-bottom: 8px;
  }
  #cta-input-wrap {
    margin-bottom: 8px;
    padding: 7px;
  }
  #cta-input-label {
    margin-bottom: 6px;
  }
  #cta-input {
    height: 38px;
    font-size: 14px;
  }
  #cta-submit {
    top: calc(50% + 8px);
  }
  #cta-chips {
    gap: 5px;
    margin-bottom: 8px;
    max-height: 54px;
    overflow: hidden;
  }
  .cta-chip {
    padding: 5px 8px;
    font-size: 9px;
  }
  #cta-logo img {
    width: min(136px, 52vw);
  }
  #cta-slogan {
    font-size: 9px;
  }
  #terminal-footer {
    margin-top: 8px;
  }
  #terminal-titlebar {
    padding: 7px 8px;
  }
  #terminal-body {
    height: 130px !important;
    min-height: 130px !important;
    padding: 9px 8px;
  }
  #terminal-commands {
    margin-bottom: 6px;
  }
  .terminal-cmd {
    font-size: 9px;
    margin-right: 8px;
  }
  #terminal-output {
    min-height: 0;
    margin-bottom: 6px;
  }
  #terminal-status {
    font-size: 7px;
    padding: 5px 8px;
  }
}

@media (max-width: 360px) {
  #scene2-5 {
    padding-top: 38px !important;
    justify-content: center;
  }
  #crt-tv {
    width: 96vw;
  }
  #crt-screen {
    height: min(470px, calc(100svh - 136px));
  }
  #scene3 {
    padding-top: 52px !important;
  }
  #cta-chips .cta-chip:nth-child(n + 4) {
    display: none;
  }
  #terminal-body {
    height: 116px !important;
    min-height: 116px !important;
  }
}

/* Mobile keeps the deck concise: hero, TV, terminal. */
@media (max-width: 900px) {
  #scene2 {
    display: none !important;
  }
  #scene2-5 {
    --crt-fit-scale: 1;
  }
  .crt-channel {
    min-height: 0;
  }
  .crt-channel-desc,
  .crt-channel-desc.prompt-focus {
    flex: 0 0 auto;
  }
  .crt-channel-preview {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
  }
  .crt-preview-media,
  .crt-channel[data-channel='0'] .crt-preview-media,
  .crt-channel[data-channel='1'] .crt-preview-media {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  .crt-preview-media iframe,
  .crt-channel[data-channel='0'] .crt-preview-media iframe,
  .crt-channel[data-channel='1'] .crt-preview-media iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    transform: none !important;
    transform-origin: center center !important;
  }
  #scene3 {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center !important;
    padding: clamp(18px, 4svh, 44px) 10px !important;
  }
  #scene3 > * {
    flex: 0 0 auto;
  }
  #cta-input-wrap,
  #cta-chips,
  #terminal-footer {
    width: min(760px, calc(100vw - 20px));
  }
  #terminal-footer {
    margin-top: clamp(10px, 2svh, 18px) !important;
  }
}

@media (max-width: 900px) {
  .crt-channel[data-channel='0'] .crt-channel-preview {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .crt-channel[data-channel='0'] .crt-preview-media {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
  }
  .crt-channel[data-channel='0'] .crt-preview-media iframe {
    display: none !important;
  }
  .crt-channel[data-channel='0'] .ppt-inline-preview {
    display: block !important;
    min-height: calc(100% + 1px);
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
  }
  .ppt-inline-preview .ppt-slide {
    min-height: clamp(160px, 48svh, 240px);
    padding: 14px;
  }
  .ppt-inline-preview .ppt-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ppt-inline-preview .ppt-tile {
    min-height: 74px;
    padding: 10px;
  }
  .ppt-inline-preview .ppt-tile span {
    font-size: 13px;
  }
  .ppt-inline-preview .ppt-bars {
    gap: 8px;
    margin-top: 18px;
  }
  .ppt-inline-preview .ppt-bar {
    height: 22px;
  }
  #cta-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-height: none !important;
    -webkit-overflow-scrolling: touch;
  }
  #cta-chips .cta-chip {
    display: inline-flex !important;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  #scene3 {
    padding: 18px 8px !important;
  }
  #terminal-body {
    height: clamp(180px, 30svh, 260px) !important;
    min-height: clamp(180px, 30svh, 260px) !important;
  }
}

@media (max-width: 360px) {
  #scene3 {
    padding: 14px 8px !important;
  }
  #terminal-body {
    height: clamp(156px, 28svh, 220px) !important;
    min-height: clamp(156px, 28svh, 220px) !important;
  }
}

/* Mobile terminal slide: keep the final action calm and breathable. */
@media (max-width: 900px) and (min-height: 640px) {
  #scene3 {
    --scene3-inline: clamp(16px, 5vw, 34px);
    justify-content: center !important;
    padding: clamp(18px, 3.6svh, 44px) var(--scene3-inline) !important;
  }
  #cta-heading {
    font-size: clamp(21px, 5.8vw, 34px) !important;
    line-height: 1.2 !important;
    letter-spacing: clamp(1px, 0.45vw, 2px) !important;
    margin-bottom: clamp(14px, 2.2svh, 22px) !important;
  }
  #cta-input-wrap,
  #cta-chips,
  #terminal-footer {
    width: min(680px, calc(100vw - (var(--scene3-inline) * 2))) !important;
  }
  #cta-input-wrap {
    margin-bottom: clamp(12px, 1.9svh, 18px) !important;
    padding: clamp(8px, 1.7vw, 12px) !important;
  }
  #cta-input-label {
    margin-bottom: clamp(6px, 1svh, 9px) !important;
  }
  #cta-input {
    height: clamp(42px, 5.8svh, 54px) !important;
    font-size: clamp(12px, 3.4vw, 16px) !important;
    padding-right: clamp(48px, 10vw, 62px) !important;
  }
  #cta-submit {
    width: clamp(30px, 7vw, 38px) !important;
    height: clamp(30px, 7vw, 38px) !important;
    right: clamp(12px, 2.6vw, 18px) !important;
  }
  #cta-chips {
    max-height: clamp(32px, 5.2svh, 44px);
    overflow: hidden;
    gap: clamp(6px, 1.4vw, 9px) !important;
    margin-bottom: clamp(12px, 2svh, 20px) !important;
  }
  .cta-chip {
    padding: clamp(5px, 1.3vw, 7px) clamp(10px, 2.4vw, 14px) !important;
    font-size: clamp(9px, 2.5vw, 11px) !important;
  }
  #cta-chips .cta-chip:nth-child(n + 5),
  #cta-logo,
  #cta-slogan {
    display: none !important;
  }
  #terminal-footer {
    margin-top: clamp(8px, 1.4svh, 14px) !important;
    margin-bottom: 0 !important;
  }
  #terminal-titlebar {
    padding: clamp(7px, 1.5svh, 10px) clamp(9px, 2.4vw, 14px) !important;
  }
  #terminal-body {
    height: clamp(260px, 38svh, 380px) !important;
    min-height: 0 !important;
    padding: clamp(10px, 2vw, 14px) clamp(10px, 2.4vw, 16px) !important;
  }
  #terminal-commands {
    margin-bottom: clamp(6px, 1.2svh, 10px) !important;
  }
  .terminal-cmd {
    margin-right: clamp(10px, 3vw, 18px) !important;
  }
}

@media (max-width: 480px) and (min-height: 640px) {
  #scene3 {
    --scene3-inline: clamp(14px, 4.2vw, 18px);
    padding-top: clamp(20px, 3.8svh, 34px) !important;
    padding-bottom: clamp(18px, 3svh, 30px) !important;
  }
  #cta-heading {
    font-size: clamp(20px, 6.2vw, 25px) !important;
  }
  #cta-chips .cta-chip:nth-child(n + 4) {
    display: none !important;
  }
  #terminal-body {
    height: clamp(250px, 37svh, 350px) !important;
  }
}

@media (max-width: 900px) and (min-height: 521px) and (max-height: 639px) {
  #scene3 {
    --scene3-inline: clamp(12px, 4.5vw, 20px);
    justify-content: center !important;
    padding: clamp(12px, 2.5svh, 20px) var(--scene3-inline) !important;
  }
  #cta-heading {
    font-size: clamp(18px, 6vw, 24px) !important;
    line-height: 1.2 !important;
    margin-bottom: 10px !important;
  }
  #cta-input-wrap,
  #terminal-footer {
    width: min(640px, calc(100vw - (var(--scene3-inline) * 2))) !important;
  }
  #cta-input-wrap {
    margin-bottom: 14px !important;
    padding: 7px !important;
  }
  #cta-input {
    height: 38px !important;
    font-size: 13px !important;
  }
  #cta-logo,
  #cta-slogan {
    display: none !important;
  }
  #cta-chips {
    width: min(640px, calc(100vw - (var(--scene3-inline) * 2))) !important;
    display: flex !important;
    max-height: 34px !important;
    overflow: hidden !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
  }
  #cta-chips .cta-chip:nth-child(n + 4) {
    display: none !important;
  }
  #terminal-footer {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
  }
  #terminal-body {
    height: clamp(170px, 31svh, 220px) !important;
    min-height: 0 !important;
    padding: 9px 10px !important;
  }
}

/* Short mobile landscape has a different constraint: height, not width. */
@media (max-height: 520px) and (max-width: 1100px) {
  #scene2 {
    display: none !important;
  }
  #scene2-5 {
    padding: 8px 0 !important;
    justify-content: center !important;
  }
  #crt-tv {
    width: min(780px, calc(100vw - 44px)) !important;
    max-width: calc(100vw - 44px) !important;
  }
  #crt-shell {
    padding: 8px 10px 7px !important;
    border-radius: 16px !important;
  }
  #crt-shell::after {
    right: 18px;
    bottom: 42px;
    font-size: 5px;
    letter-spacing: 1.5px;
  }
  #crt-label {
    font-size: 7px !important;
    letter-spacing: 3px !important;
    margin-bottom: 4px !important;
  }
  #crt-bezel {
    padding: 7px !important;
    border-radius: 10px !important;
  }
  #crt-screen {
    height: min(286px, calc(100svh - 76px)) !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
  }
  .crt-channel {
    display: grid !important;
    grid-template-columns: minmax(160px, 32%) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: stretch;
    column-gap: clamp(8px, 2vw, 14px);
    padding: 10px 12px !important;
  }
  .crt-channel-icon {
    grid-column: 1;
    margin-bottom: 5px !important;
    font-size: 8px !important;
  }
  .crt-channel-title {
    grid-column: 1;
    margin-bottom: 6px !important;
    font-size: clamp(13px, 3.4svh, 16px) !important;
    line-height: 1.15;
  }
  .crt-channel-desc,
  .crt-channel-desc.prompt-focus {
    grid-column: 1;
    max-width: 100% !important;
    font-size: clamp(9px, 2.8svh, 12px) !important;
    line-height: 1.35 !important;
  }
  .crt-channel-desc.prompt-focus {
    padding: 5px 6px !important;
  }
  .crt-channel-preview {
    position: relative !important;
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: stretch;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-top: 0 !important;
  }
  #crt-controls {
    display: grid;
    grid-template-columns: auto minmax(42px, 1fr) auto !important;
    gap: 6px !important;
    padding: 6px 2px 1px !important;
  }
  #crt-channel-display {
    min-width: 38px !important;
    padding: 2px 6px !important;
    font-size: clamp(14px, 3.6svh, 20px) !important;
    letter-spacing: 2px !important;
  }
  #crt-speaker-grille {
    height: 16px !important;
  }
  #crt-knob,
  #crt-knob-wrap {
    display: none !important;
  }
  #crt-channel-btns {
    gap: 5px !important;
  }
  .crt-arcade-btn {
    width: 28px !important;
    height: 18px !important;
  }
  .crt-btn-arrow {
    font-size: 9px !important;
  }
  #scene3 {
    justify-content: center !important;
    padding: 10px 12px !important;
  }
  #cta-heading {
    font-size: clamp(15px, 6svh, 24px) !important;
    line-height: 1.2 !important;
    margin-bottom: 8px !important;
  }
  #cta-input-wrap {
    width: min(680px, calc(100vw - 24px)) !important;
    margin-bottom: 8px !important;
    padding: 7px !important;
  }
  #cta-input-label {
    margin-bottom: 5px !important;
  }
  #cta-input {
    height: 36px !important;
    font-size: 14px !important;
  }
  #cta-submit {
    width: 30px !important;
    height: 30px !important;
    right: 12px !important;
    top: calc(50% + 8px) !important;
  }
  #cta-chips {
    width: min(680px, calc(100vw - 24px)) !important;
    max-height: 34px;
    overflow: hidden;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }
  .cta-chip {
    padding: 5px 8px !important;
    font-size: 9px !important;
  }
  #cta-logo img {
    width: min(130px, 22vw) !important;
  }
  #cta-slogan {
    font-size: 8px !important;
    margin-top: 5px !important;
  }
  #terminal-footer {
    width: min(720px, calc(100vw - 24px)) !important;
    margin-top: 8px !important;
  }
  #terminal-titlebar {
    padding: 6px 8px !important;
  }
  #terminal-body {
    height: clamp(82px, 24svh, 118px) !important;
    min-height: clamp(82px, 24svh, 118px) !important;
    padding: 8px !important;
  }
}

@media (max-height: 520px) and (max-width: 1100px) and (min-width: 520px) {
  #scene3 {
    display: grid !important;
    grid-template-columns: minmax(220px, 0.88fr) minmax(270px, 1.12fr);
    grid-template-rows: auto auto auto;
    align-items: center;
    align-content: center;
    justify-items: stretch;
    column-gap: clamp(10px, 2.5vw, 22px);
    row-gap: 7px;
    padding: 10px 16px !important;
  }
  #cta-heading,
  #cta-input-wrap,
  #cta-chips {
    grid-column: 1;
    width: 100% !important;
    max-width: none !important;
  }
  #cta-heading {
    text-align: left;
    margin-bottom: 0 !important;
  }
  #cta-input-wrap,
  #cta-chips {
    margin-bottom: 0 !important;
  }
  #cta-logo,
  #cta-slogan {
    display: none !important;
  }
  #terminal-footer {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }
  #terminal-body {
    height: clamp(78px, 23svh, 108px) !important;
    min-height: clamp(78px, 23svh, 108px) !important;
  }
}

@media (min-width: 901px) and (max-width: 1100px) and (min-height: 521px) and (max-height: 820px) {
  #scene3 {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center !important;
    padding: 24px 20px !important;
  }
  #cta-heading {
    margin-bottom: 14px !important;
  }
  #cta-input-wrap,
  #cta-chips {
    margin-bottom: 12px !important;
  }
  #terminal-footer {
    margin-top: 10px !important;
  }
  #terminal-body {
    height: 174px !important;
    min-height: 174px !important;
  }
}

@media (max-width: 900px) {
  #scene3 #cta-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-height: none !important;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #scene3 #cta-chips::-webkit-scrollbar {
    display: none;
  }
  #scene3 #cta-chips .cta-chip {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
  #scene3 #cta-input-wrap {
    margin-bottom: clamp(10px, 1.8svh, 18px) !important;
  }
}

/* ===== GLOBAL ACHIEVEMENT TOAST ===== */
#global-achievement-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid rgba(0, 255, 65, 0.5);
  background: rgba(6, 12, 8, 0.96);
  box-shadow:
    0 0 18px rgba(0, 255, 65, 0.24),
    inset 0 0 12px rgba(0, 255, 65, 0.06);
  padding: 12px;
  z-index: 12000;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
  pointer-events: none;
}
#global-achievement-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#global-achievement-toast .ga-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 1px solid rgba(0, 255, 65, 0.38);
  background: rgba(4, 8, 5, 0.9);
  color: rgba(193, 255, 188, 0.92);
  width: 22px;
  height: 22px;
  line-height: 18px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}
#global-achievement-toast .ga-close:hover {
  border-color: rgba(0, 255, 65, 0.75);
  color: #ffffff;
}
#global-achievement-toast .ga-head {
  font-family: var(--font-pixel-cjk);
  font-size: 11px;
  color: var(--neon);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-right: 28px;
}
#global-achievement-toast .ga-body {
  font-family: var(--font-mono);
  color: #d2f9d1;
  font-size: 12px;
  line-height: 1.55;
}
#global-achievement-toast .ga-line {
  margin-bottom: 5px;
}
#global-achievement-toast .ga-line-desc {
  color: rgba(210, 249, 209, 0.86);
  font-size: 11px;
}
#global-achievement-toast .ga-line-reward {
  color: #7bf9ff;
  margin-top: -1px;
}
#global-achievement-toast .ga-foot {
  margin-top: 8px;
}
#global-achievement-toast .ga-points {
  font-family: var(--font-mono);
  color: #7bf9ff;
  font-size: 11px;
}
#global-achievement-toast .ga-contact {
  margin-top: 4px;
  color: rgba(123, 249, 255, 0.85);
  font-size: 11px;
}
#global-achievement-toast .ga-proof {
  margin-top: 4px;
  color: rgba(173, 255, 173, 0.92);
  font-size: 10px;
  font-family: var(--font-mono);
}
#global-achievement-toast .ga-qr {
  margin-top: 8px;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(0, 255, 65, 0.45);
  background: #050b07;
  image-rendering: pixelated;
}

@media (max-width: 900px) {
  #cta-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-height: none !important;
    scrollbar-width: none;
  }
  #cta-chips::-webkit-scrollbar {
    display: none;
  }
  #cta-chips .cta-chip,
  #cta-chips .cta-chip:nth-child(n) {
    display: inline-flex !important;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Final CTA slide sizing: keep the composition centered, let terminal use the spare depth. */
@media (min-width: 901px) and (min-height: 521px) {
  #scene3 {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start !important;
    box-sizing: border-box;
    overflow: hidden;
    padding: clamp(48px, 6svh, 92px) clamp(18px, 3vw, 56px) clamp(28px, 3.5svh, 64px) !important;
  }
  #cta-input-wrap {
    align-self: stretch;
    width: 100% !important;
    max-width: min(1120px, calc(100vw - 96px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  #terminal-footer {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    display: flex !important;
    flex: 1 1 0 !important;
    flex-direction: column;
    margin-top: clamp(22px, 2.8svh, 42px) !important;
  }
  #terminal-titlebar,
  #terminal-status {
    flex: 0 0 auto;
  }
  #terminal-body {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0 !important;
    padding: clamp(16px, 1.45vw, 28px) clamp(18px, 1.7vw, 32px) !important;
  }
  #terminal-output {
    min-height: 0 !important;
  }
  #terminal-status {
    min-height: clamp(34px, 3.4svh, 48px);
    align-items: center;
    gap: 16px;
    overflow: visible;
  }
}

@media (min-width: 901px) and (min-height: 521px) and (max-height: 900px) {
  #scene3 {
    padding-top: clamp(34px, 5svh, 58px) !important;
    padding-bottom: clamp(22px, 3svh, 36px) !important;
  }
  #terminal-body {
    padding: 12px 14px !important;
  }
}

@media (min-width: 901px) and (min-height: 950px) {
  #terminal-footer {
    margin-top: clamp(26px, 3svh, 48px) !important;
  }
}
