/* home-film.css — the clinic film, word band, treatment rail and scroll motion on the
   homepage. Loaded before home.css. Colours and fonts come from the :root tokens in
   style.css. home.js drives the motion; without it everything here sits still. */

/* The film of the clinic. style.css gives .hero a flex layout and overflow:hidden for
   the other pages; both would stop the stage from pinning, so they are reset here. */
:root { --hdr: 76px; }
body { overflow-x: clip; }
.hero.film {
  display: block;
  position: relative;
  height: auto;
  min-height: 0;
  padding: 0;
  overflow: visible;
  background: var(--color-primary);
}
.hero__stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: calc(100vh - var(--hdr));
  min-height: calc(100svh - var(--hdr));
  overflow: hidden;
}
.hero__media,
.hero__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__media { background: var(--color-primary) url("../images/clinic-walk-poster.webp") center / cover no-repeat; }
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(100deg, rgba(15, 23, 42, 0.86) 0%, rgba(15, 23, 42, 0.55) 44%, rgba(15, 23, 42, 0.12) 72%, transparent 100%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.8) 0%, transparent 34%);
}
.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  padding: 5rem clamp(1.25rem, 5vw, 5rem) clamp(2.5rem, 7vh, 5rem);
  color: var(--color-white);
  will-change: transform, opacity;
}
.film-chapter {
  position: absolute;
  top: 1.5rem;
  right: clamp(1.25rem, 5vw, 5rem);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-white);
}
.film-chapter__n { color: var(--color-secondary); font-variant-numeric: tabular-nums; }
.film-chapter__n::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 0.75rem; vertical-align: middle; background: var(--color-secondary); }
/* The scene lines and the scroll cue only exist while the film is scroll-driven. */
.film-lines, .hero__cue { display: none; }

@media (min-width: 769px) {
  html.motion .hero.film { height: 380vh; }
  html.motion .hero__stage {
    position: sticky;
    top: var(--hdr);
    height: calc(100vh - var(--hdr));
    height: calc(100svh - var(--hdr));
  }
  html.motion .film-lines { display: block; }
  /* Hidden and unclickable until home.js shows a line. If the script never runs,
     no invisible line can sit on top of the first-screen buttons. */
  html.motion .film-line {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    left: clamp(1.25rem, 5vw, 5rem);
    right: clamp(1.25rem, 5vw, 5rem);
    bottom: clamp(3rem, 10vh, 6rem);
    z-index: 2;
    max-width: 16ch;
    margin: 0;
    opacity: 0;
    font-family: var(--font-serif);
    font-size: clamp(2.75rem, 6.4vw, 6rem);
    line-height: 1.04;
    color: var(--color-white);
    text-shadow: 0 2px 24px rgba(15, 23, 42, 0.45);
    will-change: transform, opacity;
  }
  html.motion .film-line p { margin: 0 0 1rem; }
  /* The closing scene: headline, one plain line, then both ways to reach the clinic. */
  html.motion .film-line--close { max-width: none; font-size: clamp(2.4rem, 4.4vw, 4.2rem); }
  html.motion .film-line--close p { max-width: 13ch; }
  html.motion .film-line--close .film-cta { gap: 1.75rem; }
  html.motion .film-line__sub {
    display: block;
    width: max-content;
    max-width: 44ch;
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
  }
  html.motion .film-cta { display: flex; align-items: center; gap: 0.75rem; width: max-content; }
  html.motion .film-line__kicker {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.1rem;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: none;
    color: var(--color-white);
  }
  html.motion .film-line__kicker::before { content: ""; flex: 0 0 44px; height: 1px; background: var(--color-secondary); }
  html.motion .film-line .home-btn--lg { min-height: 58px; padding: 1.05rem 2.4rem; font-size: 0.95rem; letter-spacing: 1px; }
  html.motion .film-line__facts {
    display: block;
    width: max-content;
    margin-top: 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.5;
    text-shadow: none;
    color: rgba(255, 255, 255, 0.85);
  }
  html.motion .film-line__facts a { color: var(--color-white); text-decoration: underline; text-underline-offset: 3px; }
  html.motion .film-line__facts a:hover { color: var(--color-secondary); }
  html.motion .film-line .home-btn { font-family: var(--font-sans); text-shadow: none; }
  html.motion .hero__cue {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    z-index: 2;
    display: block;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
  }
  html.motion .hero__cue::after {
    content: "";
    display: block;
    width: 1px;
    height: 22px;
    margin: 0.4rem auto 0;
    background: var(--color-secondary);
    animation: cue-drop 1.8s ease-in-out infinite;
    transform-origin: top;
  }
}
@keyframes cue-drop { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }

