/* Hero viewer for the home page (test copy): photos with depth parallax + AF, clips with focus rack + tracked AF point.
   Everything is positioned inside the hero stage (#wst), nothing outside it. */
:root { --af-ok: #38f06a; --af-mono: "Roboto Mono", ui-monospace, Menlo, monospace; }

/* work.js' own hero rotation is switched off (WORKSTILLS is emptied in the markup). The videos are only visible when the viewer shows a clip,
   and they never cross-fade (a fade would let the previous item show through the next). */
.wst .wbv { opacity: 0 !important; transition: none !important; }
.wst .wbv.afv-show { opacity: 1 !important; }
/* first paint: already out of focus, before any script runs. The sharp poster of work.js is never visible. */
.wst:not(.afv-live)::before { content: ""; position: absolute; inset: -60px; z-index: 0; background: url(/media/pages/hero/glitch-m.jpg) center / cover no-repeat; filter: blur(26px) saturate(.85) brightness(1.04); }
.wst { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.afv-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none; }
.afv-gl.afv-on { opacity: 1; }
.afv-gl.afv-first { transition: opacity .4s ease; }

/* focus rack on clips: a blur layer over the video, removed completely at lock */
.afh-blur { position: absolute; inset: -48px; z-index: 1; pointer-events: none; display: none; }
.afh-blur.on { display: block; }
/* bulb flash on clips (grain, vignette, white), photos do theirs in the shader */
.afv-fl, .afv-fv, .afv-fg { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; }
.afv-fl { background: #fff; }
.afv-fv { background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, .75) 100%); }
.afv-fg { background-size: 128px 128px; mix-blend-mode: overlay; }

/* Flexible Spot frame */
.afh-fr { position: absolute; left: 0; top: 0; z-index: 4; width: var(--w, 108px); height: var(--h, 68px); pointer-events: none; opacity: 0; color: #fff; will-change: transform; }
.afh-fr.on { opacity: 1; }
.afh-fr.lock { color: var(--af-ok); }
.afh-fr .b { position: absolute; width: 14%; height: 14%; min-width: 5px; min-height: 5px; border: 0 solid currentColor; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .7)); }
.afh-fr .tl { left: 0; top: 0; border-left-width: 1.5px; border-top-width: 1.5px; }
.afh-fr .tr { right: 0; top: 0; border-right-width: 1.5px; border-top-width: 1.5px; }
.afh-fr .bl { left: 0; bottom: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.afh-fr .br { right: 0; bottom: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; }
/* phones: a clearly visible square: thicker lines, longer dashes, full opacity, dark edge for contrast on any picture */
.afh-fr.phone.on { opacity: .72; }
.afh-fr.phone.on.lock { opacity: .85; }
.afh-fr.phone .b { width: 26%; height: 26%; min-width: 8px; min-height: 8px; filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .9)) drop-shadow(0 0 4px rgba(0, 0, 0, .45)); }
.afh-fr.phone .tl { border-left-width: 1.75px; border-top-width: 1.75px; } .afh-fr.phone .tr { border-right-width: 1.75px; border-top-width: 1.75px; }
.afh-fr.phone .bl { border-left-width: 1.75px; border-bottom-width: 1.75px; } .afh-fr.phone .br { border-right-width: 1.75px; border-bottom-width: 1.75px; }

/* HUD like a camera screen: top centre = REC + timecode (clips only), bottom centre = camera values + AF label */
.afv-top, .afv-bot { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; white-space: nowrap; pointer-events: none;
  font: 500 11px/1 var(--af-mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .92); text-shadow: 0 0 8px rgba(0, 0, 0, .85), 0 0 2px rgba(0, 0, 0, .9); font-variant-numeric: tabular-nums; }
