/* =====================================================================
   Zahnarztpraxis Hinwil — scroll film
   Layers:
     1. tokens + base type
     2. static editorial layout (no JS, reduced motion, and the mobile base)
     3. html.fx      — choreographed layout (JS + motion allowed)
     4. html.fx-h    — desktop horizontal journey
   ===================================================================== */

:root {
  /* palette derived from the practice logo */
  --white: #fbfcfd;
  --paper: #f3f0eb;
  --stone: #e6e1d9;
  --ice: #d9eef6;
  --sky: #b4daec;
  --mist: #d4dce2;
  --slate: #7b909a;
  --deep: #16222a;
  --night: #0e161b;
  --ink: #1d1d1b;
  --ink-2: #4e5a62;
  --ink-3: #7d878d;
  --red: #da1018;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "PT Sans", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 64px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 72px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
/* Lenis 1.3 recommended CSS (vendor/lenis.min.js) */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent], .lenis [data-lenis-prevent-wheel], .lenis [data-lenis-prevent-touch],
.lenis [data-lenis-prevent-vertical], .lenis [data-lenis-prevent-horizontal] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
picture { display: contents; }
figure { margin: 0; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
h1, h2, h3, p, blockquote, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px;
  background: var(--ink); color: var(--white); border-radius: 4px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- type ---------- */
.kicker {
  font: 700 .72rem/1.2 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 1.1rem;
}
.kicker .num { font-variant-numeric: tabular-nums; color: var(--red); margin-right: .7em; letter-spacing: .08em; }
.display {
  font: 300 clamp(2.4rem, 5.1vw, 5.6rem)/1.0 var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -.022em;
  text-wrap: balance;
}
.display em { font-style: italic; font-weight: 300; }
.display--m { font-size: clamp(2rem, 3.5vw, 3.7rem); line-height: 1.03; }
.lede { font-size: clamp(1.05rem, 1.25vw, 1.25rem); color: var(--ink-2); max-width: 34ch; margin-top: 1.4rem; }
.copy p:not(.kicker), .tblock > p:not(.kicker) { max-width: 36ch; margin-top: 1.2rem; color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .95em 1.5em; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--white);
  font: 700 .82rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease-out);
}
.btn:hover { background: var(--red); border-color: var(--red); }
.btn:active { transform: scale(.98); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn--small { padding: .75em 1.15em; font-size: .72rem; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: 2rem; padding: 0 var(--gutter);
  color: var(--ink);
  transition: color .4s, background-color .4s, backdrop-filter .4s;
}
.nav::before { /* scrim that keeps links legible over any scene */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(251,252,253,.82), rgba(251,252,253,0));
  opacity: 0; transition: opacity .4s, background .4s;
}
.nav.is-scrolled::before { opacity: 1; }
.nav[data-tone="dark"] { color: #eef3f5; }
.nav[data-tone="dark"]::before { background: linear-gradient(to bottom, rgba(14,22,27,.7), rgba(14,22,27,0)); }
.nav__brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.nav__brand .mark { width: 17px; height: auto; }
.nav__word { font: 400 .78rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.nav__word b { font-weight: 700; }
.nav__links { display: flex; gap: 1.8rem; margin-left: auto; }
.nav__links a, .nav__tel { font-size: .88rem; text-decoration: none; opacity: .82; transition: opacity .2s; }
.nav__links a:hover, .nav__tel:hover { opacity: 1; text-decoration: underline; }
.nav__cta { display: flex; align-items: center; gap: 1.3rem; }
.nav[data-tone="dark"] .btn { background: #eef3f5; color: var(--night); border-color: #eef3f5; }
.nav[data-tone="dark"] .btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
@media (max-width: 960px) { .nav__links { display: none; } .nav__cta { margin-left: auto; } }
@media (max-width: 560px) { .nav__tel, .nav__word { display: none; } :root { --nav-h: 60px; } }

/* =====================================================================
   2. STATIC EDITORIAL LAYOUT (base)
   ===================================================================== */

/* ---- prologue ---- */
.prologue { background: var(--white); position: relative; z-index: 1; }
.prologue__stage { display: flex; flex-direction: column; }
.arrival__id {
  order: -1; min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 4vh) var(--gutter) 10vh;
}
.arrival__mark { width: clamp(34px, 3.2vw, 48px); margin-bottom: 2.6rem; overflow: visible; }
.arrival__title {
  font: 300 clamp(3.1rem, 10.4vw, 11.5rem)/.9 var(--serif);
  letter-spacing: -.035em; margin: 0;
}
.arrival__title span { display: block; }
.arrival__title span + span { font-style: italic; padding-left: .55em; }
.arrival__line { margin-top: 2rem; font-size: clamp(1.1rem, 1.5vw, 1.4rem); color: var(--ink-2); max-width: 30ch; }
.arrival__by { margin-top: .6rem; font: 700 .72rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.arrival__light, .arrival__thread, .strip__thread, .scroll-cue { display: none; }

.strip { display: flex; flex-direction: column; }
.panel { position: relative; padding: 12vh var(--gutter); }
.panel--arrival { padding: 0; }
.arrival__photo { position: relative; height: 92svh; overflow: hidden; }
.arrival__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.arrival__caption { padding: 10vh var(--gutter) 0; }

.frame, .latest__photo, .facts__photo, .plate { background: #e8edf0; } /* a quiet shape while a photo decodes */
.frame { overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.panel .frame { margin-bottom: 2.4rem; }
.frame--reception { aspect-ratio: 4/3; }
.frame--waiting-back { aspect-ratio: 3/2; width: 88%; }
.frame--waiting-front { aspect-ratio: 3/2; width: 70%; margin: -12% 0 2.4rem auto; box-shadow: 0 30px 60px -30px rgba(22,34,42,.35); }
.frame--room { aspect-ratio: 5/4; }
.frame--consult { aspect-ratio: 520/444; }
.frame--consult img { object-position: 50% 45%; }
.copy blockquote { margin-top: 2rem; padding-left: 1.2rem; border-left: 2px solid var(--red); max-width: 40ch; }
.copy blockquote p { font: 300 italic 1.3rem/1.35 var(--serif); color: var(--ink); margin: 0; max-width: none; }
.copy blockquote footer { margin-top: .9rem; font: 700 .72rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }

.route { position: relative; margin-bottom: 2.4rem; }
.route__map { width: 100%; height: auto; overflow: visible; }
.route__rail path { stroke: var(--slate); stroke-width: 2; fill: none; }
.route__sleepers { stroke-width: 14 !important; stroke-dasharray: 2 16; opacity: .55; }
.route__station rect { fill: var(--mist); }
.route__street path { stroke: var(--stone); stroke-width: 34; fill: none; stroke-linecap: round; }
.route__building rect { fill: var(--ice); stroke: var(--sky); }
.route__p rect { fill: var(--white); stroke: var(--slate); stroke-width: 1.5; }
.route__p text { font: 700 22px var(--sans); fill: var(--slate); }
.route text { font: 700 15px var(--sans); letter-spacing: .14em; text-transform: uppercase; fill: var(--ink-2); }
.route .route__note { font: 400 13px var(--sans); letter-spacing: .05em; text-transform: none; fill: var(--ink-3); }
.route__pin { position: absolute; left: 67.5%; top: 7%; width: 22px; transform: translate(-50%, -100%); }
.route__route { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---- treatments ---- */
.treat { background: var(--deep); color: #e9eff2; position: relative; z-index: 1; }
.treat .kicker, .treat .tblock > p:not(.kicker), .treat .lede { color: #aebcc4; }
.treat__stage { padding: 14vh var(--gutter); display: grid; gap: 3rem 4vw; grid-template-columns: minmax(0, 1fr); }
.tblock { max-width: 40rem; }
.treat__intro { padding-bottom: 4vh; }
.plate { max-width: 26rem; }
.plate img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }
.plate figcaption { margin-top: .7rem; font: 700 .68rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #8fa0aa; }
.person { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; }
.person img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; }
.person figcaption { font-size: .85rem; color: #aebcc4; line-height: 1.4; }
.person b { display: block; color: #e9eff2; font-weight: 700; }
.chain { display: flex; flex-wrap: wrap; gap: .4rem 0; margin-top: 1.8rem; font: 700 .7rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #8fa0aa; }
.chain li { display: flex; align-items: center; }
.chain li + li::before { content: ""; width: 2.2rem; height: 1px; background: currentColor; opacity: .5; margin: 0 .8rem; }
.chain li.is-on { color: #fff; }
.chain li.is-on:last-child { color: var(--sky); }
.treat__rail { display: none; }
.treat__note { display: none; }
html.fx.world-ready .treat__note { display: block; position: absolute; right: var(--gutter); bottom: 3.5vh; font: 400 .7rem/1 var(--sans); letter-spacing: .08em; color: rgba(233,239,242,.42); }

/* ---- people ---- */
.people, .crew, .facts, .index, .latest { background: var(--paper); position: relative; z-index: 1; }
.people { padding: 18vh var(--gutter) 10vh; }
.people__head { max-width: 62rem; margin-bottom: 12vh; }
.spread { display: grid; gap: 3rem 6vw; align-items: end; margin-bottom: 14vh; }
.spread--abazi { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.spread__photo { overflow: hidden; background: var(--stone); }
.spread__photo img { width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 20%; }
.name { font: 400 clamp(1.6rem, 2.3vw, 2.4rem)/1.1 var(--serif); letter-spacing: -.01em; }
.role { margin-top: .5rem; font-size: .92rem; color: var(--ink-2); max-width: 40ch; }
.pull { margin-top: 2.2rem; font: 300 clamp(1.5rem, 2.4vw, 2.5rem)/1.22 var(--serif); letter-spacing: -.01em; max-width: 26ch; text-indent: -.4em; }
.pull--s { font-size: clamp(1.15rem, 1.5vw, 1.45rem); max-width: 34ch; margin-top: 1.4rem; }
.spread--pair { grid-template-columns: 1fr 1fr; align-items: start; }
.duo--feische { margin-top: 16vh; }
.duo .spread__photo { margin-bottom: 1.6rem; }
.values { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(29,29,27,.15); }
.values li { padding: 2rem 2rem 0 0; }
.values b { display: block; font: 400 1.9rem/1.1 var(--serif); font-style: italic; margin-bottom: .7rem; }
.values span { color: var(--ink-2); display: block; max-width: 28ch; }

/* ---- crew (R→L interrupt) ---- */
.crew { padding: 10vh 0 12vh; }
.crew__intro { padding: 0 var(--gutter) 6vh; max-width: 44rem; }
.crew__track { display: flex; gap: 2vw; overflow-x: auto; padding: 0 var(--gutter) 1rem; scroll-snap-type: x mandatory; }
.card { flex: 0 0 clamp(220px, 22vw, 320px); scroll-snap-align: start; }
.card figure { overflow: hidden; background: var(--stone); margin-bottom: 1.1rem; }
.card img { width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; object-position: 50% 15%; }
.card h3 { font: 400 1.35rem/1.15 var(--serif); }
.card .role { font-size: .82rem; margin-top: .3rem; }
.card .q { margin-top: .9rem; font: 300 italic 1.02rem/1.4 var(--serif); color: var(--ink-2); }

/* ---- facts ---- */
.facts { padding: 0 0 14vh; }
.facts__photo { height: 88vh; overflow: hidden; position: relative; }
.facts__photo img { width: 100%; height: 100%; object-fit: cover; }
.facts__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 3vw; padding: 0 var(--gutter); margin-top: -18vh; position: relative; }
.fact { background: var(--paper); padding: 2.2rem 0 0; }
.fact img { width: 40px; height: 40px; margin-bottom: 1.2rem; opacity: .85; }
.fact h3 { font: 400 1.35rem/1.15 var(--serif); margin-bottom: .6rem; }
.fact p { color: var(--ink-2); font-size: .95rem; }
.fact--big { padding: 2.2rem 2.6rem 0 0; }
.fact .fact__num { font: 300 clamp(5rem, 11vw, 11rem)/.85 var(--serif); letter-spacing: -.04em; color: var(--ink) !important; margin-bottom: 1.2rem; font-variant-numeric: lining-nums; }

/* ---- index ---- */
.index { padding: 10vh var(--gutter) 16vh; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.15fr); gap: 4vh 6vw; border-top: 1px solid rgba(29,29,27,.12); }
.index__head { grid-column: 1 / -1; margin-bottom: 4vh; }
.index__list { counter-reset: t; border-top: 1px solid rgba(29,29,27,.15); }
.index__list li {
  display: grid; grid-template-columns: 2.4rem 40px minmax(10rem, 17rem) 1fr auto; gap: 1.4rem; align-items: center;
  padding: 1.15rem 0; border-bottom: 1px solid rgba(29,29,27,.12); counter-increment: t;
}
.index__list li::before { content: counter(t, decimal-leading-zero); font: 700 .72rem/1 var(--sans); letter-spacing: .1em; color: var(--ink-3); }
.index__list img { width: 34px; height: 34px; opacity: .8; }
.index__list h3 { font: 400 1.3rem/1.2 var(--serif); hyphens: auto; }
.index__list p { color: var(--ink-2); font-size: .94rem; }
.tag { font: 700 .64rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--slate); border: 1px solid var(--mist); padding: .45em .7em; border-radius: 99px; white-space: nowrap; }
.index__side dl { position: sticky; top: calc(var(--nav-h) + 3vh); }
.index__side dt { font: 700 .68rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: 1.8rem; }
.index__side dt:first-child { margin-top: 0; }
.index__side dd { margin: .5rem 0 0; font: 400 1.15rem/1.4 var(--serif); }
.index__side .meta { font: 400 .8rem var(--sans); color: var(--ink-3); }

/* ---- latest ---- */
.latest { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 6vw; align-items: center; padding: 8vh var(--gutter) 22vh; }
.latest__photo { overflow: hidden; aspect-ratio: 3/2; }
.latest__photo img { width: 100%; height: 100%; object-fit: cover; }
.latest__text > p:not(.kicker) { margin-top: 1.4rem; color: var(--ink-2); max-width: 44ch; }
.latest details { margin-top: 1.6rem; max-width: 44ch; }
.latest summary { cursor: pointer; font: 700 .74rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.latest details p { margin-top: 1rem; color: var(--ink-2); }

/* ---- finale / contact ---- */
.finale { background: var(--white); position: relative; z-index: 1; }
.finale__stage { position: relative; }
.contact { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: calc(var(--nav-h) + 6vh) var(--gutter) 10vh; }
.contact__mark { width: clamp(38px, 3.4vw, 54px); margin-bottom: 2.4rem; overflow: visible; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2.6rem; }
.contact__facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 3vw; margin-top: 9vh; width: min(100%, 64rem); text-align: left; border-top: 1px solid rgba(29,29,27,.14); padding-top: 2rem; }
.contact__facts dt { font: 700 .68rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.contact__facts dd { margin: .6rem 0 0; font-size: .98rem; line-height: 1.5; }

.foot { background: var(--white); position: relative; z-index: 1; display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 2rem 4vw; align-items: end; padding: 6vh var(--gutter) 5vh; border-top: 1px solid rgba(29,29,27,.1); font-size: .88rem; color: var(--ink-2); }
.foot__brand { display: flex; gap: 1.2rem; align-items: flex-start; }
.foot__brand .mark { width: 22px; flex: none; }
.foot__brand b { color: var(--ink); }
.foot__legal { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-3); }
.foot__concept { max-width: 62rem; line-height: 1.55; padding-bottom: var(--concept-h); }
.foot__concept b { color: var(--ink); }

/* ---- booking dialog ---- */
.booking { width: min(760px, calc(100vw - 32px)); max-height: calc(100svh - 48px); padding: 0; border: 0; border-radius: 6px; background: var(--white); color: var(--ink); box-shadow: 0 40px 120px -20px rgba(14,22,27,.45); }
.booking::backdrop { background: rgba(14,22,27,.55); backdrop-filter: blur(4px); }
.booking__head { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--mist); position: sticky; top: 0; background: var(--white); z-index: 1; }
.booking__head h2 { font: 400 1.5rem/1 var(--serif); }
.booking__close { width: 40px; height: 40px; border: 1px solid var(--mist); background: transparent; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.booking__body { padding: 1rem 1.4rem; min-height: 320px; }
.booking__body { min-height: 0; padding: 1.6rem 1.4rem 1.8rem; }
.booking__demo { font: 400 1.15rem/1.45 var(--serif); max-width: 34rem; }
.booking__demo b { font-weight: 500; }
.booking__real { margin-top: 1.1rem; font-size: .92rem; color: var(--ink-2); }

/* ---- world canvas ---- */
.world { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; opacity: 0; } /* instant: fades happen in the scene itself */
.world.is-on { opacity: 1; }
.world.is-top { z-index: 4; }
/* Concept disclosure: always visible, never covers the nav */
:root { --concept-h: 34px; }
.concept {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; min-height: var(--concept-h);
  display: flex; align-items: center; justify-content: center;
  padding: .45rem var(--gutter) calc(.45rem + env(safe-area-inset-bottom));
  background: var(--night); color: #dfe7ec; border-top: 2px solid var(--red);
  font: 400 .78rem/1.35 var(--sans); letter-spacing: .02em; text-align: center;
}
.concept b { color: #fff; font-weight: 700; }
@media (max-width: 560px) { :root { --concept-h: 52px; } .concept { font-size: .72rem; } }
.veil { position: fixed; inset: 0; z-index: 45; background: var(--white); pointer-events: none; opacity: 0; visibility: hidden; }
html.rm .world, html:not(.js) .world { display: none; }

/* ---- responsive base ---- */
@media (max-width: 767px) {
  .spread--abazi, .spread--pair, .latest, .index, .values, .facts__grid, .contact__facts, .foot { grid-template-columns: minmax(0, 1fr); }
  .duo--feische { margin-top: 0; }
  .facts__grid { margin-top: 0; }
  .facts__photo { height: 60svh; }
  .index__list li { grid-template-columns: 34px minmax(0, 1fr); gap: .3rem 1rem; }
  .index__list li::before { display: none; }
  .index__list img { grid-row: span 2; }
  .index__list .tag { display: none; }
  .index__side dl { position: static; }
  .contact__facts { grid-template-columns: 1fr 1fr; }
  .route__pin { width: 14px; }
}

/* =====================================================================
   3. CHOREOGRAPHED LAYOUT  (html.fx is set by JS when motion is allowed)
   ===================================================================== */
html.fx .scroll-cue {
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  position: absolute; left: 50%; bottom: 4.5vh; transform: translateX(-50%);
  font: 700 .64rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); z-index: 4;
}
html.fx .scroll-cue i { width: 1px; height: 42px; background: linear-gradient(var(--ink-3), transparent); animation: cue 2.4s var(--ease-out) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* prologue stage: arrival overlays sit on panel 0 */
html.fx .prologue { background: transparent; }
html.fx .prologue__stage { position: relative; display: block; }
html.fx .strip { background: var(--white); }
html.fx .panel--arrival { height: 100svh; overflow: hidden; }
html.fx .arrival__photo { position: absolute; inset: 0; height: auto; }
html.fx .arrival__photo img { position: absolute; left: 0; top: 0; width: 100%; height: 150%; object-position: 50% 0; will-change: transform; transform-origin: 50% 30%; }
html.fx .arrival__caption { position: absolute; left: var(--gutter); bottom: 9vh; padding: 0; z-index: 2; color: var(--ink); max-width: 44rem; }
html.fx-h .arrival__caption { left: var(--gutter); bottom: auto; top: 50%; transform: translateY(-50%); width: 26vw; }
html.fx-h .arrival__caption::before { display: none; }
html.fx .arrival__caption::before { /* mobile: soft local scrim so type stays readable over the photo */
  content: ""; position: absolute; inset: -30% -40% -40% -30%; z-index: -1;
  background: radial-gradient(closest-side, rgba(251,252,253,.88), rgba(251,252,253,0));
}
html.fx .arrival__light { display: block; position: absolute; inset: 0; height: 100svh; background: var(--white); z-index: 2; pointer-events: none; }
html.fx .arrival__light::after { /* ceiling-light glow, drifting slowly */
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(40% 22% at 30% 12%, rgba(217,238,246,.9), transparent 70%),
    radial-gradient(34% 20% at 72% 18%, rgba(180,218,236,.55), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(4%, 3%, 0) scale(1.06); } }
html.fx .arrival__id { position: absolute; inset: 0; height: 100svh; z-index: 3; min-height: 0; padding-bottom: 14vh; pointer-events: none; }
html.fx .arrival__id a { pointer-events: auto; }
html.fx .arrival__thread { display: block; position: absolute; left: 0; top: 0; width: 100vw; height: 100svh; z-index: 3; pointer-events: none; overflow: visible; }
html.fx .arrival__thread path, html.fx .strip__thread path { fill: none; stroke: var(--red); stroke-linecap: round; opacity: .8; }
html.fx .arrival__mark .mark__arc { opacity: 0; } /* the arc is drawn by the thread overlay instead */

/* treatments: transparent stage over the WebGL world */
html.fx .treat { background: transparent; }
html.fx .people::before { /* the arch dissolves as the people arrive */
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 45vh; pointer-events: none;
  background: linear-gradient(to bottom, rgba(243,240,235,0), var(--paper));
}
html.fx:not(.world-ready) .treat__stage { background: var(--deep); } /* until (or without) WebGL */
html.fx .treat__stage::before { /* keeps copy legible over bright enamel */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: linear-gradient(90deg, rgba(14,22,27,.86) 0%, rgba(14,22,27,.6) 30%, rgba(14,22,27,0) 52%);
}
html.fx .treat.is-dark .treat__stage::before { opacity: 1; }
html.fx .treat__stage { display: block; height: 100svh; padding: 0; position: relative; overflow: hidden; }
html.fx .tblock { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(34rem, 38vw); visibility: hidden; }
html.fx .tblock--climax { width: min(38rem, 40vw); }
html.fx .treat__intro { width: min(40rem, 46vw); }
html.fx .tblock { top: 42%; }
html.fx .plate { position: absolute; visibility: hidden; left: var(--gutter); bottom: 6vh; width: clamp(180px, 15vw, 250px); }
html.fx .plate img { aspect-ratio: 3/2; }
html.fx .plate--wide { width: clamp(220px, 19vw, 320px); }
html.fx .plate[data-plate="kfo"] { left: auto; right: 5vw; bottom: 8vh; width: clamp(170px, 13vw, 220px); }
html.fx .treat__rail { display: flex; flex-direction: column; gap: 1rem; position: absolute; right: 2.2vw; top: 50%; transform: translateY(-50%); font: 700 .62rem/1 var(--sans); letter-spacing: .12em; color: rgba(233,239,242,.35); }
html.fx .treat__rail li { transition: color .3s; }
html.fx .treat__rail li.is-on { color: #fff; }
html.fx .treat__rail li.is-on::after { content: ""; display: inline-block; width: 14px; height: 1px; background: var(--red); vertical-align: middle; margin-left: 8px; }

/* crew: pinned, horizontal track */
html.fx .crew { padding: 0; }
html.fx .crew__stage { height: 100svh; display: flex; align-items: center; overflow: hidden; position: relative; }
html.fx .crew__intro { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); padding: 0; width: min(30rem, 34vw); }
html.fx .crew__track { overflow: visible; padding: 0 0 0 calc(var(--gutter) + min(30rem, 34vw) + 6vw); scroll-snap-type: none; gap: 2.4vw; }
html.fx .card { flex-basis: clamp(220px, 19vw, 300px); }
html.fx .card:nth-child(even) { margin-top: 12vh; }

/* facts: photo explored from inside */
html.fx .facts__photo img { height: 124%; }

/* finale */
html.fx .finale { background: transparent; z-index: 5; }
html.fx .finale__stage { height: 100svh; overflow: hidden; }
html.fx .contact { position: absolute; inset: 0; min-height: 0; z-index: 2; }
html.fx .contact > * { visibility: hidden; }
html.fx .foot { z-index: 6; }

/* =====================================================================
   4. DESKTOP HORIZONTAL JOURNEY (html.fx-h)
   ===================================================================== */
html.fx-h .prologue__stage { height: 100svh; overflow: hidden; }
html.fx-h .treat { margin-top: -100vh; } /* pin starts the frame the prologue's ends */
/* The strip is ~5.5 viewports wide: as ONE GPU layer it exceeds Chrome's max texture
   size (~16384px) on wide/retina screens and photos go unpainted. So the strip itself is
   never composited (2D transform, see main.js); each panel gets its own screen-sized layer. */
html.fx-h .strip { flex-direction: row; height: 100svh; width: max-content; position: relative; }
html.fx-h .strip > .panel { will-change: transform; }
html.fx-h .panel { flex: none; width: calc(var(--w, 100) * 1vw); height: 100svh; padding: 0; }
html.fx-h .panel .frame { margin: 0; position: absolute; }
html.fx-h .copy { position: absolute; z-index: 2; }
html.fx-h .strip__thread { display: block; position: absolute; left: 0; top: 0; height: 100svh; pointer-events: none; z-index: 3; overflow: visible; }

html.fx-h .panel--route { background: var(--white); }
html.fx-h .route { position: absolute; left: 33vw; right: 5vw; top: 18vh; margin: 0; }
html.fx-h .copy--route { left: 7vw; top: 20vh; width: 25vw; }

html.fx-h .panel--reception { background: linear-gradient(90deg, var(--white), #f4f8fa); }
html.fx-h .frame--reception { left: 4vw; top: 11vh; width: 54vw; height: 70vh; aspect-ratio: auto; }
html.fx-h .copy--reception { left: 61vw; top: 34vh; width: 22vw; }

html.fx-h .panel--waiting { background: #f4f8fa; }
html.fx-h .frame--waiting-back { left: 4vw; top: 10vh; width: 38vw; height: 46vh; aspect-ratio: auto; }
html.fx-h .frame--waiting-front { left: 26vw; top: 34vh; width: 32vw; height: 46vh; aspect-ratio: auto; margin: 0; }
html.fx-h .copy--waiting { left: 62vw; top: 20vh; width: 21vw; }

html.fx-h .panel--room { background: linear-gradient(90deg, #f4f8fa, var(--white)); }
html.fx-h .frame--room { left: 4vw; top: 10vh; width: 52vw; height: 72vh; aspect-ratio: auto; }
html.fx-h .copy--room { left: 60vw; top: 36vh; width: 23vw; }

html.fx-h .panel--consult { background: var(--white); overflow: hidden; }
html.fx-h .frame--consult { inset: 0; width: 100vw; height: 100svh; aspect-ratio: auto; transform-origin: 59.5% 47%; will-change: transform; }
html.fx-h .frame--consult img { object-position: 50% 40%; }
html.fx-h .copy--consult { left: 6vw; top: 22vh; width: 30vw; padding: 2.4rem 2.4rem 2.6rem; background: rgba(251,252,253,.9); backdrop-filter: blur(8px); }

/* =====================================================================
   5. MOBILE CHOREOGRAPHY (html.fx:not(.fx-h))
   ===================================================================== */
@media (max-width: 767px) {
  html.fx .arrival__caption { left: 40px; right: 16px; bottom: 8vh; }
  html.fx .arrival__photo img { object-position: 38% 0; }
  html.fx .panel:not(.panel--arrival) { padding: 12vh 16px 4vh 40px; }
  html.fx .panel:not(.panel--arrival)::before { /* vertical red thread, drawn by scroll */
    content: ""; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: var(--red);
    transform-origin: top; transform: scaleY(var(--thread, 0));
  }
  html.fx .tblock, html.fx .tblock--climax, html.fx .treat__intro { left: 16px; right: 16px; width: auto; top: auto !important; bottom: 7vh; transform: none; }
  html.fx .tblock .display--m { font-size: 2rem; }
  html.fx .tblock > p:not(.kicker) { font-size: .95rem; }
  html.fx .chain { margin-top: 1rem; font-size: .6rem; }
  html.fx .plate { width: 38vw; }
  html.fx .plate figcaption { display: none; }
  html.fx .plate, html.fx .plate--wide, html.fx .plate[data-plate="kfo"] { top: calc(var(--nav-h) + 2vh); right: 16px; left: auto; bottom: auto; width: 34vw; }
  html.fx .person { display: none; }
  html.fx .treat__rail { display: none; }
  html.fx .treat__stage::before { background: linear-gradient(0deg, rgba(14,22,27,.9) 0%, rgba(14,22,27,.6) 38%, rgba(14,22,27,0) 60%); }
  html.fx .crew__intro { position: static; transform: none; width: auto; padding: 0 16px; margin-bottom: 4vh; }
  html.fx .crew__stage { flex-direction: column; align-items: flex-start; justify-content: center; }
  html.fx .crew__track { padding-left: 16px; }
  html.fx .card { flex-basis: 62vw; }
  html.fx .card:nth-child(even) { margin-top: 0; }
  html.fx .card .q { display: none; }
}
