/* Case studies. Built from Figma keyan-folio-v2, page orchard-projects (node 922:23491): the open sheet is 922:26601,
   the stuck hero 922:25342. Each case is a sheet the size of the card, --case-drop lower, so the page behind peeks out on top.
   case.js places it, opens and closes it. Values are --case-* in tokens.css. */
.case {
  position: fixed;
  z-index: 50;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--card-radius);
  background: var(--card);
  box-shadow: 0 0 0 var(--card-line) var(--line), 0 2px 12px rgba(0, 0, 0, 0.03);
  color: #111111;
  outline: none;
  /* No scrollbar, as on the home panels: the side nav shows where you are. */
  scrollbar-width: none;
}

.case::-webkit-scrollbar {
  display: none;
}

.case[hidden] {
  display: none;
}

/* A sheet sliding in over another (case.js): the leaving sheet is the frame, so this one has no fill or shadow. */
.case.arriving {
  background: transparent;
  box-shadow: none;
}

/* The hero scrolls away with the page. It sits --case-hero-inset in from the sheet's top and sides (and, when full,
   its bottom), and its corners are the sheet's less that gap, so the two curves run parallel. */
.case {
  --hero-radius: calc(var(--card-radius) - var(--case-hero-inset, 7px));
}

.case-hero {
  position: relative;
  z-index: 3;
  margin: var(--case-hero-inset, 7px) var(--case-hero-inset, 7px) 0;
}

/* A cover image straight in the hero, or in a <picture> there (AVIF with a WebP fallback, as Intact has it). */
.case-hero > img,
.case-hero > picture > img {
  display: block;
  width: 100%;
  height: auto;
}

/* A <picture> cover is a plain photo, so it takes the hero's corners here; a bare img cover (Roblox) has its own drawn in. */
.case-hero > picture > img {
  border-radius: var(--hero-radius);
}

/* The bottom blur (case.js builds its layers). It sits last in the sheet, stuck to the bottom of what shows, and takes
   no room: the page scrolls under it, inside the sheet's rounded edge and outline. Over the body, under the hero, so a
   full height cover keeps its bottom edge and corners sharp. */
.case-blur {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: block;
  height: var(--case-blur-height, 100px);
  margin-top: calc(-1 * var(--case-blur-height, 100px));
  pointer-events: none;
}

/* On the home card the bands sit over the panel that shows (case.js), above its content and under the white sheet that
   covers the card while a case study is open; the card's rounded edge clips them. */
.track > .case-blur {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
}

.track > .case-blur.bottom {
  top: auto;
  bottom: 0;
}

/* The top band, while --case-blur-top is 1: first in the sheet, stuck to the top of what shows, also taking no room. */
.case-blur.top {
  top: 0;
  bottom: auto;
  margin-top: 0;
  margin-bottom: calc(-1 * var(--case-blur-height, 100px));
}

.case-blur[hidden] {
  display: none;
}

/* The amount and the scroll fade go on each layer, not on the band: an ancestor below full opacity cuts off what a
   backdrop blur inside it can see, so the blur would vanish instead of thinning. A layer's own opacity mixes its
   blurred picture with the sharp page under it, as wanted. */
.case-blur i {
  position: absolute;
  inset: 0;
  opacity: calc(var(--case-blur-amount, 1) * var(--edge-fade, 1));
}

/* Full: the cover fills the sheet's height, with the same gap under it as above and beside it (case.js sets --sheet-height). */
.case[data-hero="full"] .case-art,
.case[data-hero="full"] .case-hero > img,
.case[data-hero="full"] .case-hero > picture > img {
  height: calc(var(--sheet-height, 100vh) - 2 * var(--case-hero-inset, 7px));
  aspect-ratio: auto;
}

.case[data-hero="full"] .case-hero > img,
.case[data-hero="full"] .case-hero > picture > img {
  object-fit: cover;
  border-radius: var(--hero-radius);
}

/* Ramp's hero is the home cover drawn wide, at the Roblox hero's shape: the meadow at 90% and the wordmark through its
   mask. No riso wash here: its white edge showed as a streak down the right side. */
