/* MoVerse project page — main layout */

/* Google Fonts removed — was causing 75s load time.
   Use local JetBrains Mono if installed, otherwise fall back to system monospace. */

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

html {
  /* Background lives on <html> so the fixed canvas can sit on top of it
     and underneath the (transparent) <body> content. */
  background: var(--bg);
}

body {
  background: transparent;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#code-rain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  opacity: 0.14;
  pointer-events: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-dim);
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
a:hover { color: var(--fg); border-bottom-color: var(--accent); }

::selection { background: var(--accent); color: var(--bg); }

/* ============================================================
   Layout primitives
   ============================================================ */

main { display: block; }

.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--gap-lg) var(--gap-md);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-lg);
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--border);
}
.section-head .prompt { color: var(--accent); font-weight: 500; }
.section-head .title  { color: var(--fg); font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0.05em; }
.section-head .meta   { margin-left: auto; color: var(--fg-dim); font-size: 0.85rem; }

.intro {
  color: var(--fg-mute);
  max-width: 800px;
  margin-bottom: var(--gap-lg);
  font-size: 0.98rem;
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--gap-lg) var(--gap-md);
}

.hero-inner {
  max-width: var(--content-max);
  width: 100%;
  text-align: center;
}

.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
  margin-bottom: var(--gap-sm);
}

.hero-logo {
  height: clamp(10rem, 28vw, 10rem);  /* scales proportionally with the title */
  width: auto;
  display: block;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6.5rem);
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
  margin-bottom: 0;
  position: relative;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  color: var(--fg);
  margin-bottom: var(--gap-lg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-team {
  font-family: 'Silkscreen', 'Press Start 2P', 'Courier New', monospace;
  font-size: 1.10rem;
  color: var(--accent);
  margin-bottom: var(--gap-md);
  letter-spacing: 0.05em;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.hero-authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  font-family: 'Silkscreen', 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: var(--gap-lg);
  letter-spacing: 0.02em;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.hero-authors a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--fg);
}

.hero-tldr {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--accent);
  /* letter-spacing: 0.05em; */
  text-transform: uppercase;
  margin-bottom: var(--gap-lg);
}
/* .hero-tldr-label {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.5em;
} */

.hero-tagline {
  font-family: var(--font-mono);
  color: var(--fg-mute);
  font-size: 0.95rem;
  margin-bottom: var(--gap-lg);
  padding: var(--gap-sm) var(--gap-md);
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--bg-code);
  border-radius: var(--radius-sm);
}
.hero-tagline .prompt { color: var(--accent); }
.hero-tagline .cursor {
  display: inline-block;
  width: 0.5em;
  background: var(--accent);
  animation: blink 1s steps(2) infinite;
  margin-left: 2px;
  height: 1em;
  vertical-align: middle;
}

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

