/* Interactive film player (interactive-video-creation skill). Generic: no brand, no film.
   Sizes inside the frame are in cqw (1% of the player's width), so every overlay scales with the video and sits
   exactly on the cards drawn into it. Positions come from journey.json?v=5db6ec2256 (percent of the frame), set by player.js.
   Theme: override these tokens (build_page.mjs injects page-theme.json after this file). */
:root{
  --iv-page:#0B0E14;          /* page background */
  --iv-bg:#0B0E14;            /* behind the video */
  --iv-ground:#060A14;        /* the cover over an in-film button click (L-112); the map's "ground" wins */
  --iv-ink:#F4F6FA;           /* text on the page */
  --iv-muted:#9AA3B5;
  --iv-font:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --iv-radius:18px;           /* the player's corners */
  --iv-max:1180px;            /* the player's max width */
  --iv-ring:244,246,250;      /* r,g,b of the hover/focus ring on a card */
  --iv-seen-bg:#F4F6FA;       /* the seen mark */
  --iv-seen-ink:#0B0E14;
  --iv-action-bg:#F4F6FA;     /* the call to action (the one action colour) */
  --iv-action-ink:#0B0E14;
  --iv-play-ink:#F4F6FA;      /* the play button: glass, never the action colour (lesson 33) */
  --iv-play-glass:rgba(20,24,34,.48);
  --iv-play-rim:rgba(244,246,250,.55);
  --iv-card:rgba(20,24,34,.92);  /* phone-stack buttons */
  --iv-card-line:rgba(244,246,250,.24);
}
[hidden]{display:none!important}   /* lesson 34: test computed display, never trust the attribute alone */
*{box-sizing:border-box}
html,body{margin:0;background:var(--iv-page);color:var(--iv-ink);font:400 16px/1.5 var(--iv-font);-webkit-font-smoothing:antialiased}
.iv-wrap{max-width:var(--iv-max);margin:0 auto;padding:32px 16px 64px}
.iv{position:relative;margin:0}
.iv .screen{position:relative;aspect-ratio:16/9;overflow:hidden;border-radius:var(--iv-radius);background:var(--iv-bg);container-type:inline-size}
.iv .vid{position:absolute;inset:0;width:100%;height:100%;display:block;opacity:0;background:var(--iv-bg)}
.iv .vid.on{opacity:1}
.iv .nojs{margin:12px 0 0;color:var(--iv-muted)}

/* ---------- the poster: the first clip's own <video> paused on frame 0, a large play button over it ---------- */
.iv .poster{position:absolute;inset:0;z-index:5;cursor:pointer}
.iv:not(.js) .poster,.iv:not(.js) .bigplay{display:none}
.iv .bigplay{position:absolute;z-index:6;left:50%;top:50%;width:12.5cqw;height:12.5cqw;min-width:64px;min-height:64px;
  transform:translate(-50%,-50%);padding:0;border:0;border-radius:50%;cursor:pointer;color:var(--iv-play-ink);
  background:var(--iv-play-glass);-webkit-backdrop-filter:blur(.9cqw);backdrop-filter:blur(.9cqw);
  box-shadow:inset 0 0 0 .16cqw var(--iv-play-rim),0 1cqw 3cqw rgba(0,0,0,.35);
  transition:transform .25s cubic-bezier(.16,1,.3,1)}
