/* ============================================================
   COASTWISE OCCUPATIONAL THERAPY — style.css
   Hand-written CSS3. No frameworks, no preprocessors.
   System: 12-col fluid grid · 8px spacing base · CSS custom
   property tokens · mobile-first · WCAG 2.2 AA
   ============================================================ */

/* ============ 1. FONTS (self-hosted, no CDN) ============ */
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-var.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-italic-var.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============ 2. DESIGN TOKENS ============ */
:root {
  /* Palette — two-colour system: warm limestone sand + deep forest ink */
  --sand:        #F3F1E6;
  --sand-deep:   #E6E3D7;
  --ink:         #1F2926;
  --ink-hover:   #30403B;
  --hairline:    color-mix(in srgb, var(--ink) 14%, transparent);
  --hairline-lt: color-mix(in srgb, var(--sand) 20%, transparent);

  /* Typography */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --fs-hero:      clamp(3rem, 10vw, 9rem);
  --fs-title:     clamp(2.2rem, 5.2vw, 4.6rem);
  --fs-manifesto: clamp(1.55rem, 3.2vw, 2.9rem);
  --fs-lede:      clamp(1.1rem, 1.5vw, 1.375rem);
  --fs-body:      clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  --fs-small:     0.8125rem;
  --fs-eyebrow:   0.75rem;

  /* Easing — no linear defaults */
  --ease-heavy:  cubic-bezier(0.83, 0.01, 0.29, 1);
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.275, 1.6, 0.28, 0.996);
  --ease-link:   cubic-bezier(0.25, 1, 0.5, 1);

  /* Layout — 12-col fluid grid, 8px base spacing */
  --gutter: clamp(20px, 6vw, 110px);
  --maxw: 1720px;
  --radius: 3px;
  --header-h: 88px;

  --dur-slow: 1.4s;
  --dur-med: 0.7s;
}

/* ============ 3. RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html.js { scroll-behavior: auto; } /* JS engine takes over */

body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* fallback: iOS Safari < 16 lacks clip */
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent; /* focus + :active states cover feedback */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

::selection { background: var(--ink); color: var(--sand); }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
em { font-style: italic; }

h1, h2, h3, h4 { font-weight: 400; line-height: 1.02; letter-spacing: -0.015em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 1200;
  padding: 12px 20px; background: var(--ink); color: var(--sand);
  border-radius: var(--radius); transform: translateY(-160%);
  transition: transform 0.4s var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.section--ink :focus-visible, .site-footer :focus-visible { outline-color: var(--sand); }
main:focus { outline: none; } /* skip-link target, not a control */

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(72px, 12vw, 200px); }
.section--sand { background: var(--sand-deep); }
.section--ink  { background: var(--ink); color: var(--sand); }

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.72;
  margin-bottom: clamp(20px, 3vw, 36px);
}
.eyebrow--light { opacity: 0.66; }

.section-title {
  font-family: var(--serif);
  font-size: var(--fs-title);
  font-variation-settings: "opsz" 144;
  max-width: 15ch;
}
.section-title--light { color: var(--sand); }
.section-head { margin-bottom: clamp(44px, 7vw, 110px); }

/* ============ 4. REVEAL SYSTEM (JS-gated so no-JS = fully visible) ============ */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
html.js [data-reveal].is-visible { opacity: 1; transform: translateY(0); }

html.js [data-reveal-img] { clip-path: inset(12% 6% 12% 6%); transition: clip-path 1.6s var(--ease-heavy); }
html.js [data-reveal-img] img { transform: scale(1.08); transition: transform 1.6s var(--ease-heavy); }
html.js [data-reveal-img].is-visible { clip-path: inset(0 0 0 0); }
html.js [data-reveal-img].is-visible img { transform: scale(1); }

/* Split-text line masks */
.st-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.st-line-inner { display: inline-block; will-change: transform; }
html.js .st-line-inner {
  transform: translateY(115%);
  transition: transform 1.15s var(--ease-heavy);
  transition-delay: var(--line-delay, 0s);
}
html.js .is-visible .st-line-inner,
html.js .st-line-inner.is-visible { transform: translateY(0); }

