/* Animesh Verma portfolio. Ported from prototype v4.3.
   The page reads fine with no JavaScript. html.js means scripts are running;
   html[data-tier] says which version this device gets: high = computers, mobile = phones and tablets.
   html.nogl: the browser can't draw 3D, so the still pictures and plain tool cards stay. */

/* ---------- fonts (self-hosted, Latin only, text shows at once in a fallback font while these load) ---------- */
@font-face { font-family:'JetBrains Mono'; src:url(../fonts/jetbrains-mono.woff2) format('woff2'); font-weight:400 500; font-display:swap; }
@font-face { font-family:'Space Grotesk'; src:url(../fonts/space-grotesk.woff2) format('woff2'); font-weight:400 700; font-display:swap; }
@font-face { font-family:'Unbounded'; src:url(../fonts/unbounded-800.woff2) format('woff2'); font-weight:800; font-display:swap; }
@font-face { font-family:'Outfit'; src:url(../fonts/outfit-700.woff2) format('woff2'); font-weight:700; font-display:swap; }
@font-face { font-family:'Anybody'; src:url(../fonts/anybody-800-wdth.woff2) format('woff2'); font-weight:800; font-stretch:50% 150%; font-display:swap; }

:root { --bg:#050505; --ink:#e9e9ec; --dim:rgba(233,233,236,.55); --line:rgba(255,255,255,.18); --violet:#6b4bff; --violet2:#9d86ff; --red:#ff2a2a;
        --ease:cubic-bezier(.7,0,.2,1); --gut:clamp(16px,2.4vw,40px); color-scheme:dark; }
* { box-sizing:border-box; margin:0; padding:0; }
html { background:var(--bg); }
body { background:var(--bg); color:var(--ink); font-family:'Space Grotesk',sans-serif; overflow-x:hidden; }
body.locked { overflow:hidden; }
html.cursor-custom, html.cursor-custom a, html.cursor-custom button { cursor:none; }
a { color:inherit; text-decoration:none; }
ul { list-style:none; }
h1, h2, h3 { font:inherit; }
.mono { font-family:'JetBrains Mono',monospace; font-size:11px; letter-spacing:.08em; text-transform:uppercase; }
.lk { text-transform:none; border-bottom:1px solid rgba(255,255,255,.35); }
.dim { color:var(--dim); }
.vh { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
:focus-visible { outline:2px solid var(--violet2); outline-offset:3px; }
.chrome { background:linear-gradient(100deg,#2a2170 0%,#eef0ff 14%,#6b4bff 27%,#3a2f99 39%,#d4daff 52%,#7a5cff 64%,#f6f7ff 77%,#4a3bb0 90%,#eef0ff 100%);
  background-size:220% 100%; -webkit-background-clip:text; background-clip:text; color:transparent; animation:chrome 7s ease-in-out infinite alternate; }
@keyframes chrome { to { background-position:100% 0; } }

/* film grain over everything. It jiggles at most 3% each way, so 5% of overhang is enough (it used to be 50%: four screens of blending per frame).
   The noise is a baked picture: Chrome's own drawing of the old SVG noise tile (feTurbulence fractalNoise, baseFrequency .9,
   3 octaves, stitched, 160 px), saved at 1x and 2x. Generating that noise on the fly cost the graphics chip up to ~200 ms
   of freezes during the loading screen; the picture looks the same and costs nothing to draw. */
.grain { position:fixed; inset:-5%; pointer-events:none; opacity:.11; mix-blend-mode:overlay; z-index:90;
  background-image:-webkit-image-set(url(../media/grain-160.webp) 1x, url(../media/grain-320.webp) 2x);   /* older Safari */
  background-image:image-set(url(../media/grain-160.webp) 1x, url(../media/grain-320.webp) 2x); background-size:160px 160px;
  animation:grain .6s steps(4) infinite; }
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} }

/* ---------- custom cursor: only exists when JS turns it on (mouse devices, high/medium tier) ---------- */
#cur, #ring { position:fixed; left:0; top:0; pointer-events:none; z-index:100; mix-blend-mode:difference; display:none; }
html.cursor-custom #cur, html.cursor-custom #ring { display:block; }
#cur { width:6px; height:6px; background:#fff; border-radius:50%; margin:-3px 0 0 -3px; }
#ring { width:36px; height:36px; margin:-18px 0 0 -18px; border:1px solid #fff; transition:width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), border-radius .35s var(--ease); }
#ring.big { width:84px; height:84px; margin:-42px 0 0 -42px; border-radius:50%; }
#ring span { position:absolute; left:calc(100% + 8px); top:50%; transform:translateY(-50%); white-space:nowrap; color:#fff; font:500 10px 'JetBrains Mono',monospace; letter-spacing:.08em; }

