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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  overflow-x: hidden;
}

/* Hero entrance animations — above the fold, always visible */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Scroll reveal — below the fold only, progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  }

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

/* Fallback: if JS is disabled, all content is visible */
@media not all and (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Mobile menu transitions */
#mobile-menu {
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.mobile-link {
  transition: color 0.3s ease;
}

/* Navbar scroll state */
.nav-scrolled {
  background: rgba(5, 13, 26, 0.92) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #050D1A;
}
::-webkit-scrollbar-thumb {
  background: rgba(77, 184, 130, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(77, 184, 130, 0.5);
}

/* Selection color */
::selection {
  background: rgba(77, 184, 130, 0.3);
  color: #fff;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #4DB882;
  outline-offset: 2px;
}

/* Image placeholder shimmer */
img {
  display: block;
}

/* Smooth image loading */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
