/* =========================================================
   Woof Waste — Home Page (motion-rich landing page)
   Loaded only on index.html, in addition to css/styles.css.
   ========================================================= */

/* Lenis smooth-scroll housekeeping */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* =========================================================
   Hero
   ========================================================= */
.home-hero {
  position: relative;
  /* Bottom-anchored text over a full-bleed image looks great on typical
     landscape viewports, but min-height:100svh alone stretches without
     bound on tall/portrait viewports (iPad portrait, some Mac browser
     windows), pushing the text unreasonably far down with a big empty
     gap above it. Clamping the height keeps a floor for short viewports
     and a ceiling for tall ones. */
  min-height: clamp(560px, 100svh, 860px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--color-slate-900);
  isolation: isolate;
}

.home-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.home-hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.55);
  transform-origin: 0% 15%;
}
.home-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15,23,42,0.78) 0%, rgba(15,23,42,0.4) 45%, rgba(15,23,42,0.15) 75%),
    linear-gradient(180deg, rgba(15,23,42,0.35) 0%, rgba(15,23,42,0.55) 35%, rgba(15,23,42,0.78) 60%, rgba(15,23,42,0.95) 100%);
}

/* Three.js particle canvas sits above the photo, below the text */
.home-hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
}

.home-hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding-block: var(--space-6) var(--space-7);
}
.home-hero-content .container { max-width: 900px; }

.home-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin-bottom: var(--space-3);
}

/* HERO HEADLINE — swap the text inside [data-hero-headline] for the final tagline.
   Keep the markup structure (two <span> lines) so the reveal animation still works.
   Visible by default: home.js hides these via gsap.set() only once it's confirmed
   it can also animate them back in, so the text never gets stuck invisible if the
   motion CDNs are slow/blocked/offline. */
.home-hero-headline {
  font-family: var(--font-heading);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.98;
  font-size: clamp(2.75rem, 3vw + 2.5rem, 5.5rem);
  margin: 0 0 var(--space-3);
  color: #fff;
}
.home-hero-headline .line { display: block; overflow: hidden; }
.home-hero-headline .line span { display: inline-block; }
.home-hero-headline .accent-word { color: var(--color-accent-light); }

.home-hero-sub {
  font-size: clamp(1.05rem, 0.4vw + 1rem, 1.25rem);
  color: rgba(255,255,255,0.82);
  max-width: 46ch;
  margin: 0 0 var(--space-4);
}

.home-hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.home-hero-actions .btn-link {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 2px solid rgba(255,255,255,0.35);
  padding-bottom: 2px;
  transition: border-color var(--transition), color var(--transition);
}
.home-hero-actions .btn-link:hover { border-color: var(--color-accent-light); color: var(--color-accent-light); }

.home-scroll-cue {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.home-scroll-cue .scroll-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
  overflow: hidden;
  position: relative;
}
.home-scroll-cue .scroll-line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-accent-light);
  animation: scrollCueDrop 2.2s ease-in-out infinite;
}
@keyframes scrollCueDrop {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .home-scroll-cue .scroll-line::after { animation: none; top: 0; }
}

@media (max-width: 640px) {
  .home-hero-content { padding-block: var(--space-5) var(--space-6); }
  .home-scroll-cue { display: none; }
  .home-hero-media img { transform-origin: right 22%; }
}

/* =========================================================
   Trust bar
   ========================================================= */
.trust-bar {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-slate-200);
}
.trust-bar .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-slate-700);
  border-left: 2px solid var(--color-accent-light);
  opacity: 0;
}
.trust-item:first-child { border-left: none; }
.trust-item:nth-child(2n) { border-left-color: var(--color-secondary-light); }
.trust-item svg { width: 18px; height: 18px; color: var(--color-primary); flex-shrink: 0; }
.trust-item:nth-child(2n) svg { color: var(--color-secondary); }

@media (max-width: 860px) {
  .trust-bar .container { grid-template-columns: repeat(2, 1fr); }
  .trust-item { border-left: none !important; border-top: 2px solid var(--color-slate-200); justify-content: center; text-align: center; }
}

/* =========================================================
   Section shell helpers
   ========================================================= */
.home-section-head {
  max-width: 640px;
  margin-bottom: var(--space-5);
}
.home-section-head .eyebrow { color: var(--color-primary); }
.home-kicker {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(2rem, 1.4vw + 1.6rem, 3rem);
  line-height: 1.05;
}
.home-kicker .accent { color: var(--color-primary); }

/* =========================================================
   Services — clip-path reveal blocks
   ========================================================= */
.service-blocks { display: flex; flex-direction: column; }
.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-slate-200);
}
.service-block:first-child { border-top: none; }
.service-block:nth-child(even) .service-block-media { order: 2; }
.service-block:nth-child(even) .service-block-copy { order: 1; }

.service-block-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-slate-100);
  /* Visible by default; JS clips it right before animating the reveal so a
     failed/slow CDN load can never leave the image permanently hidden. */
}
.service-block-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.service-block-media:hover img { transform: scale(1.14); }
.service-block-media canvas {
  position: absolute;
  inset: 0;
  mix-blend-mode: soft-light;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.service-block-media:hover canvas { opacity: 0.8; }

.service-block-index {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--color-primary);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  display: block;
}
.service-block h3 {
  font-size: clamp(1.5rem, 1vw + 1.2rem, 2rem);
  margin-bottom: 0.6rem;
}
.service-block p { font-size: 1.05rem; max-width: 42ch; }
.service-block-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  margin-top: var(--space-2);
}
.service-block-link svg { width: 18px; height: 18px; transition: transform var(--transition); }
.service-block-link:hover svg { transform: translateX(4px); }