/* the triangle is optically centred: its centroid, not its box, sits on the button's centre */
.iv .bigplay svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.iv .bigplay path{fill:currentColor;stroke:currentColor;stroke-width:6;stroke-linejoin:round}
.iv .bigplay:hover,.iv .bigplay:focus-visible,.iv .poster:hover~.bigplay{transform:translate(-50%,-50%) scale(1.06)}
.iv .bigplay:focus-visible{outline:.16cqw solid var(--iv-play-ink);outline-offset:.5cqw}
.iv .bigplay:active{transform:translate(-50%,-50%) scale(.95)}
.iv.leave .bigplay,.iv.leave .bigplay:hover{transform:translate(-50%,-50%) scale(0);transition:transform .4s cubic-bezier(.6,-.28,.735,.045)}
.iv.leave .poster{cursor:default}
.iv.started .poster,.iv.started .bigplay{display:none}
/* site-v2 W1: while the picker loops muted behind the play button, a light scrim keeps it in the background */
.iv.ambient .poster{background:rgba(6,10,20,.18)}
.iv[data-state="loading"] .screen::after{content:"";position:absolute;inset:0;z-index:9}
@media (prefers-reduced-motion:reduce){.iv .bigplay,.iv.leave .bigplay{transition:none}}

/* ---------- the presenter circle across a page cut: minimised, never dissolved (lessons 1, 2, 4) ----------
   --pc-x, --pc-y (% of the frame) and --pc-r (cqw) come from journey.json?v=5db6ec2256 presenter_circle, set by player.js. */
.iv .pipx{position:absolute;z-index:4;border-radius:50%;pointer-events:none;visibility:hidden;transform-origin:50% 50%;
  left:var(--pc-l,0);top:var(--pc-t,0);width:var(--pc-d,0);height:var(--pc-d,0)}
