/* ============================================================
   REDESIGN v3 — one page, three inherited pieces:
   1) hero: the typographic positioning hero (pill nav, eyebrow,
      three-line title, sub, scroll cue) — dark by default
   2) intro: the giant paragraph with greyed highlights
   3) work: the ORIGINAL tennis-era "Selected Projects" section —
      poster card left, mark/name/desc/badge right, 3D hover video
   Case pages: basement.studio showcase (sticky aside + media
   grid) — dark by default. Light theme via the nav toggle.
   Fonts self-hosted: General Sans + JetBrains Mono.
   ============================================================ */

@font-face {
  font-family: 'General Sans';
  src: url('../assets/fonts/general-sans-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../assets/fonts/general-sans-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../assets/fonts/general-sans-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono-var.woff2') format('woff2');
  font-weight: 100 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter Display';
  src: url('../assets/fonts/inter-display-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- tokens (dark leads) ---------- */
:root,
[data-theme="dark"] {
  --bg: #121212;                        /* tennis-era supersolid grey-black */
  --ink: #eaf9fb;                       /* its cold off-white */
  --ink-soft: rgba(234, 249, 251, 0.66);
  --muted: rgba(234, 249, 251, 0.5);
  --hairline: rgba(234, 249, 251, 0.14);
  --accent: #ff4d00;
  --card: rgba(234, 249, 251, 0.05);
  --badge: rgba(234, 249, 251, 0.08);
  --pill: rgba(18, 18, 18, 0.3);
  --glow: rgba(255, 255, 255, 0.07);
  --sans: 'General Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --edge: clamp(20px, 4vw, 64px);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ececea;
  --ink: #1c1c1c;
  --ink-soft: rgba(28, 28, 28, 0.66);
  --muted: rgba(28, 28, 28, 0.5);
  --hairline: rgba(28, 28, 28, 0.16);
  --card: rgba(33, 33, 33, 0.05);
  --badge: rgba(33, 33, 33, 0.08);
  --pill: rgba(242, 242, 242, 0.32);
  --glow: rgba(255, 255, 255, 0.85);
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: none; text-size-adjust: none; background: var(--bg); }
body {
  font-family: var(--sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease, opacity 0.3s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- film grain (kept from the tennis site) ---------- */
.grain {
  position: fixed; inset: -100px;
  z-index: 9000;
  pointer-events: none;
  will-change: transform;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grainShift 0.6s steps(4) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-34px, 22px); }
  50%  { transform: translate(20px, -30px); }
  75%  { transform: translate(-14px, -12px); }
  100% { transform: translate(26px, 18px); }
}

/* ---------- header: one uniform pill, centered ---------- */
.nav {
  position: fixed;
  top: 16px; left: 16px; right: 16px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;               /* only the pill catches clicks */
}
.nav__box {
  pointer-events: auto;
  position: relative;
  overflow: hidden;                     /* clips the refraction layer to the pill */
  display: flex;
  align-items: center;
  gap: 22px;
  height: 52px;
  padding: 0 22px;
  border-radius: 100px;
  background: var(--pill);
  border: 1px solid var(--hairline);
  transition: background 0.35s ease, border-color 0.35s ease;
}
.nav__box > * { position: relative; z-index: 1; }
/* liquid glass, three layers under the content:
   1) .nav__glass — blur+saturate of the backdrop; the extra `filter:
      url(#glass-distortion)` bends that snapshot at the edges in
      Chromium (real refraction); Safari/Firefox ignore it and keep
      the rich blur
   2) .nav__shine — specular inset ring, the "wet edge"
   3) .nav__hl — the highlight pill that glides between items (site.js) */
.nav__glass {
  position: absolute; inset: 0;
  z-index: 0;
  border-radius: inherit;
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
  filter: url(#glass-distortion);
}
.nav__shine {
  position: absolute; inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  /* faint resting rim; the live specular below takes over near the cursor */
  box-shadow:
    inset 0.8px 0.8px 0.5px rgba(255, 255, 255, 0.16),
    inset -0.6px -0.6px 0.5px rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .nav__shine {
  box-shadow:
    inset 0.8px 0.8px 0.5px rgba(255, 255, 255, 0.65),
    inset -0.6px -0.6px 0.5px rgba(255, 255, 255, 0.3);
}
/* the cursor is the light source: site.js writes --lx/--ly (cursor in pill
   coords) and --spec (0..1 by distance), so the sheen and the bright rim
   segment travel with the pointer — that movement is what sells the glass */
.nav__shine::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(170px 90px at var(--lx, 50%) var(--ly, 0%),
    rgba(255, 255, 255, 0.08), transparent 70%);
  opacity: var(--spec, 0);
  transition: opacity 0.35s ease;
}
.nav__shine::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  background: radial-gradient(140px 80px at var(--lx, 50%) var(--ly, 0%),
    rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.14) 55%, transparent 78%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: var(--spec, 0);
  transition: opacity 0.35s ease;
}
.nav__hl {
  position: absolute; left: 0; top: 50%;
  z-index: 0;
  height: 34px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.25s ease, transform 0.4s var(--ease), width 0.4s var(--ease);
  pointer-events: none;
}
.nav__hl.is-on { opacity: 1; }
.nav__link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}
.nav__link:hover,
.nav__link.is-magnet { color: var(--ink); }
.nav__logo {
  font-family: 'Inter Display', 'General Sans', 'Helvetica Neue', sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
  margin-right: 8px;
}
@media (max-width: 1024px) {
  .nav__link--play { display: none; }   /* the court is a desktop toy */
}
@media (max-width: 720px) {
  .nav__box { gap: 12px; padding: 0 14px; height: 46px; }
  .nav__logo { font-size: 15px; margin-right: 2px; }
  .nav__link { font-size: 10px; letter-spacing: 0.08em; }
}
.theme-btn {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: color 0.25s ease, transform 0.4s var(--ease);
}
.theme-btn:hover,
.theme-btn.is-magnet { color: var(--ink); transform: rotate(40deg); }
.theme-btn svg { width: 14px; height: 14px; }
.theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .moon { display: block; }

/* ---------- page transitions ---------- */
/* home ↔ case: a plain JS-driven fade — the page fades out before the
   navigation and fades in on arrival (site.js adds/removes .page-fade).
   Deliberately not View Transitions: those hang behind the preview's
   auth layer and injected toolbar.
   The nav pill is exempt (opacity fade on <body> would take it too), so
   the menu stays visible across the whole transition. */
html.page-fade body > *:not(.nav):not(.grain):not(.cursor):not(.page-veil):not(.court-frame) { opacity: 0; }
body > * { transition: opacity 0.3s ease; }

/* → play: content flies down while a dark veil closes over the page —
   #1c1c1c is the court's own space-grey wash (.court-veil inside the
   iframe), so the handoff is colour-for-colour seamless */
.page-veil {
  position: fixed; inset: 0;
  background: #1c1c1c;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
  z-index: 10500;
}
body.to-play .page-veil { opacity: 1; }

/* the court itself: a same-origin iframe booted in the background */
.court-frame {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  background: #1c1c1c;
  z-index: 11000;             /* over the veil, under the nav pill */
  /* visibility (not display): the hidden iframe keeps its real viewport
     size, so the court renderer boots at the right resolution */
  visibility: hidden;
}
body.in-court .court-frame { visibility: visible; }
body.in-court { overflow: hidden; }
body.in-court .grain { display: none; }
body.in-court .cursor { display: none; }

/* on the court the pill is rendered INSIDE the iframe (play.html
   .court-nav) — the parent's own nav and ring cursor stand down */
body.in-court .nav { display: none; }
body.in-court.has-cursor,
body.in-court.has-cursor a,
body.in-court.has-cursor button { cursor: auto; }

body.to-play .nav,
body.to-play .hero,
body.to-play .intro,
body.to-play .plist,
body.to-play .footer,
body.to-play .case-layout {
  transition: transform 0.6s cubic-bezier(0.55, 0, 0.85, 0.36), opacity 0.6s ease;
  transform: translateY(70vh);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  html.page-fade body { opacity: 1; }
  body.to-play .nav, body.to-play .hero, body.to-play .intro,
  body.to-play .plist, body.to-play .footer, body.to-play .case-layout { transition: none; transform: none; }
}

/* ---------- custom cursor (ported from the tennis site) ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 7vw; height: 7vw;
  margin: -3.5vw 0 0 -3.5vw;
  z-index: 13000;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}
.cursor__dot {
  width: clamp(22px, 2vw, 32px); height: clamp(22px, 2vw, 32px);
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  opacity: 0.85;
  /* width/height/radius morph the ring into a nav-item outline (site.js) */
  transition: transform 0.5s var(--ease), border-color 0.3s,
    width 0.25s var(--ease), height 0.25s var(--ease), border-radius 0.25s var(--ease);
}
.cursor.is-hover .cursor__dot { transform: scale(1.8); }
.cursor.is-hidden .cursor__dot { transform: scale(0); }
body.has-cursor,
body.has-cursor a,
body.has-cursor button { cursor: none; }
@media (max-width: 760px) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: auto; }
  .cursor { display: none; }
}

