/* ==========================================================================
   Osteon orthopaedic clinic
   1. Palette   2. Base   3. Buttons   4. Loader   5. Header
   6. Atlas (stage, skeleton, hotspots, rail, chapters)
   7. Content bands   8. Visit   9. Footer   10. Small screens
   ========================================================================== */

/* 1. Palette (Glacier: ice blues, clinical teal, cyan light) ------------- */
:root {
  --c-ground: #e4eff4;
  --c-surface: #f4f9fb;
  --c-text: #0b2732;
  --c-muted: #48626d;
  --c-primary: #0e6680;
  --c-on-primary: #f4f9fb;
  --c-line: #bad2dc;
  --c-accent: #0b7593;
  --c-glow: #4ec3e0;
  --c-bone: #f6f3ea;
  --c-bone-line: #2f5664;
  --c-socket: #c2d9e2;
  --c-deep: #072d3b;
  --c-deep-2: #0d4c61;
  --c-on-deep: #e4f2f6;
}

/* 2. Base ---------------------------------------------------------------- */
:root {
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --step-4: clamp(2.75rem, 1.8rem + 4vw, 4.75rem);
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --header-h: 4.5rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.is-loading { overflow: hidden; }

/* Lenis smooth scrolling (see initSmoothScroll in osteon.js). */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--c-ground);
  color: var(--c-text);
  font: 400 var(--step-0) / 1.6 var(--font-body);
  transition: background-color 0.4s, color 0.4s;
}

h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* 3. Buttons ------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 1px solid var(--c-primary);
  border-radius: 999px;
  background: var(--c-primary);
  color: var(--c-on-primary);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}

.button:hover { background: var(--c-text); border-color: var(--c-text); color: var(--c-surface); }
.button--small { min-height: 2.5rem; padding: 0 1.1rem; font-size: var(--step--1); }
.button--quiet { background: transparent; color: var(--c-primary); }
.button--quiet:hover { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); }
.button--light { background: var(--c-on-deep); border-color: var(--c-on-deep); color: var(--c-deep); }
.button--outline-light { background: transparent; border-color: var(--c-on-deep); color: var(--c-on-deep); }
.button--light:hover,
.button--outline-light:hover { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }

/* 4. Loader -------------------------------------------------------------- */
.loader { display: none; }

.js .loader {
  --hole: 0px;
  --cx: 50%;
  --cy: 50%;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background-color: var(--c-deep);
  background-image:
    radial-gradient(circle at center, rgba(7, 45, 59, 0.4) 0%, rgba(7, 45, 59, 0.85) 75%, var(--c-deep) 100%),
    url("../img/welcome-bg.webp");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: var(--c-on-deep);
  -webkit-mask-image: radial-gradient(circle at var(--cx) var(--cy), transparent var(--hole), #000 calc(var(--hole) + 1px));
  mask-image: radial-gradient(circle at var(--cx) var(--cy), transparent var(--hole), #000 calc(var(--hole) + 1px));
}

.loader__mark { width: clamp(7rem, 18vw, 10rem); aspect-ratio: 1; }

.osteon-mark--loader { width: 100%; height: 100%; overflow: visible; }
.osteon-mark--loader .osteon-mark__ring { stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; }
.osteon-mark--loader .osteon-mark__lacunae ellipse { fill: currentColor; }

.osteon-mark__progress {
  fill: none;
  stroke: var(--c-accent);
  stroke-width: 0.8;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transform: rotate(-90deg);
  transform-origin: 32px 32px;
}

.loader__word {
  display: flex;
  overflow: hidden;
  font: 400 clamp(2.75rem, 7vw, 4.5rem) / 1.1 var(--font-display);
  letter-spacing: -0.01em;
}

.loader__word span { display: inline-block; }

.loader__tagline {
  margin-top: -0.75rem;
  color: color-mix(in srgb, var(--c-on-deep) 70%, transparent);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}

.loader__count {
  position: absolute;
  right: var(--gutter);
  bottom: var(--gutter);
  font: 400 var(--step-1) / 1 var(--font-display);
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--c-on-deep) 70%, transparent);
}

