/* ═══════════════════════════════════════════════════════════
   XEVRO — Cathedral of Sound
   Deep Frequency Spectrum Theme
   ═══════════════════════════════════════════════════════════ */

:root {
  --black-infinite: #0D0F14;
  --resonance-violet: #7A5CFF;
  --bg-void: #050608;
  --text-light: #F3F5F8;
  --electric-cyan: #3EF0D0;
  --sonic-purple: #9B4DFF;
  --infrared-magenta: #FF2D8A;
  --neon-indigo: #4A3AFF;
  --aurora-cyan: #00E5C7;

  --font-heading: 'Space Grotesk', 'Syne', sans-serif;
  --font-display: 'Syne', 'Space Grotesk', sans-serif;
  --font-body: 'Inter', 'Manrope', sans-serif;

  --nav-size: 52px;
  --section-min-h: 100vh;
  --section-min-h-svh: 100svh;
  --ease-resonance: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pulse: cubic-bezier(0.45, 0, 0.55, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-void);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  background: var(--bg-void);
  cursor: crosshair;
}

body.menu-open {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--resonance-violet);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* ─── Tuning Fork Navigation ─── */

.tuning-nav {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
}

.tuning-fork {
  position: relative;
  width: var(--nav-size);
  height: var(--nav-size);
  border: none;
  background: rgba(13, 15, 20, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50%;
  color: var(--electric-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.4s var(--ease-resonance), box-shadow 0.4s var(--ease-resonance), transform 0.3s var(--ease-resonance);
  box-shadow: 0 0 20px rgba(122, 92, 255, 0.15);
}

.tuning-fork:hover,
.tuning-fork:focus-visible {
  color: var(--resonance-violet);
  box-shadow: 0 0 30px rgba(62, 240, 208, 0.3), 0 0 60px rgba(122, 92, 255, 0.2);
  outline: none;
  transform: scale(1.05);
}

.tuning-fork-icon {
  width: 28px;
  height: 36px;
}

.tuning-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--electric-cyan);
  opacity: 0;
  animation: tuningPulse 3s var(--ease-pulse) infinite;
}

@keyframes tuningPulse {
  0%, 100% { transform: scale(1); opacity: 0; }
  50% { transform: scale(1.3); opacity: 0.4; }
}

.freq-menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-resonance), visibility 0.5s;
}

.freq-menu.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.freq-menu-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.freq-list {
  position: relative;
  z-index: 2;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.freq-list a {
  display: block;
  padding: 0.85rem 2.5rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-light);
  border-radius: 100px;
  background: rgba(13, 15, 20, 0.5);
  border: 1px solid rgba(122, 92, 255, 0.2);
  backdrop-filter: blur(8px);
  transform: scale(0.8) translateY(20px);
  opacity: 0;
  transition: all 0.4s var(--ease-resonance);
}

.freq-menu.is-open .freq-list a {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.freq-menu.is-open .freq-list li:nth-child(1) a { transition-delay: 0.05s; }
.freq-menu.is-open .freq-list li:nth-child(2) a { transition-delay: 0.1s; }
.freq-menu.is-open .freq-list li:nth-child(3) a { transition-delay: 0.15s; }
.freq-menu.is-open .freq-list li:nth-child(4) a { transition-delay: 0.2s; }
.freq-menu.is-open .freq-list li:nth-child(5) a { transition-delay: 0.25s; }
.freq-menu.is-open .freq-list li:nth-child(6) a { transition-delay: 0.3s; }

.freq-list a:hover,
.freq-list a:focus-visible {
  color: var(--electric-cyan);
  border-color: var(--electric-cyan);
  box-shadow: 0 0 25px rgba(62, 240, 208, 0.25);
  outline: none;
}

.freq-list a::after {
  content: attr(data-freq);
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  opacity: 0.5;
  margin-top: 0.15rem;
}

/* ─── Section Base ─── */

.sonic-section {
  position: relative;
  min-height: var(--section-min-h);
  min-height: var(--section-min-h-svh);
  overflow: hidden;
  background: var(--bg-void);
}

.section-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.section-label {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  text-shadow: 0 0 40px rgba(122, 92, 255, 0.5);
}

.section-sublabel {
  font-size: 0.9rem;
  opacity: 0.6;
  margin-top: 0.5rem;
  letter-spacing: 0.08em;
}

/* ═══ SECTION 1 — FIRST VIBRATION ═══ */

.section-vibration {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.vibration-core {
  position: relative;
  z-index: 2;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.pulse-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--electric-cyan);
  box-shadow: 0 0 20px var(--electric-cyan), 0 0 40px var(--resonance-violet);
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid var(--electric-cyan);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.scroll-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.4;
  animation: hintFade 4s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.6s;
}

.scroll-hint.is-hidden {
  opacity: 0;
}

@keyframes hintFade {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.6; }
}

