/* ===== BASE & RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

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

::selection {
  background-color: #7B2D3B;
  color: #FDF9F5;
}

/* ===== NAVBAR SCROLL STATE ===== */
#navbar.scrolled {
  background-color: rgba(61, 16, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

#navbar.scrolled .nav-text-white {
  color: #FDF9F5;
}

/* ===== MOBILE MENU ===== */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.open .mobile-link {
  animation: fadeSlideIn 0.4s ease forwards;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== HAMBURGER ANIMATION ===== */
.menu-toggle.active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .menu-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .menu-line:nth-child(3) {
  width: 1.5rem;
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== HERO ENTRANCE ANIMATIONS ===== */
.hero-entrance {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-entrance:nth-child(1) { transition-delay: 0.2s; }
.hero-entrance:nth-child(2) { transition-delay: 0.4s; }
.hero-entrance:nth-child(3) { transition-delay: 0.6s; }
.hero-entrance:nth-child(4) { transition-delay: 0.8s; }
.hero-entrance:nth-child(5) { transition-delay: 1.0s; }

/* ===== SCROLL REVEAL ANIMATIONS ===== */
/* Default: visible (no JS fallback) */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 1;
  transform: none;
}

/* When JS adds the 'revealed' class */
.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/*
 * Progressive enhancement: hide before reveal via JS.
 * If JS is blocked, content remains visible (default state above).
 * Respects reduced-motion preference.
 */
@media (prefers-reduced-motion: no-preference) {
  .reveal-up {
    opacity: 0;
    transform: translateY(32px);
  }
  .reveal-left {
    opacity: 0;
    transform: translateX(-32px);
  }
  .reveal-right {
    opacity: 0;
    transform: translateX(32px);
  }
}

/* ===== FORM STYLES ===== */
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' stroke='%237B2D3B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

select:focus,
input:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(123, 45, 59, 0.1);
}

/* ===== FOCUS VISIBLE ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #7B2D3B;
  outline-offset: 2px;
}

/* ===== UTILITY ===== */
@media (max-width: 768px) {
  .font-display {
    line-height: 1.15;
  }
}
