/* ============ work — an index to scan, then a pinned strip of four samples ============
   Desktop (html.has-reel, set by js/sections/work.js): the cases travel right → left on
   one pinned reel; every plate is sampled from noise as it reaches the centre and
   diffuses back as it leaves. Panels stay on transparent ground so the film reads in
   the gaps; only the text column carries a local scrim.
   Below 1101px, and always with reduced motion, the same markup is a calm vertical stack.

   One column runs through the chapter: the index titles, every case's text and the rail's
   chapters all start on the same line (--reel-x = the site gutter + the number column). */

.work {
  position: relative;
  padding-top: clamp(6rem, 16vh, 12rem);
}

/* the chapter's foot: the film behind fades to ground before the next (opaque) chapter
   cuts across it. Under the content, over the film (main is the stacking context). */
.work::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  height: 20vh;
  background: linear-gradient(180deg, rgb(10 10 11 / 0), var(--bg) 88%);
  pointer-events: none;
}

.work__head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 1.6rem;
  align-items: end;
}
.work__head .kicker { grid-column: 1 / -1; }
.work__title { grid-column: 1 / span 9; }
.work__intro {
  grid-column: 10 / span 3;
  color: var(--ink-2);
  font-size: var(--fs-small);
  max-width: 30ch;
}

/* ---------- index ----------
   Every row has the same shape: the title on one line, its stack as a mono caption
   under it, kind and year on the title's baseline. Nothing wraps; a too-narrow column
   ellipsises instead of growing the row. */

.index {
  margin-top: clamp(4rem, 10vh, 7rem);
  border-top: 1px solid var(--hairline);
}
.index__row a {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 13rem) 3.5rem;
  grid-template-areas:
    "num title kind year"
    ".   stack .    .";
  column-gap: var(--col-gap);
  row-gap: 0.8rem;
  align-items: baseline;
  padding: clamp(1.2rem, 2.6vh, 1.9rem) 0;
  border-bottom: 1px solid var(--hairline);
  transition: opacity 400ms var(--ease-ui);
}
.index__num { grid-area: num; color: var(--ink-3); transition: color var(--d-ui) var(--ease-ui); }
.index__title {
  grid-area: title;
  min-width: 0;
  font-size: clamp(2.2rem, 0.9rem + 3.2vw, 3.8rem);
  font-weight: 320;
  font-stretch: 108%;
  letter-spacing: -0.042em;
  line-height: 1;
  white-space: nowrap;
  overflow: clip;
  text-overflow: ellipsis;
  /* the clip keeps room for descenders (Forge) and the hover nudge */
  padding-block: 0.06em 0.16em;
  margin-block: -0.06em -0.16em;
  transition: transform 600ms var(--ease-out);
}
.index__kind,
.index__stack {
  min-width: 0;
  white-space: nowrap;
  overflow: clip;
  text-overflow: ellipsis;
}
.index__kind { grid-area: kind; color: var(--ink-2); font-size: var(--fs-small); }
.index__stack { grid-area: stack; color: var(--ink-3); transition: transform 600ms var(--ease-out); }
.index__year { grid-area: year; color: var(--ink-3); justify-self: end; }

/* one sweep of light crosses a title's letters as its row is hovered (with a hairline of the
   signal colour at its core); it plays once on the way in and resets unseen on the way out */
@media (hover: hover) {
  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .index__title {
      background-image: linear-gradient(100deg, var(--ink) 0 38%, #fff 46%, var(--signal) 50%, #fff 54%, var(--ink) 62% 100%);
      background-size: 280% 100%;
      background-position: 100% 0;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      transition: transform 600ms var(--ease-out), background-position 0s;
    }
    .index__row a:hover .index__title,
    .index__row a:focus-visible .index__title {
      background-position: 0% 0;
      transition: transform 600ms var(--ease-out), background-position 1100ms var(--ease-out);
    }
  }
}
@media (forced-colors: active) {
  .index__title { background: none; color: CanvasText; }
}

