/* ===== Custom Properties ===== */
:root {
  --aurora-green: #00E676;
  --aurora-violet: #7C4DFF;
  --aurora-rose: #FF4081;
  --polar-night: #0A0A1A;
  --frost-white: #F0F0FF;
  --ballot-gold: #FFD54F;
  --parliament-slate: #3A3A5C;
  --noise-cream: #E8E0D4;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Libre Baskerville', Georgia, serif;
  background: var(--polar-night);
  color: var(--frost-white);
  overflow-x: hidden;
  line-height: 1.75;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
}

/* ===== Aurora Background ===== */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 30% 70%, rgba(0,230,118,0.12) 0%, rgba(124,77,255,0.08) 40%, rgba(255,64,129,0.06) 80%, var(--polar-night) 100%);
  animation: auroraShift 45s ease-in-out infinite;
}
@keyframes auroraShift {
  0%, 100% { filter: hue-rotate(0deg); }
  33% { filter: hue-rotate(40deg); }
  66% { filter: hue-rotate(-30deg); }
}

/* ===== Grain Overlay (via pseudo-element) ===== */
.glass-card::after,
.glass-panel::after,
.glass-title-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 256px;
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: grainShift 0.2s steps(2) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-1px, 1px); }
  100% { transform: translate(1px, -1px); }
}

/* ===== Glass Surfaces ===== */
.glass-title-card,
.glass-card,
.glass-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

/* ===== Scene Base ===== */
.scene {
  position: relative;
  z-index: 10;
}

/* ===== Scene 1: Chamber ===== */
.scene-chamber {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.glass-title-card {
  padding: 3rem 4rem;
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  animation: titleReveal 2s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
}
@keyframes titleReveal {
  to { opacity: 1; transform: scale(1); }
}
.site-title {
  font-family: 'Bungee Shade', cursive;
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 400;
  color: var(--frost-white);
  text-shadow: 0 0 60px rgba(0, 230, 118, 0.3);
  letter-spacing: 0.04em;
}
.site-subtitle {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--parliament-slate);
  margin-top: 1rem;
}
.motif-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.15;
  pointer-events: none;
}

/* ===== Scene 2: Archive ===== */
.scene-archive {
  min-height: 150vh;
  padding: 8rem 2rem;
}
.archive-cards {
  max-width: 800px;
  margin: 0 auto;
}
.glass-card {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: -6vh;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.glass-card.from-left {
  transform: translateX(-60px);
}
.glass-card.from-right {
  transform: translateX(60px);
}
.glass-card.visible {
  opacity: 1;
  transform: translateX(0);
}
.card-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  margin-bottom: 1rem;
  line-height: 1.15;
}
.glass-card p {
  color: rgba(240, 240, 255, 0.8);
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
}

/* ===== Scene 3: Timeline ===== */
.scene-timeline {
  min-height: 200vh;
  padding: 6rem 2rem;
  position: relative;
}
.timeline-beam {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  transform: translateX(-50%);
}
.beam-line {
  width: 4px;
  height: 100%;
}
.timeline-entries {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}
.timeline-entry {
  display: flex;
  margin-bottom: 4rem;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: translateY(20px);
}
.timeline-entry.visible {
  opacity: 1;
  transform: translateY(0);
}
.timeline-entry.left { justify-content: flex-start; padding-right: 55%; }
.timeline-entry.right { justify-content: flex-end; padding-left: 55%; }

.glass-panel {
  padding: 1.5rem 2rem;
}
.glass-panel h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--ballot-gold);
  margin-bottom: 0.5rem;
}
.glass-panel p {
  color: rgba(240, 240, 255, 0.8);
  font-size: 0.95rem;
}

/* ===== Scene 4: Deliberation ===== */
.scene-deliberation {
  min-height: 120vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}
.deliberation-panel {
  max-width: 56rem;
  padding: clamp(2rem, 4vw, 4rem);
  transition: transform 0.1s ease;
}
.deliberation-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 2rem;
  line-height: 1.1;
}
.deliberation-panel p {
  color: rgba(240, 240, 255, 0.85);
  margin-bottom: 1.5rem;
  line-height: 1.85;
}

/* ===== Scene 5: Seal ===== */
.scene-seal {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}
.seal-container { margin-bottom: 2rem; }
.seal-rosette { display: block; }
.seal-paths polygon,
.seal-paths circle {
  transition: stroke-dashoffset 2s ease;
}
.seal-container.visible .seal-paths polygon { stroke-dashoffset: 0; }
.seal-container.visible .seal-paths circle:nth-child(2) { stroke-dashoffset: 0; transition-delay: 0.5s; }
.seal-container.visible .seal-paths circle:nth-child(3) { stroke-dashoffset: 0; transition-delay: 1s; }
.seal-container.visible .seal-paths circle:nth-child(4) { stroke-dashoffset: 0; transition-delay: 1.5s; }

.seal-text {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1rem;
  color: var(--ballot-gold);
  margin-bottom: 1rem;
}
.seal-domain {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--parliament-slate);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .scene-archive { padding: 4rem 1rem; }
  .glass-card { margin-bottom: -3vh; }
  .timeline-entry.left,
  .timeline-entry.right {
    padding-left: 2rem;
    padding-right: 0;
    justify-content: flex-start;
  }
  .timeline-beam { left: 1rem; }
  .glass-title-card { padding: 2rem; }
  .site-title { font-size: clamp(2rem, 10vw, 4rem); }
}
@media (max-width: 480px) {
  .scene-deliberation { padding: 2rem 1rem; }
  .deliberation-panel { padding: 1.5rem; }
}
