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

::selection {
  background: rgba(196, 105, 74, 0.3);
  color: #f7f7f6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #161412;
}
::-webkit-scrollbar-thumb {
  background: #3f3d37;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #c4694a;
}

/* ===== NAVBAR SCROLLED STATE ===== */
#site-header.scrolled {
  background: rgba(22, 20, 18, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(63, 61, 55, 0.4);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== MOBILE MENU ===== */
.mobile-link {
  opacity: 1;
}

#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.closed {
  opacity: 0;
  pointer-events: none;
}

/* Menu button animation */
.menu-line {
  display: block;
}

#menu-toggle.active .menu-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
#menu-toggle.active .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#menu-toggle.active .menu-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  width: 24px;
}

/* ===== HERO REVEAL ANIMATIONS ===== */
.reveal-up {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Initial states for scroll-triggered elements — visible by default for progressive enhancement */
.reveal-on-scroll {
  opacity: 1;
  transform: translateY(0);
}

/* When JS is enabled, add animated states */
.js-enabled .reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-enabled .reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

.js-enabled .reveal-on-scroll.revealed-delay-1 {
  transition-delay: 0.1s;
}

.js-enabled .reveal-on-scroll.revealed-delay-2 {
  transition-delay: 0.2s;
}

.js-enabled .reveal-on-scroll.revealed-delay-3 {
  transition-delay: 0.3s;
}

/* Hero initial animation states (CSS-only, no JS dependency) */
@keyframes heroSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroSlideRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reveal-up {
  animation: heroSlideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: inherit;
}

.reveal-up:nth-child(1) { animation-delay: 0s; }
.reveal-up:nth-child(2) { animation-delay: 0.1s; }
.reveal-up:nth-child(3) { animation-delay: 0.2s; }
.reveal-up:nth-child(4) { animation-delay: 0.3s; }
.reveal-up:nth-child(5) { animation-delay: 0.4s; }

.reveal-right {
  animation: heroSlideRight 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.2s;
}

/* ===== IMAGE HOVER EFFECTS ===== */
.group:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

/* ===== BUTTON HOVER RISE ===== */
button, a {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== FOCUS STYLES ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(196, 105, 74, 0.7);
  outline-offset: 2px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
  .font-display.text-5xl {
    font-size: 2.75rem;
    line-height: 1.1;
  }
  
  .font-display.text-4xl {
    font-size: 2.25rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .font-display.text-5xl {
    font-size: 3.5rem;
  }
}

/* ===== LOADING STATE ===== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #161412;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-wave {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 40px;
}

.loader-wave span {
  width: 4px;
  background: #c4694a;
  border-radius: 2px;
  animation: loaderWave 1s ease-in-out infinite;
}

.loader-wave span:nth-child(1) { animation-delay: 0s; height: 16px; }
.loader-wave span:nth-child(2) { animation-delay: 0.1s; height: 24px; }
.loader-wave span:nth-child(3) { animation-delay: 0.2s; height: 32px; }
.loader-wave span:nth-child(4) { animation-delay: 0.3s; height: 24px; }
.loader-wave span:nth-child(5) { animation-delay: 0.4s; height: 16px; }

@keyframes loaderWave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}
