/* ── Base & Typography ── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

::selection {
  background-color: rgba(45, 125, 74, 0.25);
  color: #0c2a17;
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
  }

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

/* ── Focus Styles ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #2d7d4a;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #faf6eb;
}
::-webkit-scrollbar-thumb {
  background: #7fbf90;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2d7d4a;
}

/* ── Subtle pattern overlay for cream sections ── */
.bg-cream-50::before,
.bg-cream-100::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(45, 125, 74, 0.04) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
}

/* ── Hero parallax-like depth ── */
#hero {
  position: relative;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, #fdfcf7, transparent);
  pointer-events: none;
  z-index: 1;
}

/* ── Image hover smoothness ── */
img {
  image-rendering: auto;
  will-change: transform;
}

/* ── Form transitions ── */
input, textarea {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* ── Mobile menu animation ── */
#mobile-nav {
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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