/* ---------- 1 · hero (typographic, soft light core) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--edge);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(58% 42% at 50% 46%, var(--glow), transparent 70%),
    radial-gradient(90% 70% at 50% 50%, rgba(255, 77, 0, 0.05), transparent 72%);
  pointer-events: none;
  transition: opacity 0.35s ease;
}
/* monolog dot-field backdrop (js/hero-bg.js); glow retires when it boots */
.hero.has-bg::before { display: none; }
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero-fade {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 50%;
  /* smoothstep ramp all the way to the solid page color — zero-slope at
     both ends so neither edge of the gradient is ever visible; the
     fadeBottom knob drives the height */
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--bg) 0%, transparent) 0%,
    color-mix(in srgb, var(--bg) 4%, transparent) 12.5%,
    color-mix(in srgb, var(--bg) 16%, transparent) 25%,
    color-mix(in srgb, var(--bg) 32%, transparent) 37.5%,
    color-mix(in srgb, var(--bg) 50%, transparent) 50%,
    color-mix(in srgb, var(--bg) 68%, transparent) 62.5%,
    color-mix(in srgb, var(--bg) 84%, transparent) 75%,
    color-mix(in srgb, var(--bg) 96%, transparent) 87.5%,
    var(--bg) 100%);
  pointer-events: none;
}
.hero__eyebrow {
  position: relative;
  color: var(--muted);
  margin-bottom: clamp(18px, 3vh, 30px);
}
.hero__title {
  position: relative;
  font-size: clamp(40px, 6.4vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 500;
}
.hero__title em { font-style: normal; color: var(--muted); }
/* the rotating word owns its whole line, so the retype never reflows
   the rest of the title; the caret only exists once JS runs */
.type-word { white-space: nowrap; }
.type-word .tch { white-space: pre; opacity: 0; transition: opacity 0.18s ease; }
.type-word .tch.in { opacity: 1; }
.type-word.type-live::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.72em;
  margin-left: 0.06em;
  background: currentColor;
  vertical-align: -0.02em;
  animation: caret-blink 1.1s steps(1) infinite;
}
.type-word.is-typing::after { animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }
.hero__sub {
  position: relative;
  margin-top: clamp(20px, 3.4vh, 34px);
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 52ch;
}
.hero__scroll {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* ---------- 2 · giant intro ---------- */
.intro {
  padding: clamp(90px, 14vh, 180px) var(--edge);
  max-width: 1680px;
  margin: 0 auto;
}
.intro p {
  font-size: clamp(28px, 4.4vw, 64px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 500;                    /* full-bleed lines, analogue-style */
}
.intro em { font-style: normal; color: var(--muted); transition: color 0.3s ease; }
.intro em:hover { color: var(--accent); }
/* scroll-driven letter reveal: every char starts dim and resolves to
   full, letter by letter, as the block scrolls through */
.intro .w { white-space: nowrap; }
.intro .ch { opacity: 0.3; transition: opacity 0.3s ease; }
.intro .ch.on { opacity: 1; }

/* ---------- 3 · Selected Projects — the tennis-era section ---------- */
.plist {
  padding: clamp(40px, 7vh, 90px) var(--edge) clamp(80px, 12vh, 150px);
  max-width: 1680px;
  margin: 0 auto;
}
.plist__title {
  font-size: clamp(34px, 4vw, 62px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  padding-bottom: clamp(30px, 3.5vw, 58px);
}
.plist__title sup {
  font-family: var(--mono);
  font-size: 0.3em;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  vertical-align: 1.6em;
  margin-left: 0.3em;
}
.pcard {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(20px, 2.5vw, 48px);
  padding: clamp(26px, 2.8vw, 46px) 0;
  border-top: 1px solid var(--hairline);
}
.pcard__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--card);
  border-radius: 6px;
  perspective: 900px;            /* the hover video flips up in 3D inside the card */
}
.pcard__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
/* UI screenshots read straight — top-anchored, no crop tricks */
.pcard[data-case="unitbox-platform"] .pcard__media img { object-position: top; }
/* hover: the poster dims, a video panel slides up with a barely-there tilt */
.pcard__media::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(14, 11, 9, 0.8);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.pcard__media.is-hover::after { opacity: 1; }
.pcard__video {
  position: absolute; left: 50%; top: 50%;
  width: 90%; aspect-ratio: 16 / 9; height: auto;
  transform: translate(-50%, 80%);
  transform-origin: 50% 100%;
  object-fit: cover;
  visibility: hidden;
  border-radius: 4px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  /* exit: no rotation — the panel just slides down and out */
  transition: transform 0.35s cubic-bezier(0.55, 0, 0.8, 0.6), visibility 0s linear 0.35s;
  pointer-events: none;
  z-index: 1;
}
.pcard__video.is-on {
  visibility: visible;
  transform: translate(-50%, -50%);
  transition: visibility 0s;
  animation: vid-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes vid-in {
  from { transform: translate(-50%, 34%) rotateX(20deg); }
  to   { transform: translate(-50%, -50%) rotateX(0deg); }
}
.pcard[data-case="digital-twin-breig"] .pcard__video { object-position: top; }
/* placeholder cards: no case page behind them yet */
.pcard__media--soon { cursor: default; }
.pcard__info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.pcard__mark {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.08em;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.pcard__mark i { font-style: normal; }
.pcard__mark b { font-weight: 400; border: 1px solid var(--hairline); border-radius: 3px; padding: 1px 5px; }
.pcard__name {
  font-weight: 500;
  font-size: clamp(19px, 1.7vw, 28px);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
/* play.html cards still carry the PR mark above the name */
.pcard__mark + .pcard__name { margin-top: 14px; }
.pcard__desc {
  font-size: clamp(13.5px, 1.05vw, 16.5px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 40ch;
}
.pcard__stat { margin-top: auto; padding-top: clamp(22px, 2.6vw, 44px); }
.pcard__badge {
  display: inline-block;
  font-weight: 500;
  font-size: clamp(20px, 1.8vw, 30px);
  letter-spacing: -0.01em;
  background: var(--badge);
  padding: 2px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
}
.pcard__cap { font-size: clamp(12.5px, 0.95vw, 15px); line-height: 1.5; color: var(--ink-soft); }

/* ---------- footer: editorial split — big links left, portrait right ---------- */
.footer {
  padding: 0 var(--edge) clamp(40px, 6vh, 80px);
  max-width: 1680px;
  margin: 0 auto;
}
.footer__split {
  border-top: 1px solid var(--hairline);
  padding-top: clamp(60px, 9vh, 110px);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 420px);
  gap: clamp(32px, 6vw, 110px);
  align-items: start;
}
.footer__eyebrow { color: var(--muted); margin-bottom: 20px; }
.footer__title {
  font-size: clamp(34px, 3.7vw, 60px);
  letter-spacing: -0.02em;
  font-weight: 500;
  line-height: 1.05;
}
.footer__hello { color: var(--muted); }
.footer__links {
  margin-top: clamp(40px, 7vh, 80px);
  display: flex;
  flex-direction: column;
}
.flink {
  display: block;
  padding: clamp(16px, 2.4vh, 26px) 0;
  border-top: 1px solid var(--hairline);
  font-size: clamp(22px, 2.5vw, 40px);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}
.flink:last-child { border-bottom: 1px solid var(--hairline); }
.flink:hover { color: var(--ink); }
.footer__photo {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--card);
}
.footer__photo img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   CASE PAGE — basement.studio showcase
   ============================================================ */
.case-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  align-items: start;
}
.case-aside {
  position: sticky;
  top: 20px;                          /* aligns with the media top; the centered
                                         pill never overlaps the left column ≥1140 */
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 36px);
}
.case-aside__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.case-aside__back {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  display: inline-flex; gap: 8px; align-items: center;
  transition: color 0.2s ease;
}
.case-aside__back:hover { color: var(--accent); }

.case-aside h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.case-aside dl { margin-bottom: 26px; }
.case-aside .mrow {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.5;
  border-bottom: 1px solid var(--hairline);
}
.case-aside .mrow dt { color: var(--muted); }
.case-aside .mrow dd { font-weight: 500; }
.case-aside .mrow dd a { border-bottom: 1px solid var(--hairline); transition: color 0.2s ease, border-color 0.2s ease; }
.case-aside .mrow dd a:hover { color: var(--accent); border-color: var(--accent); }

.case-aside__desc p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 30ch;
}
.case-aside__desc b { color: var(--ink); font-weight: 500; }

