/* Hair Beauty Clinic — the opening film (owned by Agent B; DOM is built by assets/js/flight.js)
 *
 * Contract:
 *  - #flight is the tall scroll track; .flight__stage is sticky and pins for the whole film
 *  - flight.js sets #flight's height and --flight-overlap / --flight-p on <html>
 *  - #intro (Agent A) rises over the frozen last frame with margin-top: calc(-1 * var(--flight-overlap))
 *    and needs position:relative; z-index:2 (this section is z-index:1)
 *  - poster / video / final still share one framing: absolute, inset 0, object-fit cover, NO transforms
 *  - never `inert` on the stage: hidden things use visibility + pointer-events
 *  - pure black & white: #000, #FFF and greys only; the stage background is white, nothing ever flashes dark
 *  - type: Instrument Serif (A self-hosts it in site.css) + Inter Tight; serif fallbacks keep the shape
 */
:root{
  --flight-p:0;
  --flight-overlap:100vh;
  --flight-bg:#FFFFFF;
  --flight-ink:#0A0A0A;
  --flight-paper:#FFFFFF;
  --flight-serif:"Instrument Serif","Cormorant Garamond","Times New Roman",Georgia,serif;
  --flight-sans:"Inter Tight","Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
}

#flight{position:relative;height:calc(100vh + 300px);background:var(--flight-bg);z-index:1;overflow-anchor:none;color:var(--flight-ink)}
#flight.is-static{height:auto}

.flight__stage{position:sticky;top:0;height:100vh;overflow:hidden;background:var(--flight-bg);
  contain:layout paint size;isolation:isolate}
.is-static .flight__stage{position:relative;height:100vh}
@supports (height:100svh){.flight__stage{height:100svh}.is-static .flight__stage{height:100svh}}

.flight__poster,.flight__video,.flight__final{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  object-position:50% 50%;display:block;margin:0;border:0;transform:none;filter:grayscale(1)}
.flight__poster{z-index:0}
.flight__video{z-index:1;opacity:0;transition:opacity .28s linear;pointer-events:none}
.flight__video.is-ready{opacity:1}
/* the clip's own last frame: flight.js crossfades it over the video in the last ~12% (same framing) */
.flight__final{z-index:2;opacity:0;pointer-events:none}

/* the melt: the lower part of the frame dissolves into paper white so the intro copy lands on white */
.flight__fade{position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;
  background:linear-gradient(to bottom,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 38%,rgba(255,255,255,.55) 62%,
  rgba(255,255,255,.92) 80%,var(--flight-paper) 100%)}
/* a faint grey vignette keeps light captions readable over mid-tones; flight.js lifts it before the hand-off */
.flight__vignette{position:absolute;inset:0;z-index:3;pointer-events:none;
  background:linear-gradient(to bottom,rgba(0,0,0,.16) 0%,rgba(0,0,0,0) 28%,rgba(0,0,0,0) 62%,rgba(0,0,0,.22) 100%)}

/* ---------- overlay ---------- */
.flight__overlay{position:absolute;inset:0;z-index:4;pointer-events:none;color:var(--flight-ink);
  padding:max(22px,env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left));
  font-family:var(--flight-sans)}
.flight__overlay>*{will-change:opacity}

/* ---------- captions (one group per CFG.captions entry; flight.js drives opacity/filter/transform/clip-path) ---------- */
.flight__cap{position:absolute;top:var(--cap-y,50%);left:0;right:0;transform:translate3d(0,0,0);
  display:flex;flex-direction:column;align-items:center;text-align:center;gap:.9em;
  padding:0 clamp(20px,5vw,72px);will-change:opacity,transform,filter;visibility:hidden;opacity:0}
