/* iggi.dev - Moss Design System */
/* Colors: #c9a84c (Amber Spore), #e8efe5 (Morning Mist), #c8d4c2 (Weathered Stone),
   #4ecdc4 (Bioluminescent Teal), #0e1a14 (Deep Canopy), #1a2e1f (Deep Forest),
   #2d4137 (Forest Floor), #d4e4d1 (Pale Lichen), #7eb8c9 (Colony Blue) */

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

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

html::-webkit-scrollbar {
  display: none;
}

body {
  font-family: 'Inter', sans-serif;
  background: #0e1a14;
  color: #d4e4d1;
  overflow-x: hidden;
}

/* === SECTIONS === */
.section {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* === OPENING SECTION === */
#opening {
  background: #0e1a14;
  flex-direction: column;
}

.opening-overlay {
  position: absolute;
  inset: 0;
  background: #0e1a14;
  z-index: 10;
  opacity: 1;
  transition: opacity 1.5s ease;
}

.opening-overlay.fade-out {
  opacity: 0;
}

.concentric-rings {
  position: absolute;
  width: 80vmin;
  height: 80vmin;
  z-index: 5;
  opacity: 0;
  transition: opacity 2s ease 0.3s;
}

.concentric-rings.visible {
  opacity: 1;
}

.ring {
  fill: none;
  stroke: #7eb8c9;
  stroke-width: 1;
  opacity: 0;
  transform-origin: center;
}

.ring-1 {
  opacity: 0.5;
  animation: ringPulse 8s ease-in-out infinite;
}

.ring-2 {
  opacity: 0.3;
  animation: ringPulse 8s ease-in-out 1.5s infinite;
}

.ring-3 {
  opacity: 0.2;
  animation: ringPulse 8s ease-in-out 3s infinite;
}

.concentric-rings.visible .ring {
  opacity: 0.3;
  transition: opacity 2s ease;
}

.concentric-rings.visible .ring-1 { opacity: 0.5; transition-delay: 0.5s; }
.concentric-rings.visible .ring-2 { opacity: 0.3; transition-delay: 1.2s; }
.concentric-rings.visible .ring-3 { opacity: 0.2; transition-delay: 1.8s; }

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.03); opacity: 0.15; }
}

.opening-text {
  position: relative;
  z-index: 15;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 2s ease 1.5s, transform 2s ease 1.5s;
}

.opening-text.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: #d4e4d1;
  margin-bottom: 0.3em;
}

.hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 300;
  letter-spacing: 0.15em;
  color: #7eb8c9;
  text-transform: lowercase;
}

/* === SECTION CONTENT === */
.section-content {
  position: relative;
  z-index: 5;
  max-width: 720px;
  padding: 2rem;
  text-align: center;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: #d4e4d1;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.section-title.revealed {
  opacity: 1;
  transform: translateY(0);
}

.section-title-dark {
  color: #1a2e1f;
}

.section-prose {
  font-family: 'Inter', sans-serif;
  font-size: clamp(15px, 1.8vw, 17px);
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: #c8d4c2;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease 0.3s, transform 1.2s ease 0.3s;
}

.section-prose.revealed {
  opacity: 1;
  transform: translateY(0);
}

.section-prose-dark {
  color: #2d4137;
}

/* === RHIZOID SECTION === */
#rhizoid {
  background: linear-gradient(180deg, #0e1a14 0%, #1a2e1f 100%);
}

.rhizoid-lines {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 2rem auto 0;
  overflow: visible;
}

.rhizoid-svg {
  width: 100%;
  height: auto;
}

.rhizoid-path {
  fill: none;
  stroke: #4ecdc4;
  stroke-width: 1;
  opacity: 0.3;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 3s ease;
}

.rhizoid-path.drawn {
  stroke-dashoffset: 0;
}

.rp-1 { transition-delay: 0s; }
.rp-2 { transition-delay: 0.4s; }
.rp-3 { transition-delay: 0.8s; }
.rp-4 { transition-delay: 1.2s; }
.rp-5 { transition-delay: 1.6s; }

/* === COLONY SECTION === */
#colony {
  background: linear-gradient(180deg, #1a2e1f 0%, #2d4137 100%);
  flex-direction: column;
}

.colony-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.colony-polygon {
  position: absolute;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.colony-polygon.visible {
  opacity: 1;
}

.colony-polygon svg {
  width: 100%;
  height: 100%;
}

/* === SPORE SECTION === */
#spore {
  background: linear-gradient(180deg, #d4e4d1 0%, #e8efe5 100%);
}

.section-light {
  color: #1a2e1f;
}

.spore-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.spore-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #c9a84c;
  border-radius: 50%;
  opacity: 0;
}

/* === CLEARING SECTION === */
#clearing {
  background: radial-gradient(ellipse at center, #2d4137 0%, #1a2e1f 50%, #0e1a14 100%);
}

.section-clearing {
  flex-direction: column;
}

.clearing-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78,205,196,0.15) 0%, rgba(78,205,196,0.05) 40%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 2s ease, transform 2s ease;
  z-index: 1;
  pointer-events: none;
}

.clearing-glow.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(2);
}

/* === CLOSING SECTION === */
#closing {
  background: #0e1a14;
  min-height: 60vh;
}

.closing-content {
  text-align: center;
}

.closing-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #d4e4d1;
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.closing-text.revealed {
  opacity: 1;
  transform: translateY(0);
}

.closing-translation {
  font-family: 'Inter', sans-serif;
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 300;
  color: #c8d4c2;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
  opacity: 0;
  transition: opacity 1.5s ease 0.5s;
}

.closing-translation.revealed {
  opacity: 1;
}

.closing-mark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: #7eb8c9;
  opacity: 0;
  transition: opacity 1.5s ease 1s;
}

.closing-mark.revealed {
  opacity: 0.6;
}

/* === GLOBAL COLONY OVERLAY === */
.global-colony-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.global-colony-svg {
  width: 100%;
  height: 100%;
}

.edge-polygon {
  fill: none;
  stroke: #7eb8c9;
  stroke-width: 1;
  opacity: 0;
  transition: opacity 2s ease;
}

/* === SCROLL INDICATOR === */
.scroll-indicator {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transition: opacity 1s ease;
}

.scroll-indicator.visible {
  opacity: 1;
}

.scroll-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7eb8c9;
  opacity: 0.2;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-dot-active {
  opacity: 1;
  transform: scale(1.5);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .section-content {
    padding: 1.5rem;
    max-width: 90vw;
  }

  .scroll-indicator {
    right: 12px;
    gap: 8px;
  }

  .scroll-dot {
    width: 4px;
    height: 4px;
  }

  .rhizoid-lines {
    max-width: 95vw;
  }
}
