/* Case study pages (/work/<slug>/) and the /work/ index.
   White, black, grey; glass only on frames and buttons; motion uses the
   same soft ease as the home panels (--ease-out in site.css). */

.case { padding-bottom: 40px; }
.case[aria-busy="true"]::after {
  content: ""; display: block; width: 28px; height: 28px; margin: 30vh auto;
  border: 1.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%;
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.case-nav { position: sticky; top: 0; z-index: 5; padding: 14px 24px; font-size: 14px;
  background: rgba(255,255,255,.72); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(0,0,0,.05); }
.case-nav a { text-decoration: none; color: var(--muted); transition: color 300ms var(--ease-out); }
.case-nav a:hover { color: var(--ink); }

.case .wrap { max-width: 1080px; padding-top: 0; padding-bottom: 0; }

/* ---------- hero ---------- */
.case-hero { padding-top: clamp(48px, 10vh, 110px); }
.hero-text h1 { margin: 0; font-size: clamp(40px, 7.4vw, 92px); line-height: .96; letter-spacing: -.045em; font-weight: 600; max-width: 14ch; }
.hero-text .lede { max-width: 38ch; }
.hero-body { max-width: 60ch; color: #444; }
.eyebrow { display: flex; gap: 12px; align-items: center; }
.tier { padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; font-size: 11px; letter-spacing: .06em; color: var(--ink); }

.meta { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 36px 0 0; font-size: 14px; }
.meta dt { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.meta dd { margin: 0; }
.live { margin: 32px 0 0; }

.btn-glass {
  display: inline-block; padding: 12px 20px; border-radius: 99px; text-decoration: none; font-size: 15px;
  background: rgba(17,17,17,.04); border: 1px solid rgba(17,17,17,.08);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background 400ms var(--ease-out), transform 400ms var(--ease-out);
}
.btn-glass:hover { background: rgba(17,17,17,.08); transform: translateY(-1px); }

/* Desktop shot big, mobile shot overlapping its corner. */
.hero-stage { position: relative; max-width: 1240px; margin: clamp(48px, 8vh, 96px) auto 0; padding: 0 24px; }
.hero-stage .shot-desktop { margin: 0; }
.hero-stage .shot-mobile { position: absolute; right: clamp(8px, 4vw, 64px); bottom: -6%; width: clamp(120px, 20%, 260px); margin: 0; }
.hero-stage[data-count="1"] .shot-mobile { position: static; margin: 0 auto; width: min(320px, 70%); }

/* ---------- frames ---------- */
.shot { margin: 0; }
.shot figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); }
.frame { position: relative; overflow: hidden; background: #fafafa; }
.frame-screen > img, .frame-screen > video { display: block; width: 100%; height: auto; }
.frame-desktop { border-radius: 14px; border: 1px solid rgba(0,0,0,.08); box-shadow: 0 30px 80px -30px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.04); }
.frame-bar { display: flex; gap: 6px; padding: 10px 12px; background: rgba(250,250,250,.8); border-bottom: 1px solid rgba(0,0,0,.06); }
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: #e2e2e2; }
.frame-mobile { border-radius: 30px; border: 6px solid #111; box-shadow: 0 30px 70px -25px rgba(0,0,0,.35); }
.frame-tablet { border-radius: 22px; border: 8px solid #111; }
.frame-none { border-radius: 12px; border: 1px solid rgba(0,0,0,.06); }

.case-sec { max-width: 1080px; margin: clamp(96px, 16vh, 180px) auto 0; padding: 0 24px; }
.sec-head { display: flex; gap: 16px; align-items: baseline; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sec-title { margin: 14px 0 0; font-size: clamp(28px, 4.2vw, 48px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600; max-width: 20ch; }
.sec-intro { max-width: 60ch; color: #444; font-size: 18px; }
.sub { margin: 56px 0 18px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* ---------- galleries ---------- */
.gallery { display: grid; gap: 22px; margin-top: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.gallery .shot-mobile { max-width: 300px; }
.gallery[data-count][data-mobiles]:not([data-mobiles="0"]) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.gallery .shot-desktop { grid-column: 1 / -1; }
/* one desktop + one mobile of the same screen: side by side, bottoms aligned */
.posters { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)) !important; }
.posters .shot-none { grid-column: auto; }

/* ---------- horizontal strips ---------- */
.strip { position: relative; margin-top: 28px; container-type: inline-size; }
.strip-track {
  display: flex; gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; padding: 6px 2px 26px;
  scrollbar-width: none; cursor: grab; outline: none;
  /* runs on to the right edge of the window: a device is only cut by the window */
  margin-right: calc(-1 * var(--bleed-r, 0px));
  padding-right: calc(var(--bleed-r, 0px) + var(--tail, 0px));
}
/* soft edges: the right edge (window side) always fades; the left one only
   once the strip has moved, so the first device is never faded at rest */
.strip:not(.is-cyl):not(.is-solo) .strip-track { --fl: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - 72px), transparent);
          mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - 72px), transparent); }
.strip.is-scrolled:not(.is-cyl) .strip-track { --fl: 72px; }
.strip.is-solo .strip-track { cursor: default; margin-right: 0; padding-right: 2px; }
.strip-track::-webkit-scrollbar { display: none; }
.strip-track > .shot { transition: opacity 500ms var(--ease-out); }
.strip-track > .shot.is-past { opacity: 0; }
.strip-track.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.strip-track.dragging img, .strip-track.dragging video { pointer-events: none; }
.strip-track:focus-visible { box-shadow: 0 0 0 2px var(--ink); border-radius: 12px; }
.strip-track > .shot { flex: none; scroll-snap-align: start; }
.strip-track > .shot-desktop { width: min(82%, 860px); }
.strip-track > .shot-tablet { width: min(62%, 560px); }
.strip-track > .shot-mobile { width: clamp(170px, 22%, 250px); }
.strip-track > .shot-none { width: clamp(200px, 30%, 300px); }
.collateral-strip .strip-track > .shot-none { width: auto; }
.collateral-strip .strip-track > .shot-none .frame { background: #f4f5f8; border-color: transparent; }
.collateral-strip .frame-screen > img { height: clamp(240px, 44vh, 460px); width: auto; max-width: 86vw; object-fit: contain; }
.collateral-strip figcaption { max-width: 40ch; }
.strip-track img, .strip-track video { -webkit-user-drag: none; }
/* controls: one glass pill in front of the media, Apple style */
.strip-ui { position: absolute; left: 50%; bottom: 8px; z-index: 6; display: flex; align-items: center; gap: 10px;
  translate: -50% 0; pointer-events: none; }
.strip-ui > * { pointer-events: auto; }
.strip-pill, .strip-play { background: rgba(232,234,238,.74); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 6px 18px -10px rgba(17,24,39,.35); }
.strip-pill { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 6px; border-radius: 99px; }
.strip-dots { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.strip-dot { position: relative; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; cursor: pointer; overflow: hidden;
  background: rgba(17,24,39,.32); transition: width 500ms var(--ease-out), background 500ms var(--ease-out); }
.strip-dot::before { content: ""; position: absolute; inset: -10px -4px; }
.strip-dot > i { position: absolute; inset: 0; background: #1d1d1f; transform: scaleX(0); transform-origin: left; border-radius: inherit; }
.strip-dot.is-on { width: 44px; background: rgba(17,24,39,.16); }
.strip-dot:not(.is-on) > i { transform: none !important; background: transparent; }
.strip-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: #1d1d1f; font: inherit; font-size: 15px; cursor: pointer;
  transition: background 300ms var(--ease-out), opacity 300ms var(--ease-out); }
.strip-btn:hover:not(:disabled) { background: rgba(17,24,39,.08); }
.strip-btn:disabled { opacity: .28; cursor: default; }
.strip-play { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #1d1d1f;
  transition: transform 300ms var(--ease-out); }
.strip-play svg { width: 20px; height: 20px; fill: currentColor; }
.strip-play:hover { transform: scale(1.06); }
.strip-ui[data-state="done"] .strip-play { background: rgba(29,29,31,.86); color: #fff; }
@media (hover: none) { .strip-btn { display: none; } .strip-pill { padding: 0 4px; } }
@media (prefers-reduced-motion: reduce) { .strip-play { display: none; } }

/* ---------- system ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 44px 0; border-top: 1px solid var(--line); }
@media (min-width: 980px) {
  .feature { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 48px; align-items: start; }
  .feature-text { position: sticky; top: 72px; }
  .feature > .gallery, .feature > .strip { margin-top: 0; }
  .feature .strip-track > .shot-desktop { width: min(92%, 760px); }
  .feature-text > .strip-ui { position: static; translate: none; margin-top: 22px; }
  .feature > .strip.ui-docked .strip-track { padding-bottom: 8px; }
}
.feature h4 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; font-weight: 600; }
.feature-text p { margin: 0 0 10px; max-width: 62ch; color: #444; }
.feature-text .feature-link { margin: 14px 0 0; }
.feature.is-highlight h4::after { content: "★"; margin-left: 10px; font-size: 14px; color: var(--muted); vertical-align: 3px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; }
.tags li { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: #f4f4f4; color: #555; }

.arch-list, .dash { margin: 0; padding: 0; list-style: none; }
.arch-list li, .dash li { padding: 10px 0; border-top: 1px solid var(--line); color: #333; }

/* ---------- style ---------- */
.palette { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.palette li { display: grid; gap: 2px; font-size: 14px; }
.swatch { display: block; aspect-ratio: 4 / 3; border-radius: 12px; border: 1px solid rgba(0,0,0,.06); margin-bottom: 8px; }
.palette code { background: none; padding: 0; color: var(--muted); }
.palette em, .fonts em { font-style: normal; color: var(--muted); font-size: 13px; }
.fonts { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 32px; }
.fonts li { display: grid; gap: 2px; }
.font-sample { display: flex; gap: 14px; font-size: 64px; line-height: 1; letter-spacing: -.03em; }
.font-sample b { font-weight: 800; }
.font-sample i { font-style: normal; font-weight: 200; }
.kit { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.kit-item { display: grid; gap: 2px; font-size: 14px; }
.kit-art { aspect-ratio: 1; border-radius: 14px; background: #f4f5f8; border: 1px solid rgba(0,0,0,.05); display: grid; place-items: center; overflow: hidden; margin-bottom: 8px;
  transition: transform 600ms var(--ease-out); }
.kit-art img { width: 70%; height: 70%; object-fit: contain; }
.kit-item.is-fill .kit-art img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) { .kit-item:hover .kit-art { transform: translateY(-3px); } }
.kit-item em { font-style: normal; color: var(--muted); font-size: 13px; }
.cols { display: grid; gap: 0 48px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

/* ---------- insight split (left mockup, right data) ---------- */
.split { display: grid; gap: 48px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; margin-top: 36px; }
.split > .gallery { margin-top: 0; }
.split-solo { grid-template-columns: 1fr; }
.split-data { border-left: 1px solid var(--ink); padding-left: 32px; }
.stats { margin: 0; display: grid; gap: 28px; }
.stat dt { color: var(--muted); font-size: 14px; }
.stat dd { margin: 2px 0 0; font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -.04em; font-weight: 600; }
.stat-src { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.impact-grid { display: grid; gap: clamp(24px, 5vw, 72px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; margin-top: 8px; }
.impact-lead .sec-title { margin: 0 0 .35em; }
.impact-rest { padding-top: .5em; }
.impact-lead .impact-p { margin: 0; font-size: clamp(26px, 3.4vw, 44px); line-height: 1.12; letter-spacing: -.03em; font-weight: 500; position: sticky; top: 110px; }
.impact-rest .impact-p { margin: 0 0 1em; font-size: 16px; line-height: 1.6; color: #444; max-width: 62ch; }
.impact-stats { margin-top: clamp(40px, 6vw, 72px); padding-top: 28px; border-top: 1px solid var(--ink); }
.impact-stats .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 28px 32px; }
.impact-stats .stat dd { font-size: clamp(32px, 3.6vw, 48px); }
.impact-stats .stat { display: flex; flex-direction: column; gap: 6px; }
.impact-stats .stat dd { order: -1; }
@media (max-width: 860px) { .impact-grid { grid-template-columns: 1fr; } .impact-lead .impact-p { position: static; } }
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .split-data { border-left: 0; border-top: 1px solid var(--ink); padding: 24px 0 0; }
}

/* ---------- foot ---------- */
.case-foot { margin-top: clamp(96px, 16vh, 180px); padding-top: 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 14px; }
.next { display: grid; text-align: right; text-decoration: none; }
.next strong { font-size: 22px; letter-spacing: -.02em; transition: transform 400ms var(--ease-out); }
.next:hover strong { transform: translateX(-6px); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- /work/ index ---------- */
.cases { list-style: none; margin: 0; padding: 0; display: grid; gap: 56px; }
.case-card a { display: grid; gap: 18px; text-decoration: none; }
.case-card .frame { transition: transform 700ms var(--ease-out), box-shadow 700ms var(--ease-out); }
@media (hover: hover) { .case-card a:hover .frame { transform: translateY(-4px); } }
.case-card .card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.case-card strong { font-size: 24px; letter-spacing: -.02em; font-weight: 600; }
.case-card p { margin: 4px 0 0; color: #555; max-width: 60ch; }
.case-card em { font-style: normal; font-size: 13px; color: var(--muted); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .case[aria-busy="true"]::after { animation: none; }
}

/* =========================================================
   Device mockups, viewer and depth (layered shadows)
   ========================================================= */
:root {
  /* three-layer shadows: contact, mid, ambient. Reads as real depth. */
  --sh-1: 0 1px 1px rgba(17,24,39,.04), 0 2px 6px rgba(17,24,39,.05), 0 10px 24px -10px rgba(17,24,39,.14);
  --sh-2: 0 1px 2px rgba(17,24,39,.05), 0 8px 18px -6px rgba(17,24,39,.10), 0 30px 60px -20px rgba(17,24,39,.24);
  --sh-3: 0 2px 4px rgba(17,24,39,.06), 0 18px 36px -10px rgba(17,24,39,.16), 0 60px 110px -30px rgba(17,24,39,.32);
  --phone: clamp(150px, 17vw, 230px);   /* width of a phone SCREEN in strips */
}

.mock { position: relative; width: 100%; isolation: isolate; } /* own stack: a neighbour's art never paints over this screen */
.mock-screen { position: absolute; overflow: hidden; background: #0b0b0b; z-index: 0; }
.mock-phone .mock-screen { border-radius: 9% / 4.2%; }
.mock-laptop .mock-screen { border-radius: .6% / 1%; }
.mock-screen > img, .mock-screen > video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
/* A shot shorter than the screen sits at the top, like a page that ends early. */
.mock-screen.fit-w { background: #fff; }
.mock-screen.fit-w > img, .mock-screen.fit-w > video { height: auto; }
.mock-screen.masked { border-radius: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.mock-art { position: relative; z-index: 1; display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
/* Natural shadow: a soft contact shadow on the "table" under the laptop,
   drawn inside the mockup so no scrolling box can clip it into a rectangle. */
.mock-laptop::before { content: ""; position: absolute; z-index: 0; left: 3%; right: 3%; bottom: -3.2%; height: 9%;
  background: radial-gradient(50% 50% at 50% 40%, rgba(17,24,39,.30), rgba(17,24,39,.10) 55%, rgba(17,24,39,0) 100%);
  pointer-events: none; transition: transform 700ms var(--ease-out), opacity 700ms var(--ease-out); }
.mock-phone:not(:has(.mock-art[src*="hand"]))::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: -2%; height: 4%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(17,24,39,.25), rgba(17,24,39,0)); }
/* phone screens: status bar in the page's own top colour, short shots run into its bottom colour */
.mock-screen.is-phone { background: linear-gradient(var(--top, #fff) 0 6%, var(--bottom, #fff) 6%); }
.mock-screen.is-phone > img, .mock-screen.is-phone > video { height: auto; object-fit: initial; margin-top: 12%; }
.mock-screen.is-phone.fit-w > img, .mock-screen.is-phone.fit-w > video { -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
.mock-screen.fit-w:not(.is-phone) { display: grid; align-items: start; }

.shot.has-mock .mock, .posters .frame, .collateral-strip .frame {
  transition: transform 600ms var(--ease-out), box-shadow 600ms var(--ease-out);
}
/* hover: the device grows a little, nothing opens */
@media (hover: hover) {
  .shot.has-mock:hover .mock { transform: scale(1.035); }
  .strip-track > .shot.has-mock .mock { transform-origin: 0 45%; } /* grow away from the strip's left edge */
  .shot.has-mock:hover .mock-laptop::before { opacity: .8; }
}
.shot.has-mock { position: relative; }
.shot.has-mock:focus { outline: none; }
.shot.has-mock:focus-visible .mock { outline: 2px solid var(--ink); outline-offset: 8px; border-radius: 14px; }

/* Laptops replace the browser frame: no box, no border */
.shot.has-mock .mock + figcaption, .shot.has-mock figcaption { margin-top: 18px; }

/* phone width = wanted screen width / share of the image that is screen */
/* ...but never taller than the screen minus the header and the strip arrows */
.shot-mobile.has-mock { width: min(calc(var(--phone) / var(--sw-fig, .5)), calc((100svh - 250px) / var(--ar, 2))); max-width: 100%; }

/* strips */
.strip-track { padding-top: 18px; padding-bottom: 68px; }
/* Every device in a strip shows its SCREEN at the same height (--S), and all
   screens start at the same line, so a laptop and a phone read at one scale.
   --sh = screen height / image height, --st = screen top / screen height. */
.strip-track { align-items: flex-start; }
.strip-track > .shot.has-mock { --S: min(calc(100svh - 330px), 40cqi, 520px);
  width: calc(var(--S) / (var(--sh, .8) * var(--ar, .6))); max-width: none;
  margin-top: calc(var(--S) * (.07 - var(--st, .05))); }
@supports not (width: 1cqi) { .strip-track > .shot.has-mock { --S: min(calc(100svh - 330px), 420px); } }
@media (max-width: 700px) { .strip-track > .shot.has-mock { --S: min(calc(100svh - 300px), 62vw); } }
/* Instagram feed: a 3D cylinder. JS bends each card by its distance from the middle. */
.strip.is-cyl .strip-track { align-items: flex-start;
  margin-inline: calc(-1 * var(--bleed-l, 0px)) calc(-1 * var(--bleed-r, 0px));
  padding-inline: calc(50% - clamp(110px, 13cqi, 170px)); padding-top: 34px; padding-bottom: 128px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.strip.is-cyl .strip-track > .shot { scroll-snap-align: center; transform-origin: 50% 50%; will-change: transform; }
.strip.is-cyl .strip-track > .shot-none { width: clamp(220px, 26cqi, 340px); }
.strip.is-cyl figcaption { opacity: 0; transition: opacity 400ms var(--ease-out); }
.strip.is-cyl .shot.is-cur figcaption { opacity: 1; }
.strip.is-cyl .strip-ui { bottom: 8px; }
/* what the post is, when it ran, where to see it */
.ig-meta { display: grid; justify-items: center; gap: 3px; margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted); }
.ig-meta strong { color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ig-type { padding: 3px 9px; border-radius: 99px; background: rgba(17,24,39,.06); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #333; }
.ig-meta a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(17,24,39,.3); }
.ig-meta a:hover { text-decoration-color: currentColor; }
.posters-intro { max-width: 62ch; }
/* a single device (style, insight): centred */
.gallery.style-media, .gallery.insight-media { display: flex; justify-content: center; }
.gallery.style-media > .shot-desktop.has-mock { width: min(100%, 920px); }
.strip.style-media.is-solo .strip-track, .strip.insight-media.is-solo .strip-track { justify-content: center; }
.strip.style-media.is-solo .strip-track > .shot-desktop { width: min(100%, 920px); }
.gallery > .shot-desktop.has-mock { max-width: calc((100svh - 200px) / var(--ar, .573)); }

/* hero: big laptop, phone in hand overlapping its corner */
.hero-stage { padding-bottom: 40px; }
.hero-stage .shot-desktop.has-mock { max-width: min(1080px, calc((100svh - 150px) / var(--ar, .573))); margin: 0 auto; }
.hero-stage .shot-mobile.has-mock { position: absolute; right: clamp(-10px, 1vw, 24px); bottom: 0; --phone: clamp(72px, 9.5vw, 140px); width: calc(var(--phone) / var(--sw-fig, .5)); }

/* IG cards and print pieces lift on hover */
.posters .frame, .collateral-strip .frame { box-shadow: var(--sh-1); border: 0; }
@media (hover: hover) {
  .posters .shot:hover .frame, .collateral-strip .shot:hover .frame { transform: translateY(-8px); box-shadow: 0 2px 4px rgba(17,24,39,.06), 0 16px 26px -12px rgba(17,24,39,.32); }
}

/* depth elsewhere */
.frame-desktop, .frame-tablet { box-shadow: var(--sh-2); }
.frame-none { box-shadow: var(--sh-1); }
.swatch { box-shadow: var(--sh-1), inset 0 1px 0 rgba(255,255,255,.25); border: 0; transition: transform 500ms var(--ease-out), box-shadow 500ms var(--ease-out); }
.kit-art { box-shadow: var(--sh-1); border: 0; transition: transform 600ms var(--ease-out), box-shadow 600ms var(--ease-out); }
@media (hover: hover) {
  .palette li:hover .swatch { transform: translateY(-4px); box-shadow: var(--sh-2); }
  .kit-item:hover .kit-art { box-shadow: var(--sh-2); }
}
.split-data { box-shadow: none; }

/* =========================================================
   Phones and tablets: light enough for iPhone Safari.
   Filters and backdrop blurs on dozens of large images made it run out of
   memory and reload the page, so small screens get cheap shadows instead.
   ========================================================= */
@media (max-width: 900px), (hover: none) {
  .mock-laptop, .mock-phone { filter: none; }
  .strip-track, .strip:not(.is-cyl):not(.is-solo) .strip-track { -webkit-mask-image: none; mask-image: none; }
  .strip-pill, .strip-play { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(236,238,241,.96); }
  .shot.has-mock .mock, .posters .frame, .collateral-strip .frame { transition: none; }
  .posters .frame, .collateral-strip .frame { box-shadow: 0 1px 2px rgba(17,24,39,.06), 0 10px 22px -10px rgba(17,24,39,.22); }
}
/* Phones: the feed keeps its cylinder (cards about two thirds of the
   screen, the current one centred), without the edge mask; devices never
   run wider than the screen; a lone device sits in the middle. */
@media (max-width: 700px) {
  .strip.is-cyl .strip-track { -webkit-mask-image: none; mask-image: none;
    padding-inline: calc(50% - 33vw); padding-top: 22px; padding-bottom: 150px; }
  .strip.is-cyl .strip-track > .shot-none { width: 66vw; }
  .strip-track > .shot.has-mock { max-width: calc(100vw - 48px); }
  .strip-track > .shot.shot-pair.has-mock { max-width: calc(100vw - 40px); }
}
.strip.is-solo .strip-track { justify-content: center; }
.strip.is-solo .strip-track > .shot { scroll-snap-align: center; }

/* A pair: laptop with its phone standing in front of the right corner. */
.strip-track > .shot.shot-pair.has-mock { width: calc(var(--S) / (var(--sh, .8) * var(--ar, .6)) / .86); }
.shot.shot-pair { position: relative; }
.shot.shot-pair > .shot { margin: 0; }
.shot.shot-pair > .shot-desktop.has-mock { width: 86%; max-width: none; }
.shot.shot-pair > .shot-mobile.has-mock { position: absolute; right: 0; top: 18%; width: 27%; max-width: none; z-index: 2; }
.shot.shot-pair > figcaption { max-width: 80%; }

/* =========================================================
   Access hierarchy: a stacked deck
   ========================================================= */
.role-deck { --peek: 64px; --open: 132px; list-style: none; margin: 8px 0 0; padding: 0; position: relative; max-width: 860px;
  perspective: 1600px; }
.role-card { position: relative; z-index: var(--z); margin: 0 0 calc(var(--peek) - var(--open)) calc(var(--i) * min(2.4vw, 18px));
  height: var(--open); padding: 18px 22px; border-radius: 18px; background: #fff; cursor: pointer; outline: none;
  box-shadow: 0 1px 1px rgba(17,24,39,.04), 0 -6px 16px -10px rgba(17,24,39,.16), 0 10px 24px -14px rgba(17,24,39,.22);
  border: 1px solid rgba(17,24,39,.05);
  transform: translateY(0) scale(calc(1 - var(--i) * .006)); transform-origin: 50% 0;
  transition: transform 600ms var(--ease-out), box-shadow 600ms var(--ease-out), background 400ms; }
.role-card:last-child { margin-bottom: 0; }
/* top card is the most powerful: darker */
.role-card:first-child { background: var(--ink, #111); color: #fff; }
.role-card:first-child .role-num, .role-card:first-child .role-more p { color: rgba(255,255,255,.7); }
.role-top { display: flex; align-items: baseline; gap: 14px; height: calc(var(--peek) - 36px); }
.role-num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.role-top strong { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.role-grants-tag { margin-left: auto; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px;
  background: rgba(17,24,39,.06); color: #555; }
.role-card:first-child .role-grants-tag { background: rgba(255,255,255,.14); color: #fff; }
.role-more { padding-left: 28px; opacity: .0; transform: translateY(-6px); transition: opacity 400ms var(--ease-out), transform 500ms var(--ease-out); }
.role-more p { margin: 6px 0 0; font-size: 15px; color: #444; line-height: 1.45; }
.role-more .role-grants { color: var(--muted); font-size: 14px; }
.role-card.is-open { transform: translateY(-6px) scale(1.012); box-shadow: 0 2px 4px rgba(17,24,39,.06), 0 24px 40px -18px rgba(17,24,39,.36); }
.role-card.is-open .role-more { opacity: 1; transform: none; }
.role-card.is-after { transform: translateY(calc(var(--open) - var(--peek) + 6px)) scale(calc(1 - var(--i) * .006)); }
/* the deck needs room for the opened card at the bottom */
.role-deck::after { content: ""; display: block; height: 0; transition: height 600ms var(--ease-out); }
.role-deck[data-open]:not([data-open=""])::after { height: calc(var(--open) - var(--peek)); }
.role-card:focus-visible { box-shadow: 0 0 0 2px var(--ink), 0 24px 40px -18px rgba(17,24,39,.36); }
@media (max-width: 640px) { .role-deck { --peek: 58px; --open: 150px; } .role-card { margin-left: calc(var(--i) * 6px); padding: 16px; } .role-more { padding-left: 0; } }
@media (prefers-reduced-motion: reduce) { .role-card, .role-more { transition: none; } }

/* =========================================================
   Beyond the screen: scenes
   ========================================================= */
.scene { margin: clamp(48px, 8vw, 96px) 0 0; }
.scene-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 40px; align-items: baseline; margin-bottom: 8px; }
.scene-head h4 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.scene-head p { margin: 0; color: #555; font-size: 15px; line-height: 1.55; max-width: 60ch; }
@media (max-width: 760px) { .scene-head { grid-template-columns: 1fr; } }
.scene { --px: 0; --py: 0; }

/* medals hanging over their ribbon */
.medal-stage { position: relative; padding: clamp(24px, 5vw, 60px) 0 clamp(36px, 5vw, 64px); }
.medal-ribbon { position: absolute; top: 8%; left: -4%; width: 108%; opacity: .55; pointer-events: none;
  transform: translate(calc(var(--px) * -12px), calc(var(--py) * -6px)); transition: transform 900ms var(--ease-out); }
.medal-ribbon-img { display: block; width: 100%; height: auto; position: relative; }
/* plain band carrying the printed ribbon on to both window edges (band: rows 217-358, cols 88-1512 of 1600x578) */
.rib-ext { position: absolute; top: 37.6%; height: 24.6%; width: 100vw;
  background: linear-gradient(#f1f2f3, #ececed 55%, #e4e5e7); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.rib-ext.l { right: calc(100% - 5.6%); }
.rib-ext.r { left: 94.5%; }
.medal-row { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 3vw, 40px); }
.medal { position: relative; width: clamp(110px, 24vw, 300px); margin: 0; text-align: center; perspective: 900px; }
.medal.is-center { width: clamp(130px, 29vw, 360px); margin-bottom: clamp(20px, 4vw, 48px); }
.medal-body { position: relative; transform-origin: 50% 0;
  transform: rotateY(calc(var(--px) * 18deg)) rotateX(calc(var(--py) * -8deg));
  transition: transform 900ms var(--ease-out); animation: medal-sway 6s ease-in-out infinite; animation-delay: calc(var(--d) * -1.7s); }
.medal-img { display: block; width: 100%; height: auto; }
.medal-shine { position: absolute; inset: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 48%, rgba(255,255,255,.0) 60%) no-repeat;
  background-size: 260% 100%; background-position: calc(100% + var(--px) * 60%) 0; mix-blend-mode: soft-light; transition: background-position 900ms var(--ease-out); }
.medal-floor { display: block; height: 18px; margin: 10px auto 0; width: 70%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(17,24,39,.28), rgba(17,24,39,0)); }
.medal figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
@keyframes medal-sway { 0%, 100% { rotate: -1.6deg; } 50% { rotate: 1.6deg; } }
@media (hover: hover) and (pointer: fine) {
  .medal:hover .medal-body { animation-play-state: paused; transform: rotateY(calc(var(--px) * 18deg + 10deg)) translateY(-8px) scale(1.04); }
}

/* drop banners hanging from a pole, seen at an angle */
.banner-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin: 0 -24px; padding: 0 24px; }
.banner-scroll::-webkit-scrollbar { display: none; }
.banner-stage { min-width: 560px; perspective: 1800px; perspective-origin: 50% 30%; padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 80px); }
.banner-rig { position: relative; width: 92%; margin: 0 auto; transform-style: preserve-3d;
  transform: rotateY(calc(-17deg + var(--px) * 7deg)) rotateX(calc(4deg + var(--py) * -3deg)); transition: transform 1100ms var(--ease-out); }
.pole { position: relative; z-index: 2; height: clamp(10px, 1.1vw, 16px); border-radius: 99px; margin: 0 -3%;
  background: linear-gradient(#f4f5f7 0%, #c9ccd2 28%, #8d929b 55%, #5c616a 78%, #9aa0a8 100%);
  box-shadow: 0 6px 10px -4px rgba(17,24,39,.35); }
.pole-cap { position: absolute; top: 50%; width: clamp(16px, 1.8vw, 26px); aspect-ratio: 1; border-radius: 50%; translate: 0 -50%;
  background: radial-gradient(circle at 35% 35%, #fff, #b8bcc3 45%, #5c616a 100%); box-shadow: 0 4px 8px -2px rgba(17,24,39,.4); }
.pole-cap.l { left: -6px; } .pole-cap.r { right: -6px; }
.banner-row { display: grid; grid-template-columns: repeat(var(--count), 1fr); gap: 3.2%; padding: 0 3%; margin-top: -2px; transform-style: preserve-3d; }
.banner { position: relative; transform-origin: 50% 0; transform-style: preserve-3d;
  animation: banner-sway 7s ease-in-out infinite; animation-delay: calc(var(--d) * -1.3s); }
.has-wind .banner { animation: none; will-change: transform; }
.banner .clip { position: absolute; top: -9px; width: 10px; height: 16px; border-radius: 3px; z-index: 3;
  background: linear-gradient(90deg, #4a4f57, #a6abb3 50%, #4a4f57); box-shadow: 0 2px 3px rgba(0,0,0,.25); }
.banner .clip.l { left: 16%; } .banner .clip.r { right: 16%; }
.banner-cloth { position: relative; overflow: hidden; border-radius: 1px;
  box-shadow: 0 1px 1px rgba(17,24,39,.1), 0 18px 28px -14px rgba(17,24,39,.45), 0 40px 60px -30px rgba(17,24,39,.35); }
/* fabric: a soft fold shading over the print */
.banner-cloth::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.10), rgba(255,255,255,.08) 22%, rgba(0,0,0,0) 45%, rgba(0,0,0,.06) 70%, rgba(255,255,255,.06) 85%, rgba(0,0,0,.12)),
              linear-gradient(rgba(0,0,0,.16), rgba(0,0,0,0) 6%); }
/* a ripple of light running down the cloth as the wind moves it */
.has-wind .banner-cloth::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(172deg, transparent 0 35%, rgba(255,255,255,.16) 45%, rgba(0,0,0,.07) 55%, transparent 65%) 0 var(--wave, 0%) / 100% 200%;
  mix-blend-mode: soft-light; }
.banner-img { display: block; width: 100%; height: auto; }
.banner-floor { position: absolute; left: 0; right: 0; bottom: -9%; height: 4%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(17,24,39,.16), rgba(17,24,39,0)); }
@keyframes banner-sway { 0%, 100% { transform: rotateX(0deg) rotateZ(-.4deg); } 50% { transform: rotateX(-3deg) rotateZ(.4deg); } }


/* wayfinding: signs mounted on a wall, viewed from the side */
.way-stage { perspective: 1800px; padding: clamp(20px, 4vw, 48px) 0 clamp(24px, 4vw, 56px); }
.way-wall { position: relative; padding: clamp(18px, 3vw, 40px); border-radius: 22px; transform-style: preserve-3d;
  background: linear-gradient(135deg, #f7f8fa, #eceef2); box-shadow: inset 0 1px 0 #fff, 0 30px 60px -40px rgba(17,24,39,.35);
  transform: rotateY(calc(12deg + var(--px) * -6deg)) rotateX(calc(3deg + var(--py) * -2deg)); transition: transform 1100ms var(--ease-out); }
.way-signs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 20px); transform-style: preserve-3d; }
.way-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 16px); margin-top: clamp(16px, 2.4vw, 32px); transform-style: preserve-3d; }
.way-sign, .way-tile { transform: translateZ(14px); transition: transform 600ms var(--ease-out); }
.way-sign img, .way-tile img { display: block; width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 1px 1px rgba(17,24,39,.12), 6px 12px 18px -10px rgba(17,24,39,.45); }
@media (hover: hover) and (pointer: fine) {
  .way-sign:hover, .way-tile:hover { transform: translateZ(46px) translateY(-4px); }
}
@media (max-width: 700px) {
  .way-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .way-signs { grid-template-columns: 1fr; }
  .way-wall { transform: rotateY(8deg); }
}
@media (prefers-reduced-motion: reduce) { .medal-body, .banner { animation: none; } }

/* things that run on to the window edge never make the page scroll sideways */
.case { overflow-x: clip; }
