/* ==========================================================================
   James Chen · 34th Birthday — 3D Architectural Time-Space Card Tunnel
   Warm-Dark Museum Gallery Aesthetic (Zero cheap effects)
   ========================================================================== */

:root {
  --bg-gallery: #0c0a09;
  --ink-ivory: #f4efe6;
  --ink-soft: rgba(244, 239, 230, 0.72);
  --ink-muted: rgba(244, 239, 230, 0.42);
  --accent-warm: #d4a373;
  --line-subtle: rgba(244, 239, 230, 0.14);
  --font-serif: 'Instrument Serif', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Inter', 'PingFang SC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-gallery);
  color: var(--ink-ivory);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

#webglCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  cursor: grab;
}

#webglCanvas.is-hovering {
  cursor: pointer;
}

#webglCanvas.is-dragging {
  cursor: grabbing;
}

.cinema-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 76% 70% at 50% 48%, transparent 45%, rgba(6, 5, 4, 0.62) 100%),
    linear-gradient(180deg, rgba(8, 6, 5, 0.56) 0%, transparent 18%, transparent 74%, rgba(8, 6, 5, 0.78) 100%);
}

/* ==========================================================================
   TOP MINIMALIST EXHIBITION BAR
   ========================================================================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 36px;
  pointer-events: none;
}

.brand,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.brand-mark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-warm);
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ink-ivory);
}

.brand-divider {
  color: rgba(244, 239, 230, 0.24);
  font-size: 11px;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
}

.year-range {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
}

.nav-pill {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-subtle);
  background: rgba(18, 15, 13, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.5s ease,
    transform 0.5s var(--ease-expo),
    color 0.25s ease,
    border-color 0.25s ease;
}

body[data-mode="chapter02"] .nav-pill,
body[data-mode="gallery"] .nav-pill,
body[data-mode="inspect"] .nav-pill {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-pill:hover {
  color: var(--ink-ivory);
  border-color: rgba(244, 239, 230, 0.36);
}

/* ==========================================================================
   ACT 1: GALLERY ENTRANCE OVERLAY
   ========================================================================== */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 48%, rgba(14, 11, 9, 0.42) 0%, rgba(10, 8, 7, 0.72) 100%);
  transition:
    opacity 1.05s var(--ease-smooth),
    transform 1.15s var(--ease-expo);
  will-change: opacity, transform;
}

body[data-mode="onboarding"] .intro-overlay,
body[data-mode="chapter02"] .intro-overlay,
body[data-mode="gallery"] .intro-overlay,
body[data-mode="inspect"] .intro-overlay {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}

.intro-inner {
  text-align: center;
  padding: 0 28px;
  max-width: 820px;
}

.intro-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--accent-warm);
  margin-bottom: 22px;
  opacity: 0.92;
}

.intro-title {
  font-family: var(--font-sans);
  font-size: clamp(2.8rem, 6.4vw, 5.4rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--ink-ivory);
  text-shadow: 0 14px 48px rgba(0, 0, 0, 0.55);
}

.intro-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  letter-spacing: -0.01em;
  color: #f8e9d6;
}

.intro-subtitle {
  margin-top: 20px;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.45vw, 1.24rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.intro-cta-wrap {
  margin-top: 38px;
}

.enter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 30px 0 32px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.16);
  background: var(--ink-ivory);
  color: #120f0d;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.35s var(--ease-expo),
    background-color 0.25s ease,
    box-shadow 0.35s var(--ease-expo);
}

.enter-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease-expo);
}

.enter-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.58);
}

.enter-btn:hover svg {
  transform: translateX(4px);
}

.enter-btn:active {
  transform: scale(0.97);
}

.intro-hint {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
}

/* ==========================================================================
   ACT 2 & 3: GALLERY STORY HUD & TIMELINE SCRUBBER
   ========================================================================== */

.gallery-hud {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease 0.25s;
}

