/* =========================================================================
   ET's Lawn Care & More — Motion layer

   Rules this file lives by:
   - Only transform, opacity, filter and clip-path animate, so everything
     stays on the compositor and off the main thread.
   - Content is hidden for its entrance ONLY under html.js, which an inline
     script in <head> sets before first paint. No JS, no hiding. If motion.js
     fails to load, the same inline script adds html.motion-off after 2.5s
     and everything shows anyway.
   - prefers-reduced-motion turns all of it off and shows the page static.
   ========================================================================= */

:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);       /* fast start, long settle */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1); /* slight overshoot */
  --reveal-dist: 34px;
}

/* Cross-fade between pages in browsers that support cross-document view
   transitions. Ignored everywhere else. */
@view-transition { navigation: auto; }

/* ---------------------------------------------------------------------------
   Scroll reveal
   motion.js adds .is-in when an element enters the viewport and sets --d
   for staggered siblings.
   ------------------------------------------------------------------------- */
.js .rv {
  opacity: 0;
  transform: translate3d(0, var(--reveal-dist), 0);
  transition:
    opacity .8s var(--ease-out) var(--d, 0s),
    transform .9s var(--ease-out) var(--d, 0s);
  will-change: opacity, transform;
}
.js .rv-left  { transform: translate3d(calc(var(--reveal-dist) * -1.4), 0, 0); }
.js .rv-right { transform: translate3d(calc(var(--reveal-dist) * 1.4), 0, 0); }
.js .rv-zoom  { transform: scale(.9); }
.js .rv.is-in {
  opacity: 1;
  transform: none;
}

/* A slide-in starts outside its resting box, and transforms count toward a
   page's scrollable width — so a card waiting to slide in from the right
   made the whole page too wide on a phone. clip (unlike hidden) doesn't turn
   <main> into a scroll container, so nothing else changes. */
main { overflow-x: clip; }

/* Narrow screens have no room for side-slides: rise instead. This also
   covers browsers too old for overflow: clip. */
@media (max-width: 760px) {
  .js .rv-left,
  .js .rv-right { transform: translate3d(0, var(--reveal-dist), 0); }
}
/* Once revealed, stop reserving a compositor layer. */
.js .rv.is-done { will-change: auto; }

/* Images wipe up from the bottom, settling from a slight zoom.
   The clip goes on the IMAGE, never on the observed tile: Chrome's
   IntersectionObserver honours a target's own clip-path, so a tile clipped
   to nothing reports zero visible area and is never revealed. The tile
   itself stays visible as a dark frame the photo wipes up into. */
.js .rv-wipe img {
  clip-path: inset(100% 0 0 0);
  transform: scale(1.18);
  transition:
    clip-path 1.1s var(--ease-out) var(--d, 0s),
    transform 1.4s var(--ease-out) var(--d, 0s);
}
.js .rv-wipe.is-in img {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

/* Section titles: the neon underline draws itself in. */
.js .section-title.rv::after {
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .9s var(--ease-out) calc(var(--d, 0s) + .25s);
}
.js .section-title.rv.is-in::after { transform: scaleX(1); }
.js .contact .section-title.rv::after { transform-origin: left; }

/* ---------------------------------------------------------------------------
   Hero intro — plays once on load, no observer needed
   ------------------------------------------------------------------------- */
.hero-logo-wrap {
  position: relative;
  display: block;
  width: min(420px, 78vw);
  margin: 0 auto 22px;
}
.hero-logo-wrap .hero-logo { margin: 0; width: 100%; }

/* A glint of light sweeping across the badge, masked to the logo's own
   shape so it never spills onto the background. */
.hero-logo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg,
    transparent 38%, rgba(255,255,255,.55) 48%, rgba(14,242,1,.35) 52%, transparent 62%);
  background-size: 260% 100%;
  background-position: 120% 0;
  -webkit-mask: url("../assets/logo.png") center / contain no-repeat;
          mask: url("../assets/logo.png") center / contain no-repeat;
  mix-blend-mode: screen;
  opacity: 0;
}

.js .hero-logo-wrap {
  animation: logoDrop 1.1s var(--ease-spring) both;
}
.js .hero-logo-wrap::after {
  animation: glint 1.6s ease-in-out 1.1s 1 both, glintRepeat 7s ease-in-out 4s infinite;
}
.js .hero-logo {
  animation: logoBreathe 4.5s ease-in-out 1.2s infinite;
}