@media (hover: hover) {
  .index:has(a:hover) .index__row a:not(:hover) { opacity: 0.28; }
  .index__row a:hover .index__title,
  .index__row a:hover .index__stack { transform: translateX(1.2rem); }
  .index__row a:hover .index__num { color: var(--signal); }
}
.index__row a:focus-visible .index__num { color: var(--signal); }

/* cursor-follow preview (desktop, fine pointer) */
.preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: clamp(15rem, 20vw, 22rem);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  pointer-events: none;
  clip-path: inset(100% 0 0 0);
  visibility: hidden;
}
html.is-fine .preview { visibility: visible; }
.preview__track { position: absolute; inset: 0; }
/* the sampled layer: glitter condensing into the project (js/sections/work-stage.js) */
.preview__gl {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.preview__track img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   cases — shared pieces (every layout)
   ============================================================ */

.reel {
  position: relative;
  margin-top: clamp(5rem, 14vh, 10rem);
}
.reel__lead, .reel__rail, .case__edge { display: none; }

.case {
  /* plate grade: --settle runs 0 (sampled noise, graded mono) → 1 (settled, colour back) */
  --settle: 1;
  --g-end: 0.15;
  --c-end: 1.06;
  --b-end: 0.92;
  --t-end: 0.08;
  position: relative;
}
/* Server Survival's board has cartoon sprites: its plate settles into the graded duotone,
   so the abstract instrument carries the scene (full colour only on hover/focus) */
.case[data-case="server"] { --g-end: 1; --c-end: 1.16; --b-end: 0.8; --t-end: 0.32; }

.case__head { display: grid; gap: 1rem; align-content: start; }
.case__num { display: flex; gap: 0.9rem; color: var(--ink-3); }
.case__num span { color: var(--ink); }

.case__title {
  --wdth: 108;
  font-size: clamp(2.6rem, 1.3rem + 4.2vw, 6.2rem);
  font-weight: 320;
  font-stretch: calc(var(--wdth) * 1%);
  line-height: 0.92;
  letter-spacing: -0.048em;
}
/* each line is its own mask; padded so ascenders and descenders survive the clip */
.case__line {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.08em 0.04em 0.14em 0;
  margin: -0.08em -0.04em -0.14em 0;
}
.case__line > span { display: inline-block; white-space: nowrap; }

.case__body { display: grid; gap: 1.5rem; align-content: start; }
.case__desc { color: var(--ink-2); max-width: 40ch; }

.case__meta { border-top: 1px solid var(--hairline); }
.case__meta > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--fs-small);
}
.case__meta dt { padding-top: 0.2em; }

.case__links { display: flex; gap: 1.6rem; flex-wrap: wrap; }

/* ---------- evidence plate ---------- */

.case__media {
  position: relative;
  display: grid;
  gap: 0.75rem;
}
.case__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  background: var(--surface-1);
  isolation: isolate;
}
.case__frame:focus-visible { outline-offset: 6px; }

/* the plate is wider than its window so it can drift (parallax) without exposing an edge.
   The grade lives on the plate itself, not on the image: the plate is a composited layer
   while it moves, so each sampler step and the hover reveal re-grade it on the GPU
   instead of re-rastering the image. */
.case__plate {
  position: absolute;
  inset: 0 -6%;
  display: block;
  filter:
    grayscale(calc(1 + (var(--g-end) - 1) * var(--settle)))
    contrast(calc(1.14 + (var(--c-end) - 1.14) * var(--settle)))
    brightness(calc(0.78 + (var(--b-end) - 0.78) * var(--settle)));
}
html.is-reduced .case__plate { inset: 0; }
.case__plate img,
.case__plate canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}
.case__plate img {
  object-fit: cover;
  object-position: 50% 40%;
}
/* while the plate is being sampled the (opaque) canvas is the plate: the image is not painted;
   at x₀ the canvas hides and the real <img> (crisp, hoverable, the viewer's source) takes over */