.case-aside__more { margin-top: auto; padding-top: 40px; }
.case-aside__more h3 { font-size: 20px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.case-aside__more a {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 5px 0 5px 24px;
  position: relative;
  transition: color 0.2s ease;
}
.case-aside__more a::before {
  content: "↳";
  position: absolute; left: 2px; top: 4px;
  color: var(--muted);
}
.case-aside__more a:hover { color: var(--accent); }

/* right: tight media grid */
.case-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.case-media > * { border-radius: 6px; overflow: hidden; background: var(--card); }
.case-media .span2 { grid-column: 1 / -1; }
/* grey placeholder cells — stand-ins until real case media lands */
.case-media .ph { aspect-ratio: 4 / 3; }
.case-media .ph.tall { aspect-ratio: 21 / 9; }
.case-media img, .case-media video { width: 100%; height: 100%; object-fit: cover; }
.case-media figure { position: relative; }
.case-media iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }

/* expandable live-stream banner: a low poster strip until clicked,
   then it grows and mounts the cloud-streamed twin inline */
.case-media .stream-banner {
  position: relative;
  height: 500px;
  cursor: pointer;
  transition: height 0.7s var(--ease);
}
.case-media .stream-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stream-banner__scrim { position: absolute; inset: 0; background: rgba(8, 8, 8, 0.48); transition: background 0.4s ease; }
.stream-banner:hover .stream-banner__scrim { background: rgba(8, 8, 8, 0.34); }
.stream-banner__label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; color: #f2f2f2; padding: 0 24px;
}
.stream-banner__label .mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(242, 242, 242, 0.72); }
.stream-banner__label b { font-size: clamp(22px, 2.6vw, 40px); font-weight: 500; letter-spacing: -0.02em; }
.stream-banner__hint { font-size: 13px; color: rgba(242, 242, 242, 0.72); }
.stream-banner__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(8, 8, 8, 0.55); color: #f2f2f2; font-size: 14px;
  backdrop-filter: blur(6px); cursor: pointer;
}
.stream-banner.is-live { height: min(82vh, 920px); cursor: default; }
.stream-banner.is-live > img,
.stream-banner.is-live .stream-banner__scrim,
.stream-banner.is-live .stream-banner__label { display: none; }
.stream-banner.is-live .stream-banner__close { display: flex; }
.stream-banner iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* embedded 3D widget (Gaussian Splatting viewer) */
.case-media .embed-3d { aspect-ratio: 16 / 9; }
.case-media .embed-3d iframe { width: 100%; height: 100%; aspect-ratio: auto; }
/* hosted players (YouTube/Loom/live apps) inside a story */
.case-media .embed-video { background: var(--card); }
.case-media .embed-video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* flush cases: the media column is one seamless stack of screens —
   no gaps, no radius, nothing cropped */
