*, *::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: 8px;
}
::-webkit-scrollbar-track {
  background: #1a1a1a;
}
::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #545454;
}

/* Selection */
::selection {
  background: rgba(240, 90, 26, 0.3);
  color: #fff;
}

/* Fade-in animation for hero */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Scroll reveal */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
  }
  .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Navbar scroll state */
.navbar-scrolled {
  background: rgba(15, 15, 15, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(64, 64, 64, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Image lazy loading fade */
img {
  transition: opacity 0.4s ease, transform 0.6s ease;
}

img[data-src] {
  opacity: 0;
}

img.loaded {
  opacity: 1;
}

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

/* Mobile menu animation */
#mobile-menu {
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  opacity: 1;
}

#mobile-menu.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

/* Smooth section transitions */
section {
  position: relative;
}

/* Subtle grain texture overlay on hero */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
}
