@font-face { font-family: "Diatype"; src: url("fonts/ABCDiatype-Thin.ttf") format("truetype"); font-weight: 100; font-display: swap; }
@font-face { font-family: "Diatype"; src: url("fonts/ABCDiatype-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Diatype"; src: url("fonts/ABCDiatype-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Diatype"; src: url("fonts/ABCDiatype-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Diatype"; src: url("fonts/ABCDiatype-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --media-ratio: 16 / 9;
  --bar-top: 20px;   /* the top bar: back, view switch and theme button */
  --bar-h: 24px;
  --bg: #fff;
  --fg: #111;
  --muted: #8a8f91;
  --faint: #c9cccd;
  --line: #e6e6e6;
  --chip: #f1f1f1;
  --mono: "Diatype", "Inter", system-ui, -apple-system, sans-serif;
  --ease-in-out-expo: cubic-bezier(.65, 0, .15, 1);
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-out-quad: cubic-bezier(.25, .46, .45, .94);
  --ease-in-out-cubic: cubic-bezier(.645, .045, .355, 1);
  --pad: 16px;
  --see-bg: #ececec;
  --amb: #c2c5c6;
  --vid-frame: #fafafa;
  --mark-ink: #121214;
  color-scheme: light;
}

/* Dark mode follows the system until [data-theme] says otherwise. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0e;
    --fg: #f2f2f2;
    --muted: #7e8486;
    --faint: #3c4042;
    --line: #26282a;
    --chip: #17181a;
    --see-bg: #1d1f21;
    --amb: #4a4f52;
    --vid-frame: #121214;
    --mark-ink: #f2f2f2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0e;
  --fg: #f2f2f2;
  --muted: #7e8486;
  --faint: #3c4042;
  --line: #26282a;
  --chip: #17181a;
  --see-bg: #1d1f21;
  --amb: #4a4f52;
  --vid-frame: #121214;
  --mark-ink: #f2f2f2;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* the hidden attribute must beat a display rule, or .track stays flex */
[hidden] { display: none !important; }
html { scroll-behavior: auto; }
body {
  background: var(--bg); color: var(--fg);
  font-family: "Diatype", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px; line-height: 1.4; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; letter-spacing: -.01em; }
input, textarea { font: inherit; color: inherit; letter-spacing: -.01em; }
.mono { font-family: var(--mono); font-size: 12px; }
.dim { color: var(--muted); }

/* ---------- Header ---------- */
.top {
  position: relative;
  flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: start; gap: 24px; padding: 22px var(--pad) 0;
}
.logo {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: clamp(16px, 1.3vw, 20px); font-weight: 400; letter-spacing: -.01em;
  line-height: 1; white-space: nowrap;
}
/* the mark scales with the wordmark */
/* the mark stands alone now, so it sizes itself rather than tracking the type */
.logo-mark { display: block; width: auto; height: clamp(26px, 2.3vw, 34px); flex: 0 0 auto; }
:root[data-theme="dark"] .logo-mark { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-mark { filter: invert(1); }
}
.top-desc { font-size: 13.5px; line-height: 1.4; max-width: 440px; }
.top-desc b { display: block; font-size: 16.5px; line-height: 1.2; letter-spacing: -.012em; font-weight: 500; margin-bottom: 7px; }
.top-nav { justify-self: end; margin-right: 26px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .01em; }
.top-nav a { color: var(--faint); transition: color .2s ease; }
.top-nav a[aria-current], body.about .top-nav [data-about] { color: var(--fg); }
@media (hover: hover) and (pointer: fine) {
  .top-nav a:hover { color: var(--fg); }
}

/* chips used for tags */
.tag { display: inline-block; padding: 1px 4px; background: var(--c, var(--chip)); color: #000; font-family: var(--mono); font-size: 10px; white-space: nowrap; }

/* ---------- Main / about push-back ---------- */
body { overflow: hidden; }
main {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  transition: transform .69s var(--ease-in-out-expo), opacity .6s var(--ease-out-quad);
}
body.about main { transform: perspective(1200px) translateZ(-420px); transition-duration: .7s; }

/* ---------- Header paragraph ---------- */
.hero-text { color: var(--muted); }
.hero-text .w { display: inline; opacity: .1; transition: opacity .6s var(--ease-out-quad); }
.hero-text.in .w { opacity: 1; transition-delay: calc(var(--k) * 12ms); }
.hero-text .name { color: var(--fg); font-weight: 500; }

.col .links { display: flex; gap: 18px; }
.col .links a { color: var(--muted); transition: color .2s ease; }
@media (hover: hover) and (pointer: fine) {
  .col .links a:hover { color: var(--fg); }
}

/* ---------- Projects view switch ---------- */
/* sits directly above the row, on the same left margin as the cards */
.views {
  flex: 0 0 auto; display: flex; align-items: baseline; gap: 12px;
  padding: 0 var(--pad) 18px;
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: .01em;
}
.views-label { color: var(--fg); }

/* ---------- Theme button ---------- */
.top-right { justify-self: end; }
/* fixed, and outside <main>, so the theme can still be switched inside a project */
.theme {
  position: fixed; top: var(--bar-top); right: var(--pad); z-index: 90;
  width: var(--bar-h); height: var(--bar-h);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  color: var(--faint); transition: color .2s ease;
}
.theme svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
/* show the theme you would move to: a moon in light, a sun in dark */
.theme .i-sun { display: none; }
.theme[aria-pressed="true"] .i-moon { display: none; }
.theme[aria-pressed="true"] .i-sun { display: block; }
@media (hover: hover) and (pointer: fine) {
  .theme:hover { color: var(--fg); }
}

/* ---------- Studio ---------- */
.col .place { display: inline-flex; align-items: center; gap: 7px; }
.globe { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; flex: 0 0 auto; color: var(--muted); }

/* ---------- Ambient phrases ---------- */
/* Lines type themselves out in the empty middle of the page, hold, then fade. */
.amb {
  position: absolute; left: var(--pad); right: var(--pad);
  top: var(--amb-top, 150px); bottom: 8px;
  pointer-events: none; overflow: hidden; z-index: 0;
}
.amb-line {
  position: absolute; white-space: nowrap; color: var(--amb);
  font-size: clamp(11px, .92vw, 14px); letter-spacing: -.005em; line-height: 1.25;
  opacity: 0;
  transition: opacity .42s var(--ease-out-quad);
}
.amb-line.lit { opacity: 1; }
.amb-line.out { opacity: 0; }
/* characters hide only once the line has been measured and placed */
.amb-line.pre .c { display: none; }
.amb-line mark { background: var(--hi); color: #000; padding: 1px 3px; margin: 0 -1px; }
.amb-line mark.on-light { color: #fff; }
/* caret, only while the line is still typing */
.amb-line.typing::after {
  content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 2px;
  vertical-align: -.14em; background: var(--muted);
  animation: amb-caret 1s step-end infinite;
}
@keyframes amb-caret { 50% { opacity: 0; } }

/* ---------- Project row ---------- */
.track {
  --card-h: min(40vh, 360px);
  flex: 0 0 auto; display: flex; align-items: flex-end; gap: 56px;
  overflow-x: auto; overflow-y: hidden; padding: 0 var(--pad) 28px; scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.track.drag { user-select: none; cursor: grabbing; }
.track.drag * { pointer-events: none; }
.card { flex: 0 0 auto; display: flex; gap: 16px; height: var(--card-h); }
.card:last-child { margin-right: 30vw; }
.card .panel { height: 100%; width: calc(var(--card-h) * var(--media-ratio)); }
.card-text { width: 260px; display: flex; flex-direction: column; justify-content: space-between; font-size: 13px; line-height: 1.45; }
.card-text h2 { font-size: 15px; font-weight: 500; line-height: 1.2; letter-spacing: -.012em; }
.card-text p { color: var(--muted); margin-bottom: 8px; }
/* services sit on the project page now, under its description */
.cv-info .cv-svc { margin-bottom: 14px; }
.cv-info .cv-svc span { color: var(--faint); }

.panel { position: relative; overflow: hidden; background: transparent; transition: background .6s var(--ease-out-quad); }
.panel.seen { background: var(--tint); }
.panel canvas { width: 100%; height: 100%; display: block; cursor: pointer; clip-path: inset(100% 0 0 0); transition: clip-path 1.1s var(--ease-in-out-expo); }
/* the clip plays as a 1600x900 screen centred inside the 1920 frame */
.panel.vid,
.panel[data-fit="contain"] { background: var(--vid-frame); display: grid; place-items: center; }
/* a video would swallow the click that opens the project, and the wheel that
   scrolls the row, so the panel takes both on its behalf */
.panel-vid { pointer-events: none; }
.card .panel { cursor: pointer; }
.panel-vid {
  width: 83.3333%; height: 83.3333%; display: block; object-fit: cover;
  opacity: 0; transition: opacity .7s var(--ease-out-quad);
}
.panel.vid.seen,
.panel[data-fit="contain"].seen { background: var(--vid-frame); }
.panel.seen .panel-vid { opacity: 1; }
/* the reel's stills are whole 16:9 screens, so they take the full panel, frame and all */
.panel-reel { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.panel.seen canvas { clip-path: inset(0 0 0 0); }

/* Plain text until you point at it, then a square grey block appears behind. */
.see {
  align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 0; background: transparent; color: var(--fg); font-size: 11.5px;
  transition: .22s ease;
  transition-property: background-color, color;
}
@media (hover: hover) and (pointer: fine) {
  .see:hover { background-color: var(--see-bg); }
}
.see:focus-visible { background-color: var(--see-bg); outline: none; }
.see .arr { transition: transform .45s var(--ease-out-expo); }
@media (hover: hover) and (pointer: fine) {
  .see:hover .arr { transform: translateX(3px); }
}

/* ---------- About veil ---------- */
#about { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#about::before { content: ""; position: fixed; inset: 0; z-index: -1; background: transparent; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); transition: backdrop-filter .69s var(--ease-in-out-expo), background .69s var(--ease-in-out-expo); }
body.about #about { pointer-events: auto; }
body.about #about::before { backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); background: color-mix(in srgb, var(--bg) 62%, transparent); }
.about-scroll { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; }
.col { width: min(520px, calc(100% - 32px)); margin: 0 auto; padding: 110px 0 96px; cursor: auto; }
.col > * { opacity: 0; transform: translateY(14px); transition: opacity .35s var(--ease-out-quad), transform .5s var(--ease-in-out-expo); }
body.about .col > * { opacity: 1; transform: none; transition: opacity .7s var(--ease-out-expo), transform 1s var(--ease-out-expo); transition-delay: calc(.18s + var(--k, 0) * 55ms); }
.col > p { margin-bottom: 20px; }
.col section { margin-top: 34px; }
.col .studio .place { margin-bottom: 16px; }
.label { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.col a.u { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; color: var(--muted); }
/* the text scrolls with the images when it lives inside the scroller */
.cv:not(.hz) .cv-left > .cv-info {
  position: static; width: auto; max-width: none;
  margin: 0 0 28px; opacity: 1; translate: none;
}

/* ---------- Mobile Safari edges ---------- */
/* Safari samples a fixed strip at each edge to colour its status and tool bars.
   It needs a few visible pixels, so these sit above everything and stay clear of
   content. Technique: joshpuckett.me/seamless-mobile-safari */
html { background: var(--bg); }
.edge-top, .edge-bottom { position: fixed; left: 0; right: 0; z-index: 200; pointer-events: none; }
.edge-top { top: 0; height: max(8px, env(safe-area-inset-top)); background: var(--bg); }
.edge-bottom { bottom: 0; height: max(8px, env(safe-area-inset-bottom)); background: var(--bg); }

/* ---------- Coming soon ---------- */
.gate {
  position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  background: transparent;
  transition: opacity .35s ease, backdrop-filter .5s var(--ease-out-expo),
              -webkit-backdrop-filter .5s var(--ease-out-expo),
              background .5s var(--ease-out-expo), visibility 0s linear .5s;
}
.gate.open {
  opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s;
  backdrop-filter: blur(22px) saturate(1.1); -webkit-backdrop-filter: blur(22px) saturate(1.1);
  background: color-mix(in srgb, var(--bg) 58%, transparent);
}
.gate-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transform: translateY(8px); opacity: 0;
  transition: transform .45s var(--ease-out-expo), opacity .3s ease;
}
.gate.open .gate-box { transform: none; opacity: 1; }
.gate-soon { font-size: 16.5px; letter-spacing: -.012em; }
.gate-name { font-size: 12.5px; color: var(--muted); }
.gate-x { display: inline-flex; padding: 4px; margin-top: 6px; color: var(--muted); transition: color .2s ease; }
.gate-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; }
@media (hover: hover) and (pointer: fine) {
  .gate-x:hover { color: var(--fg); }
}

/* ---------- Case study view ---------- */
body.cv-on main { opacity: .08; }
main { transition: opacity .6s var(--ease-out-quad), transform .69s var(--ease-in-out-expo); }
.cv {
  --pad: 28px; --hpad: clamp(40px, 8vw, 128px); --col: min(1000px, 64vw); --side: calc((100vw - var(--col)) / 2);
  position: fixed; inset: 0; z-index: 70; background: transparent;
  pointer-events: none; visibility: hidden; transition: visibility 0s linear .8s, background .6s var(--ease-out-quad);
}
.cv.open { pointer-events: auto; visibility: visible; background: var(--bg); transition-delay: 0s; }

/* image stage */
.cv-left { position: absolute; inset: 0; scrollbar-width: none; overscroll-behavior: contain; }
.cv-left::-webkit-scrollbar { display: none; }
.cv-fig { margin: 0; }
/* inset: the clip sits on the themed frame at 1600x900 inside 1920x1080.
   Side padding is 8.3333% of the width; top and bottom is the same share of the
   height, which is 8.3333% x 9/16 = 4.6875% once resolved against the width. */
.cv-fig.inset {
  background: var(--vid-frame);
  box-sizing: border-box; padding: 4.6875% 8.3333%;
  aspect-ratio: var(--media-ratio);
}
/* Keep the 16:9 ratio. With the figure height auto, height:100% here is
   indeterminate, so the element would fall back to the file's own ratio and
   push the panel taller than the ones beside it. */
.cv-fig.inset .cv-media { width: 100%; height: 100%; aspect-ratio: var(--media-ratio); }
/* In horizontal the row has 50% side padding, so its content width is ~0 and a
   percentage padding would resolve to nothing. Size the inset off the height instead. */
.cv.hz .cv-fig.inset {
  --fh: 54vh; height: var(--fh); width: auto;
  padding: calc(var(--fh) * .08333) calc(var(--fh) * .14815);
}
/* beats .cv.hz .cv-fig .cv-media, which pins the height to the viewport */
.cv.hz .cv-fig.inset .cv-media { width: 100%; height: 100%; max-width: none; }
/* cover by default: the recording is 1920x1100, so a 16:9 crop takes ~10px off
   the top and bottom, which is what removes the capture's bleed line. A panel
   that needs the whole image sets object-fit inline via its `fit` property. */
.cv-fig .cv-media { display: block; cursor: default; object-fit: cover; }
.cv-fig { opacity: 0; transform: translateY(40px); transition: opacity .5s var(--ease-out-quad), transform .9s var(--ease-out-expo); }
.cv.open.in .cv-fig { opacity: 1; transform: none; transition-delay: calc(.25s + var(--k, 0) * 70ms); }

/* vertical: equal side columns, images centred at one shared width */
.cv:not(.hz) .cv-left { overflow-y: auto; overflow-x: hidden; padding: var(--pad) var(--side) 120px; }
.cv:not(.hz) .cv-fig { width: 100%; margin: 0 0 24px; }
.cv:not(.hz) .cv-fig .cv-media { width: 100%; height: auto; }
.cv:not(.hz) .cv-info { display: flex; flex-direction: column; top: calc(var(--pad) + 40px); left: var(--pad); width: calc(var(--side) - var(--pad) * 2); max-width: 280px; }

/* horizontal: text across the top, full-width centred carousel below */
.cv.hz .cv-left { display: flex; align-items: flex-start; gap: 64px; overflow-x: auto; overflow-y: hidden; padding: 33vh 50% 0; }
.cv.hz .cv-left.drag { cursor: grabbing; user-select: none; }
.cv.hz .cv-fig { flex: 0 0 auto; }
.cv.hz .cv-fig .cv-media { height: 54vh; width: auto; max-width: 78vw; object-fit: cover; pointer-events: none; }

/* overlay text + controls */
.cv-right { position: absolute; inset: 0; pointer-events: none; }
.cv-right > * { pointer-events: auto; position: absolute; opacity: 0; transition: opacity .5s var(--ease-out-quad), translate .8s var(--ease-out-expo); translate: 0 10px; }
.cv.open.in .cv-right > * { opacity: 1; translate: 0 0; transition-delay: calc(.3s + var(--k, 0) * 80ms); }
/* The top bar fades but never moves: the theme button is fixed outside this group,
   so a 10px entry offset here would leave the row out of line while it settles. */
.cv-right > .cv-back, .cv-right > .cv-ctrl { translate: 0 0; }
.cv.swap .cv-fig, .cv.swap .cv-right > * { opacity: 0 !important; transition-delay: 0s !important; transition-duration: .25s !important; }

.cv.hz .cv-info {
  top: 100px; left: var(--hpad); right: var(--hpad);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 48px; align-items: start;
}
/* heading and its one-line description on the left, the detail opposite */
.cv.hz .cv-info .cv-head { order: 1; }
.cv.hz .cv-info .cv-detail { order: 2; }
.cv:not(.hz) .cv-info .cv-head { order: 1; }
.cv:not(.hz) .cv-info .cv-detail { order: 2; }
.cv-title { font-weight: 500; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 14px; }
.cv-info .cv-detail p, .cv-info .cv-desc { font-size: 13px; line-height: 1.45; color: var(--muted); margin-bottom: 10px; }
.cv-info .cv-detail p:last-child { margin-bottom: 0; }

.cv-ctrl { top: var(--bar-top); right: var(--pad); height: var(--bar-h); display: flex; align-items: center; gap: 22px; }
/* mirrors .cv-info: its own gutter container, text left aligned inside it */
.cv:not(.hz) .cv-ctrl {
  left: calc(var(--side) + var(--col) + var(--pad)); right: var(--pad);
  justify-content: flex-start;
}
.cv-views { display: flex; align-items: center; gap: 18px; font-size: 12px; }
.cv-views button { padding: 4px 0; color: var(--fg); opacity: .35; transition: opacity .25s ease; }
@media (hover: hover) and (pointer: fine) {
  .cv-views button:hover { opacity: .65; }
}
.cv-views button[aria-current] { opacity: 1; }
.cv-back { top: var(--bar-top); left: var(--pad); height: var(--bar-h); display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); transition: color .2s ease; }
.cv.hz .cv-back { left: var(--hpad); }
.cv.hz .cv-ctrl { right: var(--hpad); }
.cv-back svg { transition: transform .45s var(--ease-out-expo); }
@media (hover: hover) and (pointer: fine) {
  .cv-back:hover { color: var(--fg); }
  .cv-back:hover svg { transform: translateX(-3px); }
}

.cv-nextlink { right: var(--pad); bottom: var(--pad); display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg); }
.cv-nextlink .dim { color: var(--muted); }
.cv-nextlink .arr { transition: transform .45s var(--ease-out-expo); }
@media (hover: hover) and (pointer: fine) {
  .cv-nextlink:hover .arr { transform: translateX(4px); }
}
.cv-clone { position: fixed; z-index: 90; pointer-events: none; object-fit: cover; }

@media (max-width: 900px) {
  .cv { --pad: 16px; --fw: 78vw; }
  .cv { --col: calc(100vw - 32px); }
  .cv { --hpad: 16px; }
  .cv:not(.hz) .cv-left { padding: 300px var(--pad) 90px; }
  .cv:not(.hz) .cv-info { width: calc(100% - 140px); max-width: none; }
  /* the gutters vanish here, so the menu goes back to the corner */
  /* clear of the fixed theme button in the corner */
  .cv:not(.hz) .cv-ctrl { left: auto; right: calc(var(--pad) + 34px); }
  /* Narrow screens size the carousel from the WIDTH, not the height. Sizing from
     height and letting max-width clamp it broke the 16:9 box: the element kept its
     46vh height but was capped to 78vw wide, leaving black underneath. */
  .cv.hz .cv-fig .cv-media { width: var(--fw); height: auto; max-width: none; }
  .cv.hz .cv-fig.inset {
    /* an explicit height, or the box takes the video's own ratio instead of 16:9
       and the panel sits taller than the ones beside it */
    width: var(--fw); height: calc(var(--fw) * 9 / 16);
    padding: calc(var(--fw) * .046875) calc(var(--fw) * .08333);
  }
  /* The centred panel is narrower than the screen and the gap is small, so a slice
     of the next panel either side stays in view: the row reads as a row, and there
     is something to swipe towards. 78vw + a 12px gap leaves ~8vw of the neighbour. */
  .cv.hz .cv-left { padding-top: 38vh; gap: 12px; }
  .cv.hz .cv-ctrl { right: calc(var(--hpad) + 34px); }
  .cv.hz .cv-info { top: 72px; left: var(--pad); right: var(--pad); grid-template-columns: 1fr; gap: 10px; }
  .cv.hz .cv-info .cv-head { order: 1; }
  .cv.hz .cv-info .cv-detail { order: 2; }
  .cv-title { font-size: 15px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  /* Stacked cards: stretch them all to the tallest so the previews line up at the
     top and the buttons at the bottom. Bottom-aligning pushed a card with a
     shorter description down by a whole line. */
  .track { --card-h: auto; gap: 28px; align-items: stretch; }
  .card { flex-direction: column; height: auto; }
  .card .panel { width: min(86vw, 520px); height: auto; aspect-ratio: var(--media-ratio); }
  /* same width as the 16:9 panel above it, so the button lines up */
  /* grow into the leftover height so space-between can push the button down */
  .card-text { width: min(86vw, 520px); gap: 10px; flex: 1 1 auto; }
  /* the layer starts under the stacked header; JS sets --amb-top */
  .amb { left: var(--pad); right: var(--pad); }
  .top { grid-template-columns: 1fr auto; }
  .top-desc { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
