:root{color-scheme:dark;--ink:#0a0a0b;--fg:#efeee9;--dim:#7c7c80;--mid:#8d8d90;--acc:#ff4a1c;--split:46%;--ease:cubic-bezier(.2,.7,.1,1)}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden;overscroll-behavior:none}
body{background:var(--ink);color:var(--fg);font-family:"Inter Tight",system-ui,sans-serif;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
:focus-visible{outline:1px solid var(--fg);outline-offset:4px}
.mono,.h{font:400 10.5px/1.4 "JetBrains Mono",monospace;letter-spacing:.14em;text-transform:uppercase}
.mono{color:var(--dim)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.skip{position:absolute;left:12px;top:-60px;z-index:20;background:var(--fg);color:var(--ink);padding:10px 14px}
.skip:focus{top:12px}

/* ---------- stage: the carousel ---------- */
.stage{position:absolute;left:0;top:0;width:var(--split);height:100%;overflow:hidden;background:#0d0d0e;touch-action:pan-y;cursor:grab;z-index:2;
  transition:width .55s var(--ease) .15s,height .55s var(--ease) .15s}
.stage:active{cursor:grabbing}
.tracks{position:absolute;inset:0;perspective:1400px;perspective-origin:50% 50%}
.track{position:absolute;inset:0;visibility:hidden;transform-style:preserve-3d}
.track.on{visibility:visible;z-index:1}
.track.out{visibility:visible;z-index:0}
.shot{position:absolute;inset:0;transform-origin:50% 50%;will-change:transform,opacity;backface-visibility:hidden}
.shot img{width:100%;height:100%;object-fit:cover;display:block;filter:grayscale(1) contrast(1.08) brightness(.86);transition:filter .9s ease;user-select:none;-webkit-user-drag:none;pointer-events:none}
.shot.live img{filter:grayscale(0) contrast(1.04) brightness(.95)}
.shot.wide{overflow:hidden}
.shot.wide::before{content:"";position:absolute;inset:-60px;background:var(--bg) center/cover;filter:blur(34px) grayscale(1) brightness(.32)}
body:not(.ph) .shot.wide img{position:absolute;left:0;top:19%;height:62%}
.shot.wide.live::before{filter:blur(34px) brightness(.38) saturate(.8)}
.stage::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:2;background:linear-gradient(180deg,rgba(0,0,0,.62),transparent 26%,transparent 70%,rgba(0,0,0,.62))}

/* glitch wipe between sections */
.stage.glitch .track.on{animation:glitch .46s steps(1) both}
.stage.glitch .track.on .shot img{filter:grayscale(1) contrast(1.3) drop-shadow(4px 0 0 rgba(255,40,60,.55)) drop-shadow(-4px 0 0 rgba(40,220,255,.5))}
.stage.glitch::before{content:"";position:absolute;left:0;right:0;height:22%;z-index:3;pointer-events:none;
  background:linear-gradient(180deg,transparent,rgba(239,238,233,.10) 45%,rgba(239,238,233,.22) 50%,transparent);animation:scan .46s linear both}
@keyframes glitch{
  0%{clip-path:inset(0 0 62% 0);transform:translateX(0)}
  12%{clip-path:inset(0 0 62% 0);transform:translateX(-14px)}
  24%{clip-path:inset(30% 0 22% 0);transform:translateX(10px)}
  36%{clip-path:inset(0 0 30% 0);transform:translateX(-6px)}
  52%{clip-path:inset(48% 0 0 0);transform:translateX(8px)}
  68%{clip-path:inset(0 0 8% 0);transform:translateX(-3px)}
  84%{clip-path:inset(0 0 0 0);transform:translateX(2px)}
  100%{clip-path:inset(0 0 0 0);transform:none}}
@keyframes scan{from{top:-22%}to{top:100%}}

/* ---------- HUD ---------- */
.hud{position:absolute;inset:0;pointer-events:none;z-index:4;color:#fff}
.br{position:absolute;width:22px;height:22px;border:1px solid rgba(255,255,255,.85);transition:all .45s var(--ease)}
.br.tl{left:28px;top:28px;border-width:1px 0 0 1px}
.br.tr{right:28px;top:28px;border-width:1px 1px 0 0}
.br.bl{left:28px;bottom:28px;border-width:0 0 1px 1px}
.br.br4{right:28px;bottom:28px;border-width:0 1px 1px 0}
.cross{position:absolute;left:50%;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;opacity:.45}
.cross::before,.cross::after{content:"";position:absolute;background:#fff}
.cross::before{left:6.5px;top:0;width:1px;height:14px}.cross::after{top:6.5px;left:0;height:1px;width:14px}
.h{position:absolute;color:rgba(255,255,255,.9);text-shadow:0 0 2px rgba(0,0,0,.75),0 1px 8px rgba(0,0,0,.55)}
#tc{display:inline-block;min-width:14ch;contain:layout}
.tl-t{left:60px;top:31px}
.tr-t{right:60px;top:31px}
.bl-t{left:60px;bottom:30px;display:flex;flex-direction:column;gap:5px}
.bl-t #cap{color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.geo{opacity:.6}
.br-t{right:46px;bottom:21px;z-index:5;display:flex;align-items:center;gap:2px}
.nav{width:36px;height:36px;font-size:9px;color:rgba(255,255,255,.75)}
.nav:hover{color:#fff}
.nav:disabled{opacity:.25;cursor:default}
.rec{color:var(--acc);font-weight:400;animation:blink 1.4s steps(1) infinite}
@keyframes blink{50%{opacity:0}}
.ticks{position:absolute;right:60px;bottom:62px;display:flex;gap:6px}
.ticks i{width:14px;height:1px;background:rgba(255,255,255,.35);transition:background .3s,width .3s}
.ticks i.on{background:#fff;width:26px}

/* lock-on: brackets snap in, frame takes the screen */
body.lock .br.tl{left:16%;top:16%}body.lock .br.tr{right:16%;top:16%}
body.lock .br.bl{left:16%;bottom:16%}body.lock .br.br4{right:16%;bottom:16%}
body.lock .br{width:34px;height:34px;border-color:#fff}
body.lock.is-book .br{border-color:var(--acc)}
body.lock .stage{width:100%}
body.lock .side,body.lock #pulse{opacity:0;transition:opacity .3s;pointer-events:none}
body:not(.lock) .side,body:not(.lock) #pulse{transition:opacity .35s .6s}
body:not(.lock) .h,body:not(.lock) .ticks,body:not(.lock) .cross{transition:opacity .3s .6s}
body.lock .h,body.lock .ticks,body.lock .cross{opacity:0;transition:opacity .2s}
body.is-book .cross::before,body.is-book .cross::after{background:var(--acc)}

/* ---------- heartbeat divider ---------- */
#pulse{position:absolute;left:var(--split);top:0;width:90px;height:100%;margin-left:-45px;overflow:visible;z-index:3;pointer-events:none;transition:opacity .3s}
#pulse .base{fill:none;stroke:var(--fg);stroke-width:1;stroke-linejoin:round;opacity:.72}
#pulse .sig{fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;opacity:0}
#pulse .sig.go{opacity:1}
#pulse .dot.on{animation:dot .9s ease-out}
@keyframes dot{0%{r:7}100%{r:2.6}}

/* ---------- list side ---------- */
.side{position:absolute;left:var(--split);right:0;top:0;height:100%;padding:40px 56px 34px 104px;display:flex;flex-direction:column;overflow:hidden;transition:opacity .4s}
.top{display:flex;justify-content:space-between;align-items:center;position:relative;z-index:2}
.logo img{height:32px;width:auto;display:block}
.rings-clip{position:absolute;inset:0;overflow:hidden;pointer-events:none}
/* the spinning world: placed by placeGlobe() in the open space beside the list (assets/globe.js, same as the inside pages) */
.big-globe{position:absolute;left:0;top:0;width:180px;height:180px;overflow:visible;z-index:3;visibility:hidden;cursor:default;
  --globe-mesh:rgba(239,238,233,.2);--globe-land:rgba(239,238,233,.55);--globe-rim:rgba(239,238,233,.24);--globe-pin:var(--acc)}
.big-globe.placed{visibility:visible}
#rings{position:absolute;right:-250px;bottom:-280px;width:620px;height:620px;pointer-events:none;overflow:visible}
#rings circle{fill:none;stroke:var(--fg);stroke-width:1;opacity:.08;transform-origin:310px 310px;transform-box:view-box}
#rings circle.out{stroke:var(--acc);opacity:.24}
#rings .sw{transform-origin:310px 310px;transform-box:view-box;opacity:0}
#rings .sw line{stroke:var(--fg);stroke-width:1}
#rings.sweep .sw{animation:sweep 1.1s var(--ease)}
@keyframes sweep{0%{transform:rotate(-40deg);opacity:0}15%{opacity:.45}100%{transform:rotate(320deg);opacity:0}}
#rings.book circle.out{animation:ring 2.2s ease-in-out infinite}
@keyframes ring{0%,100%{opacity:.3;stroke-width:1}50%{opacity:1;stroke-width:2.5}}

.side>nav{margin:auto 0;position:relative;z-index:2}
ol{list-style:none}
li a{display:flex;align-items:baseline;gap:22px;font-weight:200;font-size:clamp(24px,min(4.4vw,8.2vh),64px);line-height:1.14;letter-spacing:-.025em;color:var(--mid);transition:color .25s}
li .n{width:22px;flex:none;font:400 10px "JetBrains Mono",monospace;letter-spacing:.1em;color:var(--dim);transform:translateY(-.9em)}
li .s{font:400 10px "JetBrains Mono",monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--dim);transform:translateY(-.9em)}
li .hint{display:none}
li .t{white-space:nowrap}
@media (max-width:1180px){body:not(.ph) li .s{display:none}}
li.on a,li a:hover{color:var(--fg)}
li.book a{color:var(--acc)}
li.book .n{color:var(--acc);opacity:.7}
li.on .t{position:relative}
.foot{position:relative;z-index:2}
.foot nav{display:flex;flex-wrap:wrap;gap:8px 22px}
.foot a{padding:6px 0}
.foot a:hover{color:var(--fg)}

.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);z-index:30;opacity:0;pointer-events:none;
  font:400 11px "JetBrains Mono",monospace;letter-spacing:.12em;text-transform:uppercase;background:var(--fg);color:var(--ink);padding:10px 14px;transition:all .3s}
.toast.on{opacity:1;transform:translate(-50%,0)}

/* ---------- boot (first visit) ---------- */
body.boot .br{animation:brIn .55s var(--ease) both}
body.boot .br.tr{animation-delay:.06s}body.boot .br.bl{animation-delay:.12s}body.boot .br.br4{animation-delay:.18s}
body.boot .tracks{animation:fade .7s .45s both}
body.boot .h,body.boot .ticks,body.boot .cross{animation:fade .4s .7s both}
body.boot #pulse .dot{animation:fade .35s .95s both}
body.boot #pulse .base{stroke-dasharray:4000;animation:draw 1s .15s var(--ease) both}
body.boot li{animation:type .5s calc(.35s + var(--i)*.07s) steps(12) both}
body.boot #rings .rg{animation:grow 1.2s .2s var(--ease) both}
body.boot .top,body.boot .foot{animation:fade .5s .9s both}
body.boot .big-globe{animation:fade .8s 1s both}
@keyframes brIn{from{width:0;height:0;opacity:0}}
@keyframes fade{from{opacity:0}}
@keyframes draw{from{stroke-dashoffset:4000}}
@keyframes type{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes grow{from{transform:scale(.4);opacity:0}}
#rings .rg{transform-origin:310px 310px;transform-box:view-box}

/* ---------- phone ---------- */
body.ph{--split:0%}
body.ph .stage{width:100%;height:40%;height:40dvh}
body.ph .hud .br{width:16px;height:16px}
body.ph .br.tl,body.ph .br.bl{left:14px}body.ph .br.tr,body.ph .br.br4{right:14px}
body.ph .br.tl,body.ph .br.tr{top:56px}body.ph .br.bl,body.ph .br.br4{bottom:16px}
body.ph .tl-t{left:38px;top:58px;font-size:9.5px}
body.ph .tr-t{right:38px;top:58px;font-size:9.5px}
body.ph .bl-t{left:38px;bottom:30px;font-size:9.5px}
body.ph .geo{display:none}
body.ph .br-t{right:20px;bottom:18px;font-size:9.5px}
body.ph .nav{width:44px;height:44px}
body.ph .ticks{display:none}
body.ph #pulse{left:0;top:40%;top:40dvh;width:100%;height:44px;margin:-22px 0 0}
body.ph .side{left:0;top:40%;top:40dvh;height:60%;height:60dvh;padding:30px 20px calc(18px + env(safe-area-inset-bottom))}
body.ph .top{position:fixed;left:0;top:0;right:0;padding:16px 18px;z-index:6;background:linear-gradient(rgba(0,0,0,.55),transparent)}
body.ph .top .logo img{height:24px}
body.ph .top .mono{color:#fff;opacity:.8;font-size:9px}
body.ph #rings{width:380px;height:380px;right:-170px;bottom:-150px}
body.ph .side>nav{margin:2px 0 auto}
body.ph li a{font-size:min(54px,8.6vw,5.4vh);gap:12px;line-height:1.24;flex-wrap:nowrap;align-items:baseline;min-height:44px}
body.ph li .n{width:16px;font-size:9px}
body.ph li .s{font-size:9.5px;white-space:nowrap}
li.armed .hint{display:inline;font:400 8.5px "JetBrains Mono",monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--fg);opacity:.6;transform:translateY(-1.1em);white-space:nowrap}
li.armed .s{display:none}
body.ph .foot nav{gap:4px 18px}
body.ph .foot a{font-size:9.5px;padding:10px 0}
body.ph.lock .stage{height:100%}
body.ph.lock .shot.wide img{position:absolute;left:0;top:30%;height:40%}
/* short landscape phones: keep the split, tighten everything */
body.short .side{padding:14px 24px 10px 66px}
body.short .top .mono,body.short .tr-t,body.short .geo,body.short .ticks,body.short .cross{display:none}
body.short .logo img{height:22px}
body.short .br.tl,body.short .br.tr{top:14px}body.short .br.bl,body.short .br.br4{bottom:12px}
body.short .tl-t,body.short .tr-t{top:17px}body.short .br-t{bottom:4px}
/* long captions never run into the shot counter: own line under REC on short screens, room kept for the counter on phones */
body.short .bl-t{top:38px;bottom:auto;left:60px;right:24px}
body.ph .bl-t{right:160px}
body.short .foot a{padding:4px 0}
.side{overflow-y:auto}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  .stage,.br,.shot img,li a,#pulse,.side{transition:none!important}
  .rec{animation:none}
  .stage.glitch .track.on,.stage.glitch::before{animation:none!important}
  #rings.book circle.out{animation:none;opacity:1}
}