/* The osteon mark: concentric lamellae around a central canal. */
.osteon-mark { color: currentColor; }
.osteon-mark__ring { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.osteon-mark__canal { fill: var(--c-accent); }

/* 5. Header -------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2.25rem);
  height: var(--header-h);
  padding: 0 var(--gutter);
  transition: background-color 0.3s, box-shadow 0.3s, top 0.45s var(--ease-out);
}

.site-header.is-scrolled,
.site-header.is-menu-open {
  background: color-mix(in srgb, var(--c-ground) 86%, transparent);
  box-shadow: 0 1px 0 var(--c-line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Slides away while reading down the page, returns on the first scroll up.
   Moved with top, not transform, so it never traps the fixed menu panel. */
.site-header.is-hidden { top: calc(-1 * var(--header-h) - 1px); }

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--c-primary);
  text-decoration: none;
}

.brand .osteon-mark { flex: none; width: 2.25rem; height: 2.25rem; }
.brand__text { display: grid; }
.brand__word { font: 500 1.55rem / 1 var(--font-display); color: var(--c-text); }
.brand__tag { margin-top: 0.2rem; color: var(--c-muted); font-size: 0.75rem; line-height: 1; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 1.8vw, 1.75rem);
  margin-left: auto;
  font-size: var(--step--1);
}

.site-nav a:not(.button) {
  position: relative;
  padding: 0.5rem 0;
  color: var(--c-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

/* Underline marks the section in view. */
.site-nav a:not(.button)::after {
  content: "";
  position: absolute;
  inset: auto 0 0.1rem;
  height: 2px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.site-nav a:not(.button):hover,
.site-nav a[aria-current] { color: var(--c-text); }
.site-nav a[aria-current]::after { transform: scaleX(1); }

/* The menu's own booking button only appears in the small-screen panel. */
.site-nav__book { display: none; }

.site-header__phone {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-left: clamp(1rem, 1.8vw, 1.75rem);
  border-left: 1px solid var(--c-line);
  color: var(--c-text);
  font-size: var(--step--1);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__phone svg { width: 1rem; height: 1rem; fill: var(--c-primary); }
.site-header__phone:hover { color: var(--c-primary); }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: transparent;
  color: var(--c-text);
  font: 500 var(--step--1) / 1 var(--font-body);
  cursor: pointer;
}

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  display: block;
  width: 1rem;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), background-color 0.2s;
}

.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before,
.menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -5px; }
.menu-toggle__bars::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

html.is-menu-open { overflow: hidden; }

/* 6. Atlas --------------------------------------------------------------- */
.atlas {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.atlas__chapters { position: relative; z-index: 1; grid-column: 1; grid-row: 1; }

/* Hero background: osteon rings centred low behind the headline, plus a soft
   light from the upper left. It scrolls away with the first chapter. */
.atlas__hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% * 5 / 11);
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, var(--c-surface), transparent 70%),
    radial-gradient(ellipse 60% 50% at 20% 95%, color-mix(in srgb, var(--c-glow) 22%, transparent), transparent 70%);
  -webkit-mask-image: linear-gradient(to right, #000 70%, transparent);
  mask-image: linear-gradient(to right, #000 70%, transparent);
}

.atlas__hero-bg svg {
  position: absolute;
  left: -45%;
  bottom: -62%;
  width: 140%;
  aspect-ratio: 1;
}

.hero-rings circle { fill: none; stroke: var(--c-primary); stroke-width: 1; opacity: 0.16; }
.hero-rings .is-strong { stroke: var(--c-glow); stroke-width: 1.6; opacity: 0.45; }
.hero-lacunae ellipse { fill: var(--c-primary); opacity: 0.18; }
.hero-canal { fill: var(--c-accent); opacity: 0.5; }

.atlas__stage {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 42% 48%, color-mix(in srgb, var(--c-glow) 26%, transparent) 0%, transparent 42%),
    radial-gradient(ellipse at 50% 45%, var(--c-surface) 0%, transparent 70%);
}

/* Faint scanner rings around the figure, like a holographic display. A layer
   of its own: the camera moves it less than the skeleton, for depth. Oversized
   so its edges never show while it drifts. */
