/* ── Base & Typography ── */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: #ffcec3;
  color: #781f0e;
}

/* ── Scroll Reveal (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    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);
  }
}

/* Fallback: if JS is disabled, all content is visible */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* ── Nav Link Underline Hover ── */
.nav-link::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: #ff5c3a;
  border-radius: 9999px;
  margin-top: 2px;
  transition: width 0.3s ease;
}

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

/* ── Header Scroll State ── */
#site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── Mobile Menu Transition ── */
#mobile-menu {
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

#mobile-menu.hidden {
  animation: slideUp 0.25s ease forwards;
}

@keyframes slideUp {
  from {
    opacity: 1;
    max-height: 500px;
  }
  to {
    opacity: 0;
    max-height: 0;
  }
}

/* ── Button Focus States ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #ff5c3a;
  outline-offset: 2px;
  border-radius: 0.5rem;
}

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

::-webkit-scrollbar-track {
  background: #fff5f2;
}

::-webkit-scrollbar-thumb {
  background: #ffcec3;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ffaa96;
}

/* ── Responsive Tweaks ── */
@media (max-width: 640px) {
  .font-serif {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }
}
