/* Base & resets */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* Selection */
::selection { background: #B85446; color: #FDF9F4; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #FDF9F4; }
::-webkit-scrollbar-thumb { background: #D4A56A; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #B85446; }

/* Reveal animations — progressive enhancement, only active when JS adds class */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

/* When JS is active, start hidden and animate in */
.js .reveal {
  opacity: 0;
  transform: translateY(30px);
}
.js .reveal.reveal-active {
  opacity: 1;
  transform: none;
}

/* Staggered children */
.reveal-group > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-group > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-group > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-group > *:nth-child(4) { transition-delay: 0.35s; }

/* Navbar scroll state */
#nav.scrolled {
  background: rgba(253, 249, 244, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(61, 43, 31, 0.08);
}
#nav.scrolled .menu-line { background: #3D2B1F; }

/* Mobile menu */
#mobileMenu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-link {
  transition: opacity 0.3s ease;
}
#mobileMenu:not(.open) .mobile-link {
  opacity: 0;
  pointer-events: none;
}
#mobileMenu.open .mobile-link {
  opacity: 1;
}

/* Mobile menu button active state */
#mobileMenu.open ~ div .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}
#mobileMenu.open ~ div .menu-line:nth-child(2) {
  opacity: 0;
}
#mobileMenu.open ~ div .menu-line:nth-child(3) {
  width: 5;
  transform: rotate(-45deg) translate(3px, -3px);
}

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

/* Print */
@media print {
  #nav, #mobileMenu, .reveal { display: none; }
  body { color: #000; background: #fff; }
}