/* Hero terminal window */
.hv-terminal {
  max-width: 640px;
  margin: 0 auto var(--gap-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: left;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.hv-terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0,255,65,0.04);
  border-bottom: 1px solid var(--border);
}
.hv-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.hv-terminal-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.hv-terminal-body {
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
}
.hv-line {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.hv-prompt {
  color: var(--accent);
  font-weight: 600;
}
.hv-cmd {
  color: var(--fg);
}
.hv-output {
  padding-left: 18px;
  border-left: 2px solid var(--border);
}
.hv-step {
  color: var(--fg);
  padding: 2px 0;
}
.hv-step.dim {
  color: var(--fg-dim);
}
.hv-step.active .spinner {
  display: inline-block;
  color: var(--accent);
  animation: spin 1s linear infinite;
  margin-right: 6px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-links {
  display: flex;
  gap: var(--gap-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--gap-lg);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  padding: 10px 18px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border-radius: var(--radius-sm);
  border-bottom-style: solid;
}
.btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent);
  color: var(--fg);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Terminal-window frame for hero video */
.terminal {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  border: 1px solid var(--border-hi);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(0,255,65,0.05);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  padding: 8px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--fg-dim);
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.terminal-dots .red    { background: #ff5f57; }
.terminal-dots .yellow { background: #febc2e; }
.terminal-dots .green  { background: #28c840; }
.terminal-title { margin-left: var(--gap-sm); font-family: var(--font-mono); }

.terminal-body {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.terminal-body video,
.terminal-body .video-placeholder {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================================
   Placeholder (when video file not yet present)
   ============================================================ */

.video-placeholder {
  /* Overlay the video element so there is exactly ONE visible cell */
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  background:
    linear-gradient(transparent 50%, rgba(0, 255, 65, 0.03) 50%),
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0,255,65,0.05) 2px 4px);
  background-size: 100% 4px, 4px 100%;
  pointer-events: none;
}
.video-placeholder::before {
  content: '> LOADING...';
  border: 1px solid var(--accent-dim);
  padding: 6px 14px;
  background: var(--bg-code);
  border-radius: var(--radius-sm);
}
.video-placeholder::after {
  /* moving scanline */
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.4;
  animation: scan 4s linear infinite;
  box-shadow: 0 0 8px var(--accent);
}
@keyframes scan {
  0%   { top: 0;    opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.4; }
  100% { top: 100%; opacity: 0; }
}

/* ============================================================
   Switch Console Frame — Premium Depth
   iOS-inspired: gradient fills, multi-layer shadows,
   metallic stick caps, tactile raised buttons.
   ============================================================ */

.switch-console {
  display: flex;
  align-items: stretch;
  justify-content: center;
  max-width: 880px;
  margin: 0 auto;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}

/* ---- Joy-Con ---- */
.joycon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 18%;
  min-width: 120px;
  padding: 32px 16px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(0,255,65,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,65,0.03) 1px, transparent 1px),
    linear-gradient(165deg, #111a11 0%, #0a120a 35%, #060a06 70%, #040804 100%);
  background-size: 14px 14px, 14px 14px, 100% 100%;
  border: 1.5px solid rgba(0,255,65,0.25);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.6),
    0 4px 12px rgba(0,0,0,0.4),
    0 16px 48px rgba(0,0,0,0.35),
    0 0 12px rgba(0,255,65,0.06),
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -1px 0 rgba(0,0,0,0.3);
}

.joycon-left {
  border-radius: 40px 0 0 40px;
  border-right: none;
}
.joycon-right {
  border-radius: 0 40px 40px 0;
  border-left: none;
}

.joycon > * {
  position: relative;
  z-index: 1;
}

/* ---- Analog stick — metallic cap with depth ---- */
.jc-stick {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  border: 2px solid rgba(0,255,65,0.25);
  background: radial-gradient(circle at 38% 32%, #1a2e1a, #0a140a 60%, #060a06 100%);
  box-shadow:
    0 3px 8px rgba(0,0,0,0.6),
    0 0 15px rgba(0,255,65,0.08),
    inset 0 2px 3px rgba(255,255,255,0.06),
    inset 0 -2px 4px rgba(0,0,0,0.5);
}
/* Crosshair — horizontal */
.jc-stick::before {
  content: '';
  position: absolute;
  top: 50%; left: 12%; right: 12%;
  height: 1px;
  transform: translateY(-0.5px);
  background: rgba(0,255,65,0.12);
}
/* Inner cap */
.jc-stick::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 36px; height: 36px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #1e321e, #0c180c 70%);
  border: 1.5px solid rgba(0,255,65,0.25);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.05),
    inset 0 -1px 2px rgba(0,0,0,0.4);
}

/* ---- D-pad — neon double-outline cross ---- */
.jc-dpad {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  filter: none;
}

/* Layered cross shapes: each .dpad-plus draws a rounded cross
   via ::before (vertical) and ::after (horizontal).
   Layers alternate green/black to produce the double outline. */
.dpad-plus,
.dpad-plus::before,
.dpad-plus::after {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}
.dpad-plus { width: var(--dp-s); height: var(--dp-s); }
.dpad-plus::before,
.dpad-plus::after {
  content: "";
  background: var(--dp-c);
  border-radius: var(--dp-r);
}
.dpad-plus::before { width: var(--dp-t); height: var(--dp-s); }
.dpad-plus::after  { width: var(--dp-s); height: var(--dp-t); }

.dpad-outer      { --dp-s: 100px; --dp-t: 35px; --dp-r: 7px;  --dp-c: rgba(0,255,65,0.25); }
.dpad-outer-fill { --dp-s: 96px;  --dp-t: 31px; --dp-r: 6px;  --dp-c: #050a05; }
.dpad-inner      { --dp-s: 86px;  --dp-t: 22px; --dp-r: 5px;  --dp-c: rgba(0,255,65,0.2); }
.dpad-inner-fill { --dp-s: 82px;  --dp-t: 18px; --dp-r: 4px;  --dp-c: #050a05; }

/* Directional arrow buttons */
.dpad-dir {
  position: absolute;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}
.dpad-dir::before {
  content: "";
  width: 12px;
  height: 10px;
  background: rgba(0,255,65,0.5);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transition: background 0.15s, filter 0.15s;
}
.dpad-up    { top: 6px;    left: 50%; translate: -50%; }
.dpad-down  { bottom: 6px; left: 50%; translate: -50%; }
.dpad-left  { left: 6px;   top: 50%;  translate: 0 -50%; }
.dpad-right { right: 6px;  top: 50%;  translate: 0 -50%; }

.dpad-down::before  { rotate: 180deg; }
.dpad-left::before  { rotate: -90deg; }
.dpad-right::before { rotate: 90deg; }

/* ---- Face buttons — filled, raised, diamond layout ---- */
.jc-faces {
  position: relative;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}
.jc-face {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1;
  user-select: none;
  cursor: default;
  background: linear-gradient(180deg, #141e14, #080e08);
  border: 2px solid rgba(0,255,65,0.25);
  color: rgba(0,255,65,0.5);
  box-shadow:
    0 2px 5px rgba(0,0,0,0.5),
    0 0 8px rgba(0,255,65,0.05),
    inset 0 1px 0 rgba(255,255,255,0.05);
  transition: all 0.2s var(--ease);
}
.jc-face:nth-child(1) { top: 0;    left: 50%; transform: translateX(-50%); }
.jc-face:nth-child(2) { top: 50%;  left: 0;   transform: translateY(-50%); }
.jc-face:nth-child(3) { top: 50%;  right: 0;  transform: translateY(-50%); }
.jc-face:nth-child(4) { bottom: 0; left: 50%; transform: translateX(-50%); }

.jc-face:hover {
  border-color: rgba(0,255,65,0.4);
  color: var(--accent);
  box-shadow:
    0 2px 5px rgba(0,0,0,0.5),
    0 0 16px rgba(0,255,65,0.2),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ---- Pill buttons (minus / plus) ---- */
.jc-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 18px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1;
  user-select: none;
  background: linear-gradient(180deg, #101810, #080e08);
  border: 1.5px solid rgba(0,255,65,0.25);
  color: rgba(0,255,65,0.4);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: all 0.2s var(--ease);
}

/* ---- Screen bezel ---- */
.switch-screen {
  flex: 1;
  max-width: 700px;
  background: #000;
  position: relative;
  z-index: 1;
  border: 2px solid rgba(0,255,65,0.55);
  border-radius: 0;
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.5),
    0 4px 20px rgba(0,0,0,0.4),
    0 0 18px rgba(0,255,65,0.1),
    0 0 40px rgba(0,255,65,0.05);
}
.switch-screen .terminal {
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-width: 100%;
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
  .switch-console {
    flex-direction: column;
    align-items: center;
    max-width: 100%;
  }
  .joycon {
    flex-direction: row;
    width: 100%;
    min-width: unset;
    height: 56px;
    padding: 8px 16px;
    gap: 12px;
  }
  .joycon-left {
    border-radius: 16px 16px 0 0;
    border-right: 1px solid rgba(0,255,65,0.12);
    border-bottom: none;
    order: -1;
  }
  .joycon-right {
    border-radius: 0 0 16px 16px;
    border-left: 1px solid rgba(0,255,65,0.12);
    border-top: none;
    order: 1;
  }
  .jc-stick  { width: 36px; height: 36px; }
  .jc-dpad   { width: 44px; height: 44px; }
  .jc-faces  { width: 48px; height: 48px; }
  .jc-face   { width: 20px; height: 20px; font-size: 0.5rem; }
  .switch-screen {
    order: 0;
    border-radius: 0;
  }
}


/* ============================================================
   Pipeline section
   ============================================================ */

.pipeline-figure {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: var(--gap-sm);
  margin-top: var(--gap-sm);
  text-align: center;
}
.pipeline-figure img,
.pipeline-figure svg {
  max-width: 100%;
  height: auto;
}
.pipeline-figure .pipeline-placeholder {
  color: var(--fg-dim);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  padding: var(--gap-xl) 0;
}

.pipeline-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.pipeline-flow .node {
  border: 1px solid var(--accent-dim);
  padding: 8px 12px;
  background: var(--bg-elev);
  color: var(--fg);
  border-radius: var(--radius-sm);
}
.pipeline-flow .node strong { color: var(--accent); display: block; font-size: 0.72rem; letter-spacing: 0.1em; margin-bottom: 2px; }
.pipeline-flow .arrow { color: var(--accent); font-size: 1.1rem; }

/* ============================================================
   Roaming — sidebar + video layout
   ============================================================ */

.roam-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--gap-md);
  max-width: 960px;
  margin: 0 auto;
}

/* Left: scrollable scene list — grid row constrains height to match video */
.roam-sidebar {
  height: 0;
  min-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}
.roam-sidebar::-webkit-scrollbar { width: 4px; }
.roam-sidebar::-webkit-scrollbar-track { background: transparent; }
.roam-sidebar::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 2px; }

.roam-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--fg-mute);
  text-align: left;
  flex-shrink: 0;
}
.roam-item img {
  width: 140px;
  height: 88px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.roam-item:hover {
  border-color: var(--accent);
  color: var(--fg);
}
.roam-item.active {
  border-color: var(--accent);
  background: rgba(0, 255, 65, 0.06);
  color: var(--accent);
}
.roam-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right: video player */
.roam-player {
  flex: 1;
  min-width: 0;
  max-width: 540px;
}
.roam-player .terminal { max-width: 100%; }

/* ============================================================
   Scaffold — 2x2 grid panel (left side of section 4)
   ============================================================ */

.scaffold-grid-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  height: 0;
  min-height: 100%;
}