@keyframes logoDrop {
  0%   { opacity: 0; transform: translate3d(0, -60px, 0) scale(.82) rotate(-6deg); filter: blur(10px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes glint {
  0%   { opacity: 1; background-position: 120% 0; }
  100% { opacity: 1; background-position: -60% 0; }
}
@keyframes glintRepeat {
  0%, 70% { opacity: 0; background-position: 120% 0; }
  72%     { opacity: 1; }
  100%    { opacity: 1; background-position: -60% 0; }
}
@keyframes logoBreathe {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(14,242,1,.30)); }
  50%      { filter: drop-shadow(0 0 46px rgba(14,242,1,.62)); }
}

/* Headline: each word rises out of a mask, staggered. */
.hero h1 .w {
  display: inline-block;
  vertical-align: top;
  padding-bottom: .08em;   /* room for descenders inside the mask */
  margin-bottom: -.08em;
}
/* The mask clips only the bottom edge, where each word rises from, and
   opens fully once the headline has landed. overflow:hidden would have
   clipped the neon glow on GREENER into a visible box. */
.js .hero h1 .w {
  clip-path: inset(-.6em -.6em 0 -.6em);
  animation: unmask .01s linear 2s forwards;
}
@keyframes unmask { to { clip-path: inset(-2em -2em -2em -2em); } }
.hero h1 .w > span { display: inline-block; }
.js .hero h1 .w > span {
  animation: wordRise .95s var(--ease-out) both;
  animation-delay: calc(.45s + var(--i, 0) * .09s);
}
@keyframes wordRise {
  0%   { transform: translate3d(0, 110%, 0) rotate(4deg); }
  100% { transform: none; }
}

/* "GREENER" flickers on like a neon sign, then breathes. */
.js .hero h1 .neon {
  animation: neonOn 1.4s steps(1) 1.15s both, neonBreathe 3.2s ease-in-out 2.6s infinite;
}
@keyframes neonOn {
  0%   { opacity: .15; text-shadow: none; }
  12%  { opacity: 1;   text-shadow: 0 0 26px rgba(14,242,1,.6); }
  18%  { opacity: .2;  text-shadow: none; }
  28%  { opacity: 1;   text-shadow: 0 0 26px rgba(14,242,1,.6); }
  34%  { opacity: .35; text-shadow: none; }
  46%  { opacity: 1;   text-shadow: 0 0 34px rgba(14,242,1,.8); }
  100% { opacity: 1;   text-shadow: 0 0 26px rgba(14,242,1,.5); }
}
@keyframes neonBreathe {
  0%, 100% { text-shadow: 0 0 22px rgba(14,242,1,.45), 0 0 2px rgba(14,242,1,.9); }
  50%      { text-shadow: 0 0 44px rgba(14,242,1,.85), 0 0 4px rgba(170,255,160,1); }
}

/* Everything under the headline cascades in after it. */
.js .hero-tagline,
.js .hero-sub,
.js .hero-rating,
.js .hero-mow-strip,
.js .hero-actions,
.js .hero-social {
  animation: riseIn .9s var(--ease-out) both;
}
.js .hero-tagline  { animation-delay: .95s; }
.js .hero-sub      { animation-delay: 1.05s; }
.js .hero-rating   { animation-delay: 1.2s; }
.js .hero-mow-strip{ animation-delay: 1.3s; }
.js .hero-actions  { animation-delay: 1.4s; }
.js .hero-social   { animation-delay: 1.55s; }
@keyframes riseIn {
  0%   { opacity: 0; transform: translate3d(0, 26px, 0); }
  100% { opacity: 1; transform: none; }
}

/* Stars light up one by one. */
.hero-stars .star { display: inline-block; }
.js .hero-stars .star {
  animation: starPop .5s var(--ease-spring) both;
  animation-delay: calc(1.35s + var(--i, 0) * .09s);
}
@keyframes starPop {
  0%   { opacity: 0; transform: scale(0) rotate(-90deg); }
  100% { opacity: 1; transform: none; }
}

/* Service / town / about heroes get a lighter version of the same entrance. */
.js .service-hero .service-hero-icon { animation: riseIn .8s var(--ease-spring) .05s both; }
.js .service-hero h1                 { animation: riseIn .9s var(--ease-out) .15s both; }
.js .service-hero .section-sub       { animation: riseIn .9s var(--ease-out) .3s both; }
.js .service-hero .btn               { animation: riseIn .9s var(--ease-out) .45s both; }

/* ---------------------------------------------------------------------------
   Mower driving the stripe strip (replaces the old emoji)
   ------------------------------------------------------------------------- */
.hero-mow-strip .mower-svg {
  position: absolute;
  top: 50%;
  left: -12%;
  width: 46px;
  height: 30px;
  transform: translateY(-58%);
  filter: drop-shadow(0 0 8px rgba(14,242,1,.7));
  opacity: 0;
  animation: mowerDrive 2.2s cubic-bezier(.45, .05, .35, 1) 1.5s forwards;
}
.hero-mow-strip .mow-trail {
  animation: trailReveal 2.2s cubic-bezier(.45, .05, .35, 1) 1.5s forwards;
}
.mower-svg .wheel { transform-box: fill-box; transform-origin: center; animation: wheelSpin .35s linear infinite; }
@keyframes wheelSpin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   Swaying grass along the bottom edge of heroes (built by motion.js)
   ------------------------------------------------------------------------- */
.grass {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 90px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.service-hero .grass { height: 60px; }
.grass svg { width: 100%; height: 100%; display: block; }
.grass .blade {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: sway var(--sd, 3.4s) ease-in-out var(--sdl, 0s) infinite alternate;
}
.grass.grow .blade-row {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: grassGrow 1.4s var(--ease-out) .3s both;
}
@keyframes sway {
  0%   { transform: rotate(calc(var(--sw, 6deg) * -1)); }
  100% { transform: rotate(var(--sw, 6deg)); }
}
@keyframes grassGrow {
  0%   { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}

/* Clippings drifting up through the hero. */
.clippings {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.clip {
  position: absolute;
  bottom: -20px;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(var(--lime-soft), var(--green));
  opacity: 0;
  box-shadow: 0 0 6px rgba(14,242,1,.6);
  animation: drift var(--cd, 9s) linear var(--cdl, 0s) infinite;
}
@keyframes drift {
  0%   { opacity: 0;   transform: translate3d(0, 0, 0) rotate(0deg); }
  10%  { opacity: .9; }
  85%  { opacity: .5; }
  100% { opacity: 0;   transform: translate3d(var(--cx, 40px), -95vh, 0) rotate(var(--cr, 540deg)); }
}

/* Pause decorative loops while their section is off screen. */
.motion-paused .grass .blade,
.motion-paused .clip,
.motion-paused .marquee-track { animation-play-state: paused; }

/* ---------------------------------------------------------------------------
   Scroll progress: a mower cutting a stripe across the top of the page
   ------------------------------------------------------------------------- */
.mow-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 70;
  pointer-events: none;
  background: rgba(6, 63, 4, .55);
}
.mow-progress-cut {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: repeating-linear-gradient(90deg, var(--lime) 0 26px, var(--green) 26px 52px);
  box-shadow: 0 0 12px rgba(14,242,1,.8);
}
.mow-progress-mower {
  position: absolute;
  top: -9px;
  left: 0;
  width: 26px;
  height: 18px;
  transform: translate3d(-30px, 0, 0);
  filter: drop-shadow(0 0 6px rgba(14,242,1,.9));
}

/* ---------------------------------------------------------------------------
   Header tightens once you scroll
   ------------------------------------------------------------------------- */
.site-header,
.site-header .header-inner,
.site-header .brand-logo,
.site-header .brand-tag {
  transition: padding .35s var(--ease-out), width .35s var(--ease-out), height .35s var(--ease-out),
              background .35s ease, box-shadow .35s ease, opacity .25s ease;
}
.site-header.is-compact {
  background: rgba(0,0,0,.86);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
          backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 6px 28px rgba(0,0,0,.6), 0 2px 18px rgba(14,242,1,.22);
}
.site-header.is-compact .header-inner { padding-top: 6px; padding-bottom: 6px; }
.site-header.is-compact .brand-logo { width: 44px; height: 44px; }

/* ---------------------------------------------------------------------------
   Buttons: a light sweep across the primary CTA
   ------------------------------------------------------------------------- */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -75%;
  width: 50%;
  z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-20deg);
  animation: btnShine 4.8s ease-in-out 2.5s infinite;
}
.btn-primary:hover::after { animation-duration: 1.1s; animation-delay: 0s; }
@keyframes btnShine {
  0%, 62% { left: -75%; }
  100%    { left: 140%; }
}
.btn { will-change: transform; }
.btn:active { transform: translateY(0) scale(.97); }

/* ---------------------------------------------------------------------------
   Cards: tilt toward the pointer with a neon spotlight under it
   (motion.js sets --rx, --ry, --mx, --my; pointer:fine devices only)
   ------------------------------------------------------------------------- */
.tilt {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .5s var(--ease-out), box-shadow .3s ease, border-color .3s ease;
}
.tilt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(14,242,1,.16), transparent 42%);
  transition: opacity .35s ease;
}
.tilt.is-tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px);
  transition: transform .12s linear, box-shadow .3s ease, border-color .3s ease;
}
.tilt.is-tilting::before { opacity: 1; }
.card.tilt:hover,
.mini-card.tilt:hover { transform: none; }  /* tilt owns transform while hovered */
.card.tilt.is-tilting,
.mini-card.tilt.is-tilting { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px); }

