/* ============ WHIPLASH INJURY CLINIC - calm clinical warmth ============ */

:root {
  --bone: #f4f1ea;
  --bone-2: #ece7dd;
  --ink: #1f2933;
  --ink-dim: rgba(31, 41, 51, 0.62);
  --ink-soft: rgba(31, 41, 51, 0.5);
  --amber: #c98a3c;
  --amber-soft: rgba(201, 138, 60, 0.32);
  --sage: #8a9a8f;
  --line: rgba(31, 41, 51, 0.14);
  --display: "Fraunces", serif;
  --body: "Inter", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: initial; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* Fonts gate */
main, footer, .nav, .callbar { visibility: hidden; }
html.is-ready main, html.is-ready footer, html.is-ready .nav, html.is-ready .callbar { visibility: visible; }
html.is-locked { overflow: hidden; }

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
em { font-style: italic; color: var(--amber); }

.mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -100%; z-index: 90;
  pointer-events: none; opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0,0); } 20% { transform: translate(-5%,5%); }
  40% { transform: translate(5%,-5%); } 60% { transform: translate(-3%,-3%); } 80% { transform: translate(4%,2%); }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem 2.5rem;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1), background 0.4s ease, box-shadow 0.4s ease;
}
.nav.is-scrolled { background: rgba(244,241,234,0.86); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo { font-family: var(--display); font-size: 1.3rem; font-weight: 500; display: flex; flex-direction: column; line-height: 1; }
.nav__mark { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--amber); margin-top: 0.3rem; }
.nav__links { display: flex; gap: 2.25rem; align-items: center; }
.nav__links a { font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.18em; position: relative; }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 1px; background: var(--amber);
  transform: scaleX(0); transform-origin: right; transition: transform 0.4s cubic-bezier(0.65,0,0.35,1);
}
.nav__links a:not(.nav__cta):hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta { background: var(--amber); color: var(--bone); padding: 0.7rem 1.1rem; border-radius: 999px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-block;
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.16em;
  padding: 1.25rem 2.5rem; border-radius: 999px;
  background: var(--amber); color: var(--bone);
  overflow: hidden; font-weight: 600;
}
.btn__fill {
  position: absolute; inset: 0; background: var(--ink); color: var(--bone);
  display: flex; align-items: center; justify-content: center;
  transform: translateY(101%); transition: transform 0.45s cubic-bezier(0.65,0,0.35,1);
}
.btn:hover .btn__fill { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid rgba(31,41,51,0.3); }
.btn--ghost .btn__fill { background: var(--amber); color: var(--bone); }

/* ---------- HERO: the scroll is the recovery ----------
   Layer roles (each GSAP-owned property lives on exactly one element, so
   the intro, the scrub and the jitter never fight over a transform):
   .hero__media  -> impact jitter (x/y, ticker) + arrival fade (opacity)
   .hero__frame  -> the trauma grade: scale / tilt / filter (scrub)
   ghost <video> -> the double vision: offset + opacity (scrub, JS clone)
   .hero__tint   -> amber-red bruise wash: opacity (scrub)
   .hero__seismo -> hairline impact trace: flattens + fades (scrub)
   --impact var  -> drives the headline's chromatic echo (scrub)
   Default = the CALM state everywhere, so no-JS, static-fallback and
   reduced-motion visitors get the healed frame for free. */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
  --impact: 0;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__frame { position: absolute; inset: 0; overflow: hidden; will-change: transform, filter; }
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.hero__video--ghost {
  opacity: 0;
  filter: blur(3px) saturate(0.55) brightness(1.04);
  pointer-events: none;
  will-change: transform, opacity;
}
.hero__tint {
  position: absolute; inset: 0; opacity: 0;
  mix-blend-mode: multiply; pointer-events: none;
  background: radial-gradient(120% 95% at 68% 38%,
    rgba(186, 82, 44, 0.42) 0%,
    rgba(201, 138, 60, 0.30) 46%,
    rgba(31, 41, 51, 0.30) 100%);
}
.hero__wash {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--bone) 0%, rgba(244,241,234,0.88) 30%, rgba(244,241,234,0.38) 58%, rgba(244,241,234,0.04) 100%),
    linear-gradient(180deg, rgba(244,241,234,0.5) 0%, transparent 26%, transparent 68%, rgba(244,241,234,0.6) 100%);
}
.hero__seismo {
  position: absolute; top: 15%; right: 1.2rem;
  width: 22px; height: 70%;
  opacity: 0; overflow: visible;
}
.hero__seismo-line {
  fill: none; stroke: var(--amber); stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.hero__content {
  position: relative; z-index: 2;
  padding: 0 2.5rem;
  max-width: 60rem;
}
.hero__eyebrow { margin-bottom: 1.5rem; color: var(--amber); }
.hero__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 7rem);
  line-height: 1.02; letter-spacing: -0.01em;
}
.hero__line { display: block; position: relative; }
/* Chromatic impact echo: an amber ghost of each headline line, offset and
   blurred in proportion to --impact. At --impact: 0 it sits exactly under
   the real text at opacity 0 (i.e. it does not exist for calm states). */
