/* lunatic.dev - Lunar Cycle Design System */
/* Flat design, bubble-playful motifs, parallax sections */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  --void: #1c1e26;
  --light: #e8eaed;
  --gray-600: #6b7280;
  --gray-700: #2d3748;
  --gray-100: #f3f4f6;
  --silver: #b0bec5;
  --gray-300: #d1d5db;
  --gray-500: #4a5568;
  --gray-400: #9ca3af;
  --font-display: 'Nunito', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--void);
  color: var(--light);
  overflow-x: hidden;
}

/* ============================================
   Bubble Container (Fixed overlay)
   ============================================ */
#bubble-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

#bubble-container .bubble {
  position: absolute;
  border-radius: 50%;
  pointer-events: auto;
  transition: transform 0.3s ease-out, opacity 0.5s ease;
  will-change: transform, opacity;
}

/* ============================================
   Moon Indicator (Fixed top-right)
   ============================================ */
#moon-indicator {
  position: fixed;
  top: 32px;
  right: 32px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}

.moon-phase-icon {
  width: 36px;
  height: 36px;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
}

.moon-sphere {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--light);
  position: absolute;
  top: 0;
  left: 0;
}

.moon-shadow {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--void);
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.6s ease, clip-path 0.6s ease;
}

.moon-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  transition: color 0.5s ease;
}

/* ============================================
   Scroll Progress
   ============================================ */
#scroll-progress {
  position: fixed;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  width: 3px;
  height: 120px;
}

.progress-track {
  width: 100%;
  height: 100%;
  background: var(--gray-700);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  width: 100%;
  height: 0%;
  background: var(--light);
  border-radius: 2px;
  transition: height 0.1s linear, background-color 0.5s ease;
}

/* ============================================
   Lunar Sections
   ============================================ */
.lunar-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: background-color 0.8s ease;
  padding: 60px 24px;
}

.section-dark {
  background-color: var(--void);
  color: var(--light);
}

.section-mid {
  background-color: var(--gray-700);
  color: var(--light);
}

.section-light {
  background-color: var(--gray-100);
  color: var(--void);
}

.section-content {
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
}

/* ============================================
   Typography
   ============================================ */
.display-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 8vw, 160px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--light);
}

.section-light .display-title,
.full-moon-title {
  color: var(--void);
}

.dot {
  color: var(--silver);
}

.section-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.5vw, 16px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-400);
}

.body-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.7;
  color: var(--gray-300);
  max-width: 560px;
}

.dark-text {
  color: var(--gray-500);
}

.mono-accent {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--silver);
}

.mono-label {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2vw, 24px);
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: var(--gray-400);
  margin-bottom: 8px;
}

/* ============================================
   Moon Circle Phases
   ============================================ */
.moon-circle {
  width: clamp(100px, 20vw, 200px);
  height: clamp(100px, 20vw, 200px);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  margin: 24px auto;
}

.new-moon-circle {
  background: var(--void);
  border: 2px solid var(--gray-700);
}

.crescent-circle {
  background: var(--void);
}

.crescent-circle .moon-light {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--light);
}

.crescent-circle .moon-dark {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--void);
  left: 30%;
}

.crescent-circle.waning .moon-dark {
  left: auto;
  right: 30%;
}

.quarter-circle {
  background: var(--void);
}

.quarter-circle .moon-light {
  position: absolute;
  width: 50%;
  height: 100%;
  right: 0;
  background: var(--light);
  border-radius: 0 1000px 1000px 0;
}

.quarter-circle .moon-dark {
  position: absolute;
  width: 50%;
  height: 100%;
  left: 0;
  background: var(--void);
}

.quarter-circle.waning .moon-light {
  right: auto;
  left: 0;
  border-radius: 1000px 0 0 1000px;
}

.quarter-circle.waning .moon-dark {
  left: auto;
  right: 0;
}

.gibbous-circle {
  background: var(--light);
}

.gibbous-circle .moon-light {
  display: none;
}

.gibbous-circle .moon-dark {
  position: absolute;
  width: 60%;
  height: 100%;
  background: var(--void);
  left: -10%;
  border-radius: 50%;
}

.gibbous-circle.waning .moon-dark {
  left: auto;
  right: -10%;
}

.full-circle {
  background: var(--light);
  border: none;
}

.section-light .full-circle {
  background: var(--void);
}

/* ============================================
   Scroll Hint
   ============================================ */
.scroll-hint {
  position: absolute;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: hintPulse 2.5s ease-in-out infinite;
}

.scroll-hint-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-600);
}

.scroll-hint-arrow {
  width: 2px;
  height: 24px;
  background: var(--gray-600);
  position: relative;
}

.scroll-hint-arrow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--gray-600);
  border-bottom: 2px solid var(--gray-600);
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(8px); }
}

/* ============================================
   Final Text
   ============================================ */
.final-text {
  margin-top: 64px;
  text-align: center;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  #moon-indicator {
    top: 16px;
    right: 16px;
  }

  #scroll-progress {
    left: 12px;
    height: 80px;
  }

  .lunar-section {
    padding: 40px 16px;
  }

  .section-content {
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .moon-label {
    display: none;
  }
}
