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

::selection {
  background-color: rgba(212, 168, 83, 0.3);
  color: #faf8f0;
}

/* ===== Scroll Reveal (Progressive Enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .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; }
}

/* Default visible state for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Navbar ===== */
#navbar {
  background: transparent;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
  background: rgba(2, 44, 34, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(212, 168, 83, 0.1), 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, #d4a853, #f0d48a);
  transition: width 0.3s ease;
}

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

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

#mobileMenu.close {
  opacity: 0;
  pointer-events: none;
}

.mobile-nav-link {
  position: relative;
}

/* Menu button animation */
.menu-line {
  display: block;
}

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

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

#menuBtn.active .menu-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  width: 1.375rem;
}

/* ===== Gold gradient text utility ===== */
.text-gold-gradient {
  background: linear-gradient(135deg, #f0d48a, #d4a853, #b8862d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

::-webkit-scrollbar-track {
  background: #022c22;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4a853, #9a6f20);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f0d48a, #d4a853);
}

/* ===== Focus styles ===== */
a:focus-visible, button:focus-visible {
  outline: 2px solid #d4a853;
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ===== Responsive adjustments ===== */
@media (max-width: 767px) {
  html {
    scroll-padding-top: 80px;
  }
}

@media (min-width: 768px) {
  html {
    scroll-padding-top: 100px;
  }
}