/* ============ 5. BUTTONS & LINKS ============ */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 1.05em 1.9em;
  background: var(--ink); color: var(--sand);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  transition: color 0.5s var(--ease-out), border-color 0.5s var(--ease-out);
}
/* sheen sweep */
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(243, 241, 230, 0.25) 50%, transparent 65%);
  transform: translateX(-110%);
  transition: transform 0.9s var(--ease-out);
}
.btn__text { position: relative; z-index: 1; }
.btn__arrow { position: relative; z-index: 1; transition: transform 0.5s var(--ease-spring); }
.btn:active { background: var(--ink-hover); border-color: var(--ink-hover); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost::after { background: linear-gradient(105deg, transparent 35%, rgba(31, 41, 38, 0.12) 50%, transparent 65%); }
.btn--ghost:active { background: var(--ink); color: var(--sand); }

.btn--invert { background: var(--sand); color: var(--ink); border-color: var(--sand); }
.btn--invert::after { background: linear-gradient(105deg, transparent 35%, rgba(31, 41, 38, 0.14) 50%, transparent 65%); }
.btn--invert:active { background: var(--sand-deep); border-color: var(--sand-deep); }

/* Hover effects only where hover exists: on touch a tap leaves :hover stuck */
@media (hover: hover) {
  .btn:hover::after { transform: translateX(110%); }
  .btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
  .btn:hover .btn__arrow { transform: translateX(4px); }
  .btn--ghost:hover { background: var(--ink); color: var(--sand); }
  .btn--invert:hover { background: var(--sand-deep); border-color: var(--sand-deep); }
}

.btn--small { padding: 0.75em 1.4em; }

/* Underline sweep — full width → zero, left to right */
.link-sweep {
  position: relative;
  display: inline-block;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 0.35em;
}
.link-sweep::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transition: width 0.6s var(--ease-link);
}
@media (hover: hover) and (pointer: fine) {
  .link-sweep:hover::after { left: auto; right: 0; width: 0; }
}

/* ============ 6. HEADER ============ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 900;
  transition: transform 0.55s var(--ease-out), background-color 0.4s, backdrop-filter 0.4s;
}
.site-header.is-hidden { transform: translateY(-102%); }
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--sand) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
/* After .is-scrolled so it wins when the menu opens mid-page
   (otherwise: sand text + close icon on a sand bar = invisible) */
.site-header.is-menu-open {
  z-index: 1000; color: var(--sand);
  background: transparent; border-bottom-color: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.site-header.is-menu-open .menu-toggle__line { background: var(--sand); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: var(--header-h);
  padding-inline: var(--gutter);
  max-width: var(--maxw); margin-inline: auto;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark { flex: none; }
.brand__text {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.brand__text em { display: block; font-size: 0.82em; opacity: 0.75; }

.site-nav__list { display: flex; gap: clamp(20px, 2.6vw, 44px); }
.nav-link {
  position: relative;
  font-size: var(--fs-small); font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding-block: 6px;
}
.nav-link::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease-link);
}
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }

.site-header__cta { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 28px); }
.header-phone { text-align: right; line-height: 1.3; }
.header-phone__label {
  display: block;
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6;
}
.header-phone__number { font-family: var(--serif); font-size: 1.1rem; }

.header-call {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  transition: border-color 0.3s;
}
.header-call:active { border-color: currentColor; }
.site-header.is-menu-open .header-call { border-color: var(--hairline-lt); }

.menu-toggle {
  display: none;
  position: relative; z-index: 960;
  width: 44px; height: 44px;
  flex-direction: column; align-items: center; justify-content: center; gap: 7px;
}
.menu-toggle__line {
  display: block; width: 26px; height: 1.5px; background: var(--ink);
  transition: transform 0.45s var(--ease-out), opacity 0.3s;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__line:first-child { transform: translateY(4.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 950;
  background: var(--ink); color: var(--sand);
  display: flex; flex-direction: column;
  padding: calc(var(--header-h) + 16px) var(--gutter) var(--gutter);
  overflow-y: auto;
  overscroll-behavior: contain;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-heavy), visibility 0s 0.7s;
}
.mobile-menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition-delay: 0s; }
/* Auto margins centre the content but collapse to 0 when it overflows
   (landscape phones), so the top links never get cut off */
