/* ═══════════════════════════════════════════════════════════════
   SCROLL-SITE TEMPLATE — design system.

   Generic. Contains no client content and no client colours: every
   colour here is a var() defined in theme.css. Do not edit this file
   per client — edit theme.css and client.config.js.
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
/* overflow-x: clip (NOT hidden) contains sideways overflow WITHOUT turning
   html/body into a scroll container. `hidden` forces overflow-y to `auto`,
   which makes the body the scroller — that breaks window.scrollY (the film
   engine reads it) and the film's position:sticky pin. `clip` leaves
   overflow-y visible, so the window stays the scroller and sticky works. */
html { scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
/* <em> inside a heading is the accent word, not italics */
h1 em, h2 em { font-style: normal; color: var(--accent-ink); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

/* spacious scale */
:root { --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 40px; --s-5: 64px; --s-6: 96px;
        --ease: cubic-bezier(0.22, 0.61, 0.36, 1); --maxw: 1440px; }

.kicker {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent-ink);
}

/* ── skip links: hundreds of vh of film is hostile to keyboard users ── */
.skip {
  position: fixed; top: -100px; left: var(--s-2); z-index: 200;
  background: var(--brand-deep); color: #fff;
  padding: 12px 22px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: var(--s-2); }

/* ─────────────────────────── loader ─────────────────────────── */
#loader {
  position: fixed; inset: 0; z-index: 100; background: var(--brand-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transition: opacity 0.7s ease, visibility 0.7s;
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
#loader .mark { font-family: var(--serif); font-size: 26px; color: #fff; text-align: center; padding: 0 24px; }
#loader .sub { font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--on-dark-muted); }
#loader .bar { width: 170px; height: 2px; border-radius: 2px; background: rgba(255,255,255,0.18); overflow: hidden; }
#loader .bar i { display: block; height: 100%; width: 0; background: var(--accent-l); transition: width 0.25s ease; }

#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 90; pointer-events: none;
}

/* ─────────────────────── the film stage ─────────────────────── */
#track { position: relative; }   /* height set from config.film.trackVh */
#stage {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  width: 100%; overflow: hidden; background: var(--film-bg);
}
#film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Pulls the letterboxed frame edges back into the page so there is no seam. */
#vignette {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background:
    radial-gradient(ellipse 66% 70% at 50% 50%, transparent 48%, var(--paper) 96%),
    linear-gradient(to right, var(--paper), transparent 16%, transparent 84%, var(--paper)),
    linear-gradient(to bottom, var(--paper), transparent 20%, transparent 78%, var(--paper));
  opacity: 0.94;
}

/* ── captions ──
   The film is bright, so text gets a halo rather than a scrim box —
   a box reads as UI furniture and kills the film. */
.caption {
  position: absolute; z-index: 10; opacity: 0; pointer-events: none;
  will-change: opacity, transform; max-width: min(34ch, 42vw);
}
/* A single soft halo keeps the ink legible over the bright film without the
   heavy triple-glow that read as a blurry outline around every letter. */
.caption h1, .caption h2 {
  text-shadow: 0 1px 2px rgba(19,32,29,0.12), 0 0 22px var(--paper);
}
.caption h1 { font-size: clamp(34px, 5.4vw, 76px); }
.caption h2 { font-size: clamp(26px, 3.6vw, 52px); }
.caption p {
  margin-top: 16px; font-size: clamp(15px, 1.25vw, 19px); color: var(--muted);
  text-shadow: 0 0 16px var(--paper);
}
.caption .kicker { margin-bottom: 14px; }
.caption .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

.cap-center { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; max-width: min(38ch, 90vw); }
.cap-center p { margin-left: auto; margin-right: auto; }
.cap-left   { left: 7vw;  top: 50%; transform: translateY(-50%); }
.cap-right  { right: 7vw; top: 50%; transform: translateY(-50%); text-align: right; }
.cap-right p { margin-left: auto; }
.cap-bottom { left: 50%; bottom: 11vh; transform: translateX(-50%); text-align: center; max-width: min(38ch, 90vw); }

#scroll-cue {
  position: absolute; bottom: 4.5vh; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  transition: opacity 0.5s ease;
}
#scroll-cue::after {
  content: ""; width: 1px; height: 32px;
  background: linear-gradient(to bottom, var(--brand), transparent);
  animation: cue 1.9s ease-in-out infinite;
}
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(9px); opacity: 0.35; } }

