/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { overflow-x: hidden; }

/* ── Reveal animations ── */
.reveal-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Navbar ── */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}
#navbar.scrolled {
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(26, 58, 42, 0.08);
}

/* ── Nav links underline effect ── */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
  border-radius: 1px;
}
.nav-link:hover::after {
  width: 100%;
}

/* ── Mobile menu ── */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Smooth image loading ── */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ── Selection color ── */
::selection {
  background: rgba(26, 58, 42, 0.2);
  color: #1a3a2a;
}

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid #3a6e58;
  outline-offset: 2px;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f5f0e8; }
::-webkit-scrollbar-thumb { background: #9bbfad; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #71a48e; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal-up {
    opacity: 1;
    transform: none;
  }
}

/* ── Tablet adjustments ── */
@media (max-width: 767px) {
  #hero h1 {
    font-size: 2.75rem;
  }
  .floating-card {
    position: relative;
    margin-top: 1rem;
  }
}

/* ── Large desktop ── */
@media (min-width: 1280px) {
  #hero h1 {
    font-size: 4.5rem;
  }
}