.mobile-menu > nav { margin-top: auto; }
.mobile-menu__list li { overflow: hidden; }
.mobile-menu__list a {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  line-height: 1.25;
  transform: translateY(110%);
  transition: transform 0.8s var(--ease-heavy);
}
.mobile-menu.is-open .mobile-menu__list a { transform: translateY(0); }
.mobile-menu.is-open .mobile-menu__list li:nth-child(2) a { transition-delay: 0.06s; }
.mobile-menu.is-open .mobile-menu__list li:nth-child(3) a { transition-delay: 0.12s; }
.mobile-menu.is-open .mobile-menu__list li:nth-child(4) a { transition-delay: 0.18s; }
.mobile-menu.is-open .mobile-menu__list li:nth-child(5) a { transition-delay: 0.24s; }
.mobile-menu__meta {
  margin-top: 6vh; margin-bottom: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  font-size: var(--fs-small); letter-spacing: 0.05em; opacity: 0.8;
}
.mobile-menu__meta a { padding-block: 10px; } /* ~44px tap targets */

/* ============ 7. PRELOADER ============ */
.preloader {
  position: fixed; inset: 0; z-index: 1100;
  background: var(--sand);
  display: none;
  flex-direction: column; justify-content: center;
  padding-inline: var(--gutter);
}
html.js .preloader { display: flex; }
html.js .preloader.is-done { transform: translateY(-100%); transition: transform 0.9s var(--ease-heavy); }
.preloader__curtain {
  position: absolute; inset: 0; z-index: -1;
  background: var(--ink);
  transform: translateY(100%);
}
html.js .preloader.is-done .preloader__curtain {
  transform: translateY(-100%);
  transition: transform 0.9s var(--ease-heavy) 0.08s;
}
.preloader__count {
  position: absolute; top: clamp(20px, 3.5vw, 48px); right: var(--gutter);
  font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}
.preloader__count span::after { content: "%"; opacity: 0.5; margin-left: 2px; }
.preloader__line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.preloader__line-inner {
  display: inline-block;
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(1.6rem, 4.5vw, 3.2rem);
  letter-spacing: -0.02em; line-height: 1.1;
  transform: translateY(110%);
  transition: transform 1.4s var(--ease-heavy);
}
.preloader__line-inner--serif {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2.4rem, 7.5vw, 5.6rem);
  transition-delay: 0.12s;
}
html.js .preloader.is-booted .preloader__line-inner { transform: translateY(0); }

/* ============ 8. PAGE WIPE (transitions) ============ */
.page-wipe { position: fixed; inset: 0; z-index: 1050; pointer-events: none; visibility: hidden; }
.page-wipe.is-active { visibility: visible; pointer-events: all; }
.page-wipe__panel { position: absolute; inset: 0; transform: translateY(101%); }
.page-wipe__panel--back { background: var(--sand-deep); }
.page-wipe__panel--front { background: var(--ink); }

/* ============ 9. CUSTOM CURSOR ============ */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.js .cursor { display: block; position: fixed; inset: 0; z-index: 1150; pointer-events: none; }
}
.cursor__dot, .cursor__ring {
  position: absolute; top: 0; left: 0;
  border-radius: 50%;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
}
.cursor__dot { width: 8px; height: 8px; background: var(--sand); }
.cursor__ring {
  width: 38px; height: 38px;
  border: 1px solid var(--sand);
  display: flex; align-items: center; justify-content: center;
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), background-color 0.3s;
}
.cursor__label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink);
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.25s, transform 0.35s var(--ease-spring);
}
.cursor.is-hover .cursor__ring { width: 58px; height: 58px; }
.cursor.is-label .cursor__ring { width: 84px; height: 84px; background: var(--sand); }
.cursor.is-label .cursor__label { opacity: 1; transform: scale(1); }
.cursor.is-down .cursor__ring { width: 30px; height: 30px; }

