@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Theme — JS (main.js applyTheme) overrides --bg/--fg and the derived tokens below from
     content.json (Site Settings, or a project's own colours). These defaults reproduce the
     original near-black look, so with no colour set the site is unchanged. Secondary tones are
     derived from --bg/--fg so they stay legible whatever the background. */
  --bg: #050505;          /* base background / the void behind the gallery */
  --fg: #f2f2f2;          /* primary text */
  --surface: rgba(6,6,6,0.92); /* frosted overlays (list view, About, Let's Talk) */
  --fg-2: #cfcfcf;        /* secondary text (leads, blurbs, body) */
  --fg-3: #8a8a8a;        /* labels / tertiary text */
  --fg-4: #5f5f5f;        /* faint text (indices) */
  --line: rgba(255,255,255,.14); /* hairlines / borders */
  --mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sans: 'Archivo', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body { cursor: grab; }
body.dragging { cursor: grabbing; }
body.pointing { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }   /* kill the grey tap-flash on touch */

#scene {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  touch-action: none;
}

/* Depth vignette — darkens the edges to imply the curve of the sphere */
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  /* the WebGL lens pass already darkens the rim; keep this very light */
  background:
    radial-gradient(130% 100% at 50% 50%, transparent 62%, rgba(0,0,0,0.28) 92%, rgba(0,0,0,0.5) 100%);
}
#grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ───────────────── UI CHROME ───────────────── */
.ui { z-index: 10; }
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-2);
}

#chrome { position: fixed; inset: 0; pointer-events: none; }
#chrome > * { pointer-events: auto; }

.top-left { position: fixed; top: 22px; left: 26px; z-index: 33; }   /* persists above section overlays */
.logo { position: relative; display: inline-block; cursor: pointer; }
.logo-mark { display: block; font-family: var(--sans); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -.04em; color: var(--fg); filter: drop-shadow(0 2px 14px rgba(0,0,0,.6)); }
.logo .reg { position: absolute; right: -10px; bottom: 2px; font-size: 9px; color: var(--fg); }

/* right of the AC monogram, clear of the centred tagline (was overlapping at left:44%) */
.top-sound { position: fixed; top: 24px; left: 92px; }
.dot-grid { letter-spacing: -2px; opacity: .8; }

.top-mid {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  line-height: 1.45; color: var(--fg); text-align: left;
}

.top-clocks {
  position: fixed; top: 18px; right: 150px; line-height: 1.5; text-align: left; color: var(--fg-2);
}
.top-clocks .t { display: inline-block; margin-left: 14px; color: var(--fg-3); }
.top-clocks .moon, .top-clocks .pin { display:inline-block; width: 14px; opacity:.7; }

