/* Angstvrij Klachtvrij — the intro film (DOM is built by assets/js/flight.js: canvas camera pan over one plate, locked)
 *
 * Contract (see _bron/CONTRACT.md "Interfaces — 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, coarse on <html>, exact on #hero), --flight-overlap (px) and --flight-thread-x (%)
 *    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
 *    Overslaan receives REAL clicks; A must additionally set html.flight-lock #site{pointer-events:none} and hide the
 *    header with visibility (never `inert`).
 *  - inline blurred poster (data URI, cover) → tile-0 poster <img> placed by frame 0's camera transform → canvas →
 *    final <img> (= stop 2 crop, cover-fit: exactly the frame the canvas ends on) → thread SVG (the end state of the
 *    gold line; A's page thread continues from --flight-thread-x) → melt → captions (world + ui) → Overslaan → loader
 *  - hidden things use opacity/visibility + pointer-events — never `inert` on a full-screen layer (it freezes scrolling)
 *  - the melt (lower part → --flight-melt) is a separate overlay A can tune (--flight-melt-color / --flight-melt-alpha)
 */
:root{
  --flight-p:0;
  --flight-overlap:100vh;
  --flight-overlap:100svh;
  --flight-dusk:#33495a;                                   /* scene 1's sky: paints before the poster */
  --flight-ink:var(--ink,#0C3640);
  --flight-teal:var(--teal-deep,var(--deep-teal,#0F5E6E));
  --flight-cream:var(--cream,#F7F3EA);
  --flight-sage:var(--sage,#93B578);
  --flight-sage-ink:#4f7a3c;
  --flight-gold:var(--gold,#C9A24B);
  --flight-melt:var(--flight-melt-color,var(--cream,#F7F3EA));   /* = the colour A's hero lands on */
  --flight-melt-alpha:1;
  --flight-font-display:var(--f-display,var(--font-display,"Nunito","Quicksand","Segoe UI",system-ui,-apple-system,sans-serif));
  --flight-font-ui:var(--f-body,var(--font-body,"Nunito","Segoe UI",system-ui,-apple-system,sans-serif));
  --flight-ease:cubic-bezier(.2,.7,.2,1);
}

#flight{position:relative;height:100vh;height:100svh;background:var(--flight-dusk);z-index:1;overflow-anchor:none}
html.flight-lock #flight{z-index:60}

html.flight-lock,html.flight-lock body{overflow:hidden;overscroll-behavior:none}
html.flight-lock body{touch-action:none}
html.flight-lock #site{pointer-events:none}

.flight__stage{position:relative;height:100vh;height:100svh;overflow:hidden;background:var(--flight-dusk);
  contain:layout paint size;isolation:isolate}

.flight__poster-lo,.flight__poster,.flight__canvas,.flight__final{position:absolute;display:block;margin:0;border:0;
  -webkit-user-select:none;user-select:none;pointer-events:none}
.flight__poster-lo{inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 50%;z-index:0;
  background:var(--flight-dusk)}
/* tile 0 (preloaded, LCP) placed with frame 0's camera transform (flight.js writes width/height/transform) */
.flight__poster{left:0;top:0;z-index:1;transform-origin:0 0;object-fit:fill;max-width:none}
.flight__canvas{inset:0;width:100%;height:100%;z-index:2;opacity:0;background:transparent}
.flight__canvas.is-on{opacity:1}
.flight__final{inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 50%;z-index:3;opacity:0}

/* the gold thread's end state (identical to the canvas' last thread frame); stays as part of the hero */
.flight__thread{position:absolute;inset:0;width:100%;height:100%;z-index:4;pointer-events:none;opacity:0;overflow:visible}
.flight__thread-glow{stroke:rgba(245,241,215,.42);stroke-linecap:round;stroke-linejoin:round}
.flight__thread-core{stroke:rgba(201,162,75,.96);stroke-linecap:round;stroke-linejoin:round}

/* the melt: the lower part of the frame dissolves into the site colour so A's hero lands on the page background */
.flight__fade{position:absolute;inset:0;z-index:5;pointer-events:none;opacity:0;
  background:linear-gradient(to bottom,transparent 0%,transparent 58%,color-mix(in srgb,var(--flight-melt) 22%,transparent) 70%,
  color-mix(in srgb,var(--flight-melt) 62%,transparent) 82%,color-mix(in srgb,var(--flight-melt) 92%,transparent) 92%,var(--flight-melt) 100%)}
@supports not (color: color-mix(in srgb, red, blue)){
  .flight__fade{background:linear-gradient(to bottom,rgba(247,243,234,0) 0%,rgba(247,243,234,0) 58%,rgba(247,243,234,.22) 70%,
    rgba(247,243,234,.62) 82%,rgba(247,243,234,.92) 92%,#F7F3EA 100%)}
}

/* ---------- world layer: scene-1 pictograms in plate coordinates (flight.js writes the camera transform) ---------- */
.flight__world{position:absolute;left:0;top:0;width:0;height:0;z-index:6;pointer-events:none;transform-origin:0 0;
  visibility:hidden;will-change:transform;--flight-r:60px;font-family:var(--flight-font-ui)}
.flight__picto{position:absolute;width:190px;margin-left:-95px;margin-top:calc(var(--flight-r) * -.55);
  display:flex;flex-direction:column;align-items:center;gap:7px;opacity:0;color:#fff;will-change:opacity,transform;
  text-align:center;font-size:21px;font-weight:600;letter-spacing:.02em;line-height:1.3;
  text-shadow:0 1px 2px rgba(12,54,64,.55),0 0 12px rgba(12,54,64,.35);--glow:0}
.flight__picto-ring{display:flex;align-items:center;justify-content:center;flex:none;
  width:calc(var(--flight-r) * 1.2);height:calc(var(--flight-r) * 1.2);border-radius:50%;
  border:2px solid rgba(255,255,255,.92);background:rgba(255,255,255,calc(.08 + .3 * var(--glow)));
  box-shadow:0 0 calc(22px * var(--glow)) rgba(255,255,255,calc(.75 * var(--glow))),0 0 0 calc(5px * var(--glow)) rgba(255,255,255,calc(.18 * var(--glow)));
  will-change:box-shadow,background-color}
.flight__picto-ring svg{width:56%;height:56%}

/* ---------- ui layer: screen-anchored captions ---------- */
.flight__ui{position:absolute;inset:0;z-index:7;pointer-events:none;font-family:var(--flight-font-ui)}
.flight__ui>*{will-change:opacity,transform;opacity:0}
.flight__cap{position:absolute;left:0;right:0;bottom:clamp(14px,11%,120px);margin:auto;width:max-content;max-width:80%;
  padding:12px 26px;border-radius:999px;background:rgba(247,243,234,.94);color:var(--flight-ink);
  font-family:var(--flight-font-display);font-weight:700;font-size:clamp(19px,2.1vw,30px);letter-spacing:.01em;
  box-shadow:0 6px 24px rgba(12,54,64,.18)}
/* desktop: the name (scene 2) sits where the end stack will be. The END STACK = one flex column in normal flow at
   x 5 %, y 11 % (below A's 76-px header): the frosted lockup card, then the four benefit pills in a 2 × 2 grid. Every box
   sizes to its content (no fixed / percent heights), so NL or the longer EN text can never leave its box. */
.flight__name{position:absolute;left:5%;top:11%;width:max-content;max-width:60%;padding:8px 14px;border-radius:12px;
  background:rgba(247,243,234,.9);color:var(--flight-teal);font-family:var(--flight-font-display);font-weight:800;
  font-size:clamp(20px,2.1vw,28px);letter-spacing:.01em;line-height:1.15}
.flight__stack{position:absolute;left:5%;top:11%;width:31%;max-width:31%;display:flex;flex-direction:column;align-items:flex-start;
  gap:clamp(8px,1.4vh,14px);opacity:1;will-change:auto}
.flight__lockup{position:relative;width:fit-content;max-width:100%;box-sizing:border-box;
  display:flex;flex-direction:row;align-items:center;gap:12px;padding:10px 14px;border-radius:16px;
  background:rgba(247,243,234,.9);color:var(--flight-teal);text-align:left;box-shadow:0 6px 24px rgba(12,54,64,.12)}
.flight__logo{display:block;width:clamp(76px,7.2vw,104px);height:auto;flex:none}
.flight__lockup-text{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0;overflow-wrap:anywhere}
.flight__lockup-name{font-family:var(--flight-font-display);font-weight:800;font-size:clamp(17px,1.5vw,22px);letter-spacing:.01em;line-height:1.3}
.flight__lockup-tag{font-weight:600;font-size:clamp(12px,.95vw,14px);line-height:1.3;color:var(--flight-ink)}
.flight__benefits{list-style:none;margin:0;padding:0;position:relative;width:100%;
  display:grid;grid-template-columns:repeat(2,minmax(0,max-content));gap:8px 10px;opacity:1;will-change:auto}
/* high-contrast pills: cream 90 % + deep-teal text (≥ 6:1), sage-green icon; text wraps inside the pill if ever needed */
.flight__benefit{display:flex;align-items:center;gap:9px;min-height:40px;padding:5px 14px 5px 6px;border-radius:999px;box-sizing:border-box;
  max-width:100%;opacity:0;will-change:opacity,transform;background:rgba(247,243,234,.9);color:var(--flight-teal);
  font-weight:800;font-size:clamp(13px,1.05vw,16px);letter-spacing:.01em;line-height:1.3;overflow-wrap:anywhere;
  box-shadow:0 4px 14px rgba(12,54,64,.1)}
.flight__benefit-ring{display:flex;align-items:center;justify-content:center;flex:none;width:30px;height:30px;
  border-radius:50%;border:2px solid var(--flight-sage);background:#fff;color:#5f8a44}
.flight__benefit-ring svg{width:58%;height:58%}

/* ---------- overlay: Overslaan (bottom right), always clickable while the film runs ---------- */
.flight__overlay{position:absolute;inset:0;z-index:8;pointer-events:none;font-family:var(--flight-font-ui)}
.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;will-change:opacity}
.flight__skip{pointer-events:auto;cursor:pointer;appearance:none;-webkit-appearance:none;margin:0;
  font:inherit;font-family:var(--flight-font-ui);font-weight:700;font-size:13px;letter-spacing:.08em;text-transform:uppercase;
  line-height:1;text-decoration:none;color:var(--flight-cream);border-radius:999px;min-height:46px;
  display:inline-flex;align-items:center;justify-content:center;gap:9px;white-space:nowrap;
  background:rgba(15,94,110,.9);border:1px solid rgba(255,255,255,.25);padding:0 20px;
  box-shadow:0 4px 18px rgba(12,54,64,.3);
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  transition:background-color .25s,transform .25s var(--flight-ease),box-shadow .25s}
.flight__skip>span{line-height:1.3}
.flight__skip>span::after{content:" \2193";letter-spacing:0;opacity:.85}
.flight__skip:hover{background:rgba(12,76,90,.96);transform:translateY(-1px)}
.flight__skip:focus{outline:none}
.flight__skip:focus-visible{outline:2px solid var(--flight-cream);outline-offset:4px}

/* loader: a thin gold hairline + "Laden"; INVISIBLE unless decoding takes longer than CFG.loaderDelayMs */
.flight__loader{position:absolute;left:50%;bottom:max(34px,calc(env(safe-area-inset-bottom) + 28px));transform:translateX(-50%);
  z-index:9;display:flex;flex-direction:column;align-items:center;gap:10px;pointer-events:none;color:var(--flight-cream);
  font-family:var(--flight-font-ui);font-size:10.5px;font-weight:600;letter-spacing:.3em;text-transform:uppercase;
  opacity:0;visibility:hidden;transition:opacity .5s ease,visibility .5s;text-shadow:0 1px 2px rgba(12,54,64,.6)}
.flight__loader.is-late{opacity:.9;visibility:visible}
.flight__loader.is-done{opacity:0;visibility:hidden;transition:opacity .25s ease,visibility .25s}
.flight__bar{width:min(180px,40vw);height:2px;background:rgba(255,255,255,.2);overflow:hidden;border-radius:1px}
.flight__bar>i{display:block;height:100%;width:0;background:var(--flight-gold);transition:width .2s linear}

/* ---------- portrait ---------- */
@media (max-aspect-ratio: 1/1){
  .flight__picto{font-size:23px;width:200px;margin-left:-100px}
  .flight__cap{bottom:clamp(90px,14%,160px);font-size:clamp(18px,5.2vw,24px);padding:11px 22px}
  /* portrait: the stack top-left, x 4–52 %, from y 8 %: card (column) then the pills in ONE column; everything in flow,
     sized by content; the woman starts at x ≈ 57 %, so nothing touches her */
  .flight__name{left:4%;top:8%;font-size:clamp(18px,5.4vw,24px);padding:7px 12px}
  .flight__stack{left:4%;top:8%;width:48%;max-width:48%;gap:8px}
  .flight__lockup{flex-direction:column;align-items:flex-start;gap:4px;padding:9px 11px;border-radius:14px}
  .flight__logo{width:clamp(64px,20vw,88px)}
  .flight__lockup-name{font-size:clamp(14px,4.2vw,18px)}
  .flight__lockup-tag{font-size:clamp(11px,3vw,12.5px);line-height:1.25}
  .flight__benefits{display:flex;flex-direction:column;align-items:flex-start;gap:7px}
  .flight__benefit{min-height:38px;gap:8px;font-size:clamp(12.5px,3.5vw,14px);padding:4px 12px 4px 5px}
  .flight__benefit-ring{width:28px;height:28px}
  .flight__actions{right:max(16px,env(safe-area-inset-right));bottom:max(22px,calc(env(safe-area-inset-bottom) + 16px))}
  .flight__skip{font-size:12px;min-height:46px;padding:0 16px}
}
/* short phones (browser chrome eats the viewport): a smaller stack so it still ends above the melt / A's hero card */
@media (max-aspect-ratio: 1/1) and (max-height:700px){
  .flight__stack{top:7%;gap:6px}
  .flight__logo{width:clamp(56px,16vw,70px)}
  .flight__lockup{padding:7px 9px;gap:3px}
  .flight__lockup-name{font-size:clamp(13px,4vw,16px)}
  .flight__lockup-tag{font-size:11px;line-height:1.2}
  .flight__benefits{gap:5px}
  .flight__benefit{min-height:34px;font-size:12.5px;padding:3px 10px 3px 4px;gap:7px}
  .flight__benefit-ring{width:26px;height:26px}
  .flight__cap{bottom:clamp(70px,12%,120px);font-size:clamp(16px,4.6vw,20px)}
}
@media (max-width:359px){
  .flight__benefit{font-size:12px}
}

/* reduced motion: decorative transitions off (the film itself still plays — CFG.forceMotion; ?intro=0 shows the final frame) */
@media (prefers-reduced-motion:reduce){
  .flight__loader,.flight__bar>i{transition:none}
}