.hero__line::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  color: var(--amber);
  opacity: calc(var(--impact) * 0.5);
  transform: translate(calc(var(--impact) * 10px), calc(var(--impact) * -6px));
  filter: blur(calc(var(--impact) * 3px));
  pointer-events: none;
}
.hero__sub {
  margin-top: 1.9rem; max-width: 32rem;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--ink-dim);
}
.hero__actions { margin-top: 2.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 2.25rem; left: 2.5rem; z-index: 2;
  display: flex; align-items: center; gap: 0.9rem;
  color: var(--ink-soft);
}
.hero__scroll-line { width: 46px; height: 1px; background: var(--amber); transform-origin: left; animation: scrollPulseH 2s ease-in-out infinite; }
@keyframes scrollPulseH { 0%,100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(0.4); opacity: 0.4; } }

/* ---------- THE ONE THING ---------- */
.only { padding: 9rem 2.5rem; max-width: 1200px; margin: 0 auto; }
.only__label { margin-bottom: 2.5rem; }
.only__text {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.7rem, 3.8vw, 3.4rem);
  line-height: 1.32; max-width: 46rem;
}
.only__text .word { opacity: 0.16; }
.only__cards {
  margin-top: 4.5rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.ocard { border-top: 2px solid var(--amber); padding-top: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.ocard__num { font-family: var(--display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; color: var(--ink); }
.ocard__label { color: var(--ink-dim); font-size: 0.95rem; }

/* ---------- WHAT IS WHIPLASH: the scroll is the whiplash ----------
   Section 02 pins (desktop) and the visitor's scroll scrubs crash-test
   footage through the injury arc: head thrown back (hyperextension),
   snapped forward (hyperflexion), then settled. Layer roles:
   #whiplashVideo        -> currentTime driven by scrub via a proxy (JS)
   .whiplash__phase      -> clinical micro-labels at the two extremes (scrub)
   .whiplash__track-fill -> hairline amber progress under the footage (scrub)
   #whiplashText         -> resolves as the head comes to rest (scrub)
   Default = the settled, fully readable state, so no-JS, static-fallback
   and reduced-motion visitors get the calm end state for free. */
.whiplash {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: 5rem 2.5rem;
  overflow: hidden;
}
.whiplash__inner {
  width: 100%; max-width: 1300px; margin: 0 auto;
  display: grid; grid-template-columns: 0.95fr 1.05fr;
  gap: 4.5rem; align-items: center;
}
.whiplash__text {
  margin-top: 2.25rem;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  line-height: 1.42;
  max-width: 32rem;
}
.whiplash__panel { position: relative; margin: 0; }
.whiplash__frame {
  position: relative;
  height: min(70vh, 40rem); min-height: 20rem;
  border-radius: 4px; overflow: hidden;
  background: var(--ink);
  box-shadow: 0 26px 70px rgba(31, 41, 51, 0.22);
}
.whiplash__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.whiplash__phase {
  position: absolute; left: 1.5rem; bottom: 2.7rem;
  color: var(--amber); font-size: 0.64rem; letter-spacing: 0.26em;
  opacity: 0; pointer-events: none;
}
.whiplash__track {
  position: absolute; left: 1.5rem; right: 1.5rem; bottom: 1.5rem;
  height: 1px; background: rgba(244, 241, 234, 0.16);
}
.whiplash__track-fill {
  position: absolute; inset: 0;
  background: var(--amber);
  transform: scaleX(0); transform-origin: left;
}
.whiplash__caption { margin-top: 1.1rem; text-align: right; font-size: 0.62rem; }

/* ---------- THE DIFFERENCE ---------- */
.difference { padding: 9rem 2.5rem; max-width: 1200px; margin: 0 auto; }
.difference__header { margin-bottom: 4rem; display: flex; flex-direction: column; gap: 1.5rem; }
.difference__title { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.06; }
.difference__steps { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 5rem 1fr; gap: 2rem; padding: 2.4rem 0; border-top: 1px solid var(--line); align-items: start; }
.step__num { color: var(--amber); padding-top: 0.4rem; }
.step__name { font-family: var(--display); font-weight: 500; font-size: clamp(1.35rem, 2.6vw, 2rem); margin-bottom: 0.6rem; }
.step__body { color: var(--ink-dim); max-width: 42rem; }

/* ---------- THE SPECIALIST ---------- */
.specialist {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 4.5rem; align-items: center;
  padding: 9rem 2.5rem; max-width: 1300px; margin: 0 auto;
}
.specialist__media { aspect-ratio: 3 / 4; overflow: hidden; border-radius: 4px; }
/* 3:4 portrait, face upper-middle: bias the crop toward the top so the
   face stays framed, including during the scale-down reveal */
.specialist__media img { transition: transform 0.9s cubic-bezier(0.22,1,0.36,1); object-position: 50% 25%; }
.specialist__name { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1; margin: 1.2rem 0 0.6rem; }
.specialist__cred { color: var(--amber); margin-bottom: 1.75rem; }
.specialist__body { color: var(--ink-dim); font-size: 1.08rem; max-width: 34rem; }
.specialist__quote {
  margin-top: 2rem; padding-left: 1.5rem; border-left: 2px solid var(--amber);
  font-family: var(--display); font-style: italic; font-size: clamp(1.15rem, 2vw, 1.6rem);
  line-height: 1.4; color: var(--ink);
}

/* ---------- RECOVERY PATH (dark band) ---------- */
.path { position: relative; min-height: 82vh; display: flex; align-items: center; overflow: hidden; color: var(--bone); }
.path__media { position: absolute; inset: -8% 0; }
.path__media img { filter: saturate(0.92) brightness(0.9); }
.path__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,41,51,0.8) 0%, rgba(31,41,51,0.55) 50%, rgba(31,41,51,0.85) 100%); }
.path__content { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; padding: 7rem 2.5rem; width: 100%; }
.path__content .mono { color: rgba(244,241,234,0.6); }
.path__text {
  margin-top: 2rem;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 3rem); line-height: 1.3;
}
.path__text .word { opacity: 0.18; }