.view-toggle {
  position: fixed; bottom: 26px; left: 26px; z-index: 32;   /* above section overlays, below the project modal */
  display: flex; gap: 2px; background: rgba(18,18,18,.78);
  border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 4px;
}
.view-toggle button {
  width: 38px; height: 34px; border: none; background: transparent; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer; color: #9a9a9a;
}
.view-toggle button svg { fill: currentColor; }
.view-toggle button.active { background: #fff; color: #111; }

.bottom-nav {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 4px; background: rgba(18,18,18,.74);
  border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 6px;
}
.bottom-nav button {
  font-family: var(--sans); font-weight: 500; font-size: 16px; color: #cfcfcf;
  background: transparent; border: none; padding: 10px 26px; border-radius: 999px; cursor: pointer;
  transition: color .2s ease;
}
.bottom-nav button.active { background: #fff; color: #111; }
.bottom-nav button:not(.active):hover { color: #fff; }

.filter {
  position: fixed; bottom: 26px; right: 26px;
  font-family: var(--sans); font-weight: 500; font-size: 15px; color: #ededed;
  background: rgba(18,18,18,.74); border: 1px solid rgba(255,255,255,.14);
  padding: 12px 26px; border-radius: 999px; cursor: pointer;
  transition: background .2s ease;
}
.filter:hover { background: rgba(45,45,45,.7); }
.filter.btn-active { background: rgba(70,70,70,.85); color: #fff; }

#filter-panel {
  position: fixed; right: 26px; bottom: 76px; z-index: 15;
  width: 220px; padding: 8px; border-radius: 16px;
  background: rgba(10,10,10,.86); border: 1px solid rgba(255,255,255,.14);   /* frosted + slightly see-through, matching the list-view overlay */
  backdrop-filter: blur(16px); box-shadow: 0 24px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(8px) scale(.98);
  transform-origin: bottom right; transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
#filter-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.filter-head { color: #7a7a7a; font-size: 10px; letter-spacing: .18em; padding: 9px 12px 7px; }
.filter-opt {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-align: left;
  color: #cfcfcf; background: transparent; border: 0; border-radius: 10px;
  padding: 10px 12px; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.filter-opt:hover { background: rgba(255,255,255,.06); color: #fff; }
.filter-opt.active { background: #fff; color: #111; }

#hint {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%);
  color: #6f6f6f; font-size: 10px; letter-spacing: .25em; pointer-events: none;
  animation: hintPulse 3.5s ease-in-out infinite; transition: opacity .6s ease;
}
@keyframes hintPulse { 0%,100%{opacity:.35} 50%{opacity:.75} }

/* ───────────────── LIST VIEW ───────────────── */
#list-view {
  position: fixed; inset: 0; z-index: 20;
  background: var(--surface);
  backdrop-filter: blur(16px);
  opacity: 0; visibility: hidden; pointer-events: none;
  overflow: hidden;
}
#list-view.open { visibility: visible; pointer-events: auto; }

.list-head {
  position: absolute; top: 76px; left: 50%; transform: translateX(-50%);
  color: var(--fg-3); letter-spacing: .24em; font-size: 11px;
}
.list-grid {
  position: absolute; inset: 116px 0 92px 0;
  max-width: 1320px; margin: 0 auto; padding: 0 48px;
  display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 48px;
}
.list-rows { overflow-y: auto; overflow-x: hidden; padding-right: 10px; }
.list-rows::-webkit-scrollbar { width: 6px; }
.list-rows::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.list-row {
  display: grid; grid-template-columns: 44px minmax(0,1fr) minmax(0,180px) 52px;
  align-items: center; gap: 28px; width: 100%; text-align: left;
  background: transparent; border: 0; border-top: 1px solid var(--line);
  padding: 18px 6px; cursor: pointer; color: var(--fg-3);
}
.list-row:last-child { border-bottom: 1px solid rgba(255,255,255,.10); }
.lr-idx { color: var(--fg-4); align-self: center; }
.lr-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lr-client { color: var(--fg-3); font-size: 10px; letter-spacing: .14em; white-space: nowrap; }
.lr-title {
  font-family: var(--sans); font-weight: 600; font-size: 29px; letter-spacing: -.01em;
  color: var(--fg); text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .2s ease, transform .3s ease;
}
.lr-tags { color: var(--fg-3); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-year { color: var(--fg-3); text-align: right; }
.list-row:hover { color: var(--fg); }
.list-row:hover .lr-title { color: var(--fg); transform: translateX(10px); }
.list-row:hover .lr-idx { color: var(--fg-2); }

.list-preview {
  align-self: center; width: 360px; height: 270px; border-radius: 14px; overflow: hidden;
  opacity: 0; transform: scale(.96); transition: opacity .35s ease, transform .35s ease;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); pointer-events: none;
}
.list-preview.show { opacity: 1; transform: scale(1); }
.list-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 900px) {
  .list-grid { grid-template-columns: 1fr; }
  .list-preview { display: none; }
  .list-row { grid-template-columns: 34px minmax(0,1fr) auto; }
  .lr-client, .lr-tags { display: none; }
  .lr-title { font-size: 22px; }
}

/* ───────────────── ABOUT / LET'S TALK PAGES ───────────────── */
.page-overlay {
  position: fixed; inset: 0; z-index: 20;
  background: var(--surface);
  backdrop-filter: blur(18px);
  opacity: 0; visibility: hidden; pointer-events: none;
  overflow-y: auto; overflow-x: hidden;
}
.page-overlay.open { visibility: visible; pointer-events: auto; }
.page-inner { max-width: 1100px; margin: 0 auto; padding: 116px 48px 130px; }
.page-eyebrow { color: var(--fg-3); letter-spacing: .24em; font-size: 11px; margin-bottom: 24px; }
.page-inner h1 {
  font-family: var(--sans); font-weight: 600; font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.04; letter-spacing: -.02em; margin-bottom: 26px; max-width: 17ch;
}
.page-lead { font-size: clamp(17px, 2vw, 22px); line-height: 1.5; color: var(--fg-2); max-width: 720px; margin-bottom: 20px; }
.page-body { font-size: 16px; line-height: 1.65; color: var(--fg-3); max-width: 670px; margin-bottom: 36px; }

.about-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 26px; max-width: 640px;
}
.about-stats div { display: flex; flex-direction: column; gap: 6px; }
.about-stats b { font-family: var(--sans); font-weight: 600; font-size: clamp(28px,3.4vw,38px); color: var(--fg); letter-spacing: -.02em; }
.about-stats span { color: var(--fg-3); font-size: 11px; letter-spacing: .08em; text-transform: none; }

/* intro split — copy on the left, a swappable portrait placeholder on the right */
.about-top {
  display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 52px;
  align-items: start; margin: 6px 0 42px; max-width: 1000px;
}
.about-copy .page-body { margin-bottom: 0; }
.about-portrait {
  position: relative; aspect-ratio: 4/5; border-radius: 14px; overflow: hidden;
  background: linear-gradient(155deg, #1c1c1c, #0c0c0c);
  border: 1px solid rgba(255,255,255,.10); display: grid; place-items: center;
}
.about-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.about-portrait img:not([src]), .about-portrait img[src=""] { display: none; }   /* show the placeholder until a real photo is set */
.ph-label { display: flex; flex-direction: column; align-items: center; gap: 9px; color: var(--fg-3); font-size: 10px; letter-spacing: .2em; }
.ph-label svg { opacity: .55; }

/* social handles — Instagram can carry several */
.about-socials { margin-top: 38px; max-width: 640px; border-top: 1px solid rgba(255,255,255,.12); }
.soc-row {
  display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: baseline;
  padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,.08);
}
.soc-label { color: var(--fg-3); font-size: 10px; letter-spacing: .18em; }
.soc-handles { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.soc-handles a { color: var(--fg-2); font-size: 15px; font-family: var(--sans); letter-spacing: .01em; text-decoration: none; transition: color .2s ease; }
.soc-handles a:hover { color: var(--fg); text-decoration: underline; }

.contact-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 56px; margin-top: 12px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.contact-form label {
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3);
}
.contact-form input, .contact-form textarea {
  font-family: var(--sans); font-size: 16px; color: var(--fg);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; outline: none; resize: vertical;
  transition: border-color .2s ease, background .2s ease;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.06); }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--fg-3); }
