/* ============================================================
   ENHANCEMENTS — landing-page upgrades
   Layered on top of style.css + blueprint.css. Adds:
   - Hero animations (Ken Burns zoom, word reveal, scroll cue)
   - Trust badge + secondary CTA
   - Animated stats strip
   - Service card tilt + corner badges
   - Process timeline animation
   - City tag stagger
   - Reduced-motion + mobile polish
   ============================================================ */

/* Respect prefers-reduced-motion: kill animations for users who opt out */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================== HERO POLISH ================== */
.hero-static .hero-bg-wrap{
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.hero-static .hero-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.06);
  /* Paused by default; .hero-static.in-view adds the running state.
     Saves CPU/GPU when the hero is scrolled off-screen. */
  animation: heroKenBurns 28s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.hero-static.in-view .hero-img{ animation-play-state: running; }
@keyframes heroKenBurns {
  0%   { transform: scale(1.05); }
  100% { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

/* Deeper overlay for legibility — replaces the default linear gradient */
.hero-static .hero-overlay{
  background:
    radial-gradient(ellipse at 50% 70%, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 50%, transparent 80%),
    linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.15) 40%, rgba(0,0,0,.55) 100%);
  padding-top: 0;
  z-index: 1;
}

/* Wrapper around content so we can center vertically with breathing room */
.hero-content{
  max-width: 980px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* Trust badge above the title */
.hero-trust{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  /* Solid translucent dark — much cheaper than backdrop-filter blur over an
     animated image (which forces a per-frame blur of the whole region). */
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50px;
  margin-bottom: 24px;
  opacity: 0;
  animation: heroFadeDown .9s cubic-bezier(.2,.7,.3,1) .1s forwards;
}
.hero-trust-stars{
  color: #fbbf24;
  font-size: .92rem;
  letter-spacing: 1.5px;
  line-height: 1;
}
.hero-trust-text{
  color: rgba(255,255,255,.95);
  font-family: "Space Grotesk", sans-serif;
  font-size: .82rem;
  letter-spacing: .04em;
}
.hero-trust-text strong{ color: #fff; font-weight: 700 }

@keyframes heroFadeDown {
  0%   { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Word-by-word title reveal */
.hero-static .hero-title{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 1vw, 12px);
}
.hero-line{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 22px);
}
.hero-word{
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  animation: heroWordIn .8s cubic-bezier(.2,.7,.3,1) forwards;
}
/* Stagger words by index */
.hero-line:nth-child(1) .hero-word:nth-child(1){ animation-delay: .35s }
.hero-line:nth-child(1) .hero-word:nth-child(2){ animation-delay: .45s }
.hero-line:nth-child(1) .hero-word:nth-child(3){ animation-delay: .55s }
.hero-line:nth-child(2) .hero-word:nth-child(1){ animation-delay: .68s }
.hero-line:nth-child(2) .hero-word:nth-child(2){ animation-delay: .76s }
.hero-line:nth-child(2) .hero-word:nth-child(3){ animation-delay: .86s }

.hero-word--accent{
  background: linear-gradient(135deg, #d8f3dc 0%, #52b788 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes heroWordIn {
  0%   { opacity: 0; transform: translateY(28px); filter: blur(6px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Sub-headline below title */
.hero-sub{
  max-width: 640px;
  margin: 22px auto 0;
  font-family: "Inter", sans-serif;
  font-size: clamp(15px, 1.25vw, 19px);
  color: rgba(255,255,255,.88);
  line-height: 1.55;
  opacity: 0;
  animation: heroFadeUp .9s cubic-bezier(.2,.7,.3,1) 1.05s forwards;
}

/* CTA row */
.hero-actions{
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: heroFadeUp .9s cubic-bezier(.2,.7,.3,1) 1.25s forwards;
}
@keyframes heroFadeUp {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Primary CTA — enhanced with shimmer + arrow slide */
.hero-static .hero-cta{
  position: relative;
  overflow: hidden;
  margin-top: 0;            /* override existing margin-top:36px */
  padding: 16px 32px;
  background: linear-gradient(135deg, #2d6a4f 0%, #1a3a1f 100%);
  color: #fff;
  box-shadow: 0 14px 40px rgba(45,106,79,.45), 0 0 0 1px rgba(255,255,255,.08) inset;
}
.hero-static .hero-cta::before{
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: left .8s ease;
}
.hero-static .hero-cta:hover{
  transform: translateY(-3px);
  background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
  box-shadow: 0 18px 50px rgba(45,106,79,.55);
}
.hero-static .hero-cta:hover::before{ left: 130% }
.hero-cta-arrow{
  display: inline-block;
  transition: transform .25s ease;
}
.hero-static .hero-cta:hover .hero-cta-arrow{ transform: translateX(4px) }

/* Secondary CTA (ghost button) */
.hero-cta-secondary{
  display: inline-flex;
  align-items: center;
  padding: 16px 30px;
  border-radius: 50px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: clamp(15px, 1.3vw, 17px);
  color: #fff;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.4);
  text-decoration: none;
  transition: background .25s ease, transform .25s ease, border-color .25s ease;
}
.hero-cta-secondary:hover{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.7);
  transform: translateY(-3px);
}

/* Animated scroll indicator at the bottom of the hero */
.hero-scroll{
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 1.5px solid rgba(255,255,255,.6);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
  opacity: 0;
  animation: heroFadeUp .8s ease 1.6s forwards;
  z-index: 3;
}
.hero-scroll-line{
  width: 2px;
  height: 8px;
  background: #fff;
  border-radius: 2px;
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot {
  0%   { transform: translateY(0);    opacity: 0 }
  30%  { opacity: 1 }
  100% { transform: translateY(14px); opacity: 0 }
}

/* ================== STATS STRIP ================== */
.stats-strip{
  background: linear-gradient(180deg, #f5f7f5 0%, #ffffff 100%);
  padding: 60px 0;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.stats-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}
.stat-item{
  position: relative;
  padding: 12px 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.stat-item.visible{ opacity: 1; transform: translateY(0) }
.stat-item:nth-child(1){ transition-delay: 0s }
.stat-item:nth-child(2){ transition-delay: .08s }
.stat-item:nth-child(3){ transition-delay: .16s }
.stat-item:nth-child(4){ transition-delay: .24s }

.stat-item + .stat-item::before{
  content: '';
  position: absolute;
  left: -16px;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.1), transparent);
}

.stat-num{
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #1a3a1f 0%, #52b788 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-stars{
  color: #fbbf24;
  letter-spacing: 2px;
  font-size: .92rem;
  margin-top: 6px;
  line-height: 1;
}
.stat-label{
  margin-top: 10px;
  font-size: .82rem;
  color: var(--gray);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ================== SERVICE CARDS — depth + lift ================== */
.services-grid .service-card{
  transition: transform .45s cubic-bezier(.2,.8,.2,1),
              box-shadow .45s cubic-bezier(.2,.8,.2,1),
              border-color .3s ease;
}
.services-grid .service-card:hover{
  transform: translateY(-12px) scale(1.01);
  box-shadow: 0 30px 60px -10px rgba(26,58,31,.25),
              0 18px 30px -15px rgba(0,0,0,.15);
}
/* The image inside the card now zooms more smoothly */
.services-grid .service-card .service-image img{
  transition: transform 1s cubic-bezier(.2,.7,.2,1), filter .5s ease;
  filter: saturate(.95);
}
.services-grid .service-card:hover .service-image img{
  transform: scale(1.1);
  filter: saturate(1.1);
}

/* Subtle glow ring on hover */
.services-grid .service-card::after{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(82,183,136,0);
  transition: box-shadow .35s ease;
}
.services-grid .service-card:hover::after{
  box-shadow: 0 0 0 2px rgba(82,183,136,.35), 0 0 40px rgba(82,183,136,.15);
}

/* Arrow slide in the card's "See Our Process" link */
.services-grid .service-card .service-card-link{
  position: relative;
  transition: gap .3s ease, color .3s ease;
}

/* ================== PROCESS — animated connector + step glow ================== */
.process-section .process-connector{
  background: linear-gradient(90deg,
              rgba(82,183,136,0) 0%,
              rgba(82,183,136,.6) 20%,
              rgba(82,183,136,.6) 80%,
              rgba(82,183,136,0) 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
  opacity: 1;
  height: 2px;
  transition: background-position 1.8s ease .2s;
}
.process-section.in-view .process-connector{ background-position: 0 0 }

.process-section .step-number{
  transition: transform .4s cubic-bezier(.2,.8,.2,1),
              background .4s ease,
              border-color .4s ease,
              box-shadow .4s ease;
}
.process-section .process-step.visible .step-number{
  animation: stepPulse 2.2s ease-out 1;
}
@keyframes stepPulse {
  0%   { box-shadow: 0 0 0 0 rgba(82,183,136,.45) }
  70%  { box-shadow: 0 0 0 22px rgba(82,183,136,0) }
  100% { box-shadow: 0 0 0 0 rgba(82,183,136,0) }
}

/* ================== CITY TAGS — pop-in stagger ================== */
.service-areas-list .area-tag{
  opacity: 0;
  transform: translateY(12px) scale(.92);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1),
              background .25s ease, border-color .25s ease, color .25s ease;
}
.service-areas-list.in-view .area-tag{
  opacity: 1;
  transform: translateY(0) scale(1);
}
.service-areas-list.in-view .area-tag:nth-child(1){ transition-delay: .02s }
.service-areas-list.in-view .area-tag:nth-child(2){ transition-delay: .05s }
.service-areas-list.in-view .area-tag:nth-child(3){ transition-delay: .08s }
.service-areas-list.in-view .area-tag:nth-child(4){ transition-delay: .11s }
.service-areas-list.in-view .area-tag:nth-child(5){ transition-delay: .14s }
.service-areas-list.in-view .area-tag:nth-child(6){ transition-delay: .17s }
.service-areas-list.in-view .area-tag:nth-child(7){ transition-delay: .20s }
.service-areas-list.in-view .area-tag:nth-child(8){ transition-delay: .23s }
.service-areas-list.in-view .area-tag:nth-child(9){ transition-delay: .26s }
.service-areas-list.in-view .area-tag:nth-child(10){ transition-delay: .29s }
.service-areas-list.in-view .area-tag:nth-child(11){ transition-delay: .32s }
.service-areas-list.in-view .area-tag:nth-child(12){ transition-delay: .35s }
.service-areas-list.in-view .area-tag:nth-child(13){ transition-delay: .38s }
.service-areas-list.in-view .area-tag:nth-child(14){ transition-delay: .41s }

/* Section tags have a small underline accent */
.section-tag{
  position: relative;
  padding-bottom: 8px;
}
.section-tag::after{
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green-accent), transparent);
  border-radius: 2px;
}

/* ================== SCROLL PROGRESS — re-affirm visibility ================== */
.scroll-progress{
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #52b788, #2d6a4f, #1a3a1f);
  z-index: 1001;
  width: 0;
  transition: width .12s linear;
}

/* ================== FAQ — answer slide ================== */
.faq-item .faq-answer{
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  padding-top: 0;
  padding-bottom: 0;
}
.faq-item[open] .faq-answer{
  max-height: 400px;
  padding-bottom: 22px;
}

/* ================== MOBILE POLISH ================== */
@media (max-width: 720px){
  .hero-static{
    /* Use small-vh so iOS Safari URL bar doesn't crop content */
    height: 100svh;
    min-height: 560px;
  }
  .hero-static .hero-overlay{
    padding-top: 72px;   /* below the 72px-tall mobile navbar */
    padding-bottom: 96px;/* room for the floating mobile CTA */
  }
  .hero-static .hero-title{
    font-size: clamp(34px, 9vw, 56px);
    line-height: 1.06;
  }
  .hero-sub{
    font-size: .95rem;
    line-height: 1.5;
    margin-top: 16px;
  }
  .hero-actions{ gap: 10px; margin-top: 22px }
  .hero-static .hero-cta,
  .hero-cta-secondary{
    padding: 14px 24px;
    font-size: 15px;
  }
  .hero-trust{ margin-bottom: 16px; padding: 6px 14px }
  .hero-trust-stars{ font-size: .82rem }
  .hero-trust-text{ font-size: .74rem }
  .hero-scroll{ display: none }  /* tight on phones; mobile CTA covers prompt */

  /* Stats: 2x2 grid on phones */
  .stats-strip{ padding: 44px 0 }
  .stats-grid{ grid-template-columns: 1fr 1fr; gap: 24px 16px }
  .stat-item + .stat-item::before{ display: none }
  .stat-num{ font-size: clamp(2rem, 9vw, 2.6rem) }
  .stat-label{ font-size: .72rem; letter-spacing: 1.2px }
}

@media (max-width: 380px){
  .hero-actions{ flex-direction: column; width: 100% }
  .hero-static .hero-cta,
  .hero-cta-secondary{
    width: 100%;
    justify-content: center;
  }
}

/* Touch devices: disable card lift hover (sticky :hover bug) */
@media (hover: none){
  .services-grid .service-card:hover{ transform: none }
  .services-grid .service-card:hover .service-image img{ transform: none }
  .services-grid .service-card:hover::after{ box-shadow: none }
}