/* ---------- VISIT / CTA ---------- */
.visit {
  min-height: 82vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 8rem 2.5rem;
}
.visit .mono:first-child { margin-bottom: 2.25rem; }
.visit__title { font-family: var(--display); font-weight: 400; font-size: clamp(2.8rem, 9vw, 8rem); line-height: 1.0; margin-bottom: 3rem; }
.visit__line { display: block; overflow: hidden; }
.visit__actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.visit__addr { margin-top: 3rem; }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bone-2); }
.footer__main { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; padding: 4.5rem 2.5rem; max-width: 1400px; margin: 0 auto; }
.footer__logo { font-family: var(--display); font-size: 1.7rem; }
.footer__tag { font-family: var(--display); font-size: 1.15rem; color: var(--ink-dim); margin-top: 0.6rem; }
.footer__col { display: flex; flex-direction: column; gap: 0.85rem; }
.footer__col-title { margin-bottom: 0.5rem; color: var(--sage); }
.footer__col a { font-size: 0.95rem; color: var(--ink-dim); transition: color 0.3s ease, transform 0.3s ease; }
.footer__col a:hover { color: var(--amber); transform: translateX(4px); }
.footer__fax { font-size: 0.95rem; color: var(--ink-dim); }
.footer__loc { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.5rem; }
.footer__bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.75rem 2.5rem; border-top: 1px solid var(--line); max-width: 1400px; margin: 0 auto; }