.case__plate canvas { visibility: hidden; }
.case__frame.is-noisy .case__plate canvas,
.case__frame.is-glint .case__plate canvas { visibility: visible; }
.case__frame.is-noisy .case__plate img,
.case__frame.is-glint .case__plate img { visibility: hidden; }

/* case tint, laid over the graded plate; it recedes as the sample settles */
.case__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--case-tint);
  mix-blend-mode: color;
  opacity: calc(0.38 + (var(--t-end) - 0.38) * var(--settle));
  pointer-events: none;
}
/* steps are quantised on purpose: only the settled plate eases (hover, focus, rest) */
.case__frame:not(.is-noisy) .case__plate { transition: filter 700ms var(--ease-out), opacity 900ms var(--ease-out); }
.case__frame:not(.is-noisy)::after { transition: opacity 700ms var(--ease-out); }
.case__frame:not(.is-noisy):hover .case__plate,
.case__frame:not(.is-noisy):focus-visible .case__plate { filter: none; }
.case__frame:not(.is-noisy):hover::after,
.case__frame:not(.is-noisy):focus-visible::after { opacity: 0; }

/* sampler readout, docked on the plate */
.case__step {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.32rem 0.55rem 0.28rem;
  background: rgba(10, 10, 11, 0.74);
  color: var(--ink-2);
  text-transform: none;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
}
.case__step b { font-weight: 450; color: var(--ink); }
.case__frame:not(.is-noisy) + .case__step b { font-weight: inherit; color: inherit; }

.case__reticle { color: var(--ink-4); text-transform: none; letter-spacing: 0.06em; justify-self: end; }

/* the live system: an instrument docked against the plate */
.case__demo { position: relative; z-index: 3; }
/* reserve the instrument's footprint before its module mounts, so nothing below jumps */
.case__demo:empty { aspect-ratio: 5 / 4; }

/* ============================================================
   flow — the static stack (reduced motion at any width; tablet & mobile)
   ============================================================ */

html:not(.has-reel) .case {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 1fr auto auto 1fr;
  column-gap: var(--col-gap);
  row-gap: 1.5rem;
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(4rem, 11vh, 7rem) var(--gutter);
}
html:not(.has-reel) .case + .case::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--hairline);
}
html:not(.has-reel) .case__text { display: contents; }
/* the record keeps a soft local scrim, so the film behind never fights the small type */
html:not(.has-reel) .case__body { position: relative; isolation: isolate; }
html:not(.has-reel) .case__body::before {
  content: "";
  position: absolute;
  inset: -12% -14%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(10, 10, 11, 0.66), rgba(10, 10, 11, 0.42) 60%, rgba(10, 10, 11, 0));
  pointer-events: none;
}
html:not(.has-reel) .case__head { grid-column: 1 / span 5; grid-row: 2; }
html:not(.has-reel) .case__body { grid-column: 1 / span 4; grid-row: 3; }
html:not(.has-reel) .case__media { grid-column: 6 / span 7; grid-row: 1 / -1; align-self: center; }
html:not(.has-reel) .case__demo { grid-column: 5 / span 4; grid-row: 1 / -1; align-self: end; margin-bottom: 2.5rem; }
html:not(.has-reel) .case--tall .case__media { grid-column: 6 / span 3; }
html:not(.has-reel) .case--tall .case__frame { aspect-ratio: 440 / 900; }
html:not(.has-reel) .case--tall .case__demo { grid-column: 9 / span 4; align-self: center; margin-bottom: 0; }

.case--tall .case__plate img { object-position: 50% 8%; }

/* the plate drifts right → left as it crosses the screen (the desktop strip's direction, in a
   stack). A scroll-driven animation: it runs on the compositor, no script per frame. */
@supports (animation-timeline: view()) {
  html:not(.has-reel):not(.is-reduced) .case__plate {
    animation: case-drift linear both;
    animation-timeline: view();
  }
}
@keyframes case-drift {
  from { transform: translate3d(4%, 0, 0); }
  to { transform: translate3d(-4%, 0, 0); }
}