.case-art {
  position: relative;
  aspect-ratio: 1259 / 551;
  overflow: clip;
  border-radius: var(--hero-radius);
  background: #ffffff;
  isolation: isolate;
}

.case-art::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #f4f4f4;
  border-radius: inherit;
  pointer-events: none;
}

/* A cover still to come: the hero's shape in the grey of an empty .case-media. */
.case-art.blank {
  background: #f6f6f6;
}

.case-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* Intact's phones stand on the wash, centred, at most 88% of the hero's height and 92% of its width, whatever its shape. */
.case-art .phones {
  inset: 6% 4%;
  width: 92%;
  height: 88%;
  object-fit: contain;
}

/* Bump's phones layer is the whole Figma frame (1062:104080) with the wash left out, shadows and all, so it fills the
   hero and keeps the frame's own layout at any shape. */
.case-art.bump .phones {
  inset: 0;
  width: 100%;
  height: 100%;
}

.case-art .meadow {
  opacity: 0.9;
}

.case-art .wordmark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 21%;
  aspect-ratio: 281.9 / 75;
  background: #2b2b2b;
  /* Ramp's own vector wordmark, so its edges stay sharp at any size (the home cover's PNG mask is 328px wide). */
  mask: url('projects/ramp/wordmark.svg') center / 100% 100% no-repeat;
  translate: -50% -50%;
}

/* The case study frame (Figma keyan-folio-v2 node 950:38428): the side nav at the left edge, then the main column, which
   holds the text at --case-text wide in its middle and the pictures across its full width, from the nav's gap to the
   sheet's right margin. The text's width is --case-text-width, a share of the window (tokens.css). */
/* The pictures stand as far from the nav as from the sheet's right edge, --case-edge each side (Keyan, 2026-10-15; the
   nav gap was 43px, and a link too long for the nav's 141px ran into it). */
.case-body {
  --case-text: var(--case-text-width, 585px);
  --case-edge: 42px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 141px minmax(0, 1fr);
  column-gap: var(--case-edge);
  padding: 53px var(--case-edge) 160px 24px;
}

.case-side {
  /* The nav and back link take #faf7f7 for the current item and the hover, whatever the bar's selected colour is. */
  --case-pick: #faf7f7;
  position: sticky;
  top: 53px;
  align-self: start;
  display: grid;
  gap: 44px;
}

.case-back,
.case-nav a {
  display: flex;
  align-items: center;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: -0.13px;
  white-space: nowrap;
}

.case-back {
  gap: 8px;
  padding: 6px 12px;
  color: #949494;
  transition: color var(--jot-hover-fade, 150ms) ease, background-color var(--jot-hover-fade, 150ms) ease;
  line-height: 1.4;
  text-align: left;
}

/* Hover, on a mouse or trackpad: the back link and the section links show the same fill as the current one, and
   their text darkens to the nav ink. */
@media (hover: hover) {
  .case-back:hover,
  .case-nav a:hover {
    background: var(--case-pick);
    color: var(--ink-nav);
  }
}

/* The arrow takes the text's colour, so it goes black with it on hover. */
.case-back-icon {
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url('projects/roblox/icon-undo.svg') center / contain no-repeat;
}

.case-nav {
  display: grid;
  gap: 3px;
}

.case-nav a {
  padding: 7px 12px;
  color: #979393;
  line-height: normal;
  text-decoration: none;
  transition: color var(--jot-hover-fade, 150ms) ease, background-color var(--jot-hover-fade, 150ms) ease;
}

.case-nav [aria-current] {
  background: var(--case-pick);
  color: var(--ink-nav);
}

.case-main {
  --case-gap: 96px;
  display: grid;
  gap: var(--case-gap);
  align-content: start;
  justify-items: center;
  width: 100%;
}

.case-main h1,
.case-main h2,
.case-main h3,
.case-main p,
.case-main figure,
.case-facts,
.case-facts dd {
  margin: 0;
}

