:root{--gold:#EABC1F;--cyan:#098ACF;--blue:#1B1BBC;--navy:#1E196A;--bg:#1E196A;--ink:#fff;--ease:cubic-bezier(.22,1,.36,1)}
*{box-sizing:border-box;margin:0;padding:0}
html{background:var(--navy);-webkit-text-size-adjust:100%}
html.lenis,html.lenis body{height:auto}
.lenis.lenis-stopped{overflow:clip}
body{font-family:Heebo,system-ui,sans-serif;color:var(--ink);background:var(--bg);overflow-x:hidden;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
img,video{display:block}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}

#track{width:1px;pointer-events:none}

/* stage */
#stage{position:fixed;inset:0;overflow:hidden;background:var(--bg)}
#slides{position:absolute;left:0;top:0;width:100%;height:100svh}
.slide{position:absolute;inset:0;opacity:0;pointer-events:none;will-change:opacity}
.slide .page{position:absolute;left:0;top:0;width:1920px;height:1080px;transform-origin:0 0;will-change:transform}
.slide .side{position:absolute;left:0;top:0;width:0;height:0;z-index:1}
/* links on a slide: clickable only while the slide is on stage */
.slide .hit{position:absolute;display:block;pointer-events:none;cursor:pointer;transition:background-color .3s}
.slide.live .hit{pointer-events:auto}
.slide .hit:hover{background-color:rgba(234,188,31,.16)}
.slide .hit:focus-visible{outline:2px solid #EABC1F;outline-offset:5px}
.slide .mover{position:absolute;inset:0}
.slide .bg{position:absolute;left:0;top:0;width:1920px;height:1080px;object-fit:fill}
.slide .ly{position:absolute;inset:0}
.slide .pc{position:absolute}
.slide .pc img{width:100%;height:100%;display:block;user-select:none;-webkit-user-drag:none;pointer-events:none}
.slide .pc.i{overflow:hidden}

.slide.full .bleed{position:absolute;left:-2px;top:-2px;right:-2px;bottom:-2px}

/* film slides */
.film{position:absolute;inset:0;visibility:hidden;background:#000;overflow:hidden}
.film video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.film .veil{position:absolute;inset:0;background:radial-gradient(120% 90% at 50% 50%,transparent 55%,rgba(8,6,40,.55));pointer-events:none}
.film .cap{position:absolute;inset-inline:0;bottom:calc(84px + env(safe-area-inset-bottom));text-align:center;font-weight:300;letter-spacing:.32em;font-size:11px;text-transform:uppercase;opacity:.8;direction:ltr}
.film .play{position:absolute;left:50%;top:50%;width:84px;height:84px;margin:-42px;border-radius:50%;border:1px solid rgba(255,255,255,.6);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:rgba(30,25,106,.35);display:none;place-items:center}
.film.blocked .play{display:grid}


/* wipe: three brand stripes */
#wipe{position:fixed;inset:0;pointer-events:none;z-index:40;overflow:hidden}
#wipe i{position:absolute;top:-20%;height:140%;width:62vw;left:0;transform:translateX(-140vw) skewX(-18deg);will-change:transform}
#wipe i:nth-child(1){background:var(--gold)}
#wipe i:nth-child(2){background:var(--cyan)}
#wipe i:nth-child(3){background:var(--blue)}

/* hud */
#hud{position:fixed;z-index:50;top:0;inset-inline:0;display:flex;align-items:center;gap:20px;padding:calc(18px + env(safe-area-inset-top)) 28px 0;pointer-events:none;mix-blend-mode:normal}
#hud>*{pointer-events:auto}
#hud .brand img{height:34px;width:auto;filter:drop-shadow(0 1px 8px rgba(0,0,0,.25));transition:filter .6s,opacity .6s}
#hud .chapter{display:flex;gap:10px;align-items:baseline;font-size:13px;letter-spacing:.04em;margin-inline-start:auto;color:var(--ink);transition:color .6s}
#hud .chapter span:first-child{font-weight:700;font-feature-settings:"tnum";opacity:.6;direction:ltr}
#sound{display:flex;gap:8px;align-items:center;font-size:12px;padding:8px 14px;border-radius:99px;border:1px solid rgba(255,255,255,.45);background:rgba(30,25,106,.35);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#fff}
#sound[hidden]{display:none}
#sound .wave{opacity:.25;transition:opacity .3s}
#sound[aria-pressed=true] .wave{opacity:1}
body.light #hud .brand img{filter:brightness(0) saturate(100%) invert(11%) sepia(60%) saturate(4000%) hue-rotate(238deg) brightness(80%)}
body.light{--ink:#1E196A}
/* the book pages carry their own header; hide HUD logo & chapter while a page is on stage on wide screens */
@media (orientation:landscape){body.page #hud .brand,body.page #hud .chapter{opacity:0;pointer-events:none}}
#hud .brand,#hud .chapter{transition:opacity .5s}

#nav{position:fixed;z-index:50;left:20px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:14px}
#nav button{position:relative;width:14px;height:14px;display:grid;place-items:center}
#nav button::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--ink);opacity:.35;transition:transform .4s var(--ease),opacity .4s,background-color .4s}
#nav button.on::before{opacity:1;transform:scale(1.9);background:var(--gold)}
#nav button span{position:absolute;left:24px;direction:rtl;white-space:nowrap;font-size:12px;opacity:0;transform:translateX(6px);transition:.35s var(--ease);pointer-events:none;color:var(--ink);background:rgba(255,255,255,.0)}
#nav button:hover span{opacity:1;transform:none}
@media (orientation:portrait){#nav{flex-direction:row;top:auto;transform:none;bottom:calc(58px + env(safe-area-inset-bottom));left:0;right:0;justify-content:center;gap:12px}#nav button span{display:none}}

#foot{position:fixed;z-index:50;bottom:0;inset-inline:0;padding:0 28px calc(18px + env(safe-area-inset-bottom));display:flex;align-items:flex-end;gap:18px;pointer-events:none;color:var(--ink);transition:color .6s}
#foot .count{font-size:12px;display:flex;gap:6px;direction:ltr;font-feature-settings:"tnum";opacity:.85}
#foot .count b{font-weight:700}
#foot .progress{flex:1;display:grid;gap:3px;direction:ltr;padding-bottom:5px}
#foot .progress i{height:2px;border-radius:2px;transform-origin:0 50%;transform:scaleX(0)}
#foot .progress i:nth-child(1){background:var(--gold)}
#foot .progress i:nth-child(2){background:var(--cyan)}
#foot .progress i:nth-child(3){background:var(--blue);box-shadow:0 0 0 .5px rgba(255,255,255,.25)}
#foot .hint{display:flex;gap:8px;align-items:center;font-size:12px;letter-spacing:.08em}
#foot .hint svg{animation:bob 1.6s var(--ease) infinite}
@keyframes bob{0%,100%{transform:translateY(-3px)}50%{transform:translateY(3px)}}

/* loader */
#loader{position:fixed;inset:0;z-index:100;background:var(--navy);display:grid;place-content:center;justify-items:center;gap:26px}
#loader img{width:min(48vw,230px)}
#loader .bars{display:grid;gap:4px;width:min(48vw,230px);direction:ltr}
#loader .bars i{height:3px;border-radius:3px;transform-origin:0 50%;transform:scaleX(0)}
#loader .bars i:nth-child(1){background:var(--gold)}
#loader .bars i:nth-child(2){background:var(--cyan)}
#loader .bars i:nth-child(3){background:#3d3df0}

@media (prefers-reduced-motion:reduce){#foot .hint svg{animation:none}}

/* phone */
@media (orientation:portrait){
  #hud{padding:calc(14px + env(safe-area-inset-top)) 18px 0}
  #hud .brand img{height:28px}
  #hud .chapter{font-size:12px}
  #foot{padding:0 18px calc(14px + env(safe-area-inset-bottom))}
  #nav{bottom:calc(44px + env(safe-area-inset-bottom));gap:4px}
  #nav button{width:26px;height:26px}
  #sound{padding:7px 12px}
  .film .cap{bottom:calc(96px + env(safe-area-inset-bottom));font-size:10px;letter-spacing:.24em}
  body.page.full-on #hud .brand,body.page.full-on #hud .chapter{opacity:.0}
}

html.loading,html.loading body{overflow:hidden;height:100%}
#pct{font-size:12px;letter-spacing:.2em;opacity:.7;direction:ltr}
#loader .bars i{transition:transform .25s linear}
@media (orientation:landscape){body.page #hud .brand,body.page #hud .chapter{opacity:0}}
@media (orientation:portrait){body.page #hud .brand,body.page #hud .chapter{opacity:0}}

#stage{height:100dvh}
.film video{object-fit:cover;will-change:transform}
.film{will-change:clip-path}

/* brand cursor */
@media (hover:hover) and (pointer:fine){
  html,body,#stage,.slide,.film{cursor:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cpath%20d%3D%22M5%203%20L5%2033%20L13%2025.5%20L18.5%2037%20L24%2034.5%20L18.5%2023.5%20L29%2023.5%20Z%22%20fill%3D%22%23EABC1F%22%20stroke%3D%22%231E196A%22%20stroke-width%3D%222.2%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") 5 3,auto}
  a,button,[role=button],#nav button{cursor:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2220%22%20r%3D%2213%22%20fill%3D%22%23EABC1F%22%20fill-opacity%3D%22.92%22%20stroke%3D%22%231E196A%22%20stroke-width%3D%222.2%22/%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2220%22%20r%3D%223.2%22%20fill%3D%22%231E196A%22/%3E%3C/svg%3E") 20 20,pointer}
}

/* animated pieces keep their own layer for good, so starting or ending a tween never repaints them */
.slide .pc.anim{will-change:transform,opacity;backface-visibility:hidden}

#stage img{-webkit-user-drag:none}

/* HUD follows the slide's brightness smoothly */
#nav button::before{transition:transform .4s var(--ease),opacity .4s,background-color .8s ease}
#foot,#foot .count,#hud .chapter,#nav button span{transition:color .8s ease,opacity .5s}

/* brand selection highlight */
::selection{background:#EABC1F;color:#1E196A}
::-moz-selection{background:#EABC1F;color:#1E196A}
/* brand scrollbar */
html{scrollbar-color:#EABC1F #1E196A;scrollbar-width:thin}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:#1E196A}
::-webkit-scrollbar-thumb{background:linear-gradient(#EABC1F,#098ACF);border-radius:10px;border:2px solid #1E196A}
::-webkit-scrollbar-thumb:hover{background:#EABC1F}
::-webkit-scrollbar-corner{background:#1E196A}

/* OTW Design mark, bottom right next to the counter, follows the slide's brightness */
#foot .otw{pointer-events:auto;text-decoration:none;color:var(--ink);font-family:Heebo,system-ui,sans-serif;font-size:12px;line-height:1;letter-spacing:.04em;direction:ltr;display:flex;align-items:baseline;opacity:.9;transition:color .8s ease,opacity .3s}
#foot .otw b{font-weight:700;letter-spacing:.02em}
#foot .otw span{font-weight:300;letter-spacing:.06em}
#foot .otw:hover{opacity:1}

/* long text: drawn in line by line */
.slide .pc .strip{position:absolute;left:0;width:100%;background-repeat:no-repeat;will-change:clip-path}

/* mobile: temporary desktop-only note */
#mobile-note{display:none}
@media (pointer:coarse),(max-width:820px){
  #mobile-note{display:grid;position:fixed;inset:0;z-index:20000;background:#1E196A;color:#fff;place-content:center;justify-items:center;gap:22px;padding:32px;text-align:center;font-family:Heebo,system-ui,sans-serif}
  #mobile-note img{width:min(56vw,220px)}
  #mobile-note .bars{display:grid;gap:4px;width:min(56vw,220px)}
  #mobile-note .bars i{height:3px;border-radius:3px}
  #mobile-note .bars i:nth-child(1){background:#EABC1F}
  #mobile-note .bars i:nth-child(2){background:#098ACF}
  #mobile-note .bars i:nth-child(3){background:#3d3df0}
  #mobile-note p{font-size:20px;font-weight:500;line-height:1.4;direction:rtl}
  #loader,#stage,#hud,#nav,#foot,#wipe{display:none!important}
  html,body{overflow:hidden;height:100%}
}
