/* ─── Base & Utilities ─── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

/* ─── Navbar ─── */
#nav {
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(200, 180, 160, 0.15);
  transition: box-shadow 0.4s ease, background 0.4s ease;
}

#nav.scrolled {
  background: rgba(253, 251, 247, 0.95);
  box-shadow: 0 1px 20px rgba(139, 71, 54, 0.06);
}

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

#mobile-menu.closed {
  opacity: 0;
  pointer-events: none;
}

.mobile-link {
  font-size: 1.5rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

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

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

/* ─── Hamburger ─── */
.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;
}

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 1;
  transform: translateY(0);
  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);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}

/* ─── Selection ─── */
::selection {
  background: rgba(196, 114, 90, 0.2);
  color: #5C3025;
}

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

/* ─── Input autofill ─── */
input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #FAF5EC inset !important;
  -webkit-text-fill-color: #292524 !important;
}
