/*
   Animation keyframes and utilities
*/
/* --- Spinner --- */
.animate-spin {
  animation: spin 1s infinite linear;
  display: inline-block;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Fade animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* --- Slide animations --- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Zoom animations --- */
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes zoomOut {
  from { opacity: 0; transform: scale(1.1); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Flip/rotate --- */
@keyframes flipInX {
  from { opacity: 0; transform: perspective(400px) rotateX(90deg); }
  to { opacity: 1; transform: perspective(400px) rotateX(0deg); }
}
@keyframes flipInY {
  from { opacity: 0; transform: perspective(400px) rotateY(90deg); }
  to { opacity: 1; transform: perspective(400px) rotateY(0deg); }
}

/* --- Bounce --- */
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- Floating --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* --- Fence animations --- */
@keyframes fencePostDraw {
  from { stroke-dashoffset: 240; opacity: 0; }
  to { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes fenceRailDraw {
  from { stroke-dashoffset: 400; opacity: 0; }
  to { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes gateSwing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(10deg); }
}
@keyframes accentPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Fence SVG element styles */
.fence-post {
  stroke: #efbb20;
  stroke-width: 7;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: fencePostDraw 0.7s ease-out forwards;
}
.fence-rail {
  stroke: #8b4513;
  stroke-width: 11;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: fenceRailDraw 0.5s ease-out forwards;
}
.fence-gate {
  stroke: #8b4513;
  stroke-width: 11;
  fill: none;
  stroke-linecap: round;
  transform-origin: 300px 120px;
  animation: gateSwing 3s ease-in-out infinite alternate;
}
.fence-accent {
  fill: #efbb20;
  animation: accentPulse 2s ease-in-out infinite;
}

/* --- Shimmer --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* --- Animation utility classes --- */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}
.animate-fade-up {
  animation: slideUp 0.7s ease-out forwards;
}
.animate-fade-down {
  animation: slideDown 0.7s ease-out forwards;
}
.animate-slide-left {
  animation: slideLeft 0.7s ease-out forwards;
}
.animate-slide-right {
  animation: slideRight 0.7s ease-out forwards;
}
.animate-zoom-in {
  animation: zoomIn 0.6s ease-out forwards;
}
.animate-flip-in-x {
  animation: flipInX 0.8s ease-out forwards;
}
.animate-flip-in-y {
  animation: flipInY 0.8s ease-out forwards;
}
.animate-bounce-in {
  animation: bounceIn 0.8s ease-out forwards;
}
.animate-float {
  animation: float 3s ease-in-out infinite;
}
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Stagger delays */
.delay-0 { animation-delay: 0s; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }
.delay-9 { animation-delay: 0.9s; }

/* Scroll-triggered animations (requires JS IntersectionObserver) */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.scroll-reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.scroll-reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.scroll-reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.scroll-reveal-zoom {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.scroll-reveal-zoom.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-fade-up,
  .animate-fade-down,
  .animate-slide-left,
  .animate-slide-right,
  .animate-zoom-in,
  .animate-flip-in-x,
  .animate-flip-in-y,
  .animate-bounce-in,
  .animate-float,
  .animate-pulse,
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-zoom {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* --- Hero full-bleed background image --- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 65%;
  display: block;
}

/* Dark gradient scrim so white text stays readable over the photo.
   Heaviest on the left where the copy sits, easing right. */
.hero__bg-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(16, 22, 38, 0.92) 0%,
      rgba(16, 22, 38, 0.78) 42%,
      rgba(16, 22, 38, 0.35) 72%,
      rgba(16, 22, 38, 0.15) 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__copy {
  max-width: 640px;
}

@media (max-width: 768px) {
  .hero__bg-scrim {
    background:
      linear-gradient(180deg,
        rgba(16, 22, 38, 0.88) 0%,
        rgba(16, 22, 38, 0.72) 60%,
        rgba(16, 22, 38, 0.45) 100%);
  }
}

/* --- Tighter section rhythm (page got longer with reveal spacing) --- */
.section { padding: clamp(34px, 4vw, 56px) 0; }
.section--tight { padding: clamp(22px, 2.5vw, 32px) 0; }
.section--tint { padding: clamp(34px, 4vw, 56px) 0; }
.section__head { margin-bottom: clamp(18px, 2.2vw, 28px); }
.cards { gap: 16px; }
.faq { gap: 10px; }
