/* ─── BASE ─── */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

::selection {
  background: rgba(168, 85, 247, 0.3);
  color: #4c1d95;
}

/* ─── NAVBAR ─── */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #fbbf24;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ─── MOBILE MENU ─── */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.open .mobile-link {
  animation: fadeDown 0.4s ease forwards;
  opacity: 0;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hamburger animation */
#menu-btn.active #bar1 {
  transform: translateY(5px) rotate(45deg);
}

#menu-btn.active #bar2 {
  opacity: 0;
}

#menu-btn.active #bar3 {
  transform: translateY(-5px) rotate(-45deg);
}

/* ─── SCROLL REVEAL (progressive enhancement) ─── */
@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger children */
  .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
  .scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
  .scroll-reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* ─── HERO PARALLAX SUBTLE ─── */
#hero img {
  will-change: transform;
}

/* ─── SMOOTH IMAGE LOADING ─── */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ─── FOCUS VISIBLE ─── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── CUSTOM SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #2e1065;
}

::-webkit-scrollbar-thumb {
  background: #7c3aed;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a855f7;
}

/* ─── FORM INPUTS ─── */
input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* ─── UTILITY ─── */
@media (max-width: 768px) {
  .font-display {
    line-height: 1.15;
  }
}