/* ============================================================
   reel — the pinned strip (desktop, motion on)
   Geometry is in container units (cqw = the reel's own width, scrollbar excluded), so a
   panel at rest sits exactly --reel-x in from both edges: its text on the site's title
   column, its far edge clear of the fade.
   ============================================================ */

html.has-reel .reel {
  --reel-x: calc(max(0px, (100cqw - var(--max)) / 2) + var(--gutter) + 3.5rem + var(--col-gap));
  --pw: calc(100cqw - 2 * var(--reel-x)); /* panel */
  --gap: max(16cqw, var(--reel-x) + 4cqw); /* negative space between panels: neighbours rest off-frame */
  --fade: 6cqw; /* the edge masks; always narrower than --reel-x, so a resting panel is never faded */
  --rail-h: 4.75rem;
  height: 100svh;
  margin-top: clamp(2rem, 5vh, 4rem);
  overflow: clip;
  container-type: inline-size;
}

/* the window the strip travels through: content fades into the film at both edges,
   so a frame caught between two samples never shows a hard-cut word */
html.has-reel .reel__window {
  position: absolute;
  inset: 0 0 var(--rail-h) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}

/* the stage: the chapter's WebGL canvas (js/gl/work-gl.js), behind the strip and inside the
   masked window, so its light fades at the edges with everything else */
.reel__gl {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* with the stage, the GL draws each plate (sample, grade, tint, dim, drift); the DOM frame stays
   as the button — hit area, focus ring, cursor target — over it */
html.has-workgl .case__frame { background: transparent; }
html.has-workgl .case__frame::after { content: none; }
html.has-workgl.has-reel .case__plate { visibility: hidden; will-change: auto; }

html.has-reel .reel__track {
  z-index: 1;
  position: absolute;
  top: calc(var(--nav-h) + 3vh);
  bottom: 2.5vh;
  left: 0;
  display: flex;
  gap: var(--gap);
  width: max-content;
  padding-right: var(--reel-x);
  transform-origin: 50% 50%;
  will-change: transform;
}

/* ---------- opening slate: one full, centred frame before the first sample ---------- */

html.has-reel .reel__lead {
  flex: none;
  position: relative;
  isolation: isolate;
  width: 100cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 0 var(--reel-x) 3vh;
  text-align: center;
}
html.has-reel .reel__lead::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  z-index: -1;
  width: min(64rem, 76cqw);
  height: 78%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(10, 10, 11, 0.66), rgba(10, 10, 11, 0.34) 58%, rgba(10, 10, 11, 0));
  pointer-events: none;
}
.reel__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  color: var(--ink-3);
  letter-spacing: 0.14em;
}
.reel__kicker::before,
.reel__kicker::after { content: ""; width: 1.6rem; height: 1px; background: currentColor; opacity: 0.6; }
.reel__legend {
  max-width: 30ch;
  color: var(--ink);
  font-size: clamp(1.3rem, 0.7rem + 1.05vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.reel__cue {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--ink-3);
}
.reel__cue .lc { letter-spacing: 0.06em; color: var(--ink-2); }
.reel__arrow {
  position: relative;
  display: block;
  width: 3.5rem;
  height: 1px;
  background: currentColor;
}
.reel__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
  transform-origin: 100% 0;
}

/* ---------- panel ---------- */

html.has-reel .case {
  flex: none;
  width: var(--pw);
  height: 100%;
  display: grid;
  grid-template-columns: 32fr 5fr 63fr;
  grid-template-rows: minmax(0, 1fr);
}

/* film-strip edge code, printed in the right margin of each panel (inside the resting frame) */
html.has-reel .case__edge {
  display: block;
  position: absolute;
  top: 50%;
  left: calc(100% + var(--reel-x) * 0.42);
  color: var(--ink-4);
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: translate(-50%, -50%) rotate(180deg);
}
html.has-reel .case__edge::before,
html.has-reel .case__edge::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: 18vh;
  background: var(--hairline);
}
html.has-reel .case__edge::before { top: calc(100% + 1rem); }
html.has-reel .case__edge::after { bottom: calc(100% + 1rem); }

