/* namu.quest - Y2K-futurism meets botanical meditation */
/* Fonts: Barlow Condensed, Outfit, Noto Sans KR */
/* Palette: Midnight Orchid, Root Soil, Digital Wisteria, Circuit Jade, Pixel Peony, Parchment Glow, Amber Sap */

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: #1e1428;
  color: #e8e0f0;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.75;
  letter-spacing: 0.02em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grain Overlay - see bottom of file for enhanced version */

/* Canvas layers */
#aurora-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

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

/* Floating Hangul Glyphs */
#hangul-glyphs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 650vh;
  pointer-events: none;
  z-index: 1;
}

.hangul-glyph {
  position: absolute;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 100;
  font-size: clamp(48px, 8vw, 160px);
  opacity: 0.1;
  color: #e8e0f0;
  pointer-events: none;
  will-change: transform;
}

/* Sections */
.section {
  position: relative;
  z-index: 2;
}

/* ====== CANOPY ====== */
#canopy {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1e1428 0%, #2a1e38 100%);
}

.canopy-content {
  text-align: center;
  z-index: 3;
}

.domain-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 300;
  font-size: clamp(32px, 6vw, 96px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8e0f0;
  margin-bottom: 40px;
  text-shadow: 0 0 60px rgba(200, 160, 224, 0.3), 0 0 120px rgba(168, 216, 200, 0.15);
}

.chevron-down {
  animation: chevronPulse 2.5s ease-in-out infinite;
  opacity: 0.6;
}

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

/* ====== BRANCHES ====== */
#branches {
  min-height: 150vh;
  padding: 10vh 0;
  position: relative;
  background: linear-gradient(180deg, #2a1e38 0%, #1e1428 30%, #1a1218 100%);
}

#branch-svg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

.branch-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 0.1s linear;
}

.panel {
  position: relative;
  z-index: 3;
  max-width: 420px;
  padding: 28px 36px;
  margin: 12vh auto;
  background: rgba(200, 180, 220, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  opacity: 0;
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-left {
  margin-left: 10%;
  margin-right: auto;
  transform: translateX(-60px);
}

.panel-right {
  margin-right: 10%;
  margin-left: auto;
  transform: translateX(60px);
}

.panel.visible {
  opacity: 1;
  transform: translateX(0);
}

.panel-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  color: rgba(232, 224, 240, 0.75);
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.75;
}

/* ====== TRUNK ====== */
#trunk {
  min-height: 150vh;
  position: relative;
  background: linear-gradient(180deg, #1a1218 0%, #1a1218 100%);
  padding: 10vh 0;
}

.trunk-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, #e8c8e0, #a8d8c8);
  opacity: 0.4;
  z-index: 1;
}

.tree-card {
  position: relative;
  z-index: 3;
  width: 180px;
  height: 240px;
  opacity: 0.4;
  will-change: transform;
  transition: opacity 600ms ease;
}

.tree-card.visible {
  opacity: 0.5;
}

.wireframe-tree {
  width: 100%;
  height: 100%;
}

.card-left {
  margin-left: calc(50% - 220px);
  margin-top: 15vh;
}

.card-right {
  margin-left: calc(50% + 40px);
  margin-top: 15vh;
}

.card-lower {
  margin-top: 10vh;
}

/* ====== ROOTS ====== */
#roots {
  min-height: 150vh;
  position: relative;
  background-color: #1a1218;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  padding: 10vh 0;
}

#roots-svg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

.root-path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 0.1s linear;
}

.root-words {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.root-word {
  position: absolute;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: clamp(24px, 4vw, 48px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0e8d8;
  opacity: 0;
  transition: opacity 1200ms ease, transform 1200ms ease;
  transform: translateY(20px);
}

.root-word.visible {
  opacity: 0.6;
  transform: translateY(0);
}

/* ====== SEED ====== */
#seed {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1a1218 0%, #000000 100%);
  position: relative;
}

.seed-container {
  text-align: center;
  z-index: 3;
}

.seed-orb {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 60px;
}

.seed-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 160, 224, 0.3) 0%, rgba(168, 216, 200, 0.15) 40%, rgba(232, 200, 224, 0.05) 70%, transparent 100%);
  animation: seedPulse 4s ease-in-out infinite;
}

.seed-core {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #f0e8d8 0%, #c8a0e0 40%, #a8d8c8 70%, #e8c8e0 100%);
  box-shadow: 0 0 30px rgba(200, 160, 224, 0.5), 0 0 60px rgba(168, 216, 200, 0.3), 0 0 100px rgba(232, 200, 224, 0.15);
}

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

.seed-domain {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: #e8e0f0;
  opacity: 0.4;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .panel-left {
    margin-left: 5%;
  }
  .panel-right {
    margin-right: 5%;
  }
  .card-left {
    margin-left: calc(50% - 130px);
  }
  .card-right {
    margin-left: calc(50% + 10px);
  }
  .panel {
    max-width: 320px;
    padding: 20px 24px;
  }
}

/* Amber Sap accent color usage */
.seed-core {
  border: 1px solid rgba(224, 184, 152, 0.15);
}

.chevron-down svg path {
  filter: drop-shadow(0 0 8px #e0b898);
}

/* Grain position animation via custom properties */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  background-position: var(--grain-x, 0) var(--grain-y, 0);
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grain-opacity, 0.4);
  mix-blend-mode: overlay;
}
