/* Base & Reset */
*, *::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;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Scroll Reveal — progressive enhancement, visible without JS */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: no-preference) {
  .reveal-up,
  .reveal-left,
  .reveal-right {
    opacity: 0;
  }

  .reveal-up {
    transform: translateY(40px);
  }

  .reveal-left {
    transform: translateX(-40px);
  }

  .reveal-right {
    transform: translateX(40px);
  }

  .reveal-up.revealed,
  .reveal-left.revealed,
  .reveal-right.revealed {
    opacity: 1;
    transform: none;
  }
}

/* Navbar glass effect */
#navbar.scrolled {
  background: rgba(3, 10, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(94, 234, 212, 0.08);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
}

/* Mobile menu transitions */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #030A14;
}

::-webkit-scrollbar-thumb {
  background: #0f273c;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1e3a5c;
}

/* Selection */
::selection {
  background: rgba(94, 234, 212, 0.25);
  color: #f0fdf9;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}

/* Button ripple effect */
button, a {
  -webkit-tap-highlight-color: transparent;
}

/* Image loading placeholder */
img {
  background: linear-gradient(135deg, #0f273c 0%, #0A2540 100%);
  min-height: 100px;
}

/* Smooth image transitions */
img {
  transition: opacity 0.3s ease;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}
