/* Spoed Sleepdienst — the intro film (DOM is built by assets/js/flight.js; locked play-through intro)
 *
 * Contract (see _bron/CONTRACT.md "Intro"):
 *  - #flight is exactly one viewport tall (flight.js pins the px height from the stage's 100svh) and holds the stage
 *  - flight.js sets --flight-p (0..1) and --flight-overlap (px) on <html>, html.flight-lock while the intro owns the
 *    page, html.flight-done after the film ended or was skipped
 *  - A's #hero rises over the frozen last frame with margin-top: calc(-1 * var(--flight-overlap, 100svh)) and needs
 *    main#site{position:relative;z-index:2}. While html.flight-lock the stage is lifted ABOVE #site (z-index 60) so
 *    the Skip / Bel direct buttons and a tap on the film receive real clicks; A must additionally set
 *    html.flight-lock #site{pointer-events:none} and hide the header with visibility (never `inert`).
 *  - poster / video / final still share one framing: absolute, inset 0, object-fit cover, NO transforms
 *  - hidden things use opacity/visibility + pointer-events — never `inert` on a full-screen layer (it freezes scrolling)
 *  - stage background is the site's asphalt black, so nothing ever flashes white
 */
:root{
  --flight-p:0;
  --flight-overlap:100vh;
  --flight-overlap:100svh;
  --flight-bg:#0a0a0b;
  --flight-orange:#fa5a00;
  --flight-amber:#ffb020;
  --flight-ivory:#f4f1ec;
  --flight-smoke:#a7a7ad;
  --flight-cap-top:15%;        /* caption block top, 16:9 film: the sky band above the man / car / loaded truck (y 28–75 %) */
  --flight-cap-top-m:9%;       /* 9:16 film: below the brand line (top 7 %), above the subjects (from y 20 %) */
  --flight-font-display:var(--f-display,"Archivo","Archivo Expanded",Inter,system-ui,-apple-system,"Segoe UI",sans-serif);
  --flight-font-ui:var(--f-body,Inter,system-ui,-apple-system,"Segoe UI",sans-serif);
  --flight-ease:cubic-bezier(.2,.7,.2,1);
}

#flight{position:relative;height:100vh;height:100svh;background:var(--flight-bg);z-index:1;overflow-anchor:none;
  color-scheme:dark}
/* the intro owns the page: lift the stage above A's overlapping #hero/#site so Skip / Bel direct get REAL clicks */
html.flight-lock #flight{z-index:60}

/* nothing scrolls until the film ends or Skip is pressed (flight.js also cancels wheel/touch/keys and clamps scrollY) */
html.flight-lock,html.flight-lock body{overflow:hidden;overscroll-behavior:none}
html.flight-lock body{touch-action:none}
/* A's #hero overlaps the stage from scroll 0 (margin-top −V): it must not catch the buttons or a tap on the film */
html.flight-lock #site{pointer-events:none}
#flight:not(.is-done) .flight__stage{cursor:pointer}

.flight__stage{position:relative;height:100vh;height:100svh;overflow:hidden;background:var(--flight-bg);
  contain:layout paint size;isolation:isolate}

.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;background:var(--flight-bg)}
.flight__poster{z-index:0}
.flight__video{z-index:1;opacity:0;transition:opacity .3s linear;pointer-events:none}
.flight__video.is-ready{opacity:1}
/* final still = the clip's exact last frame; flight.js crossfades it in over the last ~1.5 % only */
.flight__final{z-index:2;opacity:0;pointer-events:none}

/* the melt: the lower part of the frame dissolves into asphalt black so A's hero card lands on the site background */
.flight__fade{position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;
  background:linear-gradient(to bottom,rgba(10,10,11,0) 0%,rgba(10,10,11,0) 40%,rgba(10,10,11,.35) 58%,
  rgba(10,10,11,.78) 76%,rgba(10,10,11,.96) 90%,var(--flight-bg) 100%)}
/* a soft vignette keeps the captions readable; flight.js lifts it for the final frame */
.flight__vignette{position:absolute;inset:0;z-index:3;pointer-events:none;
  background:linear-gradient(to bottom,rgba(5,5,6,.46) 0%,rgba(5,5,6,0) 30%,rgba(5,5,6,0) 60%,rgba(5,5,6,.5) 100%)}
.flight__grain{position:absolute;inset:-20%;z-index:3;pointer-events:none;opacity:.06;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size:160px 160px}

