/* Ed Naish — shared styles */
:root {
  --blue: #0047FF;
  --ink: #000000;
  --grey: #8F8F8F;
  --nav-bg: rgba(18, 18, 18, 0.65);
  --btn-bg: rgba(23, 23, 23, 0.8);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --pixel: 'Bitcount Grid Single', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #ffffff; color: var(--ink); font-family: Inter, system-ui, -apple-system, sans-serif; }
body { overflow: hidden; }
a { color: var(--blue); }
button { font: inherit; }
.page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

/* Menu bar */
.site-nav { flex: none; background: var(--nav-bg); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; padding: 14px 16px; font-family: var(--pixel); font-size: 16px; position: relative; z-index: 30; }
.site-nav a { color: #ffffff; text-decoration: none; }
.site-nav a:hover { color: #cfd8ff; }
.site-nav a[aria-current="page"] { color: var(--blue); }

/* Body: sidebar + scrolling area */
.layout { flex: 1 1 auto; min-height: 0; display: flex; }
.side { --back-w: 44px; flex: none; width: 300px; padding: 0 16px 0 20px; display: flex; flex-direction: row; align-items: center; }
.side > ul { flex: 1 1 auto; min-width: 0; }
.side ul { margin: 0; padding: 0; list-style: none; }
.side button { display: block; border: 0; background: transparent; padding: 0; margin: 0; text-align: left; cursor: pointer; text-transform: uppercase; white-space: nowrap; font-family: var(--pixel); letter-spacing: 0.02em; font-size: 15px; line-height: 1.7; color: var(--grey); transition: font-size .55s var(--ease), color .3s ease, margin .55s var(--ease); }
.side button:hover { color: #555555; }
.side button[aria-current="true"] { font-size: var(--big, 26px); line-height: 1.2; color: var(--blue); margin: 6px 0; }

/* Mobile row of options */
.strip { display: none; flex: none; gap: 18px; overflow-x: auto; padding: 12px 16px; border-bottom: 1px solid #EDEDED; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: none; border: 0; background: transparent; padding: 6px 0; min-height: 36px; cursor: pointer; text-transform: uppercase; white-space: nowrap; font-family: var(--pixel); font-size: 14px; color: var(--grey); }
.strip button[aria-current="true"] { color: var(--blue); }

.scroller { flex: 1 1 auto; min-width: 0; position: relative; overflow-y: auto; padding: 0 16px; scrollbar-width: none; overscroll-behavior: contain; }
.scroller::-webkit-scrollbar { display: none; }

/* Shared card overlay pieces */
.card { position: relative; z-index: 0; border-radius: 12px; overflow: hidden; background: #111111; box-shadow: rgba(0,0,0,0.1) 0 1px 15px 0; }
.card video, .card .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.who { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; align-items: center; gap: 10px; z-index: 3; pointer-events: none; }
.who img { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; flex: none; }
.who span { color: #ffffff; font-weight: 500; font-size: 16px; letter-spacing: -0.04em; text-shadow: 0 1px 6px rgba(0,0,0,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who svg { flex: none; }
.tag { margin-left: auto; flex: none; background: var(--nav-bg); color: #ffffff; font-family: var(--pixel); font-size: 13px; padding: 5px 9px; border-radius: 8px; text-shadow: none !important; }
.round { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--btn-bg); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.pill { height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--btn-bg); color: #ffffff; font-family: var(--pixel); font-size: 14px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.wash { position: absolute; inset: 0; background: #ffffff; opacity: 0; pointer-events: none; transition: opacity .4s ease; z-index: 6; }

/* Video controls bar */
.controls { position: absolute; left: 12px; right: 12px; bottom: 12px; display: none; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--nav-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 5; }
.controls .row { display: flex; align-items: center; gap: 8px; }
.controls input[type=range] { width: 100%; margin: 0; accent-color: var(--blue); cursor: pointer; }
.controls .time { flex: 1 1 auto; color: #ffffff; font-family: var(--pixel); font-size: 14px; white-space: nowrap; }
.cbtn { width: 40px; height: 40px; flex: none; border-radius: 999px; border: 0; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: #ffffff; }
.cbtn.unmute { width: auto; padding: 0 14px; gap: 8px; background: var(--blue); font-family: var(--pixel); font-size: 14px; }
.bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 999px; border: 0; background: var(--btn-bg); display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 5; }
.show-controls .controls { display: flex; }
.show-controls.paused .bigplay { display: flex; }

@media (max-width: 760px) {
  .side { display: none; }
  .strip { display: flex; }
  .site-nav { gap: 6px 12px; font-size: 13px; padding: 12px 8px; flex-wrap: nowrap; white-space: nowrap; overflow-x: auto; justify-content: safe center; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .scroller { padding: 0 12px; }
}

/* ---------- Menu page, back arrows and page-to-page slides ---------- */
.back { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 0; color: var(--grey); text-decoration: none; transition: color .2s ease, transform .25s var(--ease); flex: none; }
.back:hover, .back:focus-visible { color: var(--blue); transform: translateX(-3px); }
.back svg { width: 26px; height: 26px; display: block; }
/* Computers: the arrow matches the size of the menu text beside it. */
@media (min-width: 761px) { .back svg, .stripbar .back svg { width: 16px; height: 16px; } }
/* On the video pages the arrow sits to the left of the list, centred on it. */
.side .back { width: var(--back-w); height: 44px; justify-content: flex-start; flex: none; }
.stripbar { display: none; flex: none; align-items: center; border-bottom: 1px solid #EDEDED; }
.stripbar .back { margin: 0 0 0 6px; width: 40px; height: 40px; }
.stripbar .back svg { width: 22px; height: 22px; }
.stripbar .strip { position: relative; flex: 1 1 auto; min-width: 0; border-bottom: 0; padding-left: 4px; }
@media (max-width: 760px) { .stripbar { display: flex; } }
.topbar { flex: none; display: flex; align-items: center; padding: 14px 20px; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; }
.topbar .back { margin: 0 0 0 -8px; }
@media (min-width: 761px) {
  .topbar { position: fixed; left: 20px; top: 50%; transform: translateY(-50%); padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar .back { margin: 0; width: 44px; height: 44px; justify-content: flex-start; }
  body.doc .page { padding-left: 64px; }
}

/* Arriving: the navigation slides in (from the right going forward, from the left going
   back) and the rest of the page fades in. Leaving: the navigation slides out. */
/* The slide happens inside the navigation's own white area: the area clips its
   contents, and they travel exactly one area-width (100cqw). */
.navpane { container-type: inline-size; }
html.enter-fwd .navpane, html.enter-back .navpane, .navpane.out-left, .navpane.out-right { overflow: hidden; }
@keyframes navInR { from { transform: translateX(100cqw); } to { transform: none; } }
@keyframes navInL { from { transform: translateX(-100cqw); } to { transform: none; } }
@keyframes navOutL { to { transform: translateX(-100cqw); } }
@keyframes navOutR { to { transform: translateX(100cqw); } }
@keyframes paneFade { from { opacity: 0; } to { opacity: 1; } }
html.enter-fwd .navpane > * { animation: navInR .65s var(--ease) both; }
html.enter-back .navpane > * { animation: navInL .65s var(--ease) both; }
/* The page's content swipes in with the menu: from the right going forward, from the
   left going back, easing to a stop as it fades in. */
@keyframes paneInR { from { opacity: 0; transform: translateX(45vw); } to { opacity: 1; transform: none; } }
@keyframes paneInL { from { opacity: 0; transform: translateX(-45vw); } to { opacity: 1; transform: none; } }
/* Held off-screen until the page has finished setting up, so heavy pages don't skip frames. */
html.enter-fwd:not(.ready) .fadepane { opacity: 0; transform: translateX(45vw); }
html.enter-back:not(.ready) .fadepane { opacity: 0; transform: translateX(-45vw); }
html.enter-fwd.ready .fadepane { animation: paneInR .75s var(--ease) both; }
html.enter-back.ready .fadepane { animation: paneInL .75s var(--ease) both; }
html.enter-fwd .page, html.enter-back .page { overflow-x: clip; }
.navpane.out-left > * { animation: navOutL .42s cubic-bezier(.55,0,.75,.2) forwards; }
.navpane.out-right > * { animation: navOutR .42s cubic-bezier(.55,0,.75,.2) forwards; }
/* Leaving: the content does the reverse of how it arrived. Going back it slides out to the
   right (it came in from the right); going forward it slides out to the left. */
@keyframes paneOutR { to { opacity: 0; transform: translateX(45vw); } }
@keyframes paneOutL { to { opacity: 0; transform: translateX(-45vw); } }
html.leaving.leave-back .fadepane { animation: paneOutR .4s cubic-bezier(.55,0,.75,.2) forwards; }
html.leaving.leave-fwd .fadepane { animation: paneOutL .4s cubic-bezier(.55,0,.75,.2) forwards; }
html.leaving .page { overflow-x: clip; }
/* Computers: no clipping edge (it showed as a line the menus appeared from behind). The
   menus come in from further right, fading in as they slow down, and fade as they leave. */
@media (min-width: 761px) {
  html.enter-fwd .navpane, html.enter-back .navpane, .navpane.out-left, .navpane.out-right { overflow: visible; }
  html.enter-fwd .navpane > * { animation: navInRd .75s var(--ease) both; }
  html.enter-back .navpane > * { animation: navInLd .75s var(--ease) both; }
  .navpane.out-left > * { animation: navOutLd .42s cubic-bezier(.55,0,.75,.2) forwards; }
  .navpane.out-right > * { animation: navOutRd .42s cubic-bezier(.55,0,.75,.2) forwards; }
}
@keyframes navInRd { from { opacity: 0; transform: translateX(min(16vw, 220px)); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes navInLd { from { opacity: 0; transform: translateX(max(-16vw, -220px)); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes navOutLd { to { opacity: 0; transform: translateX(max(-16vw, -220px)); } }
@keyframes navOutRd { to { opacity: 0; transform: translateX(min(16vw, 220px)); } }
@media (prefers-reduced-motion: reduce) {
  html.enter-fwd .navpane > *, html.enter-back .navpane > *, html.enter-fwd .fadepane, html.enter-back .fadepane, .navpane.out-left > *, .navpane.out-right > * { animation: none; }
}

/* ---------- Video wall ---------- */
/* The real videos: each sits over one tile showing its own clip (browsers keep visible
   videos playing); everything else is drawn on one canvas. */
.host { position: absolute; overflow: hidden; border-radius: 0; pointer-events: none; }
.host video { position: absolute; max-width: none; display: block; object-fit: fill; }

/* Behind every page except the landing page: the same wall, much dimmer and not clickable. */
html.walled, html.walled body { background: #000000; }
.bgwall { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #000000 var(--wall-snap, none) center / 100% 100% no-repeat; }
.bgwall canvas.main { position: absolute; inset: 0; width: 100%; height: 100%; display: block; will-change: transform; }
.bgwall { contain: strict; }
.bgwall::after { content: ''; position: absolute; inset: 0; z-index: 2; background: rgba(10,10,10,0.84); }
html.walled .page { position: relative; z-index: 1; }
/* Light text on the dark background. */
html.walled { --ink: #ffffff; --grey: rgba(255,255,255,0.8); color-scheme: dark; }
html.walled .side button:not([aria-current="true"]):hover { color: #ffffff; }
html.walled .strip, html.walled .stripbar { border-bottom-color: rgba(255,255,255,0.12); }
html.walled .num { color: rgba(255,255,255,0.55); }
html.walled .bar { background: rgba(255,255,255,0.14); }
html.walled .chips li, html.walled .exp li { border-color: rgba(255,255,255,0.28); }
html.walled .cform input, html.walled .cform select, html.walled .cform textarea { border-bottom-color: rgba(255,255,255,0.3); }
html.walled .cform input:focus, html.walled .cform select:focus, html.walled .cform textarea:focus { border-bottom-color: #ffffff; }
html.walled .cform ::placeholder { color: rgba(255,255,255,0.45); }
html.walled .cform select { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path d="M2 4l4 4 4-4" fill="none" stroke="%23ffffff" stroke-width="1.5"/></svg>'); }
html.walled .cform option { color: #000000; }
@media (max-width: 760px) { html.walled .topbar { background: rgba(18,18,18,0.6); } }

/* Wall hover: a copy of the tile grows quickly and settles back. */
.hov { position: absolute; border-radius: 0; overflow: hidden; pointer-events: none; z-index: 5; border: 1.5px solid var(--blue); box-shadow: 0 6px 18px rgba(0,0,0,0.6); transform: scale(1); opacity: 0; transition: transform .28s cubic-bezier(.22,1,.36,1), opacity .28s ease; will-change: transform; }
.hov.on { transform: scale(2.4); opacity: 1; z-index: 6; transition: transform .07s cubic-bezier(.2,.7,.3,1), opacity .04s linear; }
.hov canvas { display: block; width: 100%; height: 100%; }

/* Back arrow: a quick fade in rather than popping in. */
.back svg { animation: backFade .35s ease .1s both; }
@keyframes backFade { from { opacity: 0; } to { opacity: 1; } }

/* The back arrow behaves the same on every page: it fades in (and out) in place,
   while the lists beside it slide. */
html.enter-fwd .navpane > .back, html.enter-back .navpane > .back { animation: none; }
.navpane.out-left > .back, .navpane.out-right > .back { animation: backOut .3s ease forwards; }
@keyframes backOut { to { opacity: 0; } }
.topbar.navpane { container-type: normal; }

/* Video loading ring (only shown while a video is waiting for data) */
.vload { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .25s ease; color: #ffffff; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }
.vload.on { opacity: 1; }
.vload svg { width: 100%; height: 100%; display: block; }
.vload circle { fill: rgba(255,255,255,0.45); transition: fill .15s ease; }
.vload circle.on { fill: var(--blue); }
.vload b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--pixel); font-weight: 400; font-size: 11px; letter-spacing: 0.02em; }