.contact-form button {
  align-self: flex-start; margin-top: 6px;
  font-family: var(--sans); font-weight: 500; font-size: 15px; color: var(--bg); background: var(--fg);
  border: none; padding: 13px 30px; border-radius: 999px; cursor: pointer; transition: transform .2s ease, background .2s ease;
}
.contact-form button:hover { transform: scale(1.03); background: var(--fg-2); }
.form-note { min-height: 18px; font-family: var(--mono); font-size: 12px; color: #74d680; letter-spacing: .04em; margin: 0; }

.contact-direct { display: flex; flex-direction: column; gap: 26px; padding-top: 4px; }
.cd-row { display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--line); padding-top: 16px; }
.cd-row span { color: var(--fg-3); font-size: 10px; letter-spacing: .18em; }
.cd-row a, .cd-row p { color: var(--fg-2); font-size: 16px; text-decoration: none; font-family: var(--sans); margin: 0; }
.cd-row a:hover { color: var(--fg); text-decoration: underline; }

@media (max-width: 820px) {
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .about-top { grid-template-columns: 1fr; gap: 30px; }
  .about-portrait { max-width: 300px; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .page-inner { padding: 120px 28px 120px; }
}

/* ───────────────── PROJECT PAGE ───────────────── */
#project-page {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  color: var(--fg);                /* re-scope text colour here so a project's own --fg cascades to un-coloured copy (e.g. the title) */
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(40px);
  pointer-events: none;
}
#project-page.open { pointer-events: auto; visibility: visible; }