/* ============ 10. HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: clamp(40px, 6vw, 90px);
  overflow: clip;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__gradient {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--sand-deep) 55%, transparent) 0%, transparent 55%),
    linear-gradient(to top, var(--sand) 0%, transparent 32%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__eyebrow { margin-bottom: clamp(18px, 2.4vw, 30px); }
.hero__title {
  font-family: var(--serif);
  font-size: var(--fs-hero);
  font-variation-settings: "opsz" 144;
  line-height: 0.96;
  letter-spacing: -0.025em;
  max-width: 9ch;
}
.hero__title em { font-variation-settings: "opsz" 144; }
.hero__sub {
  max-width: 56ch;
  margin-top: clamp(24px, 3.4vw, 44px);
  font-size: var(--fs-lede);
  line-height: 1.55;
}
.hero__actions {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(28px, 4vw, 52px);
}
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 10px 0;
  margin-top: clamp(36px, 5vw, 70px);
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: var(--fs-small); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.hero__meta li { display: flex; align-items: center; }
.hero__meta li + li::before { content: "·"; margin-inline: 14px; opacity: 0.5; }
.hero__scroll-hint {
  position: absolute; right: var(--gutter); bottom: clamp(40px, 6vw, 90px); z-index: 1;
  font-size: var(--fs-small); letter-spacing: 0.2em; text-transform: uppercase;
  writing-mode: vertical-rl;
  opacity: 0.55;
}
.hero__scroll-hint::after {
  content: ""; display: block;
  width: 1px; height: 52px; margin-top: 14px;
  background: var(--ink);
  transform-origin: top;
  animation: hint-drop 2.2s var(--ease-out) infinite;
}
@keyframes hint-drop {
  0% { transform: scaleY(0); } 45% { transform: scaleY(1); transform-origin: top; }
  55% { transform-origin: bottom; transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============ 11. MARQUEE ============ */
.marquee {
  overflow: clip;
  border-block: 1px solid var(--hairline);
  padding-block: 18px;
  background: var(--sand);
}
.marquee__track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
@media (hover: hover) { .marquee:hover .marquee__track { animation-play-state: paused; } }
.marquee__item {
  white-space: nowrap;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.8vw, 1.5rem);
  letter-spacing: 0.01em;
  padding-right: 12px;
}
.marquee__item i { font-style: normal; opacity: 0.45; margin-inline: 12px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ 12. MANIFESTO & STATS ============ */
.manifesto__text {
  font-family: var(--serif);
  font-size: var(--fs-manifesto);
  font-variation-settings: "opsz" 60;
  line-height: 1.28;
  letter-spacing: -0.01em;
  max-width: 24ch;
}
.manifesto__aside {
  margin-top: clamp(24px, 3vw, 40px);
  max-width: 44ch;
  font-size: var(--fs-lede);
  opacity: 0.85;
}
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 48px);
  margin-top: clamp(48px, 8vw, 130px);
}
.stats__item { border-top: 1px solid var(--hairline); padding-top: 18px; }
.stats__number {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 1;
  font-variation-settings: "opsz" 144;
  font-variant-numeric: tabular-nums;
}
.stats__label {
  order: 2;
  font-size: var(--fs-small);
  letter-spacing: 0.06em; text-transform: uppercase;
  opacity: 0.65;
  margin-top: 10px;
  max-width: 22ch;
}
.stats__item { display: flex; flex-direction: column; }
.stats__number { order: 1; }
.stats__label { order: 2; }

/* ============ 13. SUPPORT ROWS ============ */
.support__rows { border-bottom: 1px solid var(--hairline); }
.support-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px clamp(16px, 2.4vw, 40px);
  align-items: start;
  padding-block: clamp(36px, 4.5vw, 64px);
  border-top: 1px solid var(--hairline);
  border-radius: var(--radius);
  transition: background-color 0.5s var(--ease-out);
  transform-style: preserve-3d;
}
@media (hover: hover) { .support-row:hover { background: color-mix(in srgb, var(--sand) 55%, transparent); } }
.support-row__index {
  grid-column: 1 / 3;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  opacity: 0.55;
  padding-top: 0.2em;
}
.support-row__body { grid-column: 3 / 10; max-width: 62ch; }
.support-row__title {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  margin-bottom: 14px;
}
.support-row__title span { font-size: 0.62em; font-style: italic; opacity: 0.65; }
.support-row__note { margin-top: 12px; font-size: var(--fs-small); opacity: 0.7; letter-spacing: 0.02em; }
.support-row__link { grid-column: 10 / 13; justify-self: end; margin-top: 0.9em; white-space: nowrap; }

/* ============ 14. SERVICES ============ */
.services__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 clamp(24px, 4vw, 72px);
  align-items: start;
}
.services__intro { grid-column: 1 / 6; }
.services__intro .section-title { max-width: 12ch; }
.services__lede { margin-top: clamp(20px, 2.6vw, 34px); max-width: 42ch; font-size: var(--fs-lede); }
.services__intro .btn { margin-top: clamp(24px, 3vw, 40px); }
/* Native-scroll fallback uses CSS sticky; smooth-scroll engine pins via JS */
.services__intro[data-pin] { position: sticky; top: calc(var(--header-h) + 24px); }