.case-media.flush { display: block; }
.case-media.flush > * { border-radius: 0; }
.case-media.flush figure { display: block; font-size: 0; }
.case-media.flush img { height: auto; object-fit: fill; }
.case-media.flush .reveal { transform: none; }   /* a sliding reveal would tear the seam */

/* article text: sized in container units of the media column, so the
   text-to-media proportion stays the same on every screen —
   column ≈ 72% of the media width, body ≈ 1.3% of it (~20px on desktop) */
.case-media { container-type: inline-size; }
.case-media .textrow {
  grid-column: 1 / -1;
  background: none;
  border-radius: 0;
  width: 100%;
  max-width: 72cqw;
  margin-inline: auto;
  padding: clamp(28px, 4vh, 56px) 16px;
}
/* two text blocks in a row would otherwise stack both paddings */
.case-media .textrow + .textrow { padding-top: 0; }
.case-media .textrow > p:last-child { margin-bottom: 0; }
.case-media .textrow.two { column-count: 2; column-gap: 48px; }
.case-media .textrow h2 {
  font-size: max(21px, 1.9cqw);
  letter-spacing: -0.02em;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 0.7em;
  column-span: all;
}
.case-media .textrow p {
  font-size: max(16px, 1.3cqw);
  line-height: 1.55;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 1.1em;
  break-inside: avoid;
  text-wrap: pretty;
}
/* short mono caption tied to the media above it */
.case-media .mediacap {
  grid-column: 1 / -1;
  background: none;
  border-radius: 0;
  font-family: var(--mono);
  font-size: max(11px, 0.75cqw);
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 4px 4px 0;
}
@media (max-width: 860px) {
  .case-media .textrow { max-width: 100%; }
}
/* big narrative type: grey base, white <b> accents carry the key facts */
.case-media .textrow p.lead {
  font-size: max(19px, 1.75cqw);
  line-height: 1.38;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: var(--ink-soft);
}
.case-media .textrow p.lead b { color: var(--ink); font-weight: 500; }
/* story prose furniture: lists, pulled quotes and formula lines */
.case-media .textrow ul {
  margin: 0 0 1.1em;
  padding-left: 1.2em;
  color: var(--ink-soft);
  font-size: max(16px, 1.3cqw);
  line-height: 1.65;
}
.case-media .textrow li { margin-bottom: 0.35em; }
.case-media .textrow li::marker { color: var(--muted); }
.case-media .textrow p.q {
  border-left: 2px solid var(--hairline);
  padding-left: 18px;
  font-style: italic;
  color: var(--muted);
}
.case-media .textrow p.code {
  font-family: var(--mono);
  font-size: max(13px, 0.95cqw);
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--card);
  border-radius: 6px;
  padding: 14px 18px;
  white-space: pre-wrap;
}
.case-media .textrow b { color: var(--ink); font-weight: 500; }
.case-media .textrow blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  font-size: 17px;
  line-height: 1.5;
  margin: 1.2em 0;
  break-inside: avoid;
}
.case-media .textrow ul { padding-left: 18px; }
.case-media .textrow li { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 6px; }
.case-media .textrow .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; column-span: all; }
.case-media .textrow .stat { border: 1px solid var(--hairline); border-radius: 8px; padding: 14px; }
.case-media .textrow .stat b { display: block; font-size: clamp(22px, 2.2vw, 34px); font-weight: 600; letter-spacing: -0.02em; }
.case-media .textrow .stat span { font-size: 12px; color: var(--muted); line-height: 1.4; display: block; margin-top: 6px; }
.case-media .textrow table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.case-media .textrow th { text-align: left; color: var(--muted); font-weight: 500; }
.case-media .textrow th, .case-media .textrow td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; line-height: 1.5; }