.hero.film .hero-title,
.hero.film .hero-subtitle { text-align: left; }
.hero.film .hero-buttons { justify-content: flex-start; }

/* ---------- Word band ---------- */
.wordband {
  overflow: hidden;
  padding: clamp(2.5rem, 7vw, 6rem) 0;
  background: var(--color-primary);
}
.wordband__row {
  margin: 0;
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(3rem, 11vw, 10rem);
  line-height: 1.05;
  color: var(--color-white);
  will-change: transform;
}
.wordband__row--ghost {
  color: transparent;
  -webkit-text-stroke: 1px var(--color-secondary);
}
@supports not (-webkit-text-stroke: 1px black) {
  .wordband__row--ghost { color: var(--color-secondary); }
}

/* ---------- Treatment rail ---------- */
.rail { position: relative; background: var(--color-primary); color: var(--color-white); }
.rail__stage { padding: 1rem 0 4rem; overflow: hidden; }
/* Still page (no scroll motion): the row scrolls sideways by hand instead. */
html:not(.motion) .rail__track { overflow-x: auto; }
.rail__head { padding: 0 clamp(1.25rem, 5vw, 5rem); margin-bottom: 1.75rem; }
.rail__head .home-eyebrow { color: var(--color-secondary); }
.rail__head h2 { font-size: clamp(1.8rem, 3.4vw, 3rem); line-height: 1.1; color: var(--color-white); }
.rail__track {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0 clamp(1.25rem, 5vw, 5rem);
  list-style: none;
  will-change: transform;
}
.rail-card { flex: 0 0 auto; width: min(78vw, 400px); }
.rail-card a {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: min(56vh, 520px);
  min-height: 340px;
  padding: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  color: var(--color-white);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
}
.rail-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.rail-card a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.25) 55%, rgba(15, 23, 42, 0.1) 100%);
}
.rail-card a:hover img { transform: scale(1.05); }
.rail-card a:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 3px; }
.rail-card__n, .rail-card__name, .rail-card__line { position: relative; z-index: 1; }
.rail-card__n { font-size: 0.75rem; font-weight: 600; letter-spacing: 1.5px; color: var(--color-secondary); }
.rail-card__name { margin: 0.3rem 0 0.25rem; font-family: var(--font-serif); font-size: 1.75rem; line-height: 1.15; }
.rail-card__line { font-size: 0.95rem; color: rgba(255, 255, 255, 0.85); }
@media (min-width: 769px) {
  html.motion .rail__stage {
    position: sticky;
    top: var(--hdr);
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: calc(100vh - var(--hdr));
    padding: 0;
  }
  .rail-card { width: min(34vw, 460px); }
}

/* ---------- Blocks that rise into place (class added by home.js) ---------- */
.rise { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--rise-delay, 0ms); }
.rise.is-in { opacity: 1; transform: none; }
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 950;
  height: 3px;
  background: var(--color-secondary);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}


/* ---------- First screen, pared back ----------
   One thin rule, one headline, one line, one button and a text link. The five popular
   treatments sit in a quiet strip along the bottom edge. Selectors start with
   .hero.film so they outrank the older first-screen rules in home.css. */