body[data-mode="gallery"] .gallery-hud {
  opacity: 1;
}

body[data-mode="inspect"] .gallery-hud {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.chapter-caption {
  position: absolute;
  left: 36px;
  bottom: 84px;
  max-width: 560px;
  transition: opacity 0.45s ease, transform 0.55s var(--ease-expo);
}

.chapter-caption.is-switching {
  opacity: 0;
  transform: translateY(10px);
}

.chapter-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--accent-warm);
  margin-bottom: 10px;
}

.chapter-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-warm);
}

.chapter-date {
  font-family: var(--font-sans);
  font-size: clamp(1.65rem, 3.1vw, 2.55rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--ink-ivory);
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.85);
}

.chapter-line {
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.35vw, 1.14rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.88);
}

.gallery-bottom {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.timeline-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.tl-year {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.tl-track {
  position: relative;
  width: 210px;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.tl-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(244, 239, 230, 0.22);
}

.tl-fill {
  position: absolute;
  left: 0;
  height: 1.5px;
  width: 0%;
  background: var(--accent-warm);
}

.tl-thumb {
  position: absolute;
  left: 0%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--ink-ivory);
  box-shadow: 0 0 12px rgba(212, 163, 115, 0.7);
}

.gallery-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}

.hint-sep {
  opacity: 0.5;
}

/* ==========================================================================
   INSPECTED CARD MUSEUM PLAQUE ("PULL ONE OFF THE WALL")
   ========================================================================== */

.inspect-plaque {
  position: fixed;
  right: clamp(24px, 5vw, 72px);
  top: 50%;
  transform: translateY(-50%) translateX(28px);
  z-index: 25;
  width: min(360px, 86vw);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.55s var(--ease-smooth),
    transform 0.65s var(--ease-expo);
}

body[data-mode="inspect"] .inspect-plaque {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

.plaque-inner {
  padding: 26px 28px;
  border-radius: 14px;
  border: 1px solid rgba(244, 239, 230, 0.14);
  background: rgba(16, 13, 11, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

.plaque-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.plaque-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent-warm);
}

.plaque-close {
  border: 1px solid var(--line-subtle);
  background: transparent;
  color: var(--ink-soft);
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.plaque-close:hover {
  color: var(--ink-ivory);
  border-color: rgba(244, 239, 230, 0.42);
  background: rgba(244, 239, 230, 0.08);
}

.plaque-title {
  font-family: var(--font-sans);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-ivory);
}

.plaque-subtitle {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
}

.plaque-body {
  margin-top: 18px;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.78;
  color: var(--ink-soft);
}

.plaque-nav {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plaque-step {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.25s var(--ease-expo);
}

.plaque-step:hover {
  color: var(--ink-ivory);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 820px) {
  .topbar {
    padding: 18px 20px;
  }

  .year-range,
  .gallery-hint {
    display: none;
  }

  .chapter-caption {
    left: 20px;
    right: 20px;
    bottom: 72px;
  }

  .gallery-bottom {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }

  .tl-track {
    width: 150px;
  }

  .inspect-plaque {
    right: 50%;
    top: auto;
    bottom: 20px;
    transform: translateX(50%) translateY(20px);
    width: calc(100vw - 32px);
  }

  body[data-mode="inspect"] .inspect-plaque {
    transform: translateX(50%) translateY(0);
  }
}

/* ===== 封面微调（12.04）：中文名、耳机提示、右上角日期 ===== */
.intro-cn {
  margin-top: 14px;
  font-family: var(--font-serif), 'Noto Serif SC', 'Songti SC', serif;
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  color: rgba(232, 196, 150, 0.78);
}
.intro-cn + .intro-subtitle { margin-top: 14px; }
.intro-hint {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.24em;
}
.intro-hint-emoji { display: inline-block; margin-left: 4px; letter-spacing: 0; font-size: 14px; }
.year-range.is-today { color: #e8c496; }