.section-vibration.is-materialized .vibration-core {
  opacity: 0;
  transition: opacity 1s;
}

/* ═══ SECTION 2 — CHAMBER OF ECHOES ═══ */

.section-echoes {
  background: linear-gradient(180deg, var(--bg-void) 0%, var(--black-infinite) 50%, var(--bg-void) 100%);
}

.echo-content-layer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  min-height: var(--section-min-h);
  min-height: var(--section-min-h-svh);
  padding: 4rem 2rem;
}

.echo-wave {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.6s var(--ease-resonance);
}

.echo-wave::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(122, 92, 255, 0.3);
  background: radial-gradient(circle, rgba(122, 92, 255, 0.08) 0%, transparent 70%);
  animation: echoFloat 6s ease-in-out infinite;
}

.echo-wave[data-echo="1"]::before { animation-delay: -2s; }
.echo-wave[data-echo="2"]::before { animation-delay: -4s; }

@keyframes echoFloat {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.05) translateY(-15px); }
}

.echo-wave-inner {
  position: absolute;
  inset: -40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  border-radius: 50%;
  background: rgba(13, 15, 20, 0.85);
  border: 1px solid rgba(62, 240, 208, 0.2);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.6s var(--ease-resonance);
  pointer-events: none;
}

.echo-wave.is-expanded .echo-wave-inner,
.echo-wave:hover .echo-wave-inner,
.echo-wave:focus-visible .echo-wave-inner {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.echo-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--electric-cyan);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.echo-text {
  font-size: 0.85rem;
  line-height: 1.7;
  opacity: 0.85;
  max-width: 220px;
}

/* ═══ SECTION 3 — FREQUENCY FOREST ═══ */

.section-forest {
  background: var(--black-infinite);
}