/* ─────────────────────────── buttons ────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 13px 30px; border-radius: var(--radius-pill);
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; pointer-events: auto;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.btn:active { transform: scale(0.975); }
.btn.solid { background: var(--brand); color: #fff; box-shadow: 0 2px 8px -3px rgba(0,0,0,0.28); }
.btn.solid:hover { background: var(--brand-deep); transform: translateY(-2px); box-shadow: 0 18px 34px -16px rgba(0,0,0,0.45); }
.btn.wa { background: #1faf63; color: #fff; }
.btn.wa:hover { background: #179552; transform: translateY(-2px); }
.btn.ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.btn.sm { min-height: 42px; padding: 10px 22px; font-size: 14px; }

/* ───────────────────── sticky nav (post-film) ───────────────── */
#brandnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  padding: 14px 4vw;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  opacity: 0; pointer-events: none; transform: translateY(-10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
#brandnav.on { opacity: 1; pointer-events: auto; transform: none; }
#brandnav .mark { font-family: var(--serif); font-size: 20px; color: var(--brand-deep); }
#brandnav .mark small {
  display: block; font-family: var(--sans); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: -3px;
}
#brandnav .links { display: flex; gap: 2.2vw; }
#brandnav .links a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); transition: color 0.25s;
}
#brandnav .links a:hover { color: var(--brand-deep); }
@media (max-width: 900px) { #brandnav .links { display: none; } }

/* ───────────────────── brand-page sections ──────────────────── */
.bp { position: relative; padding: var(--s-6) 7vw; max-width: var(--maxw); margin: 0 auto; }
.bp h2 { font-size: clamp(32px, 4.2vw, 62px); }
.bp p.lead { color: var(--muted); font-size: clamp(15px, 1.2vw, 18px); line-height: 1.72; max-width: 46ch; margin-top: var(--s-2); }

[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

.bp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; align-items: center; }
.bp-split.flip > :first-child { order: 2; }
.bp-figure { border-radius: var(--radius); overflow: hidden; background: var(--tint-2); aspect-ratio: 4 / 3; }
.bp-figure img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .bp-split { grid-template-columns: 1fr; gap: var(--s-4); } .bp-split.flip > :first-child { order: 0; } }

/* "More about X →" */
a.more {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  margin-top: var(--s-3); font-size: 15px; font-weight: 600; color: var(--brand);
  transition: color 0.2s, gap 0.2s var(--ease);
}
a.more:hover { color: var(--brand-deep); gap: 13px; }

/* ── page hero: the opening block on a page with no film. Quieter than the
      film on purpose — an inner page must not compete with the home page. ── */
/* Two-column editorial hero. Copy left, tall composed image right.
   pad-top clears the always-on sticky nav. */
.bp-pagehero {
  padding-top: calc(var(--s-6) + 40px);
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 6vw; align-items: center;
}
.bp-pagehero-copy { max-width: 34ch; }
/* Short headlines by design, so this size never towers; balance keeps the
   two or three lines even. */
.bp-pagehero h1 {
  font-size: clamp(40px, 5.2vw, 72px); line-height: 1.04;
  letter-spacing: -0.02em; text-wrap: balance;
}
.bp-pagehero .rule { width: 48px; height: 2px; background: var(--accent); margin: var(--s-3) 0; }
.bp-pagehero .lead { max-width: 46ch; }
.bp-pagehero-media { align-self: center; }
/* Show the WHOLE photo — never crop it. The figure takes the image's own
   aspect (height auto), so tall shots (instruments) and wide shots (the
   treatments grid) both display in full instead of being half-cut. */
.bp-pagehero-media .bp-figure { aspect-ratio: auto; height: auto; min-height: 0; background: var(--tint-2); }
.bp-pagehero-media .bp-figure img { height: auto; max-height: 74vh; object-fit: contain; margin: 0 auto; }
.pagehero-actions { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-3); }

