/* Base & Utilities */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth scroll offset for fixed nav */
section[id] {
  scroll-margin-top: 80px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Selection */
::selection {
  background: #0d9488;
  color: white;
}

/* Mobile menu active state */
body.menu-open {
  overflow: hidden;
}

/* Scroll reveal base — visible by default, animated via JS */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .reveal.revealed {
    opacity: 1;
    transform: none;
  }
  .group:hover img {
    transform: none;
  }
}

/* Navbar transitions */
.nav-text {
  transition: color 0.3s ease;
}
.nav-subtext {
  transition: color 0.3s ease;
}

/* Mobile link transitions */
.mobile-link {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

body.menu-open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger mobile links */
.mobile-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-link:nth-child(2) { transition-delay: 0.1s; }
.mobile-link:nth-child(3) { transition-delay: 0.15s; }
.mobile-link:nth-child(4) { transition-delay: 0.2s; }
.mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* Menu button animation */
.menu-line {
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

body.menu-open .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
body.menu-open .menu-line:nth-child(2) {
  opacity: 0;
}
body.menu-open .menu-line:nth-child(3) {
  width: 6px;
  transform: translateY(-4px) rotate(-45deg);
  margin-right: 0;
}