.atlas__rings {
  position: absolute;
  inset: -20%;
  background:
    repeating-radial-gradient(circle at 44.3% 48.6%,
      transparent 0 118px,
      color-mix(in srgb, var(--c-glow) 55%, transparent) 119px 120px,
      transparent 121px 160px);
  opacity: 0.5;
  transform-origin: 44.3% 48.6%;
  will-change: transform;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 44.3% 48.6%, #000 10%, transparent 45%);
  mask-image: radial-gradient(circle at 44.3% 48.6%, #000 10%, transparent 45%);
}

/* Fades the zoomed skeleton out behind the region rail. */
.atlas__stage::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 17rem;
  background: linear-gradient(to left, var(--c-ground) 60%, transparent);
  pointer-events: none;
}

/* Leaves room on the right for the region rail. */
.atlas__figure { position: absolute; inset: var(--header-h) 11rem 1.5rem 0; }

.skeleton {
  --zoom: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  /* Soft edges, so a zoomed bone fades out instead of being cut off. */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 4rem, #000 calc(100% - 4rem), transparent),
    linear-gradient(to bottom, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 4rem, #000 calc(100% - 4rem), transparent),
    linear-gradient(to bottom, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  mask-composite: intersect;
}

.skeleton .bone,
.skeleton .socket {
  fill: var(--c-bone);
  stroke: var(--c-bone-line);
  stroke-width: calc(1.4px / var(--zoom));
  stroke-linejoin: round;
  transition: fill 0.5s, stroke 0.5s;
}

.skeleton .socket { fill: var(--c-socket); }
.skeleton .bone--faint { fill-opacity: 0.5; }

.skeleton .trace {
  fill: none;
  stroke: var(--c-bone-line);
  stroke-width: calc(1px / var(--zoom));
  stroke-linecap: round;
}

.skeleton .ribs .trace { stroke-width: calc(2.4px / var(--zoom)); stroke: var(--c-bone-line); opacity: 0.75; }

.skeleton .region { transition: opacity 0.6s var(--ease-out); }
.skeleton[data-active]:not([data-active="body"]) .region { opacity: 0.3; }
.skeleton .region.is-active { opacity: 1; }
.skeleton .region.is-active :is(.bone, .socket) { stroke: var(--c-accent); stroke-width: calc(2px / var(--zoom)); }
.skeleton .region.is-active .trace { stroke: var(--c-accent); stroke-width: calc(1.4px / var(--zoom)); }

/* Before the intro draws the skeleton, its lines are hidden. */
.js .skeleton:not(.is-drawn) :is(.bone, .socket, .trace) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  fill-opacity: 0;
}

/* BodyParts3D render inside the camera; uncovered by JS after the welcome screen. */
.js .skeleton:not(.is-drawn) .skeleton__render { clip-path: inset(0 0 100% 0); }

/* Hotspots: positioned in pixels by JS on top of the skeleton. */
.hotspots { position: absolute; inset: 0; pointer-events: none; }

.hotspot {
  --leader: 3.5rem;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  will-change: transform;
}

.hotspot__dot {
  position: relative;
  width: 0.75rem;
  height: 0.75rem;
  margin: -0.375rem;
  border: 2px solid var(--c-surface);
  border-radius: 50%;
  background: var(--c-glow);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--c-glow) 28%, transparent),
    0 0 18px 4px color-mix(in srgb, var(--c-glow) 55%, transparent);
}

.hotspot__leader {
  width: var(--leader);
  height: 1px;
  margin-left: 0.375rem;
  background: linear-gradient(to right, var(--c-glow), var(--c-primary));
  transform-origin: left center;
}

/* Frosted glass cards, as in the reference design. */
.hotspot__label {
  margin-left: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid color-mix(in srgb, #fff 70%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--c-surface) 72%, transparent);
  box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--c-primary) 45%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  line-height: 1.25;
}

.hotspot__label b { display: block; font-weight: 500; font-size: var(--step--1); }
.hotspot__label i { font: italic 400 1rem / 1.2 var(--font-display); color: var(--c-muted); }

.hotspot--left { flex-direction: row-reverse; }
.hotspot--left .hotspot__leader {
  margin: 0 0.375rem 0 0;
  background: linear-gradient(to left, var(--c-glow), var(--c-primary));
  transform-origin: right center;
}
.hotspot--left .hotspot__label { margin: 0 0.4rem 0 0; text-align: right; }

/* Rail: progress through the body, head to toe. */
.rail {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 100vh;
  height: 100svh;
  padding-right: var(--gutter);
  pointer-events: none;
}

.rail__list { counter-reset: region; display: grid; gap: 1.1rem; pointer-events: auto; }