/* Feature-card photos ease in a little deeper on hover. */
.card-feature .card-photo { transition: transform .9s var(--ease-out), filter .5s ease; }
.card-feature:hover .card-photo { transform: scale(1.07); filter: saturate(1.15); }
.card-feature { overflow: hidden; }

/* Gallery tiles: neon edge on hover. */
.gallery-item { transition: box-shadow .4s ease, border-color .4s ease; }
.gallery-item:hover { border-color: var(--lime); box-shadow: 0 0 0 1px rgba(14,242,1,.4), 0 14px 40px rgba(0,0,0,.6), 0 0 26px rgba(14,242,1,.25); }
.gallery-item img { transition: transform .9s var(--ease-out); }
.gallery-item:hover img,
.js .gallery-item.rv-wipe.is-in:hover img { transform: scale(1.08); }

/* ---------------------------------------------------------------------------
   Service marquee — two ribbons running opposite ways
   ------------------------------------------------------------------------- */
.marquee-band {
  position: relative;
  overflow: hidden;
  padding: 34px 0;
  background: var(--black);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: skewY(-2deg);
  margin: 10px 0;
}
.marquee-band::before,
.marquee-band::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14%;
  z-index: 2;
  pointer-events: none;
}
.marquee-band::before { left: 0;  background: linear-gradient(90deg, var(--black), transparent); }
.marquee-band::after  { right: 0; background: linear-gradient(-90deg, var(--black), transparent); }
.marquee {
  display: flex;
  overflow: hidden;
  transform: skewY(2deg);  /* undo the band's skew for the text */
}
.marquee + .marquee { margin-top: 10px; }
.marquee-track {
  display: flex;
  flex-shrink: 0;
  gap: 0;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
}
.marquee.reverse .marquee-track { animation-direction: reverse; animation-duration: 46s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 0 .55em;
}
.marquee-item.solid  { color: var(--lime); text-shadow: 0 0 22px rgba(14,242,1,.45); }
.marquee-item.ghost  { color: transparent; -webkit-text-stroke: 1.5px rgba(192,191,191,.55); }
.marquee-item.star   { color: var(--flag-red); padding: 0 .1em; -webkit-text-stroke: 0; }
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-100%, 0, 0); }
}