.afv-top { top: 86px; gap: 14px; opacity: 0; transition: opacity .3s; }
.afv-top.clip { opacity: 1; }
.afv-top .rec { display: inline-flex; align-items: center; gap: 7px; }
.afv-top .rec i { width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 6px rgba(255, 59, 48, .7); animation: afvrec 1.6s steps(1) infinite; }
.afv-bot { bottom: calc(clamp(18px, 3.5vh, 36px) + 46px + env(safe-area-inset-bottom, 0px)); gap: clamp(10px, 1.6vw, 22px); flex-wrap: wrap; max-width: calc(100% - 2 * var(--pad, 16px)); opacity: 0; transition: opacity .6s ease; }
.afv-bot.on { opacity: 1; }
.afv-bot .s[hidden] { display: none; }
.afv-bot .s { transition: opacity .25s ease; }
.afv-bot .s.out { opacity: 0; }
.afv-bot .afl { display: inline-flex; align-items: center; gap: 7px; }
.afv-bot .afl b { font-weight: 500; }
.afv-bot .afl .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); }
.afv-bot .afl.seek .dot { animation: afvblink .42s steps(1) infinite; }
.afv-bot .afl.lock .dot { background: var(--af-ok); }
.afv-bot .afl.lock b { color: var(--af-ok); }
@keyframes afvrec { 50% { opacity: .15; } }
@keyframes afvblink { 50% { opacity: .15; } }
@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait) {
  .afv-top { top: 70px; font-size: 10px; }
  .afv-bot { font-size: 11.5px; letter-spacing: .05em; gap: 5px 11px; bottom: calc(clamp(18px, 3.5vh, 36px) + 48px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .afv-top .rec i, .afv-bot .afl.seek .dot { animation: none; } .afv-gl.afv-first, .afv-bot { transition: none; } }

/* iOS only: the tiny opt-in tilt icon (28 px icon in a 44 px tap target), bottom right on the HUD row, white at 70%, Sony green when on */
.afv-tiltbtn { position: absolute; z-index: 5; width: 44px; height: 44px; padding: 0; margin: 0; border: 0; background: none; display: grid; place-items: center; color: #fff; opacity: 0; pointer-events: auto; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  right: max(calc(var(--pad, 16px) - 8px), env(safe-area-inset-right, 0px)); bottom: calc(clamp(18px, 3.5vh, 36px) + 38px + env(safe-area-inset-bottom, 0px)); transition: opacity .4s ease, color .25s ease; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .35)); }
.afv-tiltbtn.in { opacity: .7; }
.afv-tiltbtn.on { color: var(--af-ok); }
.afv-hastilt .afv-bot { max-width: calc(100% - 2 * (44px + var(--pad, 16px))); }
@media (prefers-reduced-motion: reduce) { .afv-tiltbtn { transition: none; } }

/* phones: vertical photos get a matching blurred first paint, and a soft dark fade under the text block and the nav for readability
   (z-index 0: above the picture, below the blur / flash layers, the headline, the AF frame and the HUD) */
@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait) {
  .wst:not(.afv-live)::before { background-image: url(/media/work/glitch-festival/15-m.webp); }
  .wst::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(to top, var(--ink, #08080a) 0, rgba(8, 8, 10, .82) 8%, rgba(8, 8, 10, .62) 34%, rgba(8, 8, 10, .3) 58%, rgba(8, 8, 10, 0) 78%), linear-gradient(to bottom, rgba(8, 8, 10, .6) 0, rgba(8, 8, 10, 0) 22%); }
}

/* phones held sideways: the REC row sits right under the nav bar, the values row stays at the bottom edge */
@media (orientation: landscape) and (max-height: 520px) {
  .afv-top { top: 62px; font-size: 10px; }
  .afv-bot { font-size: 11px; gap: 4px 10px; bottom: calc(14px + 40px + env(safe-area-inset-bottom, 0px)); }
}

/* clip focus peaking overlay: above the blur layer, below the AF frame; the script sizes it to the video */
.afh-peak { position: absolute; z-index: 2; pointer-events: none; opacity: 0; image-rendering: auto; }

/* film grain over the hero: SVG turbulence as a tile, shifted in steps so it flickers like real grain; overlay blend keeps colours; static with reduced motion */
.afh-grain { position: absolute; inset: -60px; z-index: 3; pointer-events: none; opacity: .11; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 1.6 -.3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px; animation: afgrain .9s steps(1) infinite; will-change: transform; }
@keyframes afgrain { 0% { transform: translate(0, 0); } 12% { transform: translate(-37px, 21px); } 25% { transform: translate(24px, -43px); } 37% { transform: translate(-51px, -12px); } 50% { transform: translate(33px, 38px); } 62% { transform: translate(-18px, 52px); } 75% { transform: translate(47px, -27px); } 87% { transform: translate(-29px, -48px); } }
@media (prefers-reduced-motion: reduce) { .afh-grain { animation: none; } }

/* the home banner fades into the page at the bottom instead of ending in a line (the text and the HUD stay above it) */
.wst::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(to top, var(--ink, #08080a) 0, rgba(8, 8, 10, 0) 24%); }

/* ---- 2026-11-06: banner updates ported from the lab version ---- */
/* first paint: already out of focus, with the new first banner (desktop / phone) */
.wst:not(.afv-live)::before { background-image: url(/media/pages/hero/glitch-d-m.jpg); }
@media (max-width: 760px), (pointer: coarse) { .wst:not(.afv-live)::before { background-image: url(/media/pages/hero/rrf-mo-m.jpg); } }
/* phone: the headline sat on bright light (Classified lasers, smoke, flames, fire jets): a soft dark veil behind the title block, those banners only */
@media (max-width: 760px) {
  .wst[data-hero="classified-mo"]::after, .wst[data-hero="27-mo"]::after, .wst[data-hero="01"]::after, .wst[data-hero="18-mo"]::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 64%; z-index: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8, 8, 10, .74) 0%, rgba(8, 8, 10, .6) 30%, rgba(8, 8, 10, .26) 62%, rgba(8, 8, 10, 0) 100%); }
}
/* no hard edge where the banner ends: the last stretch fades into the page behind it while scrolling */
.wst { -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 150px), rgba(0, 0, 0, .5) calc(100% - 70px), transparent 100%); mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 150px), rgba(0, 0, 0, .5) calc(100% - 70px), transparent 100%); }
/* camera settings fade out as the page scrolls down (--hf runs 1 to 0, set by af-hero.js) */
.afv-bot.on { opacity: var(--hf, 1); transition: opacity .15s linear; }
.afv-top.clip { opacity: var(--hf, 1); transition: opacity .15s linear; }

/* phone: the headline sat on the light bar (Ahoy), on the portrait's bright wall (Michelle) and on the hall lights (Job Jobse): soft veil, these banners only */
@media (max-width: 760px) {
  .wst[data-hero="10-mo"]::after, .wst[data-hero="23"]::after, .wst[data-hero="rrf-mo"]::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 58%; z-index: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8, 8, 10, .66) 0%, rgba(8, 8, 10, .5) 32%, rgba(8, 8, 10, .2) 64%, rgba(8, 8, 10, 0) 100%); }
}
