/* ─── Base & Resets ─── */
*, *::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-color: rgba(212, 168, 67, 0.3);
  color: #0a1a12;
}

/* ─── Hero entrance animations (above the fold — no JS dependency for visibility) ─── */
.hero-element {
  opacity: 1;
  animation: heroReveal 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-element:nth-child(1) { animation-delay: 0.1s; }
.hero-element:nth-child(2) { animation-delay: 0.25s; }
.hero-element:nth-child(3) { animation-delay: 0.4s; }
.hero-element:nth-child(4) { animation-delay: 0.55s; }

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

/* ─── Scroll reveal (below the fold only — progressive enhancement) ─── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .reveal[data-revealed="false"] {
    opacity: 0;
    transform: translateY(32px);
  }
}

/* ─── Navbar ─── */
#navbar {
  background: transparent;
  transition: background-color 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

#navbar.scrolled {
  background: rgba(10, 26, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(212, 168, 67, 0.1);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #d4a843;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ─── Mobile menu ─── */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.3s ease;
  opacity: 0;
}

#mobile-menu.open {
  max-height: 500px;
  opacity: 1;
}

.mobile-link {
  transition: padding-left 0.3s ease;
}

.mobile-link:hover {
  padding-left: 8px;
}

/* ─── Subtle grain texture overlay (applied to hero) ─── */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

#hero > * {
  position: relative;
  z-index: 2;
}

/* ─── Decorative divider lines ─── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.3), transparent);
}

/* ─── Button focus states ─── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #d4a843;
  outline-offset: 2px;
}

/* ─── Image lazy-load placeholder ─── */
img {
  background-color: #dceee6;
}

/* ─── Smooth scrollbar ─── */
::-webkit-scrollbar {
  width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: #3d7a5c;
}
