/* layer-2.quest - Maximalist Meditation */
/* Colors: #12102B #0A0A1A #B388FF #4A4A6A #FF69B4 #FFE066 #F0E6FF #00F5D4 #FF8A50 */
/* Fonts: Recursive (variable), Inter, Space Grotesk */

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

html {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

body {
  background: #0A0A1A;
  color: #F0E6FF;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}

#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

#scroll-container {
  position: relative;
  z-index: 1;
}

.snap-section {
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.section-grid {
  display: grid;
  grid-template-rows: 1fr auto 3fr;
  grid-template-columns: 2fr 6fr 2fr;
  width: 100%;
  height: 100%;
  padding: 2rem;
}

.section-content {
  grid-row: 2;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
}

/* Domain Title - Recursive variable font */
.domain-title {
  font-family: 'Recursive', monospace;
  font-size: clamp(3rem, 12vw, 10rem);
  font-weight: 300;
  font-variation-settings: 'CASL' 1, 'MONO' 1, 'wght' 300;
  color: #B388FF;
  letter-spacing: -0.02em;
  line-height: 1;
  transition: font-variation-settings 3s cubic-bezier(0.22, 1, 0.36, 1);
}

.domain-title.animated {
  font-variation-settings: 'CASL' 0, 'MONO' 0, 'wght' 700;
}

.domain-title-final {
  background: linear-gradient(135deg, #B388FF 0%, #FF69B4 50%, #FFE066 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtitle */
.subtitle-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1.5s ease-out 2s forwards;
}

.subtitle-glyph {
  color: #FFE066;
  font-size: 1.2rem;
}

.subtitle-text {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  color: #4A4A6A;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeInUp 1s ease-out 3.5s forwards;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid #4A4A6A;
  border-bottom: 2px solid #4A4A6A;
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.5; }
  50% { transform: rotate(45deg) translate(5px, 5px); opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Headings */
.section-heading {
  font-family: 'Space Grotesk', 'Recursive', sans-serif;
  font-variation-settings: 'CASL' 0.5, 'MONO' 0, 'wght' 500;
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: #FFE066;
  letter-spacing: 0.05em;
}

.section-body {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: #4A4A6A;
  max-width: 48ch;
  line-height: 1.8;
}

/* Mandala SVG */
.mandala-container {
  width: clamp(200px, 40vw, 350px);
  height: clamp(200px, 40vw, 350px);
  margin-bottom: 1rem;
}

.mandala {
  width: 100%;
  height: 100%;
}

/* Waveform */
.waveform-container {
  width: clamp(300px, 70vw, 800px);
  height: 160px;
  margin-bottom: 1rem;
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Zen Garden */
.zen-garden {
  position: relative;
  width: clamp(280px, 50vw, 500px);
  height: clamp(200px, 30vh, 300px);
  margin-bottom: 1.5rem;
}

.garden-stone {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(ellipse at 30% 30%, #4A4A6A, #12102B);
  box-shadow: 0 4px 20px rgba(10, 10, 26, 0.8);
}

.garden-stone-1 {
  width: 50px;
  height: 40px;
  top: 40%;
  left: 20%;
  border-radius: 60% 40% 50% 50%;
}

.garden-stone-2 {
  width: 70px;
  height: 55px;
  top: 35%;
  left: 55%;
  border-radius: 50% 60% 40% 55%;
}

.garden-stone-3 {
  width: 35px;
  height: 30px;
  top: 50%;
  left: 75%;
  border-radius: 45% 55% 50% 50%;
}

.garden-ripple {
  position: absolute;
  border: 1px solid rgba(179, 136, 255, 0.15);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: rippleExpand 8s ease-in-out infinite;
}

.garden-ripple-1 {
  width: 100px;
  height: 60px;
  animation-delay: 0s;
}

.garden-ripple-2 {
  width: 160px;
  height: 96px;
  animation-delay: 1.5s;
}

.garden-ripple-3 {
  width: 220px;
  height: 132px;
  animation-delay: 3s;
}

.garden-ripple-4 {
  width: 300px;
  height: 180px;
  animation-delay: 4.5s;
}

.garden-ripple-5 {
  width: 400px;
  height: 240px;
  animation-delay: 6s;
}

@keyframes rippleExpand {
  0%, 100% { opacity: 0.1; transform: translate(-50%, -50%) scale(0.95); }
  50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.05); }
}

/* Horizon Section */
.horizon-tagline {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1rem;
}

.tagline-word {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #00F5D4;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: calc(var(--delay) * 0.3s);
}

.tagline-word.visible {
  opacity: 1;
  transform: translateY(0);
}

.tagline-dot {
  color: #4A4A6A;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.8s ease 0.5s;
}

.tagline-dot.visible {
  opacity: 1;
}

.horizon-line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #B388FF, #FF69B4, #FFE066, transparent);
  margin-top: 2rem;
  transition: width 2s cubic-bezier(0.22, 1, 0.36, 1);
}

.horizon-line.expanded {
  width: clamp(200px, 60vw, 600px);
}

/* Section visibility animations */
.snap-section .section-content {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.snap-section.visible .section-content {
  opacity: 1;
  transform: translateY(0);
}

#section-arrival .section-content {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .section-grid {
    grid-template-columns: 1fr 8fr 1fr;
    padding: 1rem;
  }

  .section-body {
    max-width: 36ch;
  }

  .zen-garden {
    width: 90vw;
  }
}

/* Accent color for interactive elements */
.scroll-arrow {
  border-color: #FF8A50;
}

.garden-stone-1 {
  box-shadow: 0 4px 20px rgba(255, 138, 80, 0.15), 0 4px 20px rgba(10, 10, 26, 0.8);
}
