/* ─── Custom Properties ──────────────────────────────────────────────────── */
:root {
  --bg-deep:        #060E09;
  --bg-surface:     #0A1A12;
  --forest:         #0D2820;
  --glow-primary:   #00FF7F;
  --glow-secondary: #39C47A;
  --ivy:            #1A4A2E;
  --text-primary:   #E8F5E9;
  --text-muted:     #7DAF8A;
  --accent-circuit: #00E5A0;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv01', 'cv02', 'cv05';  /* Inter optical alternates */
}

/* ─── WebGL Canvas ───────────────────────────────────────────────────────── */
#canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ─── Logo glow — green radial gradient that illuminates the ivy plane ───── */
/* z-index stack: 0 WebGL (ivy plane lives inside here now) | 2 ivy-glow | 3 vignette */
#ivy-glow {
  position: fixed;
  inset: 0;
  z-index: 2;
  /* Radial gradient centered on the logo (50% 42%) — fades toward the edges
     where the ivy grows, simulating green light cast from the logo outward   */
  background: radial-gradient(
    ellipse 72% 60% at 50% 42%,
    rgba(0, 255, 127, 0.18) 0%,
    rgba(0, 90, 45,  0.06) 40%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0; /* driven each frame by main.js in sync with logo pulse */
}

/* ─── Vignette ───────────────────────────────────────────────────────────── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;  /* was 2 — pushed up to sit above the glow overlay */
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 38%,
    rgba(6, 14, 9, 0.55) 72%,
    rgba(6, 14, 9, 0.88) 100%
  );
  pointer-events: none;
}

/* ─── Loading Screen ─────────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.85s ease;
}

#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

.loader-text {
  font-size: clamp(0.65rem, 1.8vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--glow-primary);
  text-shadow:
    0 0 16px var(--glow-primary),
    0 0 40px rgba(0, 255, 127, 0.25);
}

.loader-track {
  width: clamp(140px, 28vw, 260px);
  height: 1px;
  background: rgba(0, 255, 127, 0.12);
  position: relative;
  overflow: hidden;
}

.loader-track::after {
  /* scanline shimmer */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 255, 127, 0.25) 50%,
    transparent 100%
  );
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%);  }
}

#loaderBar {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 0%;
  background: var(--glow-primary);
  box-shadow: 0 0 10px var(--glow-primary), 0 0 24px rgba(0, 255, 127, 0.4);
  transition: width 0.06s linear;
}

/* ─── Main Overlay ───────────────────────────────────────────────────────── */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;   /* text sits in the lower third */
  padding-bottom: clamp(3rem, 7vh, 6rem);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.1s ease 0.3s;
}

#overlay.visible {
  opacity: 1;
}

.overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.2rem, 3vh, 2rem);
  text-align: center;
  padding: 0 2rem;
  pointer-events: none;
}

/* ─── Brand ──────────────────────────────────────────────────────────────── */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.brand-name {
  font-size: clamp(1.8rem, 5.5vw, 4.5rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-shadow:
    0 0 24px rgba(0, 255, 127, 0.18),
    0 0 60px rgba(0, 255, 127, 0.08);
  line-height: 1;
  font-variation-settings: 'opsz' 32;  /* Inter optical display size */
}

.brand-tagline {
  font-size: clamp(0.9rem, 2.2vw, 1.3rem);
  font-weight: 275;
  color: var(--glow-primary);
  letter-spacing: 0.06em;
  text-shadow: 0 0 22px rgba(0, 255, 127, 0.55);
  font-variation-settings: 'opsz' 20;
}

/* ─── Status ─────────────────────────────────────────────────────────────── */
.status-text {
  font-size: clamp(0.65rem, 1.4vw, 0.82rem);
  font-weight: 400;
  letter-spacing: 0.10em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-variation-settings: 'opsz' 14;
}

/* ─── Social Links ───────────────────────────────────────────────────────── */
.socials {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 4vw, 2.4rem);
  pointer-events: auto;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.22s ease, filter 0.22s ease, transform 0.22s ease;
}

.social-link svg {
  width: 22px;
  height: 22px;
}

.social-link:hover {
  color: var(--glow-primary);
  filter: drop-shadow(0 0 7px var(--glow-primary));
  transform: translateY(-3px);
}

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .brand-name {
    letter-spacing: 0.08em;
  }
}