/* The overview: title and intro, the facts, the NDA note and a faint rule under them. */
.case-overview,
.case-text {
  position: relative;
  width: min(var(--case-text), 100%);
}

.case-overview {
  display: grid;
  gap: 44px;
}

/* The overview's own faint rule gives way to the clover divider below. */
.case-rule {
  display: none;
}

/* Dividers (Figma keyan-folio-v2 node 1005:34070): between two sections when the first ends with no large picture (no
   .case-media in it, and not a figure of its own, like Intact's side-by-side photos; with --case-placeholders 0 an empty
   .case-media is hidden and does not count), a
   clover in the middle of the gap with a hairline either side, as wide as the text. The clover is clover.svg or
   clover-pixel.svg, as --icons says (case.js puts it on the sheet as data-divider). Drawn by the section itself,
   so a case study needs no markup for it. The clover and both hairlines are one mask over a fill, so the clover takes
   a grey of ours whatever ink its file is drawn in: --line for the hairlines, and --case-divider-clover, a touch
   darker, for the clover, since its thin strokes read lighter than a solid line of the same grey.
   A divider just above a picture (the next block is a figure, or starts with one) is as wide as that picture, not the
   text (Keyan, 2026-10-13). Pictures span the main column, so that is 100cqi; for a narrower one, set
   --case-divider-width on the block above it to the picture's width. A block with .no-divider has none after it
   (Ramp's problem, before its fix: Keyan, 2026-10-13). */
.case {
  --divider-icon: url('icons/clover.svg');
}

.case[data-divider="clover-pixel"] {
  --divider-icon: url('icons/clover-pixel.svg');
}

.case-section {
  position: relative;
}

.case-main {
  container-type: inline-size;
}

.case-main > :has(+ figure, + * > figure:first-child) {
  --case-divider-width: 100cqi;
}

