/* Base */
*, *::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;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #2b0f17;
}
::-webkit-scrollbar-thumb {
  background: #5d263a;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #732e48;
}

/* Selection */
::selection {
  background: rgba(245, 166, 35, 0.2);
  color: #f5e9ee;
}

/* Scroll line animation */
.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Hero reveal animations */
@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-up {
  animation: revealUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Scroll reveal (below fold) */
.reveal.revealed {
  animation: revealFade 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes revealFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stat cards float */
.stat-card {
  animation: floatCard 3s ease-in-out infinite;
}

.stat-card:nth-child(2) { animation-delay: 0.4s; }
.stat-card:nth-child(3) { animation-delay: 0.8s; }
.stat-card:nth-child(4) { animation-delay: 1.2s; }

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

/* Nav transition */
nav.scrolled {
  background: rgba(43, 15, 23, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(93, 38, 58, 0.4);
}

/* Mobile menu */
#menu.open {
  display: flex;
}

#mobileOverlay.open {
  display: block;
}

.menu-line:last-child {
  width: 1.5rem;
}

#menuBtn.active .menu-line:first-child {
  transform: rotate(45deg) translate(3px, 3px);
}
#menuBtn.active .menu-line:nth-child(2) {
  opacity: 0;
}
#menuBtn.active .menu-line:last-child {
  width: 1.5rem;
  transform: rotate(-45deg) translate(3px, -3px);
}

/* Focus visible */
a:focus-visible, button:focus-visible {
  outline: 1px solid rgba(245, 166, 35, 0.5);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal-up { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
  .stat-card { animation: none; }
}