/* ---------------------------------------------------------------------------
   Sticky call bar: a pulse ring so the eye finds it
   ------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .sticky-call-icon { position: relative; display: inline-grid; place-items: center; }
  .sticky-call-icon::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,.55);
    animation: ring 2.2s var(--ease-out) infinite;
  }
  .sticky-call { animation: callIn .7s var(--ease-spring) 1.8s both; }
}
@keyframes ring {
  0%   { transform: scale(.6); opacity: .9; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes callIn {
  0%   { transform: translate3d(0, 110%, 0); }
  100% { transform: none; }
}

/* ---------------------------------------------------------------------------
   Safety nets
   ------------------------------------------------------------------------- */

/* motion.js never loaded: show everything rather than leave it hidden. */
.motion-off .rv { opacity: 1 !important; transform: none !important; }
.motion-off .rv-wipe img { clip-path: none !important; transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js .rv, .js .rv-wipe img,
  .js .section-title.rv::after { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .grass, .clippings, .mow-progress-mower, .hero-logo-wrap::after, .btn-primary::after { display: none !important; }
  .marquee-track { animation: none !important; }
}

/* Printing a page should never produce blank, mid-animation content. */
@media print {
  .js .rv, .js .rv-wipe img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .grass, .clippings, .mow-progress, .marquee-band { display: none !important; }
}