.case-main > :not(figure, :has(.case-media), .no-divider):not(:last-child)::after,
.case[data-placeholders="off"] .case-main > :not(figure, :has(.case-media:not(:empty)), .no-divider):not(:last-child)::after {
  --size: var(--case-divider-size, 16px);
  --line-room: calc(50% - var(--size) / 2 - var(--case-divider-gap, 12px));
  content: '';
  position: absolute;
  top: calc(100% + var(--case-gap) / 2);
  left: 50%;
  width: var(--case-divider-width, min(var(--case-text), 100%));
  height: var(--size);
  translate: -50% -50%;
  /* The clover's square in its own grey, the rest in the hairlines' --line; the mask then cuts the clover and lines out. */
  background:
    linear-gradient(var(--case-divider-clover, var(--line)) 0 0) center / var(--size) var(--size) no-repeat,
    var(--line);
  mask:
    var(--divider-icon) center / var(--size) var(--size) no-repeat,
    linear-gradient(#000 0 0) left center / var(--line-room) 1px no-repeat,
    linear-gradient(#000 0 0) right center / var(--line-room) 1px no-repeat;
  pointer-events: none;
}

.case-intro {
  display: grid;
  gap: 16px;
}

.case-main h1 {
  font-size: 22px;
  font-weight: 350;
  line-height: normal;
  letter-spacing: -0.33px;
}

.case-intro p {
  color: rgba(17, 17, 17, 0.9);
  font-size: 15px;
  line-height: 1.4;
}

.case-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  font-size: 15px;
}

.case-facts div {
  display: grid;
  gap: 12px;
  align-content: start;
}

.case-facts dt {
  color: #7c736f;
  line-height: normal;
  letter-spacing: -0.14px;
}

.case-facts dd {
  color: rgba(17, 17, 17, 0.9);
  font-weight: 350;
  line-height: 1.4;
}

.case-nda {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 18px 16px;
  border-radius: 14px;
  background: #f6f6f6;
  font-size: 15px;
  line-height: 1.4;
}

.case-nda span {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(17, 17, 17, 0.9);
}

.case-reach {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 3.5px 14px;
  white-space: nowrap;
  border-radius: 10px;
  background: #181717;
  color: #ffffff;
  font-weight: 350;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color var(--motion-fast) var(--motion-ease-out);
}

/* The button can be a link instead (Intact's Visit slides): it takes the buttons' focus ring. */
a.case-reach:focus-visible {
  outline: 1px solid var(--mute);
  outline-offset: 2px;
}

/* A click copies the email and squishes the button (reach.js); it goes lighter, --reach-hover, under the mouse. */
@media (hover: hover) {
  .case-reach:hover {
    background: var(--reach-hover);
  }
}

/* "Email copied!" (reach.js): small black text, no background, that comes up from behind the button's top edge. reach.js
   puts its middle just under that edge and moves it up. */
.case-copied {
  position: absolute;
  translate: -50% -50%;
  color: rgba(17, 17, 17, 0.9);
  font-size: var(--reach-copied-size, 13px);
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

/* A section: a small label, a lead line, body text, then a picture as wide as the main column. */
.case-section {
  display: grid;
  gap: 60px;
  justify-items: center;
  width: 100%;
  scroll-margin-top: 40px;
}

.case-text {
  display: grid;
  gap: 16px;
  font-weight: 300;
}

.case-label {
  color: rgba(155, 140, 140, 0.9);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
}

.case-lead {
  color: #111111;
  font-size: 18px;
  line-height: 1.4;
}

.case-copy {
  display: grid;
  gap: 1.4em;
  color: rgba(17, 17, 17, 0.9);
  font-size: 15px;
  line-height: 1.4;
}

/* An empty picture is a placeholder at the Figma shape. Put an <img> in it and it takes the picture's own shape. With
   --case-placeholders 0 the empty ones are not shown (case.js sets data-placeholders). */
.case[data-placeholders="off"] .case-media:empty {
  display: none;
}

.case-media {
  width: 100%;
  aspect-ratio: 1035 / 393;
  overflow: clip;
  border-radius: 16px;
  background: #f6f6f6;
}

.case-media:has(img, video) {
  position: relative;
  aspect-ratio: auto;
  background: none;
}

/* A picture gets the cover's 1px line, over it, inside the rounded edge. */
.case-media:has(img, video)::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #f4f4f4;
  border-radius: inherit;
  pointer-events: none;
}

.case-media img,
.case-media video {
  display: block;
  width: 100%;
  height: auto;
}

/* Learnings: the label sits 28px from its notes, which run in two columns, or one under the other with .case-stack. */
.case-section:has(.case-learnings) .case-text {
  gap: 28px;
}

.case-learnings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  line-height: 1.4;
}

.case-learnings.case-stack {
  grid-template-columns: minmax(0, 1fr);
}

.case-learnings > div {
  display: grid;
  gap: 12px;
  align-content: start;
}

.case-learnings h3 {
  color: #111111;
  font-family: 'TWK Lausanne 400', 'TWK Lausanne', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
}

.case-learnings > div > p {
  color: rgba(17, 17, 17, 0.9);
  font-size: 13.5px;
}

/* Quotes under a learning keep their own look, 32px clear of the notes above, as a quote stands (the notes' 12px gap
   and 20px more). */
.case-learnings .case-quotes {
  margin-top: 20px;
}

/* With quotes under them, the learnings stand 48px apart, past the quotes' own 32px, so each reads as its own group
   (on phones too, over their 16px). */
.case-learnings.case-stack:has(.case-quotes) {
  row-gap: 48px;
}

/* Blocks for a longer case study (Bump, ported from keyqn.webflow.io/bump). Each reuses the frame's type: a lead line
   for a subhead, the Learnings heading for a small title, the body for text. */

/* A lead line can be a subhead (an h3) further down a text block: it keeps the lead's weight and sits a little apart. */
.case-lead {
  font-weight: inherit;
}

.case-sub:not(:first-child) {
  margin-top: 24px;
}

/* Links in the text: the text's own colour, with the site's link underline (style.css, .status a), darkening on hover
   to the text's colour. */

/* A plain list in the text. */
.case-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: rgba(17, 17, 17, 0.9);
  font-size: 13.5px;
  line-height: 1.4;
}