#project-back {
  position: fixed; top: 50%; left: 26px; z-index: 45;   /* body-level → fixed to the viewport */
  transform: translateY(-50%); will-change: top;        /* JS floats `top` to follow the cursor vertically */
  width: 46px; height: 46px; border-radius: 50%;        /* circular close button */
  display: grid; place-items: center; font-size: 16px; line-height: 1;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18);
  color: var(--fg); cursor: pointer;
  backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: background .2s ease, transform .2s ease, opacity .4s ease, visibility .4s;
}
#project-back.show { opacity: 1; visibility: visible; pointer-events: auto; }
#project-back:hover { background: rgba(255,255,255,.14); transform: translateY(-50%) scale(1.09); }

/* ── case-study page: header + modular content blocks ── */
.project-head { max-width: 760px; margin: 0 auto; padding: 120px 32px 8px; }
.project-meta { display: flex; justify-content: space-between; color: var(--fg-3); margin-bottom: 14px; }
#p-title {
  font-family: var(--sans); font-weight: 600; font-size: clamp(40px, 7vw, 92px);
  line-height: .98; letter-spacing: -.02em; margin-bottom: 18px;
}
.project-blurb { font-size: clamp(18px, 2.2vw, 24px); line-height: 1.4; color: var(--fg-2); max-width: 620px; margin-bottom: 26px; }
.project-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.project-tags span {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--fg-2);
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
}

/* one width system keeps any assembly composed: text + inline media share the column measure;
   media blocks can break out to `wide` or full-bleed, nothing in between. */
#p-blocks { margin-top: 44px; }
.block { margin: 64px auto 0; }
.block:first-child { margin-top: 0; }
.block[data-w="wide"] { max-width: 1120px; padding: 0 32px; }
.block[data-w="full"] { max-width: 100%; padding: 0; }
.block.text { max-width: 760px; padding: 0 32px; }