/* ── full-bleed hero with a quiet background video ── */
.bp-pagehero.has-bgvideo {
  display: block; position: relative; min-height: 72vh;
  display: flex; align-items: center;
  padding-top: calc(var(--s-6) + 40px); padding-bottom: var(--s-6);
  overflow: hidden;
}
.bp-hero-bg { position: absolute; inset: 0; z-index: 0; }
.bp-hero-bg video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* paper scrim keeps the clip subtle and the text readable in both themes */
.bp-hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, var(--paper) 8%, color-mix(in srgb, var(--paper) 62%, transparent) 55%, color-mix(in srgb, var(--paper) 40%, transparent)),
    color-mix(in srgb, var(--paper) 30%, transparent);
}
.bp-pagehero.has-bgvideo .bp-pagehero-copy { position: relative; z-index: 1; max-width: 40ch; }

@media (max-width: 860px) {
  .bp-pagehero { grid-template-columns: 1fr; gap: var(--s-4); padding-top: calc(var(--s-5) + 40px); }
  .bp-pagehero-copy { max-width: none; }
  .bp-pagehero h1 { font-size: clamp(34px, 9vw, 52px); }
  .bp-pagehero-media { order: -1; }              /* image leads on mobile */
  .bp-pagehero-media .bp-figure img { max-height: 52vh; }
  .bp-pagehero.has-bgvideo { min-height: 66vh; }
  .bp-hero-scrim { background: color-mix(in srgb, var(--paper) 55%, transparent); }
}

/* ── an image slot whose asset does not exist yet ── */
.bp-figure.is-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: var(--s-3);
  background: repeating-linear-gradient(45deg, var(--tint-2), var(--tint-2) 12px, var(--tint) 12px, var(--tint) 24px);
  border: 1px dashed var(--brand-soft);
}
.bp-figure .ph-id {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--brand-deep);
}
.bp-figure .ph-note { font-size: 12px; color: var(--muted); }

/* ── a whole section that is deliberately not built yet ── */
.bp-placeholder {
  border: 1px dashed var(--brand-soft); border-radius: var(--radius-lg);
  background: var(--tint-2); padding: var(--s-4); text-align: center;
}
.bp-placeholder h3 { font-size: 26px; margin: 8px 0 10px; }
.bp-placeholder p { color: var(--muted); font-size: 15px; max-width: 52ch; margin: 0 auto; }

/* ── services: one illustrated card per treatment ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s-3); }
.card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  overflow: hidden; scroll-margin-top: 90px;   /* anchor links clear the sticky nav */
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand-soft); box-shadow: 0 28px 52px -34px rgba(0,0,0,0.4); }
.card .bp-figure { border-radius: 0; }
.card-body { padding: var(--s-3); }
/* text-only card (no generated image yet): a clean editorial block with a
   top accent rule instead of an image, so it reads as intentional. */
.card.text { display: flex; }
.card.text .card-body { padding: var(--s-4) var(--s-3); border-top: 3px solid var(--accent); width: 100%; }
.card.text .n { color: var(--accent-ink); }
.card-body .n { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--accent-ink); }
.card-body h3 { font-size: 24px; margin: 10px 0 10px; }
.card-body p { font-size: 15px; color: var(--muted); line-height: 1.65; }

.bp-manifesto { text-align: center; padding: calc(var(--s-6) * 1.6) 7vw; }
.bp-manifesto h2 { font-size: clamp(36px, 6.4vw, 104px); max-width: 17ch; margin: var(--s-3) auto 0; }
.bp-manifesto .rule { width: 54px; height: 2px; background: var(--accent); margin: var(--s-4) auto 0; border-radius: 2px; }

.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--s-2); margin-top: var(--s-5); }
.svc { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: var(--s-3);
       transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s; }
.svc:hover { transform: translateY(-4px); border-color: var(--brand-soft); box-shadow: 0 24px 46px -30px rgba(0,0,0,0.35); }
.svc .n { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; color: var(--accent-ink); }
.svc h3 { font-size: 21px; margin: 10px 0 8px; }
.svc p { font-size: 14.5px; color: var(--muted); line-height: 1.6; }

.tooth3d { background: linear-gradient(160deg, var(--tint-2), var(--tint)); border-radius: var(--radius-lg);
           padding: var(--s-4); display: grid; grid-template-columns: 1fr 1fr; gap: 5vw; align-items: center; }
.tooth3d .viewer { aspect-ratio: 1 / 1; width: 100%; border-radius: var(--radius); position: relative; overflow: hidden;
                   background: radial-gradient(circle at 50% 45%, var(--surface), var(--tint-2) 72%); }
.tooth3d model-viewer { width: 100%; height: 100%; --poster-color: transparent; }
.tooth3d .fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
                     justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; text-align: center; padding: var(--s-3); }
