/* Base & utilities */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #FDF8F4;
}
::-webkit-scrollbar-thumb {
  background: #d4c8be;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #b8a89a;
}

/* Navbar scroll state */
#navbar.scrolled {
  background: rgba(253, 248, 244, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* Nav links underline animation */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #b83939;
  border-radius: 1px;
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

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

.mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s 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 animation */
#mobile-menu.open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
#mobile-menu.open .hamburger-line:nth-child(2) {
  opacity: 0;
}
#mobile-menu.open .hamburger-line:nth-child(3) {
  width: 20px;
  transform: rotate(-45deg) translate(5px, -5px);
  margin-left: 0;
}

/* Float animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.06s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.18s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.24s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.30s; }
.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Selection color */
::selection {
  background: #f9e4e4;
  color: #7d2525;
}

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

/* Responsive tweaks */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 70px;
  }
}
