*, *::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(200, 149, 108, 0.3);
  color: #f5efe8;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0e0b0a;
}

::-webkit-scrollbar-thumb {
  background: rgba(200, 149, 108, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 149, 108, 0.5);
}

/* Navbar scroll state */
.navbar-scrolled #navbar {
  background: rgba(8, 6, 5, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(200, 149, 108, 0.1);
}

.navbar-scrolled #navbar .nav-link {
  color: rgba(245, 239, 232, 0.85);
}

/* Mobile menu states */
.mobile-menu-open {
  opacity: 1 !important;
  pointer-events: all !important;
}

/* Reveal animations — progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 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; }
}

/* Hero parallax on scroll */
@media (prefers-reduced-motion: no-preference) {
  #hero img {
    will-change: transform;
    transition: transform 0.1s linear;
  }
}

/* Button focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(200, 149, 108, 0.6);
  outline-offset: 2px;
}

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

/* Mobile menu overlay backdrop */
#mobileMenu::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 5, 0.6);
  backdrop-filter: blur(4px);
}

/* Gold shimmer on hover for special elements */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Pulse animation for status indicator */
@keyframes softPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.animate-pulse {
  animation: softPulse 2s ease-in-out infinite;
}

/* Link underline animation */
.nav-link {
  position: relative;
}

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

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

/* Input autofill styling for dark theme */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #0e0b0a inset !important;
  -webkit-text-fill-color: #f5efe8 !important;
  caret-color: #f5efe8;
}