@media (max-width: 900px) { .tooth3d { grid-template-columns: 1fr; } }

.bp-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6vw; text-align: center; }
.bp-stats .num { font-family: var(--serif); font-size: clamp(38px, 5vw, 78px); color: var(--brand); line-height: 1; font-variant-numeric: tabular-nums; }
.bp-stats .lbl { margin-top: 10px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }

.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-2); margin-top: var(--s-5); }
.quote { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: var(--s-3); }
.quote blockquote { font-size: 16px; line-height: 1.65; }
.quote cite { display: block; margin-top: var(--s-2); font-style: normal; font-size: 13px; color: var(--muted); }
.quote cite b { color: var(--ink); font-weight: 600; }
.quote .badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
                font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); }
.quote .badge svg { width: 13px; height: 13px; }

.band-dark { background: var(--brand-deep); color: var(--on-dark); }
.band-dark h2 { color: #fff; }
.band-dark .kicker { color: var(--accent-l); }
.band-dark p.lead { color: var(--on-dark-muted); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); margin-top: var(--s-5); }
.info-grid h4 { font-family: var(--sans); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent-l); margin-bottom: 12px; }
.info-grid p { font-size: 16px; color: var(--on-dark); }
/* inline-block + padding so these clear the 44px touch minimum */
.info-grid a { display: inline-block; padding: 12px 0; color: var(--on-dark); }
.info-grid a:hover { color: #fff; text-decoration: underline; }

.bp-ctaband { text-align: center; padding: calc(var(--s-6) * 1.3) 7vw; }
.bp-ctaband .actions { display: flex; flex-wrap: wrap; gap: var(--s-1); justify-content: center; margin-top: var(--s-4); }

footer.bp-footer { border-top: 1px solid var(--line); padding: var(--s-5) 7vw var(--s-4); }
.bp-footer .cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 4vw; max-width: var(--maxw); margin: 0 auto; }
.bp-footer h4 { font-family: var(--sans); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.bp-footer .brandline { font-family: var(--serif); font-size: 22px; color: var(--brand-deep); margin-bottom: 12px; }
.bp-footer p.f { color: var(--muted); font-size: 14.5px; margin-bottom: 9px; }
.bp-footer a { display: block; color: var(--muted); font-size: 14.5px; padding: 11px 0; }
.bp-footer a:hover { color: var(--brand-deep); }
.bp-footer .fine { margin-top: var(--s-5); text-align: center; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .bp-footer .cols { grid-template-columns: 1fr 1fr; gap: var(--s-3); } }

/* ── sticky mobile action bar: the highest-value element on a phone ── */
#callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 85; display: none; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
#callbar .btn { flex: 1; }

@media (max-width: 720px) {
  #callbar { display: flex; }
  body { padding-bottom: 74px; }
  /* Proper phone film: the 16:9 frames COVER-fill the portrait screen (see
     drawFrame) and every caption sits bottom-left in the lower third, above the
     sticky call bar, over a readability scrim. One caption shows at a time. */
  .caption { max-width: none; }
  .cap-center, .cap-left, .cap-right, .cap-bottom {
    left: 6vw; right: 6vw; top: auto; bottom: 17vh;
    transform: none; text-align: left; max-width: none;
  }
  .cap-center p, .cap-right p { margin-left: 0; margin-right: 0; }
  .caption .kicker { margin-bottom: 10px; }
  .caption h1 { font-size: clamp(31px, 8.4vw, 44px); }
  .caption h2 { font-size: clamp(25px, 7vw, 36px); }
  .caption p { font-size: 15px; max-width: 32ch; margin-top: 12px; }
  .caption .actions { justify-content: flex-start; margin-top: 20px; }
  /* readability scrim behind the lower-third captions over the film */
  #vignette::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 52vh; pointer-events: none;
    background: linear-gradient(to top, var(--paper) 2%,
                color-mix(in srgb, var(--paper) 72%, transparent) 30%, transparent 62%);
  }
  .bp { padding: var(--s-5) 6vw; }
  .bp-manifesto { padding: var(--s-6) 6vw; }
}

/* ── reduced motion: the film still scrubs (it IS the content), but every
      decorative loop, drift and reveal transition is neutralised ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  #scroll-cue::after { animation: none; }
}