.rail__list a {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  justify-content: flex-end;
  color: var(--c-muted);
  font-size: var(--step--1);
  text-decoration: none;
  opacity: 0.7;
  transition: color 0.3s, opacity 0.3s;
}

.rail__list a::after {
  counter-increment: region;
  content: counter(region);
  min-width: 1ch;
  font: italic 400 1rem / 1 var(--font-display);
}

.rail__list a:hover,
.rail__list a.is-current { color: var(--c-text); opacity: 1; }
.rail__list a.is-current::after { color: var(--c-accent); }

.rail__track {
  position: relative;
  align-self: stretch;
  width: 1px;
  margin: 28vh 0 28vh 1rem;
  background: var(--c-line);
}

.rail__fill {
  position: absolute;
  inset: 0;
  background: var(--c-accent);
  transform: scaleY(0);
  transform-origin: top;
}

/* Chapters */
.chapter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 3rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: clamp(1rem, 4vw, 4rem);
}

.chapter--intro { max-width: 40rem; }

/* Region chapters are taller than the screen and their text stays put, so the
   camera holds on each region long enough to read its labels. */
.chapter:not(.chapter--intro) {
  display: block;
  min-height: 210vh;
  min-height: 210svh;
  padding-block: 0;
}

/* Nothing follows the last region, so it holds for a shorter stretch. */
.chapter:not(.chapter--intro):last-child { min-height: 150vh; min-height: 150svh; }

.chapter__body {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 2rem) 0 3rem;
}

.intro__title {
  font: 400 var(--step-4) / 1.02 var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.intro__lede { max-width: 32rem; color: var(--c-muted); font-size: var(--step-1); line-height: 1.5; }
.intro__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

.intro__facts { display: flex; gap: 2.5rem; margin-top: 1.5rem; }
.intro__facts dt { font: 400 var(--step-3) / 1 var(--font-display); color: var(--c-primary); }
.intro__facts dd { color: var(--c-muted); font-size: var(--step--1); }

.chapter__latin { font: italic 400 var(--step-1) / 1 var(--font-display); color: var(--c-accent); }

.chapter__title {
  margin-top: -0.5rem;
  font: 400 var(--step-4) / 1 var(--font-display);
  letter-spacing: -0.02em;
}

.chapter__text { max-width: 30rem; font-size: var(--step-1); line-height: 1.5; color: var(--c-muted); }

.chapter__points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.5rem;
  padding: 1.25rem 0;
  border-block: 1px solid var(--c-line);
}

.chapter__points li { display: grid; line-height: 1.3; }
.chapter__points span { font-weight: 500; font-size: var(--step--1); }
.chapter__points i { font: italic 400 1rem / 1.3 var(--font-display); color: var(--c-muted); }

.chapter__treat { max-width: 30rem; color: var(--c-muted); }
.chapter__treat b { color: var(--c-text); font-weight: 600; }

/* 7. Content bands ------------------------------------------------------- */
/* Each band has an optional .band__bg layer carrying its image as an inline
   background-image (editable in TYPO3); without it, the band shows its colour. */
.band {
  position: relative;
  isolation: isolate;
  padding: clamp(5rem, 11vw, 8.5rem) var(--gutter);
}

/* Clips the drifting background layer to its own section. */
.band,
.visit { overflow: clip; }

.band__inner { position: relative; max-width: 76rem; }

/* Curved divider: each section slides up under the one before and its top is
   cut along a wave, so the previous section (photo or colour) shows above the
   curve. Two thin lines of light trace the edge. */