#prog { position:fixed; top:0; left:0; height:2px; width:100%; background:var(--violet); transform-origin:left; transform:scaleX(0); z-index:80; }
header { position:fixed; top:0; left:0; right:0; display:flex; justify-content:space-between; align-items:center; padding:20px var(--gut); z-index:70; mix-blend-mode:difference; }
header nav a { margin-left:22px; }

/* ---------- loader: only when JS runs, never on the static tier ---------- */
#loader { display:none; }
html.js #loader { display:block; position:fixed; inset:0; background:#000; z-index:95; transition:clip-path 1.1s var(--ease); clip-path:inset(0 0 0 0); }
html.js #loader.done { clip-path:inset(0 0 100% 0); pointer-events:none; }
#scanbox { position:absolute; left:50%; top:50%; height:min(76vh,120vw); aspect-ratio:736/911; transform:translate(-50%,-50%); }
#scanbox .raw, #scanbox .xr { position:absolute; inset:0; background:url(../media/deity-600.webp) center/cover;
  background-image:image-set(url(../media/deity-600.avif) type('image/avif'), url(../media/deity-600.webp) type('image/webp')); }
#scanbox .raw { filter:invert(1) grayscale(1) sepia(.28) contrast(1.05) brightness(.6); }
#scanbox .xr  { filter:grayscale(.2) contrast(1.25) brightness(1.08); clip-path:inset(0 0 calc(100% - var(--s,0%)) 0); }
#scanbox .xr::after { content:''; position:absolute; inset:0; background:linear-gradient(transparent 60%, rgba(107,75,255,.18)); mix-blend-mode:screen; }
#scanline { position:absolute; left:-14%; right:-14%; top:var(--s,0%); height:2px; background:#fff; box-shadow:0 0 22px 5px rgba(150,130,255,.9); }
#scanline span { position:absolute; right:0; top:-18px; color:#fff; white-space:nowrap; }
#scanbox .brk { position:absolute; width:26px; height:26px; border:1px solid rgba(255,255,255,.8); }
#scanbox .b1 { left:-12px; top:-12px; border-right:0; border-bottom:0; } #scanbox .b2 { right:-12px; top:-12px; border-left:0; border-bottom:0; }
#scanbox .b3 { left:-12px; bottom:-12px; border-right:0; border-top:0; } #scanbox .b4 { right:-12px; bottom:-12px; border-left:0; border-top:0; }
.lock { position:absolute; width:9%; aspect-ratio:1; transform:translate(-50%,-50%) scale(1.8); border:1px solid #fff; opacity:0; transition:all .45s var(--ease); }
.lock.on { opacity:1; transform:translate(-50%,-50%) scale(1); }
.lock::before { content:'×'; position:absolute; left:50%; top:50%; transform:translate(-50%,-52%); color:var(--red); font:500 13px 'JetBrains Mono',monospace; }
.lock::after { content:attr(data-c); position:absolute; left:0; top:-15px; color:#fff; white-space:nowrap; font:400 9px 'JetBrains Mono',monospace; letter-spacing:.06em; }
#loader .hud { position:absolute; z-index:3; }
#lhint { left:var(--gut); bottom:var(--gut); line-height:1.8; }
#lpct { right:var(--gut); bottom:var(--gut); text-align:right; line-height:1.8; }
#lskip { right:var(--gut); top:var(--gut); }
#lskip button { background:none; border:0; color:var(--dim); font:inherit; letter-spacing:inherit; text-transform:inherit; }

/* ---------- motion language: scan reveal (only hides things when JS is there to reveal them) ---------- */
.rv { position:relative; }
html.js .rv { clip-path:inset(0 0 100% 0); transition:clip-path 1.2s var(--ease); }
.rv::after { content:''; position:absolute; left:0; right:0; top:0; height:2px; background:#fff; box-shadow:0 0 14px 3px rgba(150,130,255,.8); opacity:0; z-index:5; pointer-events:none; }
html.js .rv.in { clip-path:inset(0 0 0 0); }
.rv.in::after { animation:scanline 1.2s var(--ease) forwards; }
@keyframes scanline { 0%{top:0;opacity:1} 92%{opacity:1} 100%{top:100%;opacity:0} }

/* ---------- background-stage pattern ---------- */
section { position:relative; }
.stage { position:absolute; inset:0; z-index:0; }
.stage .pin { position:sticky; top:0; height:100vh; overflow:hidden; }
.front { position:relative; }   /* no z-index on purpose: the title video blends with the background behind it */
.glass { background:rgba(5,5,8,.42); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); }
.still img, .still { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }

/* ---------- 01 opening: background video and text layer share one 2268×1080 box that covers the screen ---------- */
#s1 { height:100vh; overflow:hidden; background:#000; }
/* The eye video is wide (2268 across, about a laptop browser window): the old 1920×1080 one enlarged 1.18× and cut top
   and bottom. That cut sliced NEW© 2026 and (+)VISUAL CREATIVE in half at the bottom edge, so the encode trims the
   bottom 36 rows (2268×1044, see media.json) and all the text marks sit on top as their own layer (.marks), pinned to
   the screen. So the video can always cover the screen without cutting any text: a 16:9 screen trims a slice of each
   side, an upright phone shows the middle. (The class name is older than the wide video.) Width is a % of the slide,
   not vw, so a desktop scrollbar never pushes the right edge off screen. */
#s1 .frame16x9 { position:absolute; left:50%; top:50%; width:max(100%,217.24vh); height:auto; aspect-ratio:2268/1044; transform:translate(-50%,-50%); }
#s1 .bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
/* where the text sits: x 96, y 390, 1744×552 in the 1920×1080 chrome clip, made for the old video. Enlarged 1.18125×
   like the video and moved up by the 97.9 rows cut off its top: centre at 50.42% / 65.98% of the 2268×1044 frame,
   90.833% of it wide. Where the cover crop would cut the word off (narrow screens), it shrinks to 92% of the screen
   width, centred on the same spot. */
#s1 #c1t, #s1 .chrome-still { position:absolute; left:50.42%; top:65.98%; width:min(90.833%, 92vw); height:auto; aspect-ratio:1744/552;
  translate:-50% -50%; display:block; pointer-events:none; }
#s1 .chrome-still img { width:100%; height:100%; display:block; }
#s1 #c1t { display:none; }
/* the credits that used to be baked into the video's edges, as text in their own layer pinned to the screen (not the
   frame), so they move into place on any window shape and are never cut. Drawn like the originals: small grotesk
   capitals, "pinaki" in a serif. The top line sits below the header. */
#s1 .marks { position:absolute; inset:0; pointer-events:none; color:#fff; font:500 clamp(10px, .78vw, 15px) / 1.05 'Space Grotesk',sans-serif; text-transform:uppercase; letter-spacing:.01em; }
#s1 .marks .top { position:absolute; top:64px; left:50%; translate:-50% 0; white-space:nowrap; }
#s1 .marks .bottom { position:absolute; left:var(--gut); right:var(--gut); bottom:var(--gut); display:flex; justify-content:space-between; align-items:flex-end; gap:16px; }
#s1 .marks .bottom > span { display:flex; flex-direction:column; }
#s1 .marks .new b { font-weight:inherit; margin-left:2.4em; }
#s1 .marks .sig { font:400 2.1em / 1 Georgia,'Times New Roman',serif; text-transform:none; margin:.35em 0 .3em; letter-spacing:-.01em; }
#s1 .marks .mid { text-align:center; max-width:40vw; }
#s1 .marks .right { text-align:right; align-items:flex-end; }
#s1 .marks .right .tp { margin-top:2.6em; }
#s1.text-live #c1t { display:block; }
#s1.text-live .chrome-still { visibility:hidden; }
/* the X-ray lens: until the video plays it inverts what is behind it (under the text); then, as a canvas (.cv), it sits
   above the text and draws video and text itself, so the word turns X-ray inside it too */
.lens { --r:110px; display:none; position:absolute; left:0; top:0; width:calc(var(--r) * 2); height:calc(var(--r) * 2); margin:calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border-radius:50%; pointer-events:none;
  /* X-ray: invert + contrast, then tinted violet (sepia gives a hue to the grey picture, hue-rotate turns it violet) */
  -webkit-backdrop-filter:invert(1) contrast(1.4) brightness(1.05) sepia(.85) hue-rotate(212deg) saturate(2.4);
  backdrop-filter:invert(1) contrast(1.4) brightness(1.05) sepia(.85) hue-rotate(212deg) saturate(2.4);
  box-shadow:0 0 0 1px rgba(255,255,255,.9), 0 0 40px rgba(107,75,255,.35), inset 0 0 calc(var(--r) * .7) rgba(107,75,255,.55); }   /* inner glow: bright areas (inverted to black) read as deep violet */
/* once the video plays, a canvas shows it magnified 1.25x and dyed violet (opening.js); CSS inverts it, like the prototype */
.lens canvas { position:absolute; inset:0; width:100%; height:100%; border-radius:50%; display:block; filter:invert(1) contrast(1.4) brightness(1.05); }
.lens.cv { z-index:1; -webkit-backdrop-filter:none; backdrop-filter:none; overflow:hidden; box-shadow:0 0 0 1px rgba(255,255,255,.9), 0 0 40px rgba(107,75,255,.35); }
.lens::before { content:''; position:absolute; inset:0; border-radius:50%; z-index:1; background:repeating-linear-gradient(to bottom, rgba(0,0,0,.12) 0 1px, transparent 1px 3px); }   /* scanlines */
/* the lens HUD: ring ticks, X-RAY readout, three trailing tracker boxes (drawn by opening.js) */
.xray { display:none; z-index:2; position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; font:500 10px 'JetBrains Mono',monospace; }
.xray line, .xray path, .xray rect { fill:none; stroke-width:1; vector-effect:non-scaling-stroke; }
.xray .tick { stroke:rgba(255,255,255,.9); } .xray path { stroke:rgba(255,255,255,.55); stroke-dasharray:3 4; } .xray rect { stroke:rgba(255,255,255,.85); }
.xray text { fill:#fff; } .xray .x { fill:#ff2a2a; font-size:13px; } .xray .c { font-size:9px; font-weight:400; }
html[data-tier]:not(.nogl) .lens, html[data-tier]:not(.nogl) .xray { display:block; }

/* ---------- 02 who ---------- */
#s2 .vstage { position:relative; height:100vh; overflow:hidden; background:#000; }
/* like slide 1, the intro video is 2268×1080 without its name badge (the badge is its own layer, .sticker), so it
   always covers the screen. No parallax, no shade over it. */
#s2 .vstage video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
/* the ANIMESH VERMA badge, pinned bottom-left with the page's safe margin, sized with the screen */
#s2 .sticker { position:absolute; left:var(--gut); bottom:var(--gut); width:clamp(220px, 34vw, 720px); pointer-events:none; }
#s2 .sticker img { width:100%; height:auto; display:block; }
#tools { position:absolute; right:0; top:50%; transform:translateY(-50%); z-index:4; }
#tools .cap { position:absolute; right:var(--gut); bottom:calc(100% + 10px); display:flex; flex-direction:column; align-items:flex-end; gap:4px; opacity:0; transition:opacity .6s; }
#tools .cap.on { opacity:1; }
#tools .cap span { background:rgba(0,0,0,.72); padding:4px 7px; white-space:nowrap; }
/* tool tiles: flat HUD panels, plain HTML, the same on every device (the user's pick, option D of the tile styles).
   Dark blurred glass with thin white lines; hover (or keyboard focus) flips one to white, a scan line sweeps down and
   corner brackets snap on, and what the tool is for shows beside it. They slide in one after another (tools.js). */
.hudtiles { --ts:clamp(78px, min(14.5vh, 24vw), 124px); display:flex; flex-direction:column; align-items:flex-end; gap:12px; padding-right:var(--gut); perspective:700px; }
.hudtiles li { position:relative; width:var(--ts); outline:none; }
html.js .hudtiles li { transition:transform .8s var(--ease), opacity .7s; }
html.js .hudtiles.away li { transform:translateX(calc(100% + var(--gut) + 40px)) rotateY(-35deg); opacity:0; }
html.js .hudtiles li:nth-child(2) { transition-delay:.18s; } html.js .hudtiles li:nth-child(3) { transition-delay:.36s; } html.js .hudtiles li:nth-child(4) { transition-delay:.54s; }
.hudtiles .t { position:relative; aspect-ratio:1; border:1px solid rgba(255,255,255,.75); background:rgba(0,0,0,.5); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  display:grid; place-items:center; color:#fff; overflow:hidden; container-type:inline-size; transition:transform .5s var(--ease), background .35s, color .35s; }
.hudtiles .ab { font:800 34cqw/1 'Unbounded',sans-serif; letter-spacing:-.03em; }
.hudtiles .nm { position:absolute; bottom:7cqw; left:0; right:0; text-align:center; font:500 6.4cqw 'JetBrains Mono',monospace; letter-spacing:.06em; opacity:.8; }
.hudtiles .n { position:absolute; top:6cqw; left:7cqw; font:400 6cqw 'JetBrains Mono',monospace; opacity:.7; }
.hudtiles .x { position:absolute; top:5cqw; right:7cqw; color:var(--red); font:500 8cqw 'JetBrains Mono',monospace; }
.hudtiles .t::after { content:''; position:absolute; left:0; right:0; top:-4px; height:2px; background:#fff; box-shadow:0 0 12px 3px rgba(150,130,255,.8); opacity:0; }
.hudtiles li:hover .t, .hudtiles li:focus-visible .t { background:#e9e9ec; color:#000; transform:translateX(-6%); }
.hudtiles li:hover .t::after, .hudtiles li:focus-visible .t::after { animation:sweep .9s var(--ease); }
.hudtiles li:hover .nm, .hudtiles li:hover .n, .hudtiles li:focus-visible .nm, .hudtiles li:focus-visible .n { opacity:1; }
@keyframes sweep { 0%{top:-4px;opacity:1} 100%{top:100%;opacity:0} }
.hudtiles i.k { position:absolute; width:12cqw; height:12cqw; border:1px solid #fff; opacity:0; transition:all .4s var(--ease); }
.hudtiles .k.a { left:-10cqw; top:-10cqw; border-right:0; border-bottom:0; } .hudtiles .k.b { right:-10cqw; top:-10cqw; border-left:0; border-bottom:0; }
.hudtiles .k.c { left:-10cqw; bottom:-10cqw; border-right:0; border-top:0; } .hudtiles .k.d { right:-10cqw; bottom:-10cqw; border-left:0; border-top:0; }
.hudtiles li:hover i.k, .hudtiles li:focus-visible i.k { opacity:1; border-color:#000; }
.hudtiles li:hover .k.a, .hudtiles li:focus-visible .k.a { left:4cqw; top:4cqw; } .hudtiles li:hover .k.b, .hudtiles li:focus-visible .k.b { right:4cqw; top:4cqw; }
.hudtiles li:hover .k.c, .hudtiles li:focus-visible .k.c { left:4cqw; bottom:4cqw; } .hudtiles li:hover .k.d, .hudtiles li:focus-visible .k.d { right:4cqw; bottom:4cqw; }
.hudtiles .use { position:absolute; right:calc(100% + 14px); top:50%; translate:0 -50%; white-space:nowrap; background:#000; border:1px solid rgba(255,255,255,.7); padding:6px 9px;
  font-style:normal; opacity:0; transition:opacity .2s; pointer-events:none; }
.hudtiles li:hover .use, .hudtiles li:focus-visible .use { opacity:1; }
#toolTab { position:absolute; right:0; top:50%; transform:translate(100%,-50%); transition:transform .6s var(--ease); writing-mode:vertical-rl;
  background:rgba(5,5,8,.55); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); color:#fff; border:1px solid rgba(255,255,255,.35); border-right:0; padding:16px 8px; font:500 10px 'JetBrains Mono',monospace; letter-spacing:.12em; text-transform:uppercase; }
#toolTab span { color:var(--violet2); }
#toolTab.on { transform:translate(0,-50%); }
#toolTab:hover { background:#fff; color:#000; }
.strip { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--gut); padding:28px var(--gut); border-bottom:1px solid var(--line); background:#050505; position:relative; z-index:2; }
.strip > div { border-left:1px solid var(--line); padding-left:14px; line-height:2; }

/* ---------- 03 motion graphics ---------- */
#s3 { padding:18vh 0 22vh; }
#s3 .pin { background:#000; }
#s3 .blurfill { position:absolute; inset:-10%; width:120%; height:120%; object-fit:cover; filter:blur(40px) grayscale(1) brightness(.35); }
html[data-tier="mobile"] #s3 .blurfill { display:none; }
#s3 .sharp { position:absolute; left:50%; top:0; height:100%; aspect-ratio:9/16; transform:translateX(-50%); object-fit:cover; filter:grayscale(1) contrast(1.15) brightness(.75);
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 18%,#000 82%,transparent); mask-image:linear-gradient(90deg,transparent,#000 18%,#000 82%,transparent); }
.torch { position:absolute; inset:0; background:radial-gradient(circle 26vmax at var(--x,50%) var(--y,50%), rgba(0,0,0,0) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,.78) 100%); pointer-events:none; }
.bglabel { position:absolute; z-index:3; left:var(--gut); bottom:var(--gut); }

/* ---------- 04 reels ---------- */
#s4 { padding:22vh 0 40vh; }
#s4 .pin { background:#000; }
#s4 .reelstrip { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }   /* the film strip video (no 3D: it plays on every device). Not ".strip": that name is the slide-2 info bar */
#s4 .reelstrip.tall { display:none; }
@media (max-aspect-ratio: 1/1) { #s4 .reelstrip.wide { display:none; } #s4 .reelstrip.tall { display:block; } }   /* phones / tall windows: the upright version */

/* ---------- section headings: the "Motion Graphics" title animation, rebuilt as text so every section gets it ----------
   Same font (Outfit), same size (the original title filled 73% of the screen width), centred. Every 4.5 s it jolts for a
   quarter of a second, frame for frame like the video: wide+flat (2 frames), narrow+tall (2 frames), extra wide (1 frame).
   step-end holds each pose like a video frame instead of easing between them. */
.sechead { font:700 var(--hs) / 1 'Outfit',sans-serif; letter-spacing:-.035em; text-align:center; padding:4vw var(--gut) 3vw; white-space:nowrap; --hs:10.4vw; }
.sechead span { display:inline-block; transform-origin:50% 50%; }
.sechead.in span { animation:jolt 4.5s -.5s step-end infinite; }
/* the work section titles are short animations, white letters on black: "screen" lets only the letters show over the
   page. No .rv reveal on these headings: its clip-path would cut the blend off from the page behind. The words are
   in the page as hidden text. */
.sechead.tag { padding:2.2vw var(--gut) 1.4vw; }
.tagvid { display:block; width:min(100%, 1500px); height:auto; aspect-ratio:1920/360; margin:0 auto; mix-blend-mode:screen; pointer-events:none; }
@keyframes jolt {
  0% { transform:none; }
  39.1% { transform:scale(1.22,.36); }
  40.9% { transform:scale(.44,1.84); }
  42.7% { transform:scale(1.36,.39); }
  43.6%, 100% { transform:none; }
}
@keyframes squash { 0%,86%,100%{font-variation-settings:'wdth' 100} 89%{font-variation-settings:'wdth' 52} 93%{font-variation-settings:'wdth' 150} 96%{font-variation-settings:'wdth' 70} }

/* ---------- work tiles ---------- */
.grid { --gap:clamp(12px,1.6vw,28px); display:grid; grid-template-columns:repeat(3,1fr); gap:var(--gap); padding:28px var(--gut) 0; perspective:1000px; }
.grid.reels { display:flex; flex-wrap:wrap; justify-content:center; --cols:4; }   /* 4 on top, the rest centred below */
.grid.reels > .tile { width:calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
.grid > * { min-width:0; }
.reels .tile .meta { flex-direction:column; gap:3px; }   /* portrait tiles are narrow: client under the title, so titles fit */   /* let tiles shrink below their longest title (the title cuts off with …) instead of widening the page */
.tile { transform-style:preserve-3d; transition:transform .5s var(--ease); }
.tile .slot { position:relative; aspect-ratio:16/10; border:1px dashed rgba(255,255,255,.32); display:grid; place-items:center; text-align:center; color:rgba(255,255,255,.55); overflow:visible; }
.tile .slot img, .tile .slot video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.reels .tile .slot { aspect-ratio:9/16; }
.brk2 { position:absolute; width:16px; height:16px; border:1px solid #fff; opacity:0; transition:all .45s var(--ease); }
.brk2.a { left:-14px; top:-14px; border-right:0; border-bottom:0; } .brk2.b { right:-14px; top:-14px; border-left:0; border-bottom:0; }
.brk2.c { left:-14px; bottom:-14px; border-right:0; border-top:0; } .brk2.d { right:-14px; bottom:-14px; border-left:0; border-top:0; }
.tile:hover .brk2, .cta:hover .brk2 { opacity:1; } .tile:hover .brk2.a { left:-1px; top:-1px; } .tile:hover .brk2.b { right:-1px; top:-1px; }
.tile:hover .brk2.c { left:-1px; bottom:-1px; } .tile:hover .brk2.d { right:-1px; bottom:-1px; }
.tile .meta { display:flex; justify-content:space-between; gap:12px; margin-top:10px; text-shadow:0 0 8px #000; }
.tile .meta h3 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tile .meta p { flex:none; }
/* a tile with a real piece: poster picture, hover preview on top of it, runtime in the corner */
.tile .slot:has(img) { border:1px solid rgba(255,255,255,.16); background:#000; }
.tile .slot img, .tile .slot video.preview { filter:saturate(.8) brightness(.86); transition:filter .5s var(--ease); }
.tile:hover .slot img, .tile:hover .slot video.preview, .tile:focus-visible .slot img, .tile:focus-visible .slot video.preview { filter:none; }
.tile .slot video.preview { z-index:1; opacity:0; }
.tile .slot video.preview.ready { opacity:1; }
.tile .len { position:absolute; z-index:2; right:8px; bottom:8px; padding:3px 6px; background:rgba(0,0,0,.72); color:#fff; font-size:10px; }
.tile .len::before { content:'▶ '; color:var(--red); }


/* ---------- 04 long-form: the pegasus scan behind, 16:9 films ---------- */
#long { padding:22vh 0 30vh; border-top:1px solid var(--line); }
#long .pin { background:#000; }
#long .bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.55; }
#long .shade { position:absolute; inset:0; background:linear-gradient(180deg, rgba(5,5,5,.92) 0%, rgba(5,5,5,.45) 32%, rgba(5,5,5,.45) 68%, rgba(5,5,5,.94) 100%); }
#long .bglabel span { font-variant-numeric:tabular-nums; }
.lfhead { position:relative; }
.lfsub { padding:14px var(--gut) 0; }
.films .tile .slot { aspect-ratio:16/9; }

/* ---------- 05 contact ---------- */
#s5 { min-height:110vh; border-top:1px solid var(--line); }
#s5 .pin { background:#000; }
#s5 canvas { position:absolute; inset:0; width:100%; height:100%; display:none; }
html[data-tier]:not(.nogl) #s5 canvas { display:block; }
#s5 .still img { object-position:72% 50%; }   /* keep the figure (right of the picture) in frame on narrow screens */
/* upright screens: "cover" zoomed into the middle of the head (loose specks all over); instead show the whole head
   (the right half of the picture, centred at 65%) across the width, like the live dots do */
@media (max-aspect-ratio:1/1) { #s5 .still img { inset:auto; left:50%; top:50%; width:170%; height:auto; translate:-65% -50%; } }
#s5.gl-live .still { opacity:0; visibility:hidden; }   /* the live dots have drawn: the still fades out under them */
/* still picture → live 3D is a crossfade, never a snap: the canvas fades in as the picture fades out */
#s5 .still { transition:opacity .9s var(--ease), visibility 0s .9s; }
#s5 canvas { opacity:0; transition:opacity .9s var(--ease); }
#s5.gl-live canvas { opacity:1; }
#s5 .veil { position:absolute; inset:0; background:linear-gradient(90deg, rgba(5,5,5,.92) 0%, rgba(5,5,5,.6) 38%, transparent 62%); pointer-events:none; }
#s5 .front { padding:20vh var(--gut) 12vh; max-width:960px; }   /* wide enough for "something." at the largest text size (the reveal clip would cut it) */
#s5 .big { font:800 clamp(44px,6.4vw,120px)/.95 'Unbounded',sans-serif; letter-spacing:-.03em; margin:20px 0 36px; }
.cta { position:relative; display:inline-flex; gap:16px; align-items:center; padding:16px 22px; border:1px solid rgba(255,255,255,.6); font:500 12px 'JetBrains Mono',monospace; letter-spacing:.1em; text-transform:uppercase; transition:background .45s var(--ease), color .45s var(--ease); }
.cta .arr { transition:transform .45s var(--ease); } .cta:hover { background:#fff; color:#000; } .cta:hover .arr { transform:translateX(6px); }
.cta:hover .brk2.a { left:-7px; top:-7px; } .cta:hover .brk2.b { right:-7px; top:-7px; } .cta:hover .brk2.c { left:-7px; bottom:-7px; } .cta:hover .brk2.d { right:-7px; bottom:-7px; }
.services { display:grid; grid-template-columns:1fr 1fr; gap:0 32px; margin:48px 0 40px; max-width:560px; }
.services > li { border-top:1px solid var(--line); padding:13px 0; transition:color .3s, padding .45s var(--ease); }
.services > li:hover { color:var(--violet2); padding-left:8px; }
.rows { display:flex; gap:44px; flex-wrap:wrap; line-height:2.1; }

/* ---------- footer ---------- */
#s6 { border-top:1px solid var(--line); padding-top:8vh; }
.marq { overflow:hidden; white-space:nowrap; border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:2.2vw 0; }
.marq .track { display:inline-flex; align-items:center; animation:marq 32s linear infinite; }
.marq:hover .track { animation-duration:80s; }
.marq span { font-family:'Anybody',sans-serif; font-weight:800; font-size:6.4vw; line-height:1; text-transform:uppercase; padding:0 2.2vw; font-variation-settings:'wdth' 100; animation:squash 4.2s infinite; }
.marq span:nth-child(4n+3) { animation-delay:1.4s; } .marq span:nth-child(4n+1) { animation-delay:2.8s; }
.marq em { font-style:normal; color:var(--red); font:500 2.6vw 'JetBrains Mono',monospace; }
@keyframes marq { to { transform:translateX(-50%); } }
.bar { display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; padding:22px var(--gut) 64px; }

/* ---------- graphics: 3 big upright boxes on top, 5 small below (leftovers centred, like Reels) ---------- */
#graphics { padding:18vh 0 22vh; }
.gfxgrid { --gap:clamp(10px,1.4vw,24px); display:flex; flex-direction:column; gap:var(--gap); padding:28px var(--gut) 0; }
.gfxrow { display:flex; flex-wrap:wrap; justify-content:center; gap:var(--gap); }
.gfx { position:relative; display:block; padding:0; border:0; background:#0d0d0d; overflow:hidden; color:inherit; font:inherit; }
.gfx.big { width:calc((100% - 2 * var(--gap)) / 3); aspect-ratio:4/5; }
.gfx.small { width:calc((100% - 4 * var(--gap)) / 5); aspect-ratio:15/14; }
.gfx picture, .gfx img { display:block; width:100%; height:100%; }
.gfx img { object-fit:cover; transition:transform .8s var(--ease); }
.gfx:hover img, .gfx:focus-visible img { transform:scale(1.035); }
.gfx:focus-visible { outline:1px solid #fff; outline-offset:4px; }

/* ---------- graphics viewer: one picture at a time, whole, on black ---------- */
#viewer { position:fixed; inset:0; width:100vw; height:100vh; max-width:none; max-height:none; border:0; background:#000; color:#fff; padding:0; }
#viewer::backdrop { background:#000; }
html:has(#viewer[open]) { overflow:hidden; }
#viewer picture { position:absolute; inset:64px clamp(56px,7vw,110px); display:flex; align-items:center; justify-content:center; }
#viewer img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; display:block; }
#viewer button { position:absolute; z-index:2; background:none; border:1px solid rgba(255,255,255,.6); color:#fff; padding:10px 14px; }
#viewer .close { right:var(--gut); top:var(--gut); }
#viewer .prev, #viewer .next { top:50%; translate:0 -50%; font-size:18px; padding:12px 16px; }
#viewer .prev { left:var(--gut); } #viewer .next { right:var(--gut); }
#viewer .count { position:absolute; left:50%; bottom:var(--gut); translate:-50% 0; }

/* ---------- work player ---------- */
#player { position:fixed; inset:0; width:100vw; height:100vh; max-width:none; max-height:none; border:0; background:#000; color:#fff; padding:0; }
#player::backdrop { background:#000; }
#player video { width:100%; height:100%; object-fit:contain; }
#player .close { position:absolute; z-index:2; right:var(--gut); top:var(--gut); background:none; border:1px solid rgba(255,255,255,.6); color:#fff; padding:10px 14px; }

/* ---------- debug badge (only with ?debug) ---------- */
#tierbadge { position:fixed; left:8px; bottom:8px; z-index:200; background:#000; color:#9d86ff; border:1px solid #9d86ff; padding:4px 8px; font:500 11px 'JetBrains Mono',monospace; }

/* ---------- no motion: anyone whose device asks for reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; }
  html.js .rv { clip-path:none; }
}

@media (max-width:760px) {
  .grid { grid-template-columns:1fr 1fr; }
  .grid.reels { --cols:2; }
  .grid.films { grid-template-columns:1fr; }
  .gfx.big { width:calc((100% - var(--gap)) / 2); }
  .gfx.small { width:calc((100% - 2 * var(--gap)) / 3); }
  #viewer picture { inset:64px 8px 72px; }
  #viewer .prev, #viewer .next { top:auto; bottom:calc(var(--gut) - 6px); translate:none; }
  header nav { white-space:nowrap; }   /* five links: kept on one line */
  header nav a { margin-left:10px; letter-spacing:.02em; }
  .tile .meta { flex-direction:column; gap:3px; }   /* narrow tiles: client under the title, so the title gets the full width */
  #idxname { display:none; }   /* the counter stays; the section name would push the links off a phone screen */
  .strip { grid-template-columns:1fr; }
  #tools canvas { height:58vh; }
  #s5 .veil { background:rgba(5,5,5,.6); }
  .services { grid-template-columns:1fr; }
}