.services__list { grid-column: 7 / 13; border-bottom: 1px solid var(--hairline); }
.service {
  position: relative;
  padding: clamp(28px, 3.4vw, 48px) 0 clamp(28px, 3.4vw, 48px) clamp(52px, 5vw, 88px);
  border-top: 1px solid var(--hairline);
}
.service__index {
  position: absolute; left: 0; top: clamp(32px, 3.6vw, 54px);
  font-family: var(--serif); font-style: italic;
  font-size: 1.05rem; opacity: 0.55;
}
.service__title {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  line-height: 1.12;
  margin-bottom: 12px;
}
.service p { max-width: 58ch; }
.service__tags {
  margin-top: 14px;
  font-size: var(--fs-small);
  letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0.6;
}

/* ============ 15. DRAG GALLERY ============ */
.gallery { overflow: clip; }
.gallery__head { margin-bottom: clamp(40px, 5vw, 70px); }
.gallery__viewport {
  overflow: hidden;
  cursor: grab;
  padding-inline: var(--gutter);
}
.gallery__viewport.is-dragging { cursor: grabbing; }
/* Native (touch / narrow) mode: snap per panel, no visible scrollbar */
.gallery__viewport.is-native {
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.gallery__viewport.is-native::-webkit-scrollbar { display: none; }
.gallery__viewport.is-native .gallery__panel { scroll-snap-align: start; }
.gallery__viewport.is-native .gallery__track { padding-right: var(--gutter); }
.gallery__track {
  display: flex; gap: clamp(16px, 2vw, 32px);
  width: max-content;
  will-change: transform;
}
.gallery__panel { width: clamp(300px, 44vw, 620px); flex: none; }
.gallery__panel img, .gallery__placeholder-inner {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius);
  transform: scale(1.001);
  transition: transform 0.8s var(--ease-out);
}
@media (hover: hover) { .gallery__panel:hover img { transform: scale(1.035); } }
.gallery__panel figcaption {
  margin-top: 14px;
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--sand) 75%, transparent);
}
.gallery__placeholder-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1px dashed var(--hairline-lt);
  background: color-mix(in srgb, var(--sand) 6%, transparent);
  color: color-mix(in srgb, var(--sand) 65%, transparent);
  text-align: center; padding: 20px;
}
.gallery__placeholder-inner span { font-family: var(--serif); font-style: italic; font-size: 1.3rem; }
.gallery__placeholder-inner small { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }
.gallery__note {
  width: 100%; aspect-ratio: 3 / 2;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  padding: clamp(24px, 3vw, 44px);
  border: 1px solid var(--hairline-lt);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--sand) 5%, transparent);
  color: var(--sand);
}
.gallery__note-kicker { font-size: var(--fs-eyebrow); letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; }
.gallery__note p { font-family: var(--serif); font-size: clamp(1.6rem, 2.8vw, 2.6rem); line-height: 1.1; max-width: 14ch; }
.gallery__hint {
  padding-inline: var(--gutter);
  margin-top: clamp(24px, 3vw, 44px);
  font-size: var(--fs-small); letter-spacing: 0.2em; text-transform: uppercase;
  opacity: 0.55;
}

/* ============ 16. PROCESS ============ */
.process__steps {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 3vw, 48px);
}
.process__steps::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 100%; height: 1px; background: var(--hairline);
}
.process__steps::after {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}
.process__step { padding-top: clamp(24px, 3vw, 40px); }
.process__index {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.6vw, 4rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink);
  margin-bottom: 16px;
}
.process__step h3 {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.9vw, 1.65rem);
  margin-bottom: 10px;
}
.process__step p { font-size: 0.95rem; opacity: 0.85; }

/* ============ 17. AREA & ABOUT ============ */
.area__grid, .about__grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
}
.area__figure { grid-column: 1 / 7; }
.area__figure img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.area__body { grid-column: 8 / 13; }
.area__towns {
  margin-top: clamp(20px, 2.6vw, 32px);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.9vw, 1.65rem);
  line-height: 1.5;
}
.area__tele { margin-top: 22px; max-width: 48ch; }
.area__body .link-sweep { margin-top: 26px; }