.band,
.visit {
  --divider-h: clamp(3.5rem, 8vw, 8.5rem);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 140' preserveAspectRatio='none'%3E%3Cpath d='M0 62C190 100 400 108 650 74C930 36 1190 128 1440 44V141H0Z'/%3E%3C/svg%3E");
  margin-top: calc(-1 * var(--divider-h));
  padding-top: calc(var(--divider-h) + clamp(3rem, 7vw, 5.5rem));
  -webkit-mask: var(--wave) top / 100% var(--divider-h) no-repeat, linear-gradient(#000 0 0) 0 calc(var(--divider-h) - 1px) / 100% 100% no-repeat;
  mask: var(--wave) top / 100% var(--divider-h) no-repeat, linear-gradient(#000 0 0) 0 calc(var(--divider-h) - 1px) / 100% 100% no-repeat;
}

/* Mirrored wave, so consecutive edges alternate. */
.band--first-visit,
.band--faq {
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 140' preserveAspectRatio='none'%3E%3Cpath d='M1440 62C1250 100 1040 108 790 74C510 36 250 128 0 44V141H1440Z'/%3E%3C/svg%3E");
}

.divider {
  position: absolute;
  top: -1px;
  left: 0;
  z-index: -1;
  width: 100%;
  height: var(--divider-h);
  overflow: visible;
  pointer-events: none;
}

.divider--flip { transform: scaleX(-1); }

.divider__line {
  fill: none;
  stroke: var(--c-glow);
  stroke-width: 1.4;
  opacity: 0.85;
}

.divider__line--soft { stroke: var(--c-primary); stroke-width: 1; opacity: 0.35; }

/* On dark sections the soft line glows too. */
.band--recovery .divider__line--soft,
.visit .divider__line--soft { stroke: var(--c-glow); opacity: 0.45; }

.band__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.section-title { font: 400 var(--step-3) / 1.05 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
.section-lede { max-width: 34rem; margin-top: 1rem; color: var(--c-muted); font-size: var(--step-1); line-height: 1.5; }

/* Treatments: pale surface, bone texture fading in from the right. */
.band--treatments { background: var(--c-surface); }

.band--treatments .band__bg {
  left: 35%;
  background-position: right center;
  opacity: 0.32;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 65%);
  mask-image: linear-gradient(to right, transparent, #000 65%);
}

.treatments__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 2.75rem 3.5rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.treatments__list li { padding-top: 1.25rem; border-top: 1px solid var(--c-line); }
.treatments__list h3 { font: 500 var(--step-2) / 1.15 var(--font-display); }
.treatments__list p { max-width: 26rem; margin-top: 0.6rem; color: var(--c-muted); }

/* First visit: full-bleed photo, the steps on an ice wash on the right. */
.band--first-visit {
  display: flex;
  align-items: center;
  min-height: 90vh;
  background: var(--c-ground);
}

.band--first-visit .band__bg { background-position: 30% center; }

/* Frosted ice glass over the photo behind the text; the people stay visible. */
.band--first-visit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg,
    transparent 30%,
    color-mix(in srgb, var(--c-ground) 72%, transparent) 55%,
    color-mix(in srgb, var(--c-ground) 84%, transparent) 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(90deg, transparent 32%, #000 56%);
  mask-image: linear-gradient(90deg, transparent 32%, #000 56%);
}

.band--first-visit .band__inner { width: 100%; max-width: 36rem; margin-left: auto; }

.steps { counter-reset: step; display: grid; gap: 1.6rem; margin-top: 2.5rem; }

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  column-gap: 1.1rem;
}

.steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-accent);
  font: italic 400 1.25rem / 1 var(--font-display);
}

.steps h3 { font: 500 var(--step-1) / 1.25 var(--font-display); }
.steps p { margin-top: 0.3rem; color: var(--c-muted); }

.band__note {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-line);
  color: var(--c-muted);
  font-size: var(--step--1);
}

/* Recovery: full-bleed photo under a soft architectural scrim, text on the left, daylight and people natural on the right. */
.band--recovery {
  display: flex;
  align-items: center;
  min-height: 85vh;
  color: var(--c-on-deep);
  background: var(--c-deep);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), 0 2px 14px rgba(0, 0, 0, 0.5);
}