.scaffold-tile {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.scaffold-tile img {
  width: 100%;
  flex: 1;
  object-fit: cover;
  display: block;
}
.scaffold-tile-name {
  display: block;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-mute);
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.scaffold-tile:hover {
  border-color: var(--accent);
  color: var(--fg);
}
.scaffold-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   Stage I / II — small sections
   ============================================================ */

.pano-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
}
.pano-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 5fr;
  gap: var(--gap-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: var(--gap-sm);
  border-radius: var(--radius-md);
  align-items: stretch;
}
.pano-row .input-img,
.pano-row .pano-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pano-row .input-img { aspect-ratio: 4 / 3; }
.pano-row .pano-img  { aspect-ratio: 4 / 1; }

.viewer-placeholder {
  margin-top: var(--gap-lg);
  border: 1px dashed var(--accent-dim);
  background: var(--bg-code);
  padding: var(--gap-lg);
  text-align: center;
  color: var(--fg-dim);
  border-radius: var(--radius-md);
}
.viewer-placeholder .label {
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: var(--gap-xs);
}
.viewer-placeholder .desc {
  font-size: 0.85rem;
  color: var(--fg-mute);
}

/* ============================================================
   Stage I — Panorama Demo (3-column layout)
   ============================================================ */

.pano-demo {
  display: grid;
  grid-template-columns: 1fr 2.5fr 1fr;
  gap: var(--gap-md);
  align-items: stretch;
  border: 1px solid var(--border-hi);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--gap-md);
  box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(0,255,65,0.05);
}