/* text column: title on top, the record at the bottom; a local scrim keeps it legible over the film */
html.has-reel .case__text {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 0;
  will-change: transform;
}
html.has-reel .case__text::before {
  content: "";
  position: absolute;
  inset: -14% -36% -14% -46%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(10, 10, 11, 0.72), rgba(10, 10, 11, 0.5) 55%, rgba(10, 10, 11, 0));
  pointer-events: none;
}
html.has-reel .case__title {
  font-size: min(4.75vw, 8.2vh);
  contain: layout style;
}
html.has-reel .case__line { display: block; width: max-content; }
html.has-reel .case__body { gap: 1.25rem; }
html.has-reel .case__desc { font-size: clamp(0.95rem, 0.6rem + 0.42vw, 1.06rem); line-height: 1.55; }
html.has-reel .case__meta > div { padding: 0.62rem 0; }

/* media column: a wide plate, the reticle beneath, the instrument docked over its corner */
html.has-reel .case__media {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  height: 100%;
  min-height: 0;
}
html.has-reel .case__frame { aspect-ratio: auto; height: 76%; flex: none; }
html.has-reel .case__reticle { align-self: flex-start; }
html.has-reel .case__plate { will-change: transform; }

html.has-reel .case__demo {
  position: absolute;
  right: -1.2vw;
  bottom: 0;
  width: clamp(330px, 25vw, 470px);
  transform-origin: 100% 100%;
  transition: scale 900ms var(--ease-out);
  will-change: transform;
}
html.has-reel .case--dock-left .case__demo { right: auto; left: calc(37% + 1.5vw); transform-origin: 0 100%; }
html.has-reel .case--dock-left .case__reticle { align-self: flex-end; }

/* the tall phone plate stands at full height; the instrument sits beside it */
html.has-reel .case--tall .case__frame {
  height: calc(100% - 2rem);
  width: auto;
  aspect-ratio: 440 / 900;
  align-self: flex-start;
}
html.has-reel .case--tall .case__demo { right: 0; width: clamp(360px, 29vw, 540px); }

/* at rest the working instrument steps forward and the evidence plate steps back.
   The dock is re-rastered at its new size (no will-change while resting), so its type stays crisp. */
html.has-reel .case.is-resting .case__demo { scale: 1.12; will-change: auto; }
html.has-reel .case.is-resting .case__frame:not(:hover):not(:focus-visible) .case__plate { opacity: 0.66; }

/* ---------- progress rail: count on the gutter, chapters on the title column ---------- */

html.has-reel .reel__rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  height: var(--rail-h);
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) 7rem;
  align-items: center;
  column-gap: var(--col-gap);
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reel__count {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.odo { display: inline-flex; color: var(--ink); }
.odo__col { display: inline-flex; flex-direction: column; height: 1.4em; overflow: hidden; line-height: 1.4; }
.odo__reel { display: block; }
.odo__col i { display: block; font-style: normal; height: 1.4em; }

.reel__chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 2rem);
}
.reel__chapters a {
  display: grid;
  gap: 0.7rem;
  padding-block: 0.9rem;
  color: var(--ink-3);
  transition: color var(--d-ui) var(--ease-ui);
}
.reel__chapters a:hover,
.reel__chapters a.is-active { color: var(--ink); }
.reel__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel__bar {
  position: relative;
  display: block;
  height: 1px;
  background: var(--hairline-strong);
}
.reel__bar i,
.reel__bar b {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
}
/* written every frame while the strip moves: their own (tiny) layers, so the rail never repaints */
html.has-reel .reel__bar i,
html.has-reel .reel__bar b { will-change: transform; }
.reel__bar i { background: var(--ink); transform: scaleX(0); }
/* playhead: the one live mark on the rail */
.reel__bar b { opacity: 0; transition: opacity var(--d-ui) var(--ease-ui); }
.reel__bar b::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
}
.reel__chapters a.is-active .reel__bar b { opacity: 1; }