.band--recovery::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg,
    rgba(5, 22, 30, 0.88) 0%,
    rgba(6, 26, 35, 0.80) 26%,
    rgba(7, 30, 40, 0.60) 35%,
    rgba(7, 30, 40, 0.15) 43%,
    transparent 49%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(90deg, #000 35%, transparent 49%);
  mask-image: linear-gradient(90deg, #000 35%, transparent 49%);
}

.band--recovery .band__bg { background-position: right center; }

.band--recovery .band__inner { width: 100%; }
.band--recovery .band__inner > * { max-width: 34rem; }
.band--recovery .section-lede { color: rgba(255, 255, 255, 0.92); }

.recovery__facts { display: grid; gap: 1.25rem; margin: 2.5rem 0; }
.recovery__facts div { padding-left: 1rem; border-left: 2px solid var(--c-accent); }
.recovery__facts dt { font: 500 var(--step-1) / 1.2 var(--font-display); color: #ffffff; }
.recovery__facts dd { margin-top: 0.2rem; color: rgba(255, 255, 255, 0.85); }
.band--recovery .button { text-shadow: none; }

/* Questions: osteon cross-section behind the heading, accordion beside it. */
.band--faq { overflow: hidden; background: var(--c-surface); }

.band--faq .band__bg {
  inset: 50% auto auto -10rem;
  width: min(44rem, 70vw);
  aspect-ratio: 1;
  opacity: 0.35;
  transform: translateY(-50%);
  -webkit-mask-image: radial-gradient(closest-side, #000 45%, transparent);
  mask-image: radial-gradient(closest-side, #000 45%, transparent);
}

.band--faq .band__inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 3rem;
  align-items: start;
}

.faq { border-top: 1px solid var(--c-line); }
.faq details { border-bottom: 1px solid var(--c-line); }

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.3rem 0;
  font: 400 var(--step-1) / 1.35 var(--font-display);
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  flex: none;
  width: 0.65rem;
  height: 0.65rem;
  margin: 0.45rem 0.3rem 0 0;
  border-right: 1.5px solid var(--c-accent);
  border-bottom: 1.5px solid var(--c-accent);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}

.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--c-primary); }
.faq details p { max-width: 40rem; overflow: hidden; padding: 0 2.5rem 1.4rem 0; color: var(--c-muted); }

/* 8. Visit --------------------------------------------------------------- */
.visit {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 3rem;
  padding: calc(var(--divider-h) + clamp(3rem, 7vw, 5.5rem)) var(--gutter) clamp(5rem, 12vw, 9rem);
  position: relative;
  isolation: isolate;
  color: var(--c-on-deep);
  background: var(--c-deep);
}

/* The text sits on the photo itself: no colour wash, only a light neutral
   shade and a soft shadow under the letters so they stay readable. */
.visit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.32));
}

.visit { text-shadow: 0 1px 2px rgb(0 0 0 / 0.55), 0 2px 18px rgb(0 0 0 / 0.45); }
.visit .button { text-shadow: none; box-shadow: 0 8px 24px -10px rgb(0 0 0 / 0.6); }
.visit .section-lede { color: #fff; }
.visit__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.visit__details { display: grid; gap: 1.75rem; align-content: start; }
.visit__details dt { font: italic 400 var(--step-1) / 1.2 var(--font-display); }
.visit__details dd { margin-top: 0.3rem; color: #fff; }

/* 9. Footer -------------------------------------------------------------- */
.site-footer {
  background:
    radial-gradient(ellipse 60% 80% at 85% 0%, color-mix(in srgb, var(--c-glow) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--c-deep), color-mix(in srgb, var(--c-deep) 70%, #000));
  color: color-mix(in srgb, var(--c-on-deep) 68%, transparent);
  font-size: var(--step--1);
  border-top: 1px solid color-mix(in srgb, var(--c-on-deep) 12%, transparent);
}

.site-footer a { color: inherit; text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--c-on-deep); }

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  padding: clamp(3.5rem, 7vw, 5.5rem) var(--gutter) 3.5rem;
}

.brand--light,
.brand--light .brand__word { color: var(--c-on-deep); }
.brand--light .brand__tag { color: color-mix(in srgb, var(--c-on-deep) 60%, transparent); }

.site-footer__brand p { max-width: 22rem; margin-top: 1.25rem; line-height: 1.6; }

.site-footer .site-footer__phone {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--c-on-deep);
  font: 400 var(--step-2) / 1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.site-footer__nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }

.site-footer__nav h2 {
  margin-bottom: 1rem;
  color: var(--c-on-deep);
  font: italic 400 var(--step-1) / 1.2 var(--font-display);
}

.site-footer__nav ul { display: grid; gap: 0.6rem; }
.site-footer__nav address { font-style: normal; }
.site-footer__nav address,
.site-footer__nav p { margin-bottom: 0.9rem; line-height: 1.6; }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid color-mix(in srgb, var(--c-on-deep) 12%, transparent);
}

.site-footer__legal { display: flex; gap: 1.5rem; margin-left: auto; }