.forest-overlay {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

/* ═══ SECTION 4 — ORCHESTRA OF PARTICLES ═══ */

.section-particles {
  background: radial-gradient(ellipse at center, #0a0c12 0%, var(--bg-void) 100%);
}

.particle-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.particle-phrase {
  position: absolute;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s var(--ease-resonance);
}

.particle-phrase.is-active {
  opacity: 1;
  transform: translateY(0);
}

.phrase-word {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--text-light) 0%, var(--resonance-violet) 50%, var(--electric-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══ SECTION 5 — RHYTHM ENGINE ═══ */

.section-rhythm {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
}

.rhythm-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.rhythm-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(122, 92, 255, 0.25);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  animation: ringRotate linear infinite;
}

.rhythm-ring[data-ring="creativity"] {
  width: 120px; height: 120px;
  animation-duration: 8s;
  border-color: rgba(62, 240, 208, 0.4);
}

.rhythm-ring[data-ring="energy"] {
  width: 200px; height: 200px;
  animation-duration: 12s;
  animation-direction: reverse;
  border-color: rgba(255, 45, 138, 0.3);
}

.rhythm-ring[data-ring="motion"] {
  width: 280px; height: 280px;
  animation-duration: 16s;
  border-color: rgba(122, 92, 255, 0.35);
}

.rhythm-ring[data-ring="expression"] {
  width: 360px; height: 360px;
  animation-duration: 20s;
  animation-direction: reverse;
  border-color: rgba(74, 58, 255, 0.3);
}

.rhythm-ring[data-ring="innovation"] {
  width: 440px; height: 440px;
  animation-duration: 24s;
  border-color: rgba(0, 229, 199, 0.25);
}

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

.ring-label {
  position: absolute;
  top: -0.5rem;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  opacity: 0.7;
  white-space: nowrap;
}

.rhythm-title {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
  pointer-events: none;
}

/* ═══ SECTION 6 — CANYON OF BASS ═══ */

.section-canyon {
  background: linear-gradient(180deg, #0a0806 0%, #050403 50%, var(--bg-void) 100%);
}

.canyon-overlay {
  position: absolute;
  top: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.canyon-label {
  color: var(--infrared-magenta);
  text-shadow: 0 0 60px rgba(255, 45, 138, 0.4);
}

/* ═══ SECTION 7 — SKY OF HARMONICS ═══ */

.section-harmonics {
  background: linear-gradient(180deg, var(--bg-void) 0%, #0a1020 40%, #101828 100%);
}

.harmonic-stories {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  max-width: 600px;
  text-align: center;
  padding: 0 2rem;
}

.harmonic-story {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  opacity: 0;
  transition: opacity 1s var(--ease-resonance);
  font-size: 1rem;
  line-height: 1.8;
  font-style: italic;
  color: rgba(243, 245, 248, 0.8);
}

.harmonic-story.is-visible {
  opacity: 1;
}

/* ═══ SECTION 8 — ARCHIVE OF VOICES ═══ */

.section-voices {
  background: radial-gradient(ellipse at 50% 30%, #12101a 0%, var(--bg-void) 70%);
}

.section-voices .section-canvas {
  cursor: pointer;
}

.voice-detail {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  max-width: 480px;
  text-align: center;
  padding: 2rem;
  background: rgba(13, 15, 20, 0.7);
  border: 1px solid rgba(122, 92, 255, 0.3);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.voice-detail-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--electric-cyan);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.voice-detail-text {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.7;
}

/* ═══ SECTION 9 — RESONANCE TOWER ═══ */

.section-resonance {
  background: var(--black-infinite);
}

.tower-levels {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tower-level {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.3;
  transition: all 0.5s var(--ease-resonance);
  padding-left: 1rem;
  border-left: 2px solid transparent;
}

.tower-level.is-active {
  opacity: 1;
  color: var(--electric-cyan);
  border-left-color: var(--electric-cyan);
  text-shadow: 0 0 20px rgba(62, 240, 208, 0.5);
}

/* ═══ SECTION 10 — FINAL NOTE ═══ */

.section-finale {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.finale-chamber {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.finale-silence {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1;
  opacity: 1;
  transition: opacity 2s var(--ease-resonance);
  pointer-events: none;
}

.finale-silence.is-lifted {
  opacity: 0;
}

.finale-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: scale(0.9);
  transition: all 1.5s var(--ease-resonance);
  margin-bottom: 3rem;
  background: linear-gradient(180deg, var(--text-light) 0%, var(--resonance-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.finale-title.is-revealed {
  opacity: 1;
  transform: scale(1);
}

.resonance-core {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 1s var(--ease-resonance) 0.5s;
}

.resonance-core.is-revealed {
  opacity: 1;
  transform: scale(1);
}

.resonance-core:focus-visible {
  outline: 2px solid var(--electric-cyan);
  outline-offset: 8px;
}

.core-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 92, 255, 0.4) 0%, transparent 70%);
  animation: coreGlow 3s ease-in-out infinite;
}

@keyframes coreGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

.core-inner {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--electric-cyan), var(--resonance-violet));
  box-shadow: 0 0 40px rgba(62, 240, 208, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.1);
  transition: transform 0.4s var(--ease-resonance);
}

.resonance-core:hover .core-inner,
.resonance-core:focus-visible .core-inner {
  transform: scale(1.08);
}

.core-button-text {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--bg-void);
  text-align: center;
  max-width: 100px;
  line-height: 1.4;
}

.resonance-core.is-pulsing .core-glow {
  animation: corePulse 0.6s ease-out;
}

@keyframes corePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* ─── Reduced Motion ─── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-hint { display: none; }
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
  .tuning-nav {
    top: 1rem;
    right: 1rem;
  }

  .echo-content-layer {
    flex-direction: column;
    gap: 2rem;
    padding: 6rem 1.5rem;
  }

  .echo-wave {
    width: 160px;
    height: 160px;
  }

  .tower-levels {
    right: 1rem;
    font-size: 0.6rem;
  }

  .rhythm-ring[data-ring="innovation"] {
    width: 300px;
    height: 300px;
  }

  .rhythm-ring[data-ring="expression"] {
    width: 250px;
    height: 250px;
  }

  .resonance-core {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 480px) {
  .freq-list a {
    padding: 0.7rem 1.8rem;
    font-size: 0.95rem;
  }

  .ring-label {
    font-size: 0.55rem;
  }
}
