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

::selection {
  background: rgba(245, 166, 35, 0.2);
  color: #F9F0FB;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

@keyframes floatDelay {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-15px) scale(1.03);
  }
}

@keyframes scrollLine {
  0% {
    top: -16px;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: calc(100%);
    opacity: 0;
  }
}

.animate-fade-up {
  animation: fadeUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-float {
  animation: float 8s ease-in-out infinite;
}

.animate-float-delay {
  animation: floatDelay 10s ease-in-out infinite;
  animation-delay: 2s;
}

.animate-scroll-line {
  animation: scrollLine 2s ease-in-out infinite;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.reveal.delay-1 {
  transition-delay: 0.1s;
}

.reveal.delay-2 {
  transition-delay: 0.2s;
}

.reveal.delay-3 {
  transition-delay: 0.3s;
}

/* Navbar scroll state */
nav.scrolled {
  background: rgba(38, 10, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

nav.scrolled .font-serif {
  color: rgba(255, 255, 255, 0.9);
}

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

/* Image loading */
img {
  display: block;
  max-width: 100%;
}

/* Smooth image rendering */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Mobile menu animation */
#mobile-menu {
  animation: fadeUp 0.3s ease forwards;
}

/* Subtle hover underline for menu items */
#nav-links a::after {
  content: '';
  display: block;
  width: 0;
  height: 1px;
  background: rgba(245, 166, 35, 0.6);
  transition: width 0.3s ease;
  margin-top: 2px;
}

#nav-links a:hover::after {
  width: 100%;
}

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

::-webkit-scrollbar-track {
  background: #260A2A;
}

::-webkit-scrollbar-thumb {
  background: rgba(245, 166, 35, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 166, 35, 0.5);
}
