/* ===== Base & Utilities ===== */
*, *::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: #3d5729;
  color: #fafaf5;
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  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-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ===== Navigation ===== */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: #3d5729;
  transition: width 0.3s ease;
}

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

/* ===== Mobile Menu ===== */
.mobile-nav-link {
  position: relative;
}

.mobile-nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1.5px;
  background-color: #3d5729;
  transition: width 0.3s ease;
}

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

/* ===== Header States ===== */
.header-scrolled {
  background-color: rgba(250, 250, 245, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(61, 87, 41, 0.08);
}

.header-scrolled .font-serif {
  color: #12180c;
}

/* ===== Menu Animation ===== */
.menu-open .menu-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-open .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-open .menu-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ===== Image Hover ===== */
img {
  will-change: transform;
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #517336;
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

::-webkit-scrollbar-thumb {
  background: #c5d9b3;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ab87e;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 767px) {
  .reveal {
    transform: translateY(24px);
  }
}
