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

img {
  max-width: 100%;
  height: auto;
}

/* Scroll Reveal Animations */
.reveal {
  opacity: 1;
  transform: translateY(0);
  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);
}

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

/* Navbar transition */
#navbar.scrolled {
  background: rgba(26, 18, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.2);
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #fdf8f3;
}
::-webkit-scrollbar-thumb {
  background: #c43f3f;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a32e2e;
}

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

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

/* Smooth image loading */
img {
  transition: opacity 0.3s ease;
}
img[loading="lazy"] {
  opacity: 0;
}
img.loaded, img:not([loading="lazy"]) {
  opacity: 1;
}
