/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

/* ===== Scroll Reveal (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }

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

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

/* ===== Navbar transition ===== */
#nav.scrolled {
  background: rgba(10, 22, 40, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(201, 168, 76, 0.15);
}

#nav.scrolled .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

#nav.scrolled #logo-text {
  color: #ffffff;
}

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

#mobile-menu .mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

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

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

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

#menu-btn.active .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

#menu-btn.active .menu-line:nth-child(2) {
  opacity: 0;
}

#menu-btn.active .menu-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
  width: 1.25rem;
}

/* ===== Selection color ===== */
::selection {
  background: rgba(201, 168, 76, 0.3);
  color: #0a1628;
}

/* ===== Focus styles ===== */
input:focus, textarea:focus, button:focus {
  outline: none;
}

/* ===== Button hover lift ===== */
button, a {
  -webkit-tap-highlight-color: transparent;
}

/* ===== Subtle image shimmer on load ===== */
img {
  background: linear-gradient(135deg, #0f1c3f 0%, #152a56 50%, #0f1c3f 100%);
  background-size: 200% 200%;
  animation: shimmer 1.5s ease-out;
}

@keyframes shimmer {
  0% { background-position: 200% 200%; }
  100% { background-position: -200% -200%; }
}

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