/* ---------- overlay ---------- */
.flight__overlay{position:absolute;inset:0;z-index:4;pointer-events:none;color:var(--flight-ivory);
  font-family:var(--flight-font-ui);text-shadow:0 1px 2px rgba(0,0,0,.4),0 2px 24px rgba(0,0,0,.45)}
.flight__overlay>*{will-change:opacity}

/* brand line top-left during the film (A's header is hidden then); hands over to the header near the end */
.flight__brand{position:absolute;top:max(24px,env(safe-area-inset-top));left:max(28px,env(safe-area-inset-left));
  display:flex;flex-direction:column;line-height:1}
.flight__brand[hidden]{display:none}
.flight__mark{font-family:var(--flight-font-display);font-weight:800;font-stretch:125%;font-size:clamp(15px,1.25vw,18px);
  letter-spacing:.08em;text-transform:uppercase}
.flight__mark b{color:var(--flight-orange);font-weight:800}
.flight__sub{font-size:10.5px;font-weight:500;letter-spacing:.28em;text-transform:uppercase;opacity:.85;margin:9px 0 0 .05em;
  font-variant-numeric:tabular-nums}

/* captions: 2–4 short punchy lines; the orange hairline sits above, each line blurs in and fades out (class .is-on) */
.flight__caption{position:absolute;left:0;right:0;top:var(--flight-cap-top);margin:0;padding:0 24px;text-align:center;
  font-family:var(--flight-font-display);font-weight:800;font-stretch:125%;text-transform:uppercase;
  font-size:clamp(26px,3.6vw,56px);line-height:1.02;letter-spacing:.02em;
  opacity:0;filter:blur(10px);transform:translateY(14px);
  transition:opacity .42s ease,filter .42s ease,transform .42s ease}
.flight__caption.is-on{opacity:1;filter:blur(0);transform:translateY(0);
  transition:opacity .8s var(--flight-ease),filter .9s var(--flight-ease),transform .9s var(--flight-ease)}
.flight__caption>span{display:inline-block}
.flight__caption::before{content:"";display:block;width:44px;height:2px;margin:0 auto 20px;background:var(--flight-orange);
  box-shadow:0 0 16px rgba(250,90,0,.55)}

/* hint: appears when the clip is ready, leaves on the first gesture */
.flight__hint{position:absolute;left:50%;bottom:max(30px,calc(env(safe-area-inset-bottom) + 24px));transform:translateX(-50%);
  display:flex;flex-direction:column;align-items:center;gap:12px;font-size:10.5px;font-weight:500;letter-spacing:.34em;
  text-transform:uppercase;opacity:0;visibility:hidden;transition:opacity .7s ease,visibility .7s}
.flight__hint.is-on{opacity:.9;visibility:visible}
.flight__hint i{display:block;width:22px;height:36px;border:1px solid rgba(244,241,236,.8);border-radius:12px;position:relative}
.flight__hint i::after{content:"";position:absolute;left:50%;top:7px;width:2px;height:7px;margin-left:-1px;border-radius:2px;
  background:var(--flight-orange);animation:flight-wheel 1.8s 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)}}

/* actions bottom-right: "Bel direct" (tel:) + Skip — real controls, always clickable while the film runs */
.flight__actions{position:absolute;right:max(24px,env(safe-area-inset-right));bottom:max(26px,calc(env(safe-area-inset-bottom) + 20px));
  display:flex;align-items:center;gap:10px;pointer-events:auto}
.flight__call,.flight__skip{pointer-events:auto;cursor:pointer;appearance:none;-webkit-appearance:none;margin:0;
  font:inherit;font-family:var(--flight-font-ui);font-weight:600;font-size:12px;letter-spacing:.14em;text-transform:uppercase;
  line-height:1;text-decoration:none;color:var(--flight-ivory);border-radius:999px;min-height:44px;
  display:inline-flex;align-items:center;justify-content:center;gap:9px;white-space:nowrap;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;text-shadow:none;
  transition:background-color .25s,border-color .25s,color .25s,transform .25s var(--flight-ease),box-shadow .25s}
/* Bel direct: solid orange pill — the one thing a stranded driver must always find */
.flight__call{background:var(--flight-orange);color:#0a0a0b;border:1px solid var(--flight-orange);padding:0 18px 0 14px;
  box-shadow:0 8px 28px rgba(250,90,0,.35)}