.flight__cap--center{align-items:center;text-align:center}
.flight__cap--left{align-items:flex-start;text-align:left;right:auto;width:min(78vw,900px)}
.flight__cap--right{align-items:flex-end;text-align:right;left:auto;width:min(78vw,900px)}
.flight__cap.is-dark{color:var(--flight-ink);text-shadow:0 0 22px rgba(255,255,255,.55)}
.flight__cap.is-light{color:#FFFFFF;text-shadow:0 1px 2px rgba(0,0,0,.28),0 6px 40px rgba(0,0,0,.35)}
.flight__cap.is-auto{color:#FFFFFF;mix-blend-mode:difference;text-shadow:none}

.flight__cap-big{display:block;font-family:var(--flight-serif);font-weight:400;font-style:normal;
  font-size:clamp(58px,11.5vw,196px);line-height:.92;letter-spacing:-.012em;margin:0;white-space:nowrap}
.flight__cap-line+.flight__cap-line{margin-top:-.1em}
/* the opening word is bigger still — a fragrance-film title card */
.flight__cap--open .flight__cap-big:first-child{font-size:clamp(76px,16vw,270px);letter-spacing:-.02em}
/* the opening title card: the Hair Beauty Clinic logo (black, a soft white halo so its hairlines read on the gate fins) */
.flight__cap-logo{display:block;width:clamp(240px,30vw,560px);height:auto;margin:0 0 .4em;user-select:none;
  filter:drop-shadow(0 0 2px rgba(255,255,255,.9)) drop-shadow(0 0 16px rgba(255,255,255,.85)) drop-shadow(0 0 40px rgba(255,255,255,.6))}
/* side words sit in the clear mist beside her face (≈ the outer 30% of the frame), so they are a size down */
.flight__cap--left .flight__cap-big,.flight__cap--right .flight__cap-big{font-size:clamp(52px,7.4vw,138px)}
.flight__cap--left,.flight__cap--right{width:min(44vw,820px)}
/* the finale rides the lower third over the mist, below her face; two lines + the CTA must fit under 90% */
.flight__cap--finale .flight__cap-big{font-size:clamp(54px,7.6vw,150px)}
.flight__cap--finale .flight__cta{margin-top:1.1em}
@media (max-aspect-ratio:1/1){
  .flight__cap{top:var(--cap-y-m,var(--cap-y,50%))}
  /* on the 9:16 film the words sit over her shoulders / the crystal bodice — a fuller white halo keeps them crisp */
  .flight__cap.is-dark{text-shadow:0 0 3px rgba(255,255,255,.7),0 0 18px rgba(255,255,255,.8),0 0 42px rgba(255,255,255,.55)}
}
.flight__cap-small{display:block;font-family:var(--flight-sans);font-weight:500;font-size:clamp(11px,1.05vw,15px);
  letter-spacing:.42em;text-transform:uppercase;margin-top:.2em;padding-left:.42em}
.flight__cap-sub{display:block;font-family:var(--flight-serif);font-style:italic;font-weight:400;
  font-size:clamp(22px,2.6vw,40px);letter-spacing:.005em;margin-top:-.2em;opacity:.92}
.flight__cap-hint{display:block;font-family:var(--flight-sans);font-weight:400;font-size:clamp(10.5px,.85vw,12.5px);
  letter-spacing:.3em;text-transform:uppercase;opacity:.72;margin-top:2.2em;padding-left:.3em}

/* the finale CTA: A's .hbc-btn styles it; here only the film-specific bits. It is real content (not aria-hidden):
   the whole group is visibility:hidden until flight.js reveals it, so it is focusable only while visible. */
.flight__cta{pointer-events:auto;margin-top:1.4em;text-shadow:none}
.flight__cta:focus-visible{outline:2px solid currentColor;outline-offset:3px}

/* ---------- chrome ---------- */
.flight__hint{position:absolute;left:50%;bottom:max(30px,calc(env(safe-area-inset-bottom) + 22px));transform:translateX(-50%);
  display:flex;flex-direction:column;align-items:center;gap:10px;font-size:10.5px;letter-spacing:.32em;text-transform:uppercase;
  color:var(--flight-ink);opacity:.72;transition:opacity .5s ease,visibility .5s}
.flight__hint i{display:block;width:20px;height:34px;border:1.5px solid rgba(10,10,10,.55);border-radius:12px;position:relative}
.flight__hint i::after{content:"";position:absolute;left:50%;top:7px;width:3px;height:7px;margin-left:-1.5px;border-radius:2px;
  background:var(--flight-ink);animation:flight-wheel 1.7s ease-in-out infinite}
.flight__hint.is-hidden{opacity:0;visibility:hidden}
@keyframes flight-wheel{0%{opacity:0;transform:translateY(0)}30%{opacity:1}100%{opacity:0;transform:translateY(12px)}}

/* skip control: a quiet small link on a white glass pill, so it reads on mist and on mid-tones alike */
.flight__skip{position:absolute;right:max(24px,env(safe-area-inset-right));bottom:max(28px,calc(env(safe-area-inset-bottom) + 20px));
  pointer-events:auto;color:var(--flight-ink);text-decoration:none;font-size:10.5px;font-weight:500;letter-spacing:.22em;text-transform:uppercase;
  padding:10px 14px;border-radius:999px;background:rgba(255,255,255,.72);border:1px solid rgba(0,0,0,.08);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);transition:background .2s,border-color .2s}
.flight__skip>span::after{content:" \2193"}
.flight__skip:hover{background:#FFFFFF;border-color:rgba(0,0,0,.2)}
.flight__skip:focus{outline:none}
.flight__skip:focus-visible{outline:2px solid var(--flight-ink);outline-offset:3px;background:#FFFFFF}

.flight__loading{position:absolute;left:0;right:0;bottom:0;height:2px;z-index:5;background:rgba(0,0,0,.08);transition:opacity .6s}
.flight__loading>i{display:block;height:100%;width:0;background:#111111;transition:width .2s linear}
.flight__loading.is-done{opacity:0}

/* ---------- portrait phones ---------- */
@media (max-width:640px){
  .flight__cap{gap:.7em;padding:0 20px}
  .flight__cap--left,.flight__cap--right{width:auto;left:0;right:0;padding:0 22px}
  .flight__cap-big,.flight__cap--left .flight__cap-big,.flight__cap--right .flight__cap-big{font-size:clamp(46px,14vw,84px);white-space:normal}
  .flight__cap--finale .flight__cap-big{font-size:clamp(40px,11.5vw,64px)}
  .flight__cap--open .flight__cap-big:first-child{font-size:clamp(58px,19vw,100px)}
  .flight__cap-logo{width:min(66vw,320px)}
  .flight__cap-small{font-size:11px;letter-spacing:.34em}
  .flight__cap-sub{font-size:clamp(20px,6vw,28px)}
  .flight__fade{background:linear-gradient(to bottom,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 50%,rgba(255,255,255,.6) 70%,
    rgba(255,255,255,.94) 86%,var(--flight-paper) 100%)}
  .flight__skip{right:max(16px,env(safe-area-inset-right));font-size:10px;letter-spacing:.18em;padding:9px 12px}
  .flight__hint{left:auto;right:auto;transform:none;left:max(22px,env(safe-area-inset-left));align-items:flex-start}
}
@media (max-height:520px){
  .flight__cap-big{font-size:clamp(40px,9vh,120px)}
}

/* reduced motion: no autonomous animation (the scrub itself is user-driven and stays) */
@media (prefers-reduced-motion:reduce){
  .flight__hint i::after{animation:none}
  .flight__video,.flight__hint{transition:none}
}
