/* ---------- video player: one lightbox for every "watch" trigger ([data-video]) ----------
   Opens by growing out of whatever was clicked (a button, the How it works cover) over the night sky's
   colour with the site grain, plays immediately with sound, and shrinks back into it on close.
   Self-hosted MP4 (the artifact viewer blocks YouTube embeds); the YouTube link sits in the header. */
:root{--vp-ink:#141414;--vp-on:#FFFFFF;--vp-on-70:rgba(255,255,255,.72);--vp-on-20:rgba(255,255,255,.2);--vp-on-12:rgba(255,255,255,.12);--vp-accent:#ED410B}
/* --consent-h: the cookie banner's room at the screen's foot on a first visit (consent.js); the film shrinks to sit above it */
.vp{position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:calc(env(safe-area-inset-top,0px) + 16px) 16px calc(env(safe-area-inset-bottom,0px) + 16px + var(--consent-h,0px))}
.vp[hidden]{display:none}
.vp-scrim{position:absolute;inset:0;background:rgba(14,13,12,.86);-webkit-backdrop-filter:blur(14px) saturate(1.15);backdrop-filter:blur(14px) saturate(1.15)}
/* phones and touch screens: the film is small there, so page text showed through the see-through scrim around it,
   over the title row and the controls; near-opaque reads as a screen of its own */
@media (max-width:720px),(pointer:coarse){.vp-scrim{background:rgba(14,13,12,.96)}}
.vp-scrim::before,.vp-scrim::after{content:"";position:absolute;inset:0;background-size:256px 256px;opacity:.08;pointer-events:none}
.vp-scrim::before{background-image:url(assets/site/grain-dark.avif);mix-blend-mode:difference}
.vp-scrim::after{background-image:url(assets/site/grain-light.avif);mix-blend-mode:plus-lighter}
.vp-box{position:relative;display:flex;flex-direction:column;gap:10px;width:min(1180px,calc(100vw - 32px),calc((100vh - 182px - var(--consent-h,0px)) * 16 / 9));transform-origin:50% 50%}
@supports (height:100dvh){.vp-box{width:min(1180px,calc(100vw - 32px),calc((100dvh - 182px - var(--consent-h,0px)) * 16 / 9))}}

/* header: title + running time, YouTube link, close */
.vp-head{display:flex;align-items:center;gap:12px;min-width:0;color:var(--vp-on)}
.vp-title{display:flex;align-items:center;gap:10px;min-width:0;margin:0;font:500 17px/1.3 var(--sans)}
.vp-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vp-dur{flex:none;display:inline-flex;align-items:center;height:20px;padding:0 6px;border-radius:4px;background:var(--vp-on-12);font:11.5px/1 var(--pixel);letter-spacing:.02em;color:var(--vp-on-70)}
.vp-yt{flex:none;display:inline-flex;align-items:center;gap:6px;margin-left:auto;padding:8px 10px;border-radius:6px;color:var(--vp-on-70);font:500 14.5px/1 var(--sans);text-decoration:none;white-space:nowrap;transition:color .2s,background-color .2s}
.vp-yt:hover{color:var(--vp-on);background:var(--vp-on-12)}
.vp-yt svg{width:12px;height:12px}
.vp-x{flex:none;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:var(--vp-on-12);color:var(--vp-on);cursor:pointer;transition:background-color .2s,transform .2s}
.vp-x:hover{background:var(--vp-on-20);transform:rotate(90deg)}
.vp-x svg{width:16px;height:16px}

/* the screen */
.vp-frame{position:relative;aspect-ratio:16/9;overflow:hidden;border-radius:14px;background:#000;box-shadow:0 0 0 1px rgba(255,255,255,.08),0 40px 90px -30px rgba(0,0,0,.75)}
.vp-video{display:block;width:100%;height:100%;object-fit:contain;background:#000;cursor:pointer}
.vp-video::cue{background:rgba(0,0,0,.72);color:#fff;font-family:var(--sans);font-size:clamp(15px,2vw,22px);line-height:1.35}
.vp-frame:focus{outline:none}
/* YouTube mode: YouTube's own player and controls fill the frame, fading in over frame 0 once it has loaded */
.vp-tube{position:absolute;inset:0;width:100%;height:100%;border:0;opacity:0;transition:opacity .35s ease-out}
.vp-tube.is-in{opacity:1}
.vp.is-yt .vp-video,.vp.is-yt .vp-big,.vp.is-yt .vp-bar,.vp.is-yt .vp-unmute{display:none}
.vp-frame:fullscreen{border-radius:0;box-shadow:none}
.vp-frame:-webkit-full-screen{border-radius:0}
.vp-frame:fullscreen .vp-video{cursor:pointer}

/* centre button: play / replay, and a quick pulse when you toggle */
.vp-big{position:absolute;left:50%;top:50%;display:grid;place-items:center;width:88px;height:88px;margin:-44px 0 0 -44px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.95);color:var(--vp-ink);box-shadow:0 12px 30px -8px rgba(0,0,0,.45);cursor:pointer;transition:opacity .25s ease-out,transform .35s cubic-bezier(.2,.9,.3,1.3)}
.vp-big svg{width:28px;height:28px}
.vp-big .ic-play{margin-left:4px}
.vp-big:hover{transform:scale(1.06)}
.vp.is-playing .vp-big{opacity:0;transform:scale(.7);pointer-events:none}
.vp-big .ic-replay{display:none}
.vp.is-ended .vp-big .ic-replay{display:block}
.vp.is-ended .vp-big .ic-play{display:none}

/* spinner (only after a short wait, so a fast start never flashes it) */
.vp-spin{position:absolute;left:50%;top:50%;width:44px;height:44px;margin:-22px 0 0 -22px;border-radius:50%;border:3px solid rgba(255,255,255,.18);border-top-color:#fff;opacity:0;pointer-events:none;transition:opacity .2s}
.vp.is-waiting .vp-spin{opacity:1;animation:vp-spin .8s linear infinite}
.vp.is-waiting .vp-big,.vp.is-scrubbing .vp-big{opacity:0;pointer-events:none}
.vp.is-scrubbing .vp-big{transition:none}
@keyframes vp-spin{to{transform:rotate(360deg)}}

/* control bar */
.vp-bar{position:relative;display:flex;align-items:center;gap:6px;padding:0 2px;color:var(--vp-on);transition:opacity .3s ease-out,transform .3s ease-out}
.vp.is-overlay .vp-bar{position:absolute;left:0;right:0;bottom:0;z-index:3;padding:44px 12px 10px;background:linear-gradient(to bottom,transparent,rgba(0,0,0,.55) 45%,rgba(0,0,0,.82))}
.vp.is-overlay .vp-time{text-shadow:0 1px 2px rgba(0,0,0,.6)}
.vp.is-overlay.is-idle .vp-bar{opacity:0;transform:translateY(6px);pointer-events:none}
.vp.is-overlay.is-idle .vp-frame,.vp.is-overlay.is-idle .vp-video{cursor:none}
.vp-btn{flex:none;display:grid;place-items:center;width:38px;height:38px;padding:0;border:0;border-radius:8px;background:none;color:inherit;cursor:pointer;transition:background-color .2s}
.vp-btn:hover{background:var(--vp-on-12)}
.vp-btn svg{width:20px;height:20px}
.vp-btn[aria-pressed="true"]{color:var(--vp-on)}
.vp-btn[hidden]{display:none}
.vp-cc[aria-pressed="true"]::after{content:"";position:absolute;width:14px;height:2px;margin-top:22px;border-radius:1px;background:var(--vp-accent)}
.vp-cc{position:relative}
.vp-time{flex:none;min-width:86px;padding:0 4px;font:500 13.5px/1 var(--sans);font-variant-numeric:tabular-nums;color:var(--vp-on-70);white-space:nowrap}
.vp-time b{font-weight:500;color:var(--vp-on)}
.vp-sp{flex:1}
.vp-btn .ic-pause,.vp-btn .ic-unmuted,.vp-btn .ic-exitfs{display:none}
.vp.is-playing .vp-play .ic-play{display:none}
.vp.is-playing .vp-play .ic-pause{display:block}
.vp:not(.is-muted) .vp-mute .ic-muted{display:none}
.vp:not(.is-muted) .vp-mute .ic-unmuted{display:block}
.vp.is-fs .vp-fs .ic-fs{display:none}
.vp.is-fs .vp-fs .ic-exitfs{display:block}

/* seek bar: a native range (keyboard + screen reader for free), drawn as played / buffered / rest */
.vp-seek{--p:0%;--b:0%;flex:1 1 auto;min-width:60px;height:22px;margin:0 6px;padding:0;-webkit-appearance:none;appearance:none;background:none;cursor:pointer;touch-action:none}
.vp-seek:focus{outline:none}
.vp-seek::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:linear-gradient(90deg,var(--vp-accent) var(--p),rgba(255,255,255,.45) var(--p) var(--b),rgba(255,255,255,.2) var(--b));transition:height .15s}
.vp-seek::-moz-range-track{height:4px;border-radius:2px;background:linear-gradient(90deg,var(--vp-accent) var(--p),rgba(255,255,255,.45) var(--p) var(--b),rgba(255,255,255,.2) var(--b))}
.vp-seek::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;margin-top:-5px;border:0;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.4);transform:scale(0);transition:transform .15s}
.vp-seek::-moz-range-thumb{width:14px;height:14px;border:0;border-radius:50%;background:#fff;transform:scale(0);transition:transform .15s}
.vp-bar:hover .vp-seek::-webkit-slider-thumb,.vp-seek:focus-visible::-webkit-slider-thumb,.vp-seek:active::-webkit-slider-thumb{transform:scale(1)}
.vp-bar:hover .vp-seek::-moz-range-thumb,.vp-seek:focus-visible::-moz-range-thumb{transform:scale(1)}
.vp-seek:focus-visible::-webkit-slider-runnable-track{box-shadow:0 0 0 2px rgba(255,255,255,.5)}
@media (hover:none){.vp-seek::-webkit-slider-thumb{transform:scale(1)}.vp-seek::-moz-range-thumb{transform:scale(1)}}

/* "sound is off" hint when the browser refused unmuted playback */
.vp-unmute{position:absolute;left:14px;top:14px;display:none;align-items:center;gap:8px;height:34px;padding:0 12px;border:0;border-radius:17px;background:rgba(255,255,255,.95);color:var(--vp-ink);font:500 14px/1 var(--sans);cursor:pointer;box-shadow:0 8px 20px -8px rgba(0,0,0,.5)}
.vp-unmute svg{width:16px;height:16px}
.vp.needs-sound .vp-unmute{display:inline-flex}
.vp-unmute:focus-visible{outline:3px solid var(--vp-accent);outline-offset:3px}

.vp :focus-visible{outline:2px solid #fff;outline-offset:2px}

@media (max-width:640px){
  .vp{padding-left:8px;padding-right:8px}
  .vp-box{width:min(calc(100vw - 16px),calc((100vh - 170px - var(--consent-h,0px)) * 16 / 9))}
  @supports (height:100dvh){.vp-box{width:min(calc(100vw - 16px),calc((100dvh - 170px - var(--consent-h,0px)) * 16 / 9))}}
  .vp-seek{height:36px}
  .vp-frame{border-radius:10px}
  .vp-yt span{display:none}
  .vp-title{font-size:15.5px}
  .vp-big{width:68px;height:68px;margin:-34px 0 0 -34px}
  .vp-big svg{width:24px;height:24px}
  .vp-bar{gap:2px}
  .vp.is-overlay .vp-bar{padding:28px 6px 4px}
  .vp-time{min-width:0;font-size:12.5px}
  .vp-btn{width:36px;height:36px}
}
@media (orientation:landscape) and (max-height:500px){
  .vp{padding:8px max(16px,env(safe-area-inset-right)) calc(max(8px,env(safe-area-inset-bottom)) + var(--consent-h,0px)) max(16px,env(safe-area-inset-left))}
  .vp-box{width:min(calc(100vw - 32px),calc((100vh - 16px - var(--consent-h,0px)) * 16 / 9))}
  @supports (height:100dvh){.vp-box{width:min(calc(100vw - 32px),calc((100dvh - 16px - var(--consent-h,0px)) * 16 / 9))}}
  .vp-head{position:absolute;z-index:4;top:0;left:0;right:0;padding:8px 10px;border-radius:14px 14px 0 0;background:linear-gradient(rgba(0,0,0,.6),transparent);transition:opacity .3s}
  .vp.is-idle .vp-head{opacity:0;pointer-events:none}
  .vp-unmute{top:60px}
  .vp-yt span{display:none}
  .vp-time{min-width:0}
  .vp.is-overlay .vp-bar{gap:2px;padding:28px 6px 4px}
}
html.vp-open,html.vp-open body{overflow:hidden}

/* ---------- the triggers ---------- */
/* hero: "Watch video" next to the trial button */
.hero .ctas{gap:10px}
.hero .ctas .btn{padding:0 20px}
.hero .ctas .btn-watch{gap:7px;padding:0 18px 0 16px}
.btn-watch{cursor:pointer;font-family:var(--sans)}
.btn-watch svg{width:16px;height:16px;flex:none;color:var(--brand)}
.btn-watch .btn-dur{margin-left:1px;color:var(--fg-60);font-size:15.5px;font-variant-numeric:tabular-nums}
/* laptops (QA 2026-10-25): the two buttons need 425px side by side; in a 382-424px column (1280-1599px screens) the
   duration goes, so "Watch video" sits beside the trial button instead of under it, below the fold. The length stays in
   the button's label. Narrower columns (tablets) stack the two as before */
@media (min-width:1024px){.hero .hc-body{container-type:inline-size}}   /* desktop only: a big phone's column is that wide too */
@container (min-width:382px) and (max-width:424.98px){.hero .ctas .btn-dur{display:none}}
/* How it works page: the cover is a video */
.hw-cover .hw-play{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:0;border:0;background:linear-gradient(to bottom,rgba(10,10,10,0) 30%,rgba(10,10,10,.28));cursor:pointer;transition:background-color .3s}
.hw-cover img{transition:transform .6s cubic-bezier(.2,.7,.2,1)}
.hw-cover:hover img{transform:scale(1.025)}
.hw-play-disc{position:relative;display:grid;place-items:center;width:92px;height:92px;border-radius:50%;background:rgba(255,255,255,.96);color:var(--ink);box-shadow:0 14px 34px -10px rgba(0,0,0,.6);transition:transform .35s cubic-bezier(.2,.9,.3,1.3)}
.hw-play-disc svg{width:28px;height:28px;margin-left:5px}
.hw-play-disc::before{content:"";position:absolute;inset:-10px;border-radius:50%;border:2px solid rgba(255,255,255,.55);animation:hw-ring 2.4s ease-out infinite}
@keyframes hw-ring{0%{transform:scale(.9);opacity:.9}70%,100%{transform:scale(1.35);opacity:0}}
.hw-cover:hover .hw-play-disc{transform:scale(1.07)}
.hw-play-t{display:inline-flex;align-items:center;gap:8px;height:28px;padding:0 11px;border-radius:6px;background:rgba(20,20,20,.72);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);color:#fff;font:13px/1 var(--pixel);letter-spacing:.02em}
.hw-play-t em{font-style:normal;color:rgba(255,255,255,.68)}
.hw-cover .hw-play:focus-visible{outline:3px solid var(--brand);outline-offset:-3px;border-radius:16px}
@media (max-width:640px){.hw-play-disc{width:64px;height:64px}.hw-play-disc svg{width:22px;height:22px;margin-left:3px}.hw-play-disc::before{inset:-7px}.hw-play-t{height:24px;font-size:11.5px}}

@media (prefers-reduced-motion:reduce){
  .vp-big,.vp-bar,.vp-x,.vp-spin,.hw-cover img,.hw-play-disc{transition:none}
  .hw-play-disc::before{animation:none;opacity:0}
  .vp.is-waiting .vp-spin{animation-duration:2s}
}
