*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  overflow-x: hidden;
}

/* Scroll reveal animations — progressive enhancement, only when JS runs and user prefers motion */
@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }

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

  .stat-card {
    animation: float 6s ease-in-out infinite;
  }

  .stat-card:nth-child(2) {
    animation-delay: -1.5s;
  }

  .stat-card:nth-child(3) {
    animation-delay: -3s;
  }

  .stat-card:nth-child(4) {
    animation-delay: -4.5s;
  }

  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }
}

/* Navbar scroll state */
nav.scrolled {
  background: rgba(253, 251, 247, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

nav.scrolled .font-display,
nav.scrolled span {
  color: #4a3b30 !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f5ebd0;
}
::-webkit-scrollbar-thumb {
  background: #B8544E;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a84640;
}

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

/* Selection */
::selection {
  background: #B8544E;
  color: white;
}