/* A picture with a light caption centred under it (as Intact's photos have it). It holds one .case-media, or a few
   stacked 12px apart. */
.case-plate {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 0;
}

.case-caption {
  justify-self: center;
  margin-top: 4px;
  color: rgba(155, 140, 140, 0.9);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
  text-align: center;
}

/* Callouts and quotes (Figma keyan-folio-v2 nodes 1048:44264 and 1048:44274): the NDA note's grey box with the text
   alone, or after a 24px icon. */
.case-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 16px 14px 14px;
  border-radius: 14px;
  background: #f6f6f6;
  color: rgba(17, 17, 17, 0.9);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.4;
}

.case-callout > div {
  display: grid;
  gap: 8px;
}

.case-callout .case-list {
  font-size: 14px;
}

/* A quote, after josephines.world/case-study/heat: a 2px bar of 15% ink at the left, the words 24px in from it, the
   body's size a shade lighter than the body (hers 60% against 70% ink), and 32px clear above and below. The text
   block's 16px gap gives half of that, the margin the rest. A subhead after it keeps its usual 40px, as a collapsing
   margin would. */
.case-quote {
  margin: 16px 0;
  padding-left: 24px;
  border-left: 2px solid rgba(17, 17, 17, 0.15);
  color: rgba(17, 17, 17, 0.6);
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.4;
}

.case-quote + .case-sub {
  margin-top: 8px;
}

/* A quote can carry its speaker's name under it, "~~ Name", in the label's grey. A run of quotes (Roblox's extras)
   stands 32px apart, the gap one quote keeps above and below. */
.case-quote footer {
  margin-top: 8px;
  color: rgba(155, 140, 140, 0.9);
  font-size: 13px;
}

.case-quotes {
  display: grid;
  gap: 32px;
}

.case-quotes .case-quote {
  margin: 0;
}

/* An icon in the text: a Central Icons SVG (round filled, radius 2, stroke 1.5) as a mask over the text's ink. */
.case-icon {
  flex: none;
  width: var(--icon-size, 24px);
  height: var(--icon-size, 24px);
  background: rgba(17, 17, 17, 0.9);
  mask: var(--icon) center / contain no-repeat;
}

/* Three across the main column, each a drawing with a small title and a line or two centred under it. The drawings
   are painted on white, so they multiply onto the sheet and their white falls away. */
.case-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  width: 100%;
}

.case-trio > div {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: center;
  text-align: center;
}