/* 10. Small screens ------------------------------------------------------ */
@media (max-width: 1180px) {
  .site-header__phone { padding-left: 0; border-left: 0; margin-left: auto; }
  .site-header__phone span { display: none; }
  .menu-toggle { display: inline-flex; }

  /* The nav turns into a panel under the header. */
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 1rem var(--gutter) 2.5rem;
    overflow-y: auto;
    background: var(--c-ground);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.75rem);
    transition: opacity 0.3s, transform 0.35s var(--ease-out), visibility 0s 0.35s;
  }

  /* backdrop-filter would make the header the panel's containing block. */
  .site-header.is-menu-open {
    background: var(--c-ground);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.3s, transform 0.35s var(--ease-out);
  }

  .site-nav a:not(.button) {
    padding: 1rem 0;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-text);
    font: 400 var(--step-2) / 1.2 var(--font-display);
  }

  .site-nav a:not(.button)::after { display: none; }
  .site-nav a[aria-current] { color: var(--c-accent); }
  .site-nav__book { display: inline-flex; align-self: flex-start; margin-top: 2rem; }

  .rail__list a { font-size: 0; gap: 0; }
  .rail__list a::after { font-size: 1rem; }
  .atlas__figure { right: 3rem; }
}

@media (max-width: 960px) {
  .band--faq .band__inner,
  .site-footer__top { grid-template-columns: minmax(0, 1fr); }

  /* Text covers the whole photo here, so the wash does too. */
  .band--first-visit { min-height: 0; }
  .band--first-visit::before {
    background: linear-gradient(
      color-mix(in srgb, var(--c-ground) 72%, transparent),
      color-mix(in srgb, var(--c-ground) 90%, transparent) 40%);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    -webkit-mask-image: none;
    mask-image: none;
  }
  .band--first-visit .band__inner { max-width: none; }
}

@media (max-width: 1040px) {
  :root { --header-h: 3.75rem; }

  .brand__tag { display: none; }

  .atlas { grid-template-columns: minmax(0, 1fr); }

  .atlas__hero-bg { top: 48svh; width: 100%; height: 85svh; }
  .atlas__hero-bg svg { left: -30%; bottom: -40%; width: 120%; }

  /* Sticky solid stage on small screens: keeps the 2.5D skeleton drawing pristine at the top;
     scrolling text gracefully passes behind it with zero overlap. */
  .atlas__stage {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    height: 48svh;
    background-color: var(--c-ground);
    background-image:
      radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c-glow) 20%, transparent) 0%, transparent 60%),
      radial-gradient(ellipse at 50% 50%, var(--c-surface) 0%, var(--c-ground) 90%);
    z-index: 20;
    box-shadow: 0 4px 16px -4px rgba(7, 45, 59, 0.12), 0 1px 0 var(--c-line);
    overflow: hidden;
  }

  .atlas__figure { inset: var(--header-h) 0 0.5rem; }
  .atlas__stage::after { display: none; }
  .atlas__chapters { grid-row: 2; position: relative; z-index: 1; }
  .rail { display: none; }

  .chapter {
    justify-content: flex-start;
    min-height: 85svh;
    margin: 0;
    scroll-margin-top: 48svh;
    padding: 2rem var(--gutter) 2.5rem;
  }

  /* The stage stays cleanly anchored above; each region holds long enough for smooth reading. */
  .chapter:not(.chapter--intro) { min-height: 120svh; padding-block: 2rem 2.5rem; }
  .chapter:not(.chapter--intro):last-child { min-height: 100svh; }
  .chapter__body { position: static; min-height: 0; padding: 0; justify-content: flex-start; }

  .hotspot { --leader: 1.25rem; }
  .hotspot__label b { display: none; }
  .hotspot__label i { font-size: 0.8rem; }

  .band--recovery { min-height: 0; }

  /* Text covers the whole photo on mobile, soft gradient so the photo and daylight remain visible. */
  .band--recovery::before {
    background: linear-gradient(180deg,
      rgba(5, 22, 30, 0.80) 0%,
      rgba(6, 26, 35, 0.70) 50%,
      rgba(7, 30, 40, 0.55) 100%);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    -webkit-mask-image: none;
    mask-image: none;
  }
  .visit { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .site-header__book { display: none; }
  .site-footer__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__legal { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* Word masks for heading reveals (see splitWords in osteon.js). */
.word { display: inline-block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; vertical-align: top; }
.word__inner { display: inline-block; transform-origin: 0 100%; }