.hero.film .hero__scrim {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.74) 0%, rgba(15, 23, 42, 0.46) 38%, rgba(15, 23, 42, 0.06) 70%, transparent 100%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.86) 0%, rgba(15, 23, 42, 0.3) 36%, transparent 62%, rgba(15, 23, 42, 0.22) 100%);
}
.hero.film .hero__content { max-width: none; padding: 4rem clamp(1.25rem, 5vw, 5rem) 0; }
.hero.film .hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--color-white);
}
.hero.film .hero-eyebrow::before { content: ""; flex: 0 0 44px; height: 1px; background: var(--color-secondary); }
.hero.film .hero-title {
  max-width: 17ch;
  margin-bottom: 1.25rem;
  font-size: clamp(2.5rem, 4.9vw, 4.6rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-shadow: none;
}
.hero.film .hero-subtitle { max-width: 46ch; margin: 0 0 2rem; font-size: 1.05rem; text-align: left; opacity: 0.9; }
.hero.film .hero-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem; }
.hero.film .home-btn--text {
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.hero.film .home-btn--text::after { content: "\2192"; margin-left: 0.5rem; color: var(--color-secondary); transition: transform 0.3s ease; }
.hero.film .home-btn--text:hover { color: var(--color-secondary); }
.hero.film .home-btn--text:hover::after { transform: translateX(5px); }
.hero.film .hero-shortcuts {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: clamp(2rem, 6vh, 4rem);
  padding: 0.9rem 0 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.hero.film .hero-shortcuts__label { flex: 0 0 auto; margin: 0; font-size: 0.72rem; letter-spacing: 0.2em; color: var(--color-secondary); }
.hero.film .hero-shortcuts ul { gap: 0 2rem; }
.hero.film .hero-shortcuts a {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 0.92rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
}
.hero.film .hero-shortcuts a:hover { color: var(--color-secondary); }
@media (min-width: 769px) {
  /* The text sits on the left, so when a tall window crops the film, it crops the left
     side, behind the text, and keeps the right side. */
  .hero.film .hero__media video { object-position: 82% 50%; }
  html.motion .hero.film .hero-shortcuts { padding-right: 10rem; }
  html.motion .hero.film .hero__cue { left: auto; right: clamp(1.25rem, 5vw, 5rem); bottom: 1.55rem; transform: none; }
  html.motion .hero.film .hero__cue::after { display: inline-block; width: 28px; height: 1px; margin: 0 0 0 0.75rem; vertical-align: middle; animation: none; }
}
@media (max-width: 768px) {
  .hero.film .hero__scrim {
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.74) 38%, rgba(15, 23, 42, 0.08) 70%, rgba(15, 23, 42, 0.3) 100%);
  }
  .hero.film .hero__content { padding: 9rem 1.25rem 0; }
  .hero.film .hero-eyebrow { margin-bottom: 1rem; font-size: 0.7rem; letter-spacing: 0.16em; }
  .hero.film .hero-eyebrow::before { flex-basis: 28px; }
  .hero.film .hero-title { max-width: none; margin-bottom: 0.9rem; font-size: 2.15rem; }
  .hero.film .hero-subtitle { margin-bottom: 1.4rem; font-size: 0.95rem; }
  .hero.film .hero-buttons { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .hero.film .hero-buttons .home-btn { max-width: none; }
  .hero.film .hero-buttons .home-btn--text { justify-content: center; }
  .hero.film .hero-shortcuts { display: block; margin-top: 0.75rem; padding: 0.4rem 0 0.9rem; }
  .hero.film .hero-shortcuts__label { display: none; }
  .hero.film .hero-shortcuts ul { gap: 0 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .hero.film .home-btn--text::after { transition: none; } }

/* ---------- No film on a wide screen ----------
   home.js adds .film-off when data saver is on or the film fails to download. The tall
   scroll section collapses to one screen with the still image. */
@media (min-width: 769px) {
  html.film-off .hero.film { height: auto; }
  html.film-off .hero.film .hero__stage { position: relative; top: auto; height: auto; }
  html.film-off .hero.film .film-lines,
  html.film-off .hero.film .hero__cue { display: none; }
}
/* Printed pages show every block; the rise-in effect needs scrolling. */
@media print { .rise { opacity: 1; transform: none; } }
