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

body {
  overflow-x: hidden;
}

::selection {
  background-color: rgba(212, 168, 75, 0.3);
  color: #1a3a2a;
}

/* Scroll Reveal Animations */
.reveal-item {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal delays */
.reveal-item:nth-child(1)  { transition-delay: 0.0s; }
.reveal-item:nth-child(2)  { transition-delay: 0.08s; }
.reveal-item:nth-child(3)  { transition-delay: 0.16s; }
.reveal-item:nth-child(4)  { transition-delay: 0.24s; }
.reveal-item:nth-child(5)  { transition-delay: 0.32s; }
.reveal-item:nth-child(6)  { transition-delay: 0.40s; }
.reveal-item:nth-child(7)  { transition-delay: 0.48s; }
.reveal-item:nth-child(8)  { transition-delay: 0.56s; }
.reveal-item:nth-child(9)  { transition-delay: 0.64s; }
.reveal-item:nth-child(10) { transition-delay: 0.72s; }
.reveal-item:nth-child(11) { transition-delay: 0.80s; }
.reveal-item:nth-child(12) { transition-delay: 0.88s; }

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

/* Initial state for reveal items (JS adds .revealed) */
.reveal-item {
  opacity: 0;
  transform: translateY(24px);
}

/* Navbar transition */
#navbar.scrolled {
  background-color: rgba(10, 26, 17, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(250, 248, 244, 0.05);
}

#navbar.scrolled .menu-line {
  background-color: #faf8f4;
}

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

/* Mobile menu button animation */
.menu-btn-active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-btn-active .menu-line:nth-child(2) {
  opacity: 0;
}

.menu-btn-active .menu-line:nth-child(3) {
  width: 20px;
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Smooth image loading */
img {
  opacity: 1;
  transition: opacity 0.3s ease;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #8fb892;
}

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

/* Print styles */
@media print {
  #navbar,
  #mobile-menu,
  .reveal-item {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