/* ---------- Sticky mobile call bar ---------- */
.callbar {
  display: none;
  position: fixed; left: 1rem; right: 1rem; z-index: 95;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  align-items: center; justify-content: center; gap: 0.6rem;
  padding: 1.05rem 1.5rem; border-radius: 999px;
  background: var(--amber); color: var(--bone);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em;
  box-shadow: 0 -2px 10px rgba(31, 41, 51, 0.1), 0 4px 18px rgba(31, 41, 51, 0.16);
}
.callbar__icon { flex: none; }

/* ---------- Reveal helper ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); }

/* ---------- Static fallback (motion libraries failed to load):
   never leave a visitor staring at hidden content ---------- */
html.is-static [data-reveal] { opacity: 1; transform: none; }
html.is-static .whiplash__phase, html.is-static .whiplash__track, html.is-static .whiplash__caption { display: none; }
html.is-static { overflow: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .only__cards { grid-template-columns: 1fr; gap: 1.75rem; }
  .whiplash__inner { gap: 2.5rem; }
  .specialist { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer__main { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 700px) {
  .nav { padding: 1.1rem 1.25rem; }
  .nav__links { gap: 1rem; }
  .nav__links a:not(.nav__cta) { display: none; }
  /* mobile: no pin, no ghost double, no seismo. The footage runs full-bleed
     under a stronger vertical wash and a short unpinned scrub drains the
     tint and blur as the hero scrolls away (see main.js). */
  .hero__seismo { display: none; }
  .hero__wash {
    background:
      linear-gradient(180deg, rgba(244,241,234,0.94) 0%, rgba(244,241,234,0.72) 42%, rgba(244,241,234,0.5) 68%, rgba(244,241,234,0.82) 100%);
  }
  .hero__content, .only, .difference { padding-left: 1.25rem; padding-right: 1.25rem; }
  .path__content, .specialist { padding-left: 1.25rem; padding-right: 1.25rem; }
  /* whiplash: no pin, no scrub on mobile (see main.js). The footage plays
     one slow pass as the panel enters and rests on its settled frame; the
     scrub-only annotations never render. */
  .whiplash { min-height: 0; padding: 5rem 1.25rem; }
  .whiplash__inner { grid-template-columns: 1fr; gap: 2rem; }
  .whiplash__panel { order: -1; }
  .whiplash__frame { height: min(56vh, 26rem); min-height: 16rem; }
  .whiplash__phase, .whiplash__track, .whiplash__caption { display: none; }
  .whiplash__text { max-width: none; }
  .hero__actions, .visit__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn, .visit__actions .btn { width: 100%; text-align: center; }
  .step { grid-template-columns: 1fr; gap: 0.6rem; }
  .hero__scroll { left: 1.25rem; }
  .callbar { display: flex; }
  /* keep the last content clear of the fixed call bar */
  .footer__bottom { padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .hero__scroll-line { animation: none !important; }
  [data-reveal], .hero__eyebrow, .hero__sub, .hero__actions, .hero__scroll { opacity: 1 !important; transform: none !important; }
  /* hero heal: no scrub, no shake, no double, no bruise. The calm frame only. */
  .hero__tint, .hero__seismo, .hero__video--ghost { display: none !important; }
  .hero { --impact: 0 !important; }
  .hero__frame, .hero__media, .hero__line, .hero__title { transform: none !important; filter: none !important; opacity: 1 !important; }
  /* whiplash: no pin, no scrub. The footage rests on its settled frame
     (see main.js) and the paragraph is simply there, fully readable. */
  .whiplash__phase, .whiplash__track, .whiplash__caption { display: none !important; }
  .whiplash__text { opacity: 1 !important; transform: none !important; }
}

/* ---------- go-live polish ---------- */
/* larger, easier-to-read section labels */
.only__label,
.whiplash__content .mono:first-child,
.difference__header .mono,
.specialist__content .mono:first-child,
.path__content .mono:first-child,
.visit .mono:first-child {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.24em;
}
/* two proof cards after removing the Only card */
.only__cards { grid-template-columns: repeat(2, 1fr); }
/* scroll cue: gentle bob so visitors know to scroll */
.hero__scroll-chev {
  display: inline-block;
  color: var(--amber);
  font-size: 1rem;
  animation: scrollBob 1.8s ease-in-out infinite;
}
@keyframes scrollBob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-chev { animation: none !important; }
}
