:root {
  --bg:         #050608;
  --bg-elev:    #0a0c10;
  --bg-card:    rgba(14, 16, 24, 0.85);
  --bg-card-hover: rgba(22, 26, 38, 0.95);
  --text:       #f1f5f9;
  --text-dim:   #94a3b8;
  --text-muted: #64748b;

  /* Cognitive / Memory Frequency Spectrum */
  --memory-violet:      #a855f7; /* 528Hz memory introspection */
  --memory-violet-glow: rgba(168, 85, 247, 0.45);
  --memory-crimson:     #f43f5e; /* Obsidian crimson pulse */
  --memory-crimson-glow:rgba(244, 63, 94, 0.45);
  --synaptic-cyan:      #00e5ff; /* 432Hz cognitive clarity */
  --synaptic-cyan-glow: rgba(0, 229, 255, 0.45);
  --mnemonic-gold:      #fbbf24; /* 396Hz nostalgia grounding */
  --mnemonic-gold-glow: rgba(251, 191, 36, 0.45);
  
  --platinum:   #f8fafc;
  --chrome:     #cbd5e1;
  --pearl:      #ffffff;
  
  --border:     rgba(255, 255, 255, 0.08);
  --border-hi:  rgba(255, 255, 255, 0.22);
  --border-glow: rgba(168, 85, 247, 0.4);

  --font-body:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Cascadia Code', Consolas, ui-monospace, monospace;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--memory-violet); color: #ffffff; }

/* Ambient Background Canvas */
#ambientCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* Header & Nav */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 6, 8, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1320px; margin: 0 auto; padding: 0.9rem 2rem;
}
nav .brand {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem;
  color: var(--pearl); text-decoration: none; letter-spacing: 0.06em;
}
nav .brand-badge {
  font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px;
  background: rgba(168, 85, 247, 0.15); border: 1px solid var(--memory-violet-glow);
  color: var(--memory-violet); font-weight: 600; letter-spacing: 0.04em;
}
nav ul { display: flex; gap: 1.2rem; list-style: none; flex-wrap: wrap; align-items: center; }
nav ul li a {
  color: var(--text-dim); text-decoration: none; font-size: 0.88rem;
  font-weight: 500; transition: all 0.2s ease;
}
nav ul li a:hover, nav ul li a.active { color: var(--pearl); text-shadow: 0 0 12px var(--memory-violet-glow); }

/* Identity & Sound Buttons */
.sound-toggle-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.sound-toggle-btn:hover, .sound-toggle-btn.active {
  border-color: var(--synaptic-cyan);
  color: var(--synaptic-cyan);
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 14px var(--synaptic-cyan-glow);
}

.identity-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(168, 85, 247, 0.12); border: 1px solid var(--memory-violet-glow);
  padding: 0.35rem 0.85rem; border-radius: 20px; font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--pearl); cursor: pointer; transition: all 0.2s ease;
}
.identity-pill:hover { background: rgba(168, 85, 247, 0.25); box-shadow: 0 0 16px var(--memory-violet-glow); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.6rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); text-decoration: none;
  font-family: var(--font-body);
}
.btn-primary {
  background: linear-gradient(135deg, #9333ea, #7c3aed, #4f46e5);
  color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(147, 51, 234, 0.6);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05); color: var(--pearl);
  border: 1px solid var(--border-hi); backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1); border-color: var(--memory-violet);
  transform: translateY(-1px);
}
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }

/* Fullscreen Cinematic Hero */
.hero-cinema {
  position: relative;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  z-index: 1;
}
.hero-headline {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.2rem;
  background: linear-gradient(180deg, #ffffff 40%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tagline {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: var(--text-dim);
  max-width: 680px;
  margin: 0 auto 2.4rem;
  line-height: 1.5;
}

/* 5-Stage Interactive Walkthrough Journey */
.stage-timeline-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2.5rem 0;
  position: sticky;
  top: 70px;
  z-index: 50;
  background: rgba(5, 6, 8, 0.85);
  backdrop-filter: blur(16px);
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  border: 1px solid var(--border);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.stage-dot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  transition: all 0.25s ease;
}
.stage-dot.active {
  color: var(--pearl);
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid var(--memory-violet);
  box-shadow: 0 0 15px var(--memory-violet-glow);
}
.stage-dot.completed {
  color: var(--synaptic-cyan);
}

.stage-scene {
  max-width: 1000px;
  margin: 0 auto 5rem;
  padding: 3rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.9;
}
.stage-scene.active {
  opacity: 1;
  border-color: var(--border-glow);
  box-shadow: 0 8px 40px rgba(168, 85, 247, 0.15);
}

/* Artifact Card & Synthetic Visualization Badge */
.artifact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.artifact-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hi);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.artifact-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a0c10;
}
.artifact-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.artifact-card:hover .artifact-img-wrap img {
  transform: scale(1.04);
}
.synthetic-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(5, 6, 8, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Memory Spine (Vertical 7-Tier Timeline) */
.memory-spine {
  position: relative;
  max-width: 860px;
  margin: 3rem auto;
  padding-left: 2.5rem;
}
.memory-spine::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12px;
  width: 2px;
  background: linear-gradient(180deg, var(--memory-violet), var(--synaptic-cyan), var(--mnemonic-gold));
}
.spine-node {
  position: relative;
  margin-bottom: 2.5rem;
}
.spine-dot {
  position: absolute;
  left: -2.5rem;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--memory-violet);
  box-shadow: 0 0 10px var(--memory-violet-glow);
  transition: all 0.25s ease;
}
.spine-node:hover .spine-dot {
  background: var(--memory-violet);
  box-shadow: 0 0 18px var(--memory-violet-glow);
  transform: scale(1.2);
}
.spine-glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(16px);
  transition: all 0.25s ease;
}
.spine-glass-panel:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-hover);
}

/* Form inputs */
.form-input, .form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  color: var(--pearl);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--memory-violet);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 15px var(--memory-violet-glow);
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(5, 6, 8, 0.85);
  backdrop-filter: blur(16px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.active {
  display: flex;
}
.modal-card {
  background: #0d0f17;
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  position: relative;
}

/* Responsive */
@media (max-width: 768px) {
  nav { padding: 0.8rem 1.2rem; }
  .stage-timeline-nav { gap: 0.6rem; overflow-x: auto; max-width: 95vw; }
  .stage-scene { padding: 2rem 1.2rem; }
}