.block-kicker { color: var(--fg-3); letter-spacing: .2em; font-size: 11px; margin-bottom: 14px; }
.block-head { font-family: var(--sans); font-weight: 600; font-size: clamp(24px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.02em; color: var(--fg); margin-bottom: 18px; max-width: 18ch; }
.block-body { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.62; color: var(--fg-2); max-width: 640px; }
.block-cap { color: var(--fg-3); letter-spacing: .08em; font-size: 11px; margin-top: 12px; }
.block[data-w="full"] .block-cap { padding: 0 32px; }

/* media wrappers — overflow:clip (NOT hidden) so the scroll-timeline parallax binds to the page
   scroller rather than freezing on the wrapper; hidden stays as the fallback. */
.iwrap, .vplayer {
  position: relative; width: 100%; border-radius: 14px; background: #111;
  overflow: hidden; overflow: clip;
}
.block[data-w="full"] .iwrap, .block[data-w="full"] .vplayer { border-radius: 0; }
.iimg, .vposter { width: 100%; height: 100%; object-fit: cover; display: block; }

/* portrait / square media: cap by height and centre, so a 9:16 never becomes a full-width monolith */
.block.media.portrait { display: flex; flex-direction: column; align-items: center; }
.block.media.portrait .iwrap, .block.media.portrait .vplayer { width: auto; max-width: 100%; height: min(78vh, 760px); }

/* faux video player (poster + play/pause badge + scrubbable track — no real file) */
.vplayer .vplay {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(0,0,0,.42); border: 1.5px solid rgba(255,255,255,.85);
  transition: transform .25s ease, background .25s ease;
}
.vplayer .vplay:hover { transform: scale(1.07); background: rgba(0,0,0,.62); }
.vicon { width: 0; height: 0; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent #fff; }
.vplayer.playing .vicon { width: 18px; height: 20px; border: 0; margin: 0; position: relative; }
.vplayer.playing .vicon::before, .vplayer.playing .vicon::after { content: ''; position: absolute; top: 0; width: 6px; height: 100%; background: #fff; }
.vplayer.playing .vicon::before { left: 0; }
.vplayer.playing .vicon::after { right: 0; }
.vbar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; color: #eee; font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); opacity: 0; transition: opacity .3s ease;
}
.vplayer:hover .vbar, .vplayer.playing .vbar { opacity: 1; }
.vtrack { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.25); cursor: pointer; }
.vtrack > i { display: block; width: 0%; height: 100%; border-radius: 2px; background: #fff; }

/* real embed (YouTube/Vimeo): iframe injected over the poster facade on first play */
.vplayer.vembed .vframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vplayer.vembed.playing .vplay { opacity: 0; pointer-events: none; }

/* gallery — equal-height contact-sheet row of mixed aspect ratios (never crops a 9:16 into 16:9) */
.gallery-row { display: flex; gap: 16px; height: clamp(220px, 34vh, 420px); }
.gallery-row .g-cell { height: 100%; display: flex; }
.gallery-row .vplayer, .gallery-row .iwrap { height: 100%; width: auto; }
.gallery-row .g-cell .block-cap { display: none; }

/* results — centred in the column (canvas) rather than left-justified */
.results-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 32px 64px; border-top: 1px solid var(--line); padding-top: 30px; }
.result { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.result b { font-family: var(--sans); font-weight: 600; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.02em; color: var(--fg); }
.result span { color: var(--fg-3); font-size: 12px; letter-spacing: .06em; }

/* credits — team & roles near the end of the case study (themeable like the rest of the page) */
.credits-inner { max-width: 760px; margin: 0 auto; }
.credits-kicker { color: var(--fg-3); letter-spacing: .2em; font-size: 11px; margin-bottom: 18px; }
.credits-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 40px; margin: 0; }
.credit { display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }
.credit dt { color: var(--fg-3); font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.credit dd { color: var(--fg); font-size: 15px; margin: 0; }
@media (max-width: 600px) { .credits-list { grid-template-columns: 1fr 1fr; } }

/* Scroll-driven parallax on media — native CSS scroll timeline (compositor-thread, no JS).
   Progressive: applies only where supported and when motion is allowed; otherwise the media
   sits still and the GSAP scrub fallback takes over. Each [data-parallax] tracks its own pass
   through the page's scroll container. The scale gives headroom so the ±6% translate never
   reveals the box edges (the .iwrap/.vplayer wrapper clips). */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    [data-parallax] {
      animation: media-parallax linear both;
      animation-timeline: view();
      animation-range: cover;
      will-change: transform;
    }
    @keyframes media-parallax {
      from { transform: scale(1.14) translateY(-6%); }
      to   { transform: scale(1.14) translateY(6%); }
    }
  }
}

@media (max-width: 760px) {
  .gallery-row { flex-direction: column; height: auto; }
  .gallery-row .vplayer, .gallery-row .iwrap { width: 100%; height: auto; }
  .block[data-w="wide"], .block[data-w="full"] { padding: 0 20px; }
  .block[data-w="full"] .iwrap, .block[data-w="full"] .vplayer { border-radius: 14px; }
}

/* related work + see-all — aligned to the wide-block column (1120px) */
.related { max-width: 1120px; margin: 80px auto 0; padding: 26px 32px 0; }
.related-head {
  font-family: var(--sans); font-weight: 600; font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.01em; color: var(--fg); margin-bottom: 22px;
}
.related-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px;
  border-top: 1px solid var(--line); padding-top: 26px;
}
.related-card {
  display: flex; flex-direction: column; gap: 13px;
  background: transparent; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.rc-img { display: block; width: 100%; aspect-ratio: 16/10; border-radius: 8px; overflow: hidden; background: #111; }
.rc-img img { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(.92); transition: transform .5s ease, filter .3s ease; }
.related-card:hover .rc-img img { transform: scale(1.04); filter: brightness(1.06); }
.rc-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rc-title { display: flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: 11px; letter-spacing: .06em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-2); flex: none; }
.rc-client { color: var(--fg-3); font-size: 11px; letter-spacing: .04em; white-space: nowrap; flex: none; }
.related-card:hover .rc-title { color: var(--fg); }

/* two big ghost-text actions side by side, sized to fit the column (.related width) */
.page-actions { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 10px 64px; padding: 36px 0 60px; }
.see-all {
  background: transparent; border: 0; cursor: pointer; text-align: left; white-space: nowrap;
  font-family: var(--sans); font-weight: 600; letter-spacing: -.02em; line-height: 1.05;
  font-size: clamp(26px, 5vw, 62px); color: var(--fg); opacity: .5;
  transition: opacity .35s ease, color .35s ease;
}
.see-all:hover { opacity: 1; }

@media (max-width: 760px) {
  .related-grid { grid-template-columns: 1fr; }
}

#loader {
  position: fixed; inset: 0; z-index: 60; display: grid; place-content: center;
  background: var(--bg); color: var(--fg-2); gap: 16px; transition: opacity .6s ease;
}
#loader span { letter-spacing: .4em; font-size: 12px; }
#loader i { display: block; width: 160px; height: 2px; background: var(--line); overflow: hidden; }
#loader i::after { content:''; display:block; width: 40%; height: 100%; background:var(--fg); animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0%{transform:translateX(-120%)} 100%{transform:translateX(360%)} }
#loader.hidden { opacity: 0; pointer-events: none; }