/* next-case transition */
.next-case {
  grid-column: 1 / -1;
  position: relative;
  display: block;
  height: 52svh;
  min-height: 320px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
}
.next-case img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.1s var(--ease); }
.next-case:hover img { transform: scale(1.03); }
.next-case__scrim { position: absolute; inset: 0; background: rgba(8, 8, 8, 0.45); transition: background 0.4s ease; }
.next-case:hover .next-case__scrim { background: rgba(8, 8, 8, 0.3); }
.next-case__label {
  position: absolute;
  left: clamp(18px, 3vw, 44px); bottom: clamp(16px, 3vw, 38px);
  color: #f2f2f2;
}
.next-case__label .mono { color: rgba(242, 242, 242, 0.75); display: block; margin-bottom: 8px; }
.next-case__label b { font-size: clamp(24px, 3vw, 46px); font-weight: 500; letter-spacing: -0.02em; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .grain { animation: none; }
}

/* ---------- adaptive: case page stacks to full width before the pill
   would ever overlap the sticky aside (~1140px) ---------- */
@media (max-width: 1140px) {
  .case-layout { grid-template-columns: 1fr; padding-top: 84px; }
  .case-aside { position: static; min-height: 0; }
  .case-aside__more { margin-top: 26px; padding-top: 0; }
  .case-media { grid-template-columns: 1fr; }
  .case-media .textrow { padding-left: 4px; padding-right: 4px; }
}

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .pcard { grid-template-columns: 1fr; gap: 16px; }
  .pcard__stat { padding-top: 18px; }
  .case-media .textrow.two { column-count: 1; }
  .footer__split { grid-template-columns: 1fr; }
  .footer__photo { max-width: 320px; }
  .flink { font-size: clamp(18px, 5.4vw, 26px); }
}