@media (max-width: 800px) {
  .service-block { grid-template-columns: 1fr; gap: var(--space-3); }
  .service-block:nth-child(even) .service-block-media,
  .service-block:nth-child(even) .service-block-copy { order: initial; }
}

/* =========================================================
   Before / After — two drag sliders side by side
   ========================================================= */
.ba-sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  max-width: 900px;
  margin-inline: auto;
}
.ba-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none;
  box-shadow: var(--shadow-md);
  cursor: ew-resize;
}
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-before-wrap {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
}
.ba-before-wrap .ba-img { width: var(--ba-frame-width, 100vw); max-width: none; }
.ba-tag {
  position: absolute;
  top: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(15,23,42,0.55);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  pointer-events: none;
}
.ba-tag-before { left: var(--space-2); }
.ba-tag-after { right: var(--space-2); }
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.ba-handle::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 3px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15,23,42,0.2);
}
.ba-handle-grip {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.ba-handle-grip svg { width: 20px; height: 20px; }
.ba-handle:focus-visible .ba-handle-grip { outline: 3px solid var(--color-accent); outline-offset: 2px; }

@media (max-width: 640px) {
  .ba-sliders { grid-template-columns: 1fr; max-width: 420px; }
  .ba-frame { aspect-ratio: 3 / 4; }
}

/* =========================================================
   How it works — animated connector path
   ========================================================= */
.how-it-works { position: relative; }
.how-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.how-path-svg {
  position: absolute;
  top: 34px;
  left: 0;
  width: 100%;
  height: 4px;
  overflow: visible;
  z-index: 0;
}
.how-path-svg path {
  fill: none;
  stroke: var(--color-slate-200);
  stroke-width: 3;
}
.how-path-svg .how-path-draw {
  stroke: var(--color-primary);
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}
.how-step {
  position: relative;
  z-index: 1;
  text-align: center;
}
.how-step-num {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 3px solid var(--color-slate-200);
  color: var(--color-slate-400);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-2);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.how-step.is-active .how-step-num {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fff;
}
.how-step h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.how-step p { font-size: 0.92rem; color: var(--color-slate-600); }

@media (max-width: 760px) {
  .how-steps { grid-template-columns: 1fr; gap: var(--space-4); }
  .how-path-svg { display: none; }
}

/* =========================================================
   Why Woof Waste — parallax
   ========================================================= */
.why-section {
  position: relative;
  overflow: hidden;
  background: var(--color-slate-900);
  color: #fff;
}
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-6);
}
.why-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.why-media img {
  position: absolute;
  inset: -10% 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: center 90%;
  will-change: transform;
}
.why-section h2 { color: #fff; }
.why-section p { color: rgba(255,255,255,0.78); }
.why-list { margin-top: var(--space-4); }
.why-list li {
  display: flex;
  gap: 0.75rem;
  padding-block: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.14);
  font-weight: 600;
}
.why-list li:first-child { border-top: none; }
.why-list svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--color-accent-light); }

@media (max-width: 800px) {
  .why-grid { grid-template-columns: 1fr; }
  .why-media { order: -1; aspect-ratio: 16 / 10; }
  .why-media img { object-position: center 27%; }
}

/* =========================================================
   Testimonial — single quote, transitions
   ========================================================= */
.testi-section { background: var(--color-bg-alt); }
.testi-wrap {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  position: relative;
  min-height: 260px;
}
.testi-mark {
  font-family: var(--font-heading);
  font-size: 4rem;
  line-height: 1;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.testi-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.testi-slide.is-active { opacity: 1; pointer-events: auto; position: relative; }
.testi-quote {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(1.35rem, 1vw + 1.1rem, 2rem);
  line-height: 1.3;
  color: var(--color-ink);
  margin-bottom: var(--space-3);
}
.testi-person { font-weight: 700; color: var(--color-slate-700); }
.testi-meta { font-size: 0.85rem; color: var(--color-slate-400); }
.testi-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: var(--space-4); }
.testi-dots button {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-slate-300);
  border: none; padding: 0; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.testi-dots button.is-active { background: var(--color-primary); transform: scale(1.3); }

.testi-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-slate-200);
  background: var(--color-bg);
  color: var(--color-slate-600);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.testi-arrow svg { width: 18px; height: 18px; }
.testi-arrow:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.testi-arrow--prev { left: -52px; }
.testi-arrow--next { right: -52px; }
@media (max-width: 900px) {
  .testi-wrap { padding-inline: 52px; }
  .testi-arrow--prev { left: 0; }
  .testi-arrow--next { right: 0; }
}
@media (max-width: 480px) {
  .testi-arrow { width: 34px; height: 34px; }
  .testi-arrow svg { width: 15px; height: 15px; }
}

/* =========================================================
   Closing CTA — full bleed
   ========================================================= */
.home-closing {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}
.home-closing-media { position: absolute; inset: 0; z-index: 0; }
.home-closing-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 10%; }
.home-closing-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.55) 0%, rgba(15,23,42,0.8) 100%);
}
.home-closing-content { position: relative; z-index: 1; text-align: center; margin-inline: auto; max-width: 640px; }
.home-closing h2 { color: #fff; font-size: clamp(2.1rem, 2vw + 1.6rem, 3.25rem); }
.home-closing p { color: rgba(255,255,255,0.85); font-size: 1.1rem; }

/* =========================================================
   Reveal animation base states (GSAP toggles these via classes/inline styles;
   this just guards against no-JS / very first paint flash) — respects
   reduced motion by never hiding content when motion is disabled.
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(24px); }
}