.about__body { grid-column: 1 / 7; }
.about__body .section-title { max-width: 13ch; }
.about__text { margin-top: clamp(20px, 2.6vw, 32px); max-width: 56ch; display: grid; gap: 16px; }
.about__sign { font-family: var(--serif); font-style: italic; font-size: var(--fs-lede); }
.about__points { margin-top: clamp(24px, 3vw, 36px); display: grid; gap: 0; }
.about__points li {
  padding: 14px 0 14px 26px;
  border-top: 1px solid var(--hairline);
  font-size: 0.95rem;
  position: relative;
}
.about__points li:last-child { border-bottom: 1px solid var(--hairline); }
.about__points li::before {
  content: ""; position: absolute; left: 2px; top: 1.55em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink); transform: translateY(-50%);
}
.about__figure { grid-column: 8 / 13; }
.about__figure img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }

/* ============ 18. CTA BAND ============ */
.cta { padding-block: clamp(88px, 16vw, 240px); }
.cta__inner { text-align: center; }
.cta__title {
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 8rem);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
}
.cta__actions {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: clamp(20px, 3vw, 44px);
  margin-top: clamp(32px, 4.5vw, 60px);
}
.cta__phone { font-size: 1rem; }

/* ============ 19. FOOTER ============ */
.site-footer {
  background: var(--ink); color: var(--sand);
  padding: clamp(80px, 10vw, 160px) 0 clamp(32px, 4vw, 56px);
}
.site-footer__word {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7.5vw, 6.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.site-footer__word em { opacity: 0.8; }
.site-footer__grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(56px, 7vw, 110px);
  padding-top: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--hairline-lt);
}
.site-footer__col { grid-column: span 4; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.site-footer__heading {
  font-size: var(--fs-small); font-weight: 600; font-family: var(--sans);
  letter-spacing: 0.18em; text-transform: uppercase;
  opacity: 0.55; margin-bottom: 8px;
}
.site-footer__col p { font-size: 0.95rem; opacity: 0.85; max-width: 30ch; }
.site-footer__fine { font-size: var(--fs-small) !important; opacity: 0.55 !important; }
.site-footer__base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px;
  margin-top: clamp(48px, 6vw, 90px);
  padding-top: 24px;
  border-top: 1px solid var(--hairline-lt);
  font-size: var(--fs-small);
  opacity: 0.85;
}
.site-footer__base .site-footer__fine { flex-basis: 100%; }
.to-top { font-size: var(--fs-small); letter-spacing: 0.12em; text-transform: uppercase; padding: 8px 0; }
@media (hover: hover) { .to-top:hover { text-decoration: underline; text-underline-offset: 4px; } }

/* ============ 20. REFER PAGE ============ */
.page-hero { padding-top: calc(var(--header-h) + clamp(60px, 9vw, 140px)); padding-bottom: clamp(64px, 8vw, 130px); }
.page-hero__title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 8vw, 7.5rem);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.025em;
  max-width: 12ch;
}
.page-hero__sub { margin-top: clamp(22px, 3vw, 36px); max-width: 52ch; font-size: var(--fs-lede); }
.page-hero__actions { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(20px, 3vw, 40px); margin-top: clamp(30px, 4vw, 50px); }

.pathways__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.6vw, 40px);
}
.pathway {
  background: var(--sand);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: clamp(26px, 3vw, 44px);
  transform-style: preserve-3d;
  transition: border-color 0.4s;
}
@media (hover: hover) { .pathway:hover { border-color: color-mix(in srgb, var(--ink) 35%, transparent); } }
.pathway h3 { font-family: var(--serif); font-size: clamp(1.4rem, 2.1vw, 1.9rem); margin-bottom: 8px; }
.pathway__who { font-size: var(--fs-small); letter-spacing: 0.04em; opacity: 0.7; margin-bottom: 22px; }
.pathway h4 {
  font-family: var(--sans); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; margin-bottom: 12px;
}
.pathway ul { display: grid; gap: 10px; margin-bottom: 22px; }
.pathway li { position: relative; padding-left: 22px; font-size: 0.95rem; }
.pathway li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink);
  transform: translateY(-50%);
}
.pathway__note { font-size: var(--fs-small); opacity: 0.7; border-top: 1px solid var(--hairline); padding-top: 16px; }