.flight__call i{display:block;width:16px;height:16px;flex:none;
  background:currentColor;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25c1.1.37 2.3.57 3.6.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1L6.6 10.8z'/></svg>") center/contain no-repeat;
  mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25c1.1.37 2.3.57 3.6.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1L6.6 10.8z'/></svg>") center/contain no-repeat}
.flight__call:hover{background:#ff6a12;border-color:#ff6a12;transform:translateY(-1px);box-shadow:0 12px 32px rgba(250,90,0,.45)}
/* Skip: glass pill, ivory ink */
.flight__skip{background:rgba(20,20,22,.55);border:1px solid rgba(244,241,236,.22);padding:0 18px;
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.flight__skip>span::after{content:" \2193";letter-spacing:0;color:var(--flight-orange)}
.flight__skip:hover{border-color:rgba(244,241,236,.6);background:rgba(20,20,22,.75)}
.flight__call:focus,.flight__skip:focus{outline:none}
.flight__call:focus-visible,.flight__skip:focus-visible{outline:2px solid var(--flight-orange);outline-offset:4px}

/* loader: centred wordmark + thin orange hairline on the poster, gone once the clip is in memory */
.flight__loader{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:22px;pointer-events:none;color:var(--flight-ivory);font-family:var(--flight-font-ui);
  transition:opacity .9s ease,visibility .9s;text-shadow:0 1px 2px rgba(0,0,0,.4),0 2px 24px rgba(0,0,0,.45)}
.flight__loader.is-done{opacity:0;visibility:hidden}
.flight__loader .flight__word{font-family:var(--flight-font-display);font-weight:800;font-stretch:125%;
  font-size:clamp(22px,2.6vw,38px);letter-spacing:.08em;text-transform:uppercase;line-height:1}
.flight__loader .flight__word b{color:var(--flight-orange);font-weight:800}
.flight__loader .flight__small{font-size:10.5px;font-weight:500;letter-spacing:.3em;text-transform:uppercase;opacity:.8;
  margin:-8px 0 0 .3em;font-variant-numeric:tabular-nums}
.flight__bar{width:min(200px,44vw);height:2px;background:rgba(250,90,0,.22);overflow:hidden;border-radius:1px}
.flight__bar>i{display:block;height:100%;width:0;background:var(--flight-orange);transition:width .25s linear;
  box-shadow:0 0 12px rgba(250,90,0,.6)}
/* buffering mid-film (should never happen with a Blob source): the hairline reappears at the bottom, the lock holds */
.flight__wait{position:absolute;left:0;right:0;bottom:0;height:2px;z-index:5;background:rgba(250,90,0,.18);
  opacity:0;transition:opacity .4s}
.flight__wait>i{display:block;height:100%;width:30%;background:var(--flight-orange);
  animation:flight-wait 1.4s cubic-bezier(.4,0,.6,1) infinite}
.is-buffering .flight__wait{opacity:1}
@keyframes flight-wait{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}

/* ---------- 9:16 film ---------- */
@media (max-aspect-ratio: 1/1){
  .flight__caption{top:var(--flight-cap-top-m);font-size:clamp(24px,7.8vw,40px);padding:0 24px;letter-spacing:.01em}
  .flight__caption::before{width:36px;margin-bottom:16px}
  .flight__fade{background:linear-gradient(to bottom,rgba(10,10,11,0) 0%,rgba(10,10,11,0) 46%,rgba(10,10,11,.4) 62%,
    rgba(10,10,11,.82) 78%,rgba(10,10,11,.97) 90%,var(--flight-bg) 100%)}
  .flight__brand{left:max(20px,env(safe-area-inset-left));top:max(20px,env(safe-area-inset-top))}
  .flight__mark{font-size:14px;letter-spacing:.06em}
  .flight__sub{font-size:9.5px;letter-spacing:.22em}
  .flight__actions{right:max(16px,env(safe-area-inset-right));left:max(16px,env(safe-area-inset-left));
    bottom:max(22px,calc(env(safe-area-inset-bottom) + 16px));justify-content:space-between}
  .flight__call,.flight__skip{font-size:11.5px;letter-spacing:.12em;min-height:46px}
  .flight__call{padding:0 20px 0 16px}
  .flight__hint{bottom:max(84px,calc(env(safe-area-inset-bottom) + 78px))}
}

/* reduced motion: decorative animation off (the film itself still plays — CFG.forceMotion) */
@media (prefers-reduced-motion:reduce){
  .flight__hint i::after,.flight__wait>i{animation:none}
  .flight__video,.flight__hint,.flight__loader{transition:none}
  .flight__caption{filter:none;transform:none;transition:opacity .4s ease}
}