.pano-demo-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pano-demo-label {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--gap-sm);
  padding-bottom: var(--gap-xs);
  border-bottom: 1px solid var(--border);
}

.pano-demo-frame {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.pano-demo-input .pano-demo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pano-demo-erp .pano-demo-frame {
  aspect-ratio: 2 / 1;
}
.pano-demo-erp .pano-demo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pano-demo-viewer .pano-demo-frame {
  aspect-ratio: 1 / 1;
}

.pano-viewer-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: grab;
}
.pano-viewer-wrap:active { cursor: grabbing; }

.pano-viewer-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.pano-viewer-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.5s var(--ease);
}
.pano-viewer-hint span {
  background: rgba(0,0,0,0.6);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-dim);
  letter-spacing: 0.06em;
}

/* Scene selector thumbnails */
.pano-selector {
  display: flex;
  justify-content: center;
  gap: var(--gap-md);
  margin-top: var(--gap-md);
  flex-wrap: wrap;
}

.pano-thumb {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  width: 120px;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.pano-thumb:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,255,65,0.15);
}
.pano-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.pano-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.pano-thumb-name {
  display: block;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-mute);
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}

/* Responsive: stack on narrow screens */
@media (max-width: 768px) {
  .pano-demo {
    grid-template-columns: 1fr;
  }
  .pano-demo-viewer .pano-demo-frame {
    aspect-ratio: 4 / 3;
  }
  .pano-thumb { width: 90px; }
}