.iv .pipx canvas{position:absolute;inset:0;width:100%;height:100%;display:block;border-radius:50%}
/* a straight cut: the outgoing <video> itself is the minimising circle (lesson 5: never copy a moving picture to a canvas) */
.iv .vid.circonly{z-index:5!important;opacity:1;clip-path:circle(var(--pc-r) at var(--pc-x) var(--pc-y));transform-origin:var(--pc-x) var(--pc-y)}
/* under a crossfade the outgoing clip is needed whole, its circle cut out (only the shrinking copy shows a face) */
.iv .vid.holed{-webkit-mask:radial-gradient(circle calc(var(--pc-r) * 1.01) at var(--pc-x) var(--pc-y),transparent 97%,#000 100%);
  mask:radial-gradient(circle calc(var(--pc-r) * 1.01) at var(--pc-x) var(--pc-y),transparent 97%,#000 100%)}

/* ---------- buttons while a clip plays (D39): a strip of real page buttons under the film, never over it ---------- */
.iv .filmbtns{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:14px}
.iv:not([data-state="playing"]) .filmbtns{display:none}
.iv .filmbtns.out{visibility:hidden}   /* L-109: outside the presenter window; keeps its space so the page does not jump */
.iv .fb{display:inline-flex;align-items:center;justify-content:center;min-height:48px;max-width:100%;padding:12px 24px;cursor:pointer;
  font:700 17px/1.2 var(--iv-font);color:var(--iv-ink);background:var(--iv-card);border:1.5px solid var(--iv-card-line);border-radius:999px;
  text-align:center;-webkit-tap-highlight-color:transparent;transition:border-color .18s ease}
.iv .fb:hover,.iv .fb:focus-visible{border-color:rgba(var(--iv-ring),.95);outline:none}
.iv .fb:focus-visible{box-shadow:0 0 0 3px rgba(var(--iv-ring),.35)}
@media (max-width:480px){.iv .fb{width:100%}}
/* L-112: an in-film click covers the film with the ground at once; the still shrinks on it; the cover lifts off the target */
.iv .cover{position:absolute;inset:0;z-index:7;pointer-events:none;background:var(--iv-ground);opacity:1;transition:opacity .25s ease}
.iv .cover.lift{opacity:0}
/* the still of the presenter circle, shrunk away on the ground (0.45s, back.in); --pc-* from presenter_circle */
.iv .snap{position:absolute;z-index:8;pointer-events:none;border-radius:50%;overflow:hidden;transform-origin:50% 50%;
  left:var(--pc-l,0);top:var(--pc-t,0);width:var(--pc-d,0);height:var(--pc-d,0);transition:transform .45s cubic-bezier(.36,0,.66,-.56)}
.iv .snap canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.iv .snap.go{transform:scale(0)}
.iv .snap.fade{opacity:0;transition:opacity .12s linear}

/* ---------- hotspots: transparent, exactly on the cards the film draws; a ring on hover and focus ---------- */
.iv .hot{position:absolute;inset:0;z-index:6;display:none}
.iv[data-state="choose"] .hot,.iv[data-state="end"] .hot{display:block}
.iv .hb{position:absolute;display:block;padding:0;margin:0;border:0;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent;color:transparent}
.iv .hb .ol{position:absolute;inset:0;border-radius:inherit;opacity:0;transition:opacity .18s ease;
  border:.12cqw solid rgba(var(--iv-ring),.95);box-shadow:0 0 0 .06cqw rgba(var(--iv-ring),.5),0 0 3cqw rgba(var(--iv-ring),.28)}
.iv .hb:hover .ol,.iv .hb:focus-visible .ol{opacity:1}
.iv .hb:focus-visible{outline:none}
.iv .hb:focus-visible .ol{border-width:.2cqw}

/* ---------- seen marks: a tick badge filling the empty slot the film draws (lessons 7, 32) ---------- */
.iv .marks{position:absolute;inset:0;z-index:5;pointer-events:none;display:none}
.iv[data-state="choose"] .marks,.iv[data-state="end"] .marks{display:block}
.iv .mark{position:absolute;display:grid;place-items:center}
.iv .mark i{display:grid;place-items:center;height:100%;max-width:100%;aspect-ratio:1;border-radius:50%;background:var(--iv-seen-bg);color:var(--iv-seen-ink);
  animation:ivpop .5s cubic-bezier(.34,1.56,.64,1) backwards}
.iv .mark svg{width:62%;height:62%}
@keyframes ivpop{from{transform:scale(0)}}
@media (prefers-reduced-motion:reduce){.iv .mark i{animation:none}}

/* ---------- the call to action ---------- */
.iv .cta-hb{border-radius:999px}
.iv .ctarow{display:flex;justify-content:center;margin-top:14px}
.iv .ctabtn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:12px 28px;border-radius:999px;
  font:700 17px/1 var(--iv-font);text-decoration:none;color:var(--iv-action-ink);background:var(--iv-action-bg)}
.iv .ctabtn:focus-visible{outline:2px solid var(--iv-ink);outline-offset:3px}

/* ---------- phones (screen under 640px): the buttons stack under the video, targets of 44px or more (lesson 49) ---------- */
.iv .stack{display:none;flex-direction:column;gap:10px;margin-top:14px}
.iv.stacked[data-state="choose"] .stack,.iv.stacked[data-state="end"] .stack,
.iv.needstack[data-state="choose"] .stack,.iv.needstack[data-state="end"] .stack{display:flex}
.iv.stacked .hot{display:none!important}
.iv.stacked .ctarow{display:none!important}
.iv .sb{display:flex;align-items:center;gap:14px;min-height:56px;padding:10px 16px;text-align:left;cursor:pointer;width:100%;
  font:700 18px/1.15 var(--iv-font);color:var(--iv-ink);background:var(--iv-card);border:1.5px solid var(--iv-card-line);border-radius:14px;
  text-decoration:none;-webkit-tap-highlight-color:transparent}
.iv .sb:hover,.iv .sb:focus-visible{border-color:rgba(var(--iv-ring),.95);outline:none}
.iv .sb .tk{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;border:2px solid var(--iv-card-line)}
.iv .sb.seen .tk{background:var(--iv-seen-bg);border-color:var(--iv-seen-bg);color:var(--iv-seen-ink)}
.iv .sb .tk svg{width:16px;height:16px}
.iv .sb.sb-cta{justify-content:center;color:var(--iv-action-ink);background:var(--iv-action-bg);border-color:var(--iv-action-bg);border-radius:999px}
