/* === Base & Utilities === */
*, *::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(232, 96, 74, 0.3);
  color: #f7f7f7;
}

/* === Scroll Reveal (progressive enhancement) === */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }

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

  .reveal:nth-child(2) { transition-delay: 0.1s; }
  .reveal:nth-child(3) { transition-delay: 0.2s; }
  .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* Fallback: content always visible if JS is disabled */
.no-js .reveal,
.js:not(body) .reveal {
  opacity: 1;
  transform: none;
}

/* === Navbar === */
.nav-fixed {
  will-change: transform;
}

/* === Mobile Menu === */
#mobileMenu {
  max-height: 0;
}

#mobileMenu.open {
  max-height: 400px;
}

.menu-line {
  display: block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menuBtn[aria-expanded="true"] .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

#menuBtn[aria-expanded="true"] .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#menuBtn[aria-expanded="true"] .menu-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
  width: 5rem;
}

.mobile-link {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(51, 51, 51, 0.5);
}

.mobile-link:last-child {
  border-bottom: none;
}

/* === Hero scroll indicator === */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.animate-bounce {
  animation: bounce 1.5s ease-in-out infinite;
}

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

::-webkit-scrollbar-track {
  background: #0d0d0d;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

/* === Image aspect ratio helpers === */
.aspect-square {
  aspect-ratio: 1 / 1;
}

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

/* === Print styles === */
@media print {
  .nav-fixed,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  body {
    background: white;
    color: black;
  }
}
