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

:root {
  --bg: #090921;
  --text: #f8f8fa;
  --cream: #e2d9c6;
  --muted: #404558;
  --accent: #79b6f2;
  --serif: 'Cormorant Garamond', serif;
  --mono: 'Space Mono', monospace;
  /* --sans removed, revert to original fonts */
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}



body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  font-family: var(--mono);
  min-height: 200vh;
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3 {
  font-family: 'Inter', sans-serif;
  line-height: 1.2;
}
p {
  font-size: 1rem;
  line-height: 1.5;
}

#hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  z-index: 10;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(121, 182, 242, 0.05) 0%, transparent 60%);
}

.welcome-line {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
  opacity: 0;
  filter: blur(20px);
  transform: translateY(10px);
  animation: blurIn 2s forwards;
  text-shadow: 0 2px 16px #79b6f2, 0 0 2px #fff2;
}

.welcome-line:first-child {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

.welcome-line.cursive {
  font-size: clamp(3rem, 7vw, 5rem);
  font-style: italic;
  color: var(--cream);
  animation-delay: .6s;
}

@keyframes blurIn {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.hint {
  position: absolute;
  bottom: 60px;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .2em;
  color: var(--muted);
  opacity: .7;
}

#moon-loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity .55s ease, visibility .55s ease;
  pointer-events: none;
}

#moon-loading.done {
  opacity: 0;
  visibility: hidden;
}

#moon-loading-inner {
  text-align: center;
  max-width: 220px;
}

.moon-loading-label {
  display: block;
  font-family: var(--mono);
  font-size: .55rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.moon-loading-bar {
  height: 2px;
  background: rgba(255, 255, 255, .08);
  border-radius: 1px;
  overflow: hidden;
}

.moon-loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5a6a82, #c4b89a);
  border-radius: 1px;
  transition: width .15s ease;
}

#scroll-space {
  height: 120vh;
}

#moon-canvas {
  position: fixed;
  inset: 0;
  cursor: pointer;
  z-index: 2;
}

#labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity .6s ease;
}

#labels.show {
  opacity: 1;
}


body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 217, 198, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Atmospheric Hover Backgrounds */
.hover-bg {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100vw;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.coding-bg {
  left: 0;
}

.creativity-bg {
  right: 0;
}

body:has(.label.left:hover) .coding-bg {
  opacity: 1;
}

body:has(.label.right:hover) .creativity-bg {
  opacity: 1;
}

#labels:has(.label.left:hover) .label.right,
#labels:has(.label.right:hover) .label.left {
  opacity: 0.15;
  filter: blur(8px);
}

/* Canvas inside hover backgrounds */
#matrix-canvas,
#creativity-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#matrix-canvas {
  opacity: 0.4;
}

/* Coding side: dark green vignette behind matrix rain */
.coding-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(0, 30, 10, 0.85) 0%, transparent 70%);
  z-index: -1;
}

/* Creativity side: dark purple vignette behind abstract art */
.creativity-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(30, 0, 50, 0.75) 0%, transparent 70%);
  z-index: -1;
}

/* ── Desktop: bigger hit area for labels ─────────────── */
.label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
  padding: 20px 28px;
}

.label.left {
  left: 52px;
}

.label.right {
  right: 52px;
}

.label:hover {
  color: rgba(255, 255, 255, 0.9);
}

body:has(.label.left:hover) .label.left {
  color: rgba(0, 255, 65, 0.8);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

body:has(.label.right:hover) .label.right {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.3), 0 0 20px rgba(0, 252, 237, 0.15);
}

/* ── Preloader ──────────────────────────────────────── */
.preloader-moon {
  margin: 0 auto 18px;
  width: 60px;
  height: 60px;
}
.preloader-arc {
  animation: preloaderSpin 1.8s ease-in-out infinite;
  transform-origin: center;
}
@keyframes preloaderSpin {
  0% { stroke-dashoffset: 150.8; transform: rotate(0deg); }
  50% { stroke-dashoffset: 40; }
  100% { stroke-dashoffset: 150.8; transform: rotate(360deg); }
}

/* ── Bottom Nav ─────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 2rem;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
#labels.show ~ #bottom-nav {
  opacity: 1;
  pointer-events: auto;
}
.bottom-link {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255,255,255,0.35);
  transition: color 0.3s ease;
}
.bottom-link:hover {
  color: rgba(255,255,255,0.8);
}

/* ── Easter Egg ─────────────────────────────────────── */
.easter-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 50;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #c8b8ff;
  background: rgba(20,20,30,0.9);
  border: 1px solid rgba(200,184,255,0.2);
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.easter-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.floating-astronaut {
  position: fixed;
  z-index: 15;
  pointer-events: none;
  animation: astronautFloat 6s ease-in-out forwards;
}
@keyframes astronautFloat {
  0% { bottom: -60px; left: 45%; opacity: 0; transform: rotate(0deg); }
  15% { opacity: 0.8; }
  50% { bottom: 55%; left: 52%; transform: rotate(15deg); }
  100% { bottom: 110%; left: 60%; opacity: 0; transform: rotate(-10deg); }
}

@media (max-width: 768px) {
  /* Hero text — readable, no overlap */
  .welcome-line:first-child {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }
  .welcome-line.cursive {
    font-size: clamp(2.2rem, 9vw, 3rem);
  }
  #hero {
    padding-top: 0;
    justify-content: flex-start;
    padding-top: 22vh;
  }
  .hint {
    bottom: 40px;
    font-size: 0.55rem;
  }

  /* Labels: stack vertically at bottom, large tap targets */
  #labels {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    padding-bottom: 100px;
    gap: 0;
    inset: 0;
  }
  .label {
    position: static;
    transform: none;
    top: auto;
    left: auto;
    right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px 24px;
    font-size: 13px;
    letter-spacing: 0.3em;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .label.left {
    left: auto;
  }
  .label.right {
    right: auto;
  }

  /* Bottom nav: spread out, easier to tap */
  #bottom-nav {
    bottom: 20px;
    gap: 1.5rem;
    width: 100%;
    justify-content: center;
    padding: 0 1rem;
  }
  .bottom-link {
    padding: 10px 8px;
    font-size: 10px;
  }

  /* Disable hover-only canvas effects on touch */
  .hover-bg {
    display: none;
  }

  /* Reduce star count impact — canvas still renders but lighter */
  #starfield-canvas {
    opacity: 0.6;
  }

  /* Cursor trail off on touch devices */
  #cursor-trail-canvas {
    display: none;
  }

  .featured-grid {
    grid-template-columns: 1fr !important;
  }
}

