/* === 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;
}

::selection {
  background-color: rgba(123, 45, 59, 0.2);
  color: #7B2D3B;
}

/* === Scroll Reveal (progressive enhancement) === */
@media (prefers-reduced-motion: no-preference) {
  .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);
  }
}

/* Fallback: ensure content is visible even without JS */
@supports not (animation: none) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* === Navbar Transition === */
.nav-scrolled #navbar {
  background-color: rgba(61, 17, 24, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(253, 248, 244, 0.06);
}

.nav-scrolled .nav-text {
  color: #FDF8F4 !important;
}

/* === Mobile Menu === */
.mobile-menu-open {
  overflow: hidden;
}

#mobileMenu.opacity-100 {
  opacity: 1;
  pointer-events: auto;
}

#mobileMenu.opacity-0 {
  opacity: 0;
  pointer-events: none;
}

#bar1.menu-open {
  transform: translateY(5.5px) rotate(45deg);
}

#bar2.menu-open {
  opacity: 0;
}

#bar3.menu-open {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #FDF8F4;
}

::-webkit-scrollbar-thumb {
  background: #7B2D3B;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a31f46;
}

/* === Form Focus Styles === */
input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* === Select Arrow === */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%237B2D3B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

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

/* === Selection for dark backgrounds === */
.bg-burgundy-950 ::selection,
#testimonials ::selection {
  background-color: rgba(245, 230, 211, 0.25);
  color: #FDF8F4;
}