.scaffold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-md);
}
.scaffold-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.scaffold-tile img,
.scaffold-tile .image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  background: #000;
}
.scaffold-tile .image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-dim);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,255,65,0.04) 8px 16px);
}
.scaffold-tile .name {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--fg-mute);
  border-top: 1px solid var(--border);
}

/* ============================================================
   Limitations
   ============================================================ */

#limitations .section-head .prompt { color: var(--danger); }
#limitations .section-head .title { color: var(--danger); }

.failure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap-md);
}
.failure-tile {
  border: 1px solid var(--danger);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.failure-tile .tile-media { aspect-ratio: 16 / 9; }
.failure-tile .label {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--fg);
  border-top: 1px solid var(--danger-soft);
}
.failure-tile .label .tag {
  color: var(--danger);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin-right: 8px;
  text-transform: uppercase;
}

/* ============================================================
   BibTeX
   ============================================================ */

.bibtex {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  padding: var(--gap-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg);
  overflow-x: auto;
  white-space: pre;
}
.bibtex .copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}
.bibtex .copy-btn:hover { background: var(--accent-deep); color: var(--fg); }
.bibtex .copy-btn.copied { color: var(--bg); background: var(--accent); }

/* ============================================================
   Lightbox
   ============================================================ */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: var(--gap-md);
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox-content {
  max-width: 95vw;
  max-height: 90vh;
  border: 1px solid var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
  cursor: default;
}
.lightbox-content video {
  display: block;
  max-width: 95vw;
  max-height: 90vh;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: 1px solid var(--accent-dim);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Footer
   ============================================================ */

footer {
  margin-top: var(--gap-xl);
  padding: var(--gap-lg) var(--gap-md);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.82rem;
}
footer .ascii {
  color: var(--accent-dim);
  font-family: var(--font-mono);
  white-space: pre;
  margin-bottom: var(--gap-sm);
  font-size: 0.7rem;
  line-height: 1.2;
}
footer .easter {
  color: var(--fg-mute);
  margin-top: var(--gap-xs);
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 720px) {
  .section { padding: var(--gap-lg) var(--gap-sm); }
  .pano-row { grid-template-columns: 1fr; }
  .pano-row .pano-img { aspect-ratio: 4 / 1; }
  .grid { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; }
  .section-head .meta { width: 100%; margin-left: 0; }
}

@media (hover: none) {
  /* Touch devices: tiles are clickable input images, no special badge needed */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