.referral__grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(28px, 5vw, 90px);
  align-items: start;
}
.referral__intro { grid-column: 1 / 6; position: sticky; top: calc(var(--header-h) + 24px); }
.referral__intro .section-title { max-width: 12ch; margin-bottom: 24px; }
.referral__intro > p { max-width: 44ch; }
.referral__contact { margin-top: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.referral__contact-label { font-size: var(--fs-small); letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; }
.referral__hours { margin-top: 10px; font-size: var(--fs-small); opacity: 0.7; line-height: 1.7; }

.rform { grid-column: 7 / 13; display: grid; gap: clamp(20px, 2.4vw, 30px); }
.rform__row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2vw, 28px); }
.rform__field { display: grid; gap: 8px; }
.rform__field label, .rform__checks legend {
  font-size: var(--fs-small); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.rform__opt { font-weight: 400; text-transform: none; letter-spacing: 0.02em; opacity: 0.6; }
.rform__field input[type="text"],
.rform__field input[type="tel"],
.rform__field input[type="email"],
.rform__field select,
.rform__field textarea {
  font: inherit; color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  padding: 12px 2px;
  transition: border-color 0.4s var(--ease-out);
  width: 100%;
  /* Focusing a field (e.g. the first invalid one) clears the fixed header */
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.rform__field textarea { resize: vertical; min-height: 96px; }
.rform__field input:focus, .rform__field select:focus, .rform__field textarea:focus {
  outline: none; border-bottom-color: var(--ink);
}
.rform__field input.is-invalid, .rform__field select.is-invalid { border-bottom-color: #8c3b2e; }
.rform__select-wrap { position: relative; }
.rform__select-wrap select { -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 28px; }
.rform__select-wrap svg { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.rform__checks { border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.rform__checks legend { margin-bottom: 12px; }
.rform__check {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 0.95rem; cursor: pointer;
  padding: 6px 0;
}
/* Option labels sit inside a .rform__field fieldset — undo its
   uppercase field-label styling so they match the consent checkbox */
.rform__field .rform__check { font-size: 0.95rem; font-weight: 400; letter-spacing: 0.01em; text-transform: none; }
.rform__check input {
  -webkit-appearance: none; appearance: none; flex: none;
  scroll-margin-top: calc(var(--header-h) + 24px);
  width: 18px; height: 18px; margin-top: 2px;
  border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent);
  border-radius: 2px;
  display: grid; place-content: center;
  transition: background-color 0.25s, border-color 0.25s;
  cursor: pointer;
}
.rform__check input::before {
  content: ""; width: 10px; height: 10px;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background: var(--sand);
  transform: scale(0);
  transition: transform 0.25s var(--ease-spring);
}
.rform__check input:checked { background: var(--ink); border-color: var(--ink); }
.rform__check input.is-invalid { border-color: #8c3b2e; box-shadow: 0 0 0 1px #8c3b2e; }
.rform__check input:checked::before { transform: scale(1); }
.rform__consent { font-size: 0.85rem; opacity: 0.85; }
.rform__submit { justify-self: start; }
.rform__status { font-size: 0.9rem; min-height: 1.4em; }
.rform__status.is-ok { color: #2e5d3f; }
.rform__status.is-err { color: #8c3b2e; }
.rform__privacy { font-size: var(--fs-small); opacity: 0.6; max-width: 52ch; }

.telehealth__grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(28px, 4vw, 72px);
}
.telehealth__grid > div:first-child { grid-column: 1 / 6; }
.telehealth__body { grid-column: 7 / 13; font-size: var(--fs-lede); }
.telehealth__list { margin-top: clamp(24px, 3vw, 40px); display: grid; }
.telehealth__list li {
  padding: 18px 0;
  border-top: 1px solid var(--hairline-lt);
  font-size: 1rem;
  color: color-mix(in srgb, var(--sand) 88%, transparent);
}
.telehealth__list li:last-child { border-bottom: 1px solid var(--hairline-lt); }
.telehealth__list strong { color: var(--sand); font-weight: 600; }

.faq__grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: start;
}
.faq__grid > div:first-child { grid-column: 1 / 6; position: sticky; top: calc(var(--header-h) + 24px); }
.faq__list { grid-column: 7 / 13; border-bottom: 1px solid var(--hairline); }
.faq__item { border-top: 1px solid var(--hairline); }
.faq__item h3 { font-weight: 400; }
.faq__q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(20px, 2.6vw, 30px) 0;
  text-align: left;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  line-height: 1.25;
  transition: opacity 0.3s;
}
@media (hover: hover) { .faq__q:hover { opacity: 0.72; } }
.faq__icon { position: relative; flex: none; width: 18px; height: 18px; }
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; background: var(--ink);
  transition: transform 0.45s var(--ease-out);
}
.faq__icon::before { left: 0; top: 8px; width: 18px; height: 1.5px; }
.faq__icon::after { left: 8px; top: 0; width: 1.5px; height: 18px; }
.faq__q[aria-expanded="true"] .faq__icon::after { transform: rotate(90deg) scaleY(0); }
.faq__q[aria-expanded="true"] .faq__icon::before { transform: rotate(180deg); }
.faq__a {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--ease-out);
}
.faq__a.is-open { grid-template-rows: 1fr; }
.faq__a-inner { overflow: hidden; }
.faq__a-inner p { padding-bottom: clamp(22px, 2.8vw, 34px); max-width: 62ch; opacity: 0.88; }

/* ============ 21. SMOOTH-SCROLL MODE (JS adds .smooth to <html>) ============ */
html.smooth { scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
html.smooth .scroll-wrapper {
  position: fixed; inset: 0;
  width: 100%;
  will-change: transform;
}
/* In smooth mode, JS drives pins — disable CSS sticky */
html.smooth .services__intro[data-pin],
html.smooth .referral__intro,
html.smooth .faq__grid > div:first-child { position: static; }

/* ============ 22. RESPONSIVE ============ */
@media (max-width: 1180px) {
  .header-phone { display: none; }
}
@media (max-width: 1023px) {
  .support-row__index { grid-column: 1 / 3; }
  .support-row__body { grid-column: 3 / 13; }
  .support-row__link { grid-column: 3 / 13; justify-self: start; margin-top: 18px; }
  .services__grid, .referral__grid, .faq__grid, .telehealth__grid { grid-template-columns: 1fr; }
  .services__intro, .services__intro[data-pin], .services__list,
  .referral__intro, .rform,
  .faq__grid > div:first-child, .faq__list,
  .telehealth__grid > div:first-child, .telehealth__body { grid-column: 1 / -1; position: static; }
  .services__intro { margin-bottom: clamp(40px, 6vw, 64px); }
  .pathways__grid { grid-template-columns: 1fr; max-width: 640px; }
  .process__steps { grid-template-columns: 1fr 1fr; }
  .area__grid, .about__grid { grid-template-columns: 1fr; }
  .area__figure, .area__body, .about__body, .about__figure { grid-column: 1 / -1; }
  .about__figure { max-width: 560px; order: 2; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 899px) {
  .site-nav { display: none; }
  .site-header__cta .btn { display: none; }
  .site-header__cta { gap: 10px; }
  .header-call { display: inline-flex; }
  .menu-toggle { display: flex; }
  .hero { min-height: 92svh; }
  .hero__scroll-hint { display: none; }
  .gallery__panel { width: min(78vw, 480px); }
}
@media (max-width: 600px) {
  :root { --header-h: 72px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 20px; }
  .process__steps { grid-template-columns: 1fr; }
  .rform__row, .rform__checks { grid-template-columns: 1fr; }
  .site-footer__col { grid-column: 1 / -1; }
  .hero__meta { flex-direction: column; gap: 6px; }
  .hero__meta li + li::before { content: none; }
  .brand__text em { display: none; }
  /* Index stacks above the copy instead of eating two of twelve columns */
  .support-row { grid-template-columns: 1fr; gap: 10px; }
  .support-row__index, .support-row__body, .support-row__link { grid-column: 1 / -1; }
  .support-row__link { margin-top: 8px; white-space: normal; }
  .service { padding-left: 40px; }
  /* Bigger tap targets for the small uppercase footer links */
  .site-footer__col { gap: 4px; }
  .site-footer__col .link-sweep { padding-top: 10px; }
}

/* ============ 23. REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .marquee__track { animation: none; flex-wrap: wrap; }
  .marquee__item + .marquee__item { display: none; }
  .marquee__item { white-space: normal; padding-inline: var(--gutter); }
  .hero__canvas { display: none; }
  html.js [data-reveal], html.js [data-reveal-img], html.js [data-reveal-img] img,
  html.js .st-line-inner {
    opacity: 1; transform: none; clip-path: none; transition: none;
  }
  html.js .preloader { display: none; }
  html { scroll-behavior: auto; }
}