.reel__hint {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink-3);
}
.reel__hint .reel__arrow { width: 2.25rem; }
.reel__hint { transition: opacity 500ms var(--ease-ui); }
.reel__hint.is-gone { opacity: 0; }

/* shorter laptop screens: tighten the record so the column never overflows */
@media (min-width: 1101px) and (max-height: 820px) {
  html.has-reel .case__desc { font-size: var(--fs-small); line-height: 1.5; }
  html.has-reel .case__meta > div { padding: 0.45rem 0; }
  html.has-reel .case__body { gap: 0.95rem; }
  html.has-reel .reel { --rail-h: 4.25rem; }
}

/* ============================================================
   tablet & mobile — natural stack, no pin
   ============================================================ */

@media (max-width: 1100px) {
  .work__title { grid-column: 1 / -1; }
  .work__intro { grid-column: 1 / span 8; }
  .index__row a {
    grid-template-columns: 3rem minmax(0, 1fr) 3.5rem;
    grid-template-areas:
      "num title year"
      ".   stack .";
  }
  .index__kind { display: none; }

  /* tablet: the plate and its record side by side, the instrument under the plate */
  html:not(.has-reel) .case {
    grid-template-rows: none;
    row-gap: 1.75rem;
    padding: clamp(3.5rem, 8vh, 5rem) var(--gutter);
  }
  html:not(.has-reel) .case__head { grid-column: 1 / -1; grid-row: 1; }
  html:not(.has-reel) .case__media { grid-column: 1 / span 7; grid-row: 2; align-self: start; }
  html:not(.has-reel) .case__body { grid-column: 8 / span 5; grid-row: 2 / span 2; }
  html:not(.has-reel) .case__demo,
  html:not(.has-reel) .case--dock-left .case__demo { grid-column: 1 / span 6; grid-row: 3; align-self: start; margin: 0; }
  html:not(.has-reel) .case--tall .case__media { grid-column: 1 / span 5; grid-row: 2 / span 2; }
  html:not(.has-reel) .case--tall .case__frame { aspect-ratio: 3 / 4; }
  html:not(.has-reel) .case--tall .case__body { grid-column: 6 / span 7; grid-row: 2; }
  html:not(.has-reel) .case--tall .case__demo { grid-column: 6 / span 6; grid-row: 3; align-self: end; }
}

/* narrow tablet & mobile: one column — head, plate, instrument, record */
@media (max-width: 900px) {
  html:not(.has-reel) .case { grid-template-columns: minmax(0, 1fr); row-gap: 1.5rem; }
  html:not(.has-reel) .case__head,
  html:not(.has-reel) .case__media,
  html:not(.has-reel) .case__body,
  html:not(.has-reel) .case__demo,
  html:not(.has-reel) .case--tall .case__media,
  html:not(.has-reel) .case--tall .case__body,
  html:not(.has-reel) .case--tall .case__demo,
  html:not(.has-reel) .case--dock-left .case__demo { grid-column: 1; grid-row: auto; }
  html:not(.has-reel) .case__head { order: 1; }
  html:not(.has-reel) .case__media { order: 2; }
  html:not(.has-reel) .case__demo { order: 3; max-width: 34rem; }
  html:not(.has-reel) .case__body { order: 4; }
  html:not(.has-reel) .case--tall .case__media { max-width: 24rem; }
}

@media (max-width: 760px) {
  .work__intro { grid-column: 1 / -1; }
  .index__row a {
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
    grid-template-areas:
      "num   .     year"
      "title title title"
      "stack stack stack";
    row-gap: 0.45rem;
  }
  /* sized so the longest title (n8n Workflow Automation) holds one line down to 320px */
  .index__title { font-size: clamp(1.45rem, 7.3vw, 2.6rem); }
  .case__title { font-size: clamp(2.6rem, 11vw, 3.4rem); }
  html:not(.has-reel) .case--tall .case__media { max-width: 21rem; }
}

/* leave the corner to the assistant's orb */
html.has-reel .reel__rail { padding-right: calc(48px + 1.25rem); }
