/* Hydro Flow — Doorstep Drip scroll-film (HOME only)
   Static-first: without JS (or with reduced motion) every chapter renders
   as a normal stacked section. js/scroll-film.js adds `film-enhanced` to
   <html> to switch to the pinned, scrubbed layout. */

/* —— Lenis (smooth scroll) housekeeping —— */
html.lenis,
html.lenis body {
  height: auto;
}

html.lenis-on,
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* —— Film shell —— */
.scroll-film {
  position: relative;
  overflow: hidden;
  background: var(--accent);
}

.film__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--accent);
}

/* Soft light accents on the lime field — static by default; GSAP drives a
   slow drift only in enhanced mode */
.film__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
}

.film__glow--1 {
  width: clamp(280px, 55vw, 500px);
  height: clamp(280px, 55vw, 500px);
  top: -14%;
  left: -8%;
  background: rgba(127, 200, 5, 0.3);
}

/* Pale-sky blob turned the solid lime milky — removed from the palette */
.film__glow--2 {
  display: none;
}

.film__glow--3 {
  width: clamp(240px, 42vw, 400px);
  height: clamp(240px, 42vw, 400px);
  top: 32%;
  right: 12%;
  background: rgba(255, 255, 255, 0.14);
}

/* Solid brand-green wash — matches the green page field, no fade to white. */
.film__wash {
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
}

/* Vertical flow motif — faint static texture; drawn on scrub when enhanced */
.film__flow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.22;
}

/* —— Chapters (static flow by default) —— */
.film__chapter {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.film__chapter--threshold {
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

/* Chapter 1 — Threshold */
.film__grid {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 860px) {
  .film__grid {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 3rem;
  }
}

.film__media {
  position: relative;
}

.film__video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  clip-path: polygon(0 0, 100% 2%, 100% 96%, 6% 100%, 0 94%);
  box-shadow: var(--shadow-soft);
}

.film__h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.film__word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.film__word-inner {
  display: inline-block;
  will-change: transform;
}

.film__lede {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 38ch;
  margin: 0 0 1.5rem;
}

.film__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.film__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 2rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Chapter 2 — The drip */
.film__overlay-line {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
  color: var(--text);
  max-width: 18ch;
  margin: 0 auto;
}

/* Chapter 3 — Real care */
.film__care {
  max-width: 46rem;
  text-align: center;
}

.film__h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--text);
}

.film__care-lead {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--text);
  margin: 0 0 1rem;
}

.film__care-body {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 58ch;
}

/* Chapter 4 — Menu settles */
.film__settle {
  text-align: center;
}

.film__services {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2.25rem;
}

/* On the solid lime field type stays --ink; a lime underline would vanish
   and sky blue on lime fails contrast, so the underline does the hover work */
.film__service a {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid rgba(0, 0, 0, 0.45);
  padding-bottom: 0.15em;
  transition: color var(--ease), border-color var(--ease);
}

.film__service a:hover {
  color: var(--ink);
  border-bottom-color: #FFFFFF;
}

.film__service a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 4px;
  border-radius: 2px;
}

.film__actions--settle {
  justify-content: center;
}

/* —— Enhanced mode (JS + GSAP active, no reduced-motion) —— */
html.film-enhanced .scroll-film {
  height: 100vh;
  height: 100svh;
  min-height: 540px;
}

html.film-enhanced .film__chapter {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-content: stretch;
  padding: calc(var(--header-h) + 1.25rem) 0 2rem;
}

html.film-enhanced .film__chapter > .container {
  width: 100%;
}

/* Chapters 2–4 start hidden; GSAP autoAlpha owns visibility from init on */
html.film-enhanced .film__chapter--drip,
html.film-enhanced .film__chapter--care,
html.film-enhanced .film__chapter--settle {
  opacity: 0;
  visibility: hidden;
}

html.film-enhanced .film__wash {
  opacity: 1;
  clip-path: inset(100% 0% 0% 0%);
  will-change: clip-path;
}

html.film-enhanced .film__flow {
  opacity: 0;
}

html.film-enhanced .film__video {
  will-change: transform;
}

/* Mobile in enhanced mode: everything must fit one small viewport */
@media (max-width: 767px) {
  html.film-enhanced .film__video {
    aspect-ratio: auto;
    height: min(30svh, 240px);
  }

  html.film-enhanced .film__h1 {
    font-size: clamp(1.7rem, 7vw, 2.4rem);
  }

  html.film-enhanced .film__lede {
    font-size: 1rem;
  }

  html.film-enhanced .film__hint {
    margin-top: 1.25rem;
  }

  html.film-enhanced .film__care-body {
    font-size: 0.95rem;
  }

  /* Copy is centered in the pinned box, so extra bottom padding lifts it by
     half. At 390x844 this puts Book Now / phone bottom ~708px, above the
     chat FAB (top 716px) and the sticky Book/Call bar (top 784px). */
  html.film-enhanced .film__chapter--threshold {
    padding-bottom: calc(var(--mobile-cta-h, 60px) + env(safe-area-inset-bottom, 0px) + var(--hf-chat-fab-size, 3.5rem) + 5rem);
  }
}

@media (max-width: 767px) and (max-height: 620px) {
  html.film-enhanced .film__hint,
  html.film-enhanced .film__care-body {
    display: none;
  }
}

/* —— Reduced motion: never pinned, everything readable —— */
@media (prefers-reduced-motion: reduce) {
  html.film-enhanced .scroll-film {
    height: auto;
    min-height: 0;
  }

  html.film-enhanced .film__chapter {
    position: relative;
    inset: auto;
  }

  html.film-enhanced .film__chapter--drip,
  html.film-enhanced .film__chapter--care,
  html.film-enhanced .film__chapter--settle {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .film__wash {
    opacity: 0 !important;
  }

  .film__word,
  .film__word-inner {
    will-change: auto;
  }
}
