/* ===== 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 (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.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal-delay-1 { transition-delay: 0.1s; }
  .reveal-delay-2 { transition-delay: 0.2s; }
  .reveal-delay-3 { transition-delay: 0.3s; }
  .reveal-delay-4 { transition-delay: 0.4s; }
}

/* ===== Navbar Scroll State ===== */
.navbar-scrolled {
  background: rgba(8, 10, 13, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #111418;
}
::-webkit-scrollbar-thumb {
  background: #363b42;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #5f6670;
}

/* ===== Selection ===== */
::selection {
  background: rgba(255, 107, 46, 0.3);
  color: #fff;
}

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

/* ===== Mobile Menu Animation ===== */
.menu-line {
  display: block;
}

#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) {
  transform: rotate(-45deg) translate(5px, -5px);
  width: 1.5rem;
}

/* ===== Smooth anchor offset ===== */
section[id] {
  scroll-margin-top: 80px;
}