/* Each drawing sits in the same square, so the titles under them line up. */
.case-trio img {
  display: block;
  width: min(100%, 240px);
  height: auto;
  aspect-ratio: 1;
  margin-bottom: 8px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.case-trio h3,
.case-findings h3,
.case-person h3,
.case-options h3,
.case-pair-text h3 {
  color: #111111;
  font-family: 'TWK Lausanne 400', 'TWK Lausanne', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.case-trio p,
.case-findings p,
.case-person p {
  color: rgba(17, 17, 17, 0.9);
  font-size: 13.5px;
  line-height: 1.4;
}

/* Findings stacked down the text column, each a filled icon beside its title and line. */
.case-findings {
  display: grid;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-findings li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.case-findings li > div {
  display: grid;
  gap: 6px;
}

/* A persona: the portrait at the top left, the text describing them beside it. */
.case-person {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.case-person img {
  display: block;
  width: 100%;
  height: auto;
}

.case-person > div {
  display: grid;
  gap: 6px;
  padding-top: 12px;
}

/* Options under a picture of them, one column under each phone: the picture's phones sit about a fifth in from its
   edges, so the columns pad in to meet them. A point is a check or a cross. */
.case-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  width: 100%;
  padding-inline: 6%;
}

.case-options > div {
  display: grid;
  gap: 12px;
  align-content: start;
}

.case-points {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(17, 17, 17, 0.9);
  font-size: 13.5px;
  line-height: 1.4;
}

.case-points li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
}

.case-points .case-icon {
  --icon-size: 16px;
  margin-top: 1.5px;
}

.case-points .con .case-icon {
  background: #bdb6b3;
}

/* A picture and its text side by side (Keyan's reference, 2026-10-13): the picture on the left, the title and lines
   at the bottom on the right. */
.case-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 40px;
  align-items: end;
  width: 100%;
}

.case-pair-text {
  display: grid;
  gap: 12px;
  font-weight: 300;
}

.case-pair-text p {
  color: #7c736f;
  font-size: 14px;
  line-height: 1.4;
}

.case-pair-text em {
  color: #111111;
  font-style: normal;
}

.case-pair-text .case-callout {
  margin-top: 8px;
}

.case-pair-text .case-callout,
.case-pair-text .case-callout p {
  color: rgba(17, 17, 17, 0.9);
}

/* Two pictures side by side at one height: each column's share is its picture's width over height (--duo). */
.case-duo {
  display: grid;
  grid-template-columns: var(--duo, 1fr 1fr);
  gap: 12px;
  width: min(100%, 880px);
}

/* Shots in a grid (Roblox, Figma keyan-folio-v2 node 1056:69057): a wide one across the column, small ones two to a row,
   all --case-grid-gap apart. Corners scale with the picture: a small one is about half as wide, so it takes
   --case-grid-small of the wide one's --case-grid-radius, and the two sizes read as one shape. Each picture gets the
   cover's 1px line, over it, inside the rounded edge. */
.case-grid {
  --r: var(--case-grid-radius, 16px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--case-grid-gap, 12px);
  width: 100%;
}

/* In the overview, the grid runs past the text to the main column's full width, as the other pictures do: the main
   column is its container (100cqi, set with the dividers), and the margins, half the difference each side, centre the
   grid on it. */
.case-overview > .case-grid {
  width: 100cqi;
  margin-inline: calc((100% - 100cqi) / 2);
}

.case-grid picture {
  position: relative;
  grid-column: 1 / -1;
  overflow: clip;
  border-radius: var(--r);
}

.case-grid .small {
  grid-column: auto;
  border-radius: calc(var(--r) * var(--case-grid-small, 0.5));
}

.case-grid picture::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #f4f4f4;
  border-radius: inherit;
  pointer-events: none;
}

.case-grid img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 899px) {
  .case-body {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px 120px;
  }

  .case-main {
    --case-gap: 64px;
  }

  /* A share of a phone's width is too narrow to read, so the text takes the full column. */
  .case-overview,
  .case-text {
    width: 100%;
  }

  .case-media {
    border-radius: 12px;
  }

  .case-grid {
    --r: var(--case-grid-radius-phone, 12px);
  }

  .case-side {
    position: static;
    margin: 0;
  }

  .case-nav {
    display: none;
  }

  .case-facts,
  .case-learnings {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .case-trio,
  .case-options,
  .case-pair {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-inline: 0;
  }

  .case-pair {
    gap: 20px;
  }
}

/* The project tabs (Figma node 924:33897). While a case study is open they take the section tabs' place, with the same
   look and pill (style.css, tabs.js). A project with no case study yet takes no click. */
.tabs[hidden] {
  display: none;
}

.case-tabs .tab[aria-disabled] {
  cursor: default;
}

/* On a phone the section tabs take their own row; the project tabs sit over it, so the swap does not move the bar. */
/* Five projects are wider than a phone, so their tabs sit closer there. */
@media (max-width: 560px) {
  .bar .case-tabs {
    --tab-pad-x: 8px;
    position: absolute;
    top: 0;
    left: 50%;
    translate: -50% 0;
  }
}

/* From the open lab (open-lab.html), 2026-10-12. */
/* The progressive blur over the sheet while it moves (case.js, pblur): it stays on the sheet's bottom edge as the page
   scrolls, as the edge blur does, and case.js sets its height (--case-pblur-reach of the sheet). */
.case-pblur {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: block;
  pointer-events: none;
}

.case-pblur[hidden] {
  display: none;
}

.case-pblur i {
  position: absolute;
  inset: 0;
  /* As much of it shows as of the bottom edge blur (--case-blur-amount). */
  opacity: var(--case-blur-amount, 1);
}