/* preview-mode badge — only injected when the CMS Preview button opened the site (?preview=1) */
#preview-badge {
  position: fixed; top: 14px; right: 18px; z-index: 80; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  background: rgba(176, 92, 28, 0.94); color: #fff;
  padding: 7px 14px; border-radius: 999px;
  font-size: 10px; letter-spacing: .18em;
  box-shadow: 0 8px 26px rgba(0,0,0,.42);
}
#preview-badge .pv-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pvPulse 1.6s ease-in-out infinite; }
@keyframes pvPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

@media (max-width: 760px) {
  .top-mid, .top-clocks, .top-sound { display: none; }
}

/* ───────────────── INTERACTIVE MODULES (built-in effects + sandboxed code) ─────────────────
   Every module renders inside a sandboxed <iframe>. Whole-page modules float as a fixed,
   click-through overlay (z-index is set inline per context: above the page content, below the
   close button + chrome). In-page modules sit in a fixed box matching the case-study rhythm. */
.fx-overlay {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  border: 0; background: transparent; pointer-events: none;   /* ambient — never blocks the UI underneath */
}
.b-module-frame {
  position: relative; width: 100%; border-radius: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
}
.fx-inline { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.about-modules { display: flex; flex-direction: column; gap: 24px; margin-top: 8px; }
.about-modules:empty { display: none; }
.about-modules .b-module { margin: 32px 0 0; max-width: 100%; padding: 0; }

/* ───────────────── MOBILE / TOUCH ─────────────────
   Touch devices have no hover and no cursor, so: hover-only affordances are surfaced at a
   readable opacity; the cursor-tracking close button is pinned to a static corner (the JS
   stops floating it); and the bottom chrome — which piles up at phone width — is split, with
   the nav kept at the bottom and the grid/list toggle + filter moved to the top where the
   hidden tagline/clocks used to sit. */

/* No hover (any touch device, any width): reveal the ghost-text actions + un-dim related art,
   and stop the close button from cursor-tracking. */
@media (hover: none) {
  .see-all { opacity: .5; }
  .rc-img img { filter: none; }
}
@media (hover: none), (max-width: 600px) {
  #project-back {
    top: 16px !important; bottom: auto; left: auto; right: 16px;
    transform: none !important;                      /* static top-right close — no float */
  }
  #project-back:hover { transform: none !important; }
}

@media (max-width: 600px) {
  /* split the bottom chrome so nav / toggle / filter stop overlapping */
  .view-toggle { top: 18px; bottom: auto; left: 92px; }                 /* up top, clear of the logo */
  .filter { top: 17px; bottom: auto; right: 16px; padding: 9px 18px; font-size: 14px; }
  #filter-panel { top: 58px; bottom: auto; right: 16px; transform-origin: top right; }
  .bottom-nav { gap: 2px; padding: 5px; }
  .bottom-nav button { padding: 9px 15px; font-size: 15px; white-space: nowrap; }

  /* readable, tighter tile-page actions */
  .see-all { opacity: .5; font-size: clamp(20px, 6.5vw, 28px); }
  .page-actions { gap: 6px 24px; padding: 26px 0 72px; }

  /* stack each social row's label above its handles */
  .soc-row { grid-template-columns: 1fr; gap: 4px; }
}
