/* ── Global ───────────────────────────────────────────── */
*, *::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; }
img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* ── Navbar scroll state ──────────────────────────────── */
#nav.scrolled {
  background: rgba(253, 248, 243, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* ── Mobile menu ──────────────────────────────────────── */
#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}
#mobileMenu .mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}
#mobileMenu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}
#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }

/* ── Menu button animation ────────────────────────────── */
#menuBtn.active .menu-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
#menuBtn.active .menu-line:nth-child(2) {
  opacity: 0;
}
#menuBtn.active .menu-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
  width: 24px;
}

/* ── Smooth image loading ─────────────────────────────── */
img {
  background: linear-gradient(135deg, #f3e9d5 0%, #fce4d9 100%);
  min-height: 200px;
}

/* ── Selection color ──────────────────────────────────── */
::selection {
  background: rgba(229, 83, 48, 0.15);
  color: #2C2C2C;
}

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

/* ── Writing mode fallback ────────────────────────────── */
.writing-mode-vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #FDF8F3; }
::-webkit-scrollbar-thumb { background: #dbba85; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c49a6a; }

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
