/* ================================================================
   Scythe Irrigation
   Custom CSS is deliberately limited to what Tailwind utilities
   cannot express: keyframes, scroll/open state hooks, the lightbox
   zoom origin, and the reduced-motion opt-out.
   Everything else on this site is a real Tailwind utility class.
   ================================================================ */

/* ---------- Hero photo: slow settle on load ---------- */
@keyframes sc-hero-zoom {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}
.sc-hero-img {
  animation: sc-hero-zoom 8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* ---------- Scroll reveal (IntersectionObserver hook) ----------
   Scoped to .js so the content is never hidden when scripting is
   unavailable. Without this, a JS failure leaves the page blank. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Sticky nav state ---------- */
#navbar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease,
              backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.is-scrolled #navbar {
  background-color: rgba(20, 53, 36, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10), 0 8px 32px -4px rgba(0, 0, 0, 0.35);
}
#topbar {
  max-height: 44px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.is-scrolled #topbar {
  max-height: 0;
  opacity: 0;
}

/* ---------- Mobile menu ---------- */
#mobileMenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#mobileMenu.is-open {
  max-height: 520px;
}

/* ---------- Back to top ---------- */
#toTop {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}
#toTop.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---------- Chat widget panel ---------- */
#chatPanel {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#chatPanel.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---------- Lightbox ---------- */
#lightbox {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
/* Cursor-tracked zoom. Origin is written from JS on mousemove. */
#lightboxImg {
  transform-origin: var(--zx, 50%) var(--zy, 50%);
  transition: transform 0.18s ease-out;
  pointer-events: none;
}
#lightboxStage:hover #lightboxImg {
  transform: scale(2.5);
}

/* ---------- FAQ accordion marker ---------- */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.sc-marker { transition: transform 0.25s ease; }
details[open] .sc-marker { transform: rotate(45deg); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .sc-hero-img { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  #lightboxStage:hover #lightboxImg { transform: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
