/* CurtainCall, assets/case.css
   The case-study pages and their index (2026-10-16), generated from Markdown by tools/case-study/build.mjs (the HTML is
   in tools/case-study/templates.mjs). Link order on a study page: tokens.css, comic.css, pages.css, proof.css, this file,
   credits.css; the index has no proof.css. pages.css is left as it is, so the three legal pages do not change: this
   file adds the case pages' own parts and wins where it overrides by order or by specificity.

   What the pages take from the homepage, and from where (copied as token references, never as values):
   - the production slate's printed type: labels in tracked Inter capitals, values in Instrument Serif at --text-xl,
     hairline rules (home.css, "Pricing slate", .slate-k and .slate-v);
   - the Work card for the study cards: a 16:9 picture with the large corner, the step numeral, the serif title, the
     line under it, the site's label for the facts and the in-card link (home.css, "Work showcase");
   - the media frame for a picture that stands on its own: --radius-l, a hairline rim and --shadow-glow, the corner
     stepping down at 640px (home.css, "Media frames"); the before-and-after slider is assets/proof.css;
   - the tag on a picture, for "Source" and "Animated" (home.css, review B8.5);
   - the eyebrow, the crumb, the chips, the reading measure, the quote and the closing call to action from pages.css.
   Not the homepage's cinematic opening or its end card (Eric, 2026-10-14).

   Tokens only: CLAUDE.md's Verification greps must find no colour, size, weight, leading or tracking written here.
   Motion is transform and opacity, hover sits inside the pointer query, focus is pages.css's one ring. */

/* ---------- The page ---------- */
.case { padding-bottom: 0; }

/* ---------- Opening: the crumb, the format, the name, the headline, the logline, the chip, and the film ----------
   A study page wraps these, the film and the slate in .case-top. Up to 900px it is one column: on a phone (640px and
   under) the slate comes before the film, as before 2026-10-16; from 641px the film comes straight after the story,
   which puts all of it on the first screen of an 834 x 1112 tablet. From 901px it is two columns, the film beside the
   story, so the first screen shows the work (Eric, 2026-10-16; the Two columns rule below has the measurements). The
   index's header is a .case-open--index on its own. */
.case-top, .case-open--index { padding-top: var(--space-7); }
.case-top { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
/* On a study page the name and the headline are two spans in one h1 (templates.mjs says why), each a block of its own.
   The name repeats the h1's tracking because -.01em is resolved at the h1's own size and inherited as that length, so
   a span set at another size would inherit the wrong tracking. The index's h1 is a .case-title itself. */
.case-title { display: block; margin-top: var(--space-3); font-size: var(--display-serif-l); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); text-wrap: balance; }
.case-headline { display: block; margin-top: var(--space-4); max-width: 30ch; font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--display-serif-s); line-height: var(--leading-snug); letter-spacing: var(--tracking-display); color: var(--text-primary); text-wrap: balance; }
.case-logline { margin-top: var(--space-5); max-width: 52ch; font-size: var(--text-lg); line-height: var(--leading-normal); color: var(--text-body); text-wrap: pretty; }
.case-chips { margin-top: var(--space-5); }

/* ---------- The slate: the homepage Pricing slate's printed type, on the page ----------
   Source, Runtime, Generated in and the credit, in the homepage Work card's order, one cell each between hairlines; the
   first cell's words start on the text's left edge. The facts are rows under it, their labels in a column as wide as
   the first cell, so every value from the second cell on starts on one line. */
.case-top > .case-slate-wrap { margin-top: var(--space-7); }
.case-slate { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-block: 1px solid var(--border-subtle); }
.case-cell { padding: var(--space-4) var(--space-5); }
.case-cell:first-child { padding-left: 0; }
.case-cell + .case-cell { border-left: 1px solid var(--border-subtle); }
.case-k { font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: var(--leading-normal); letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--text-secondary); }
.case-v { margin-top: var(--space-1); font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-xl); line-height: var(--leading-snug); letter-spacing: var(--tracking-normal); color: var(--text-primary); text-wrap: balance; }
.case-fact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); align-items: baseline; padding-block: var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.case-fact dd { padding-left: var(--space-5); max-width: 66ch; font-size: var(--text-md); line-height: var(--leading-normal); color: var(--text-body); text-wrap: pretty; }

/* ---------- The film: a media frame, as large as fits under the nav ----------
   The frame is .case-film-box: the still (templates.mjs says why it is an <img> and not only the video's poster) and
   the video over it, transparent until it has a frame. A portrait film (Cloaked's is 9:16) is never taller than 720px. */
.case-film { margin-top: var(--space-6); width: min(100%, calc((100svh - var(--nav-h) - var(--space-7)) * var(--ar))); }
.case-film.is-portrait { width: min(100%, calc(min(100svh - var(--nav-h) - var(--space-7), 720px) * var(--ar))); }
.case-film-box { position: relative; aspect-ratio: var(--ar); overflow: hidden; background: var(--surface-sunken);
  border-radius: var(--radius-l); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-glow); }
.case-film-box :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.case-film-box video { background: none; }
/* Chrome paints a grey stand-in over a video with controls and no poster, which hid the still with scripts off (the
   video gets its poster attribute from case.js). Its own rule, so a browser that rejects the selector keeps the rest. */
.case-film-box video::-webkit-media-controls { background: none; }

/* ---------- Two columns from 901px: the story on the left, the film on the right ----------
   Measured on the three studies (log: temporary screenshots/case-2026-10-16/opening.md). The story takes five parts of
   twelve, 463px at 1440 and 1280, 390px at 1024: the logline runs 40 to 55 characters a line (Sulver's 294 characters
   in six lines at 1440), where the full 1152px row would give 70. The film takes the other seven, 649 x 365 at 1440
   and 1280. At 900px the story column would be 339px, the logline's 40-character floor, so 901 is the line, the
   site's own (the header's hamburger, the old portrait row). The name steps to --display-serif-m here: at -l
   "Sulver's Journey" is 662px wide at 1440 and 590 at 1280, so it would break in two in a 463px column and push the
   chip to about 790px, under a 1280 x 650 screen; at -m it is 324 and 288. A name across both columns at -l was
   measured too: it leaves 294px of height for the film at 1280 x 650 (523 x 294) and the chip at 673px, off that
   screen. The film's height is capped by the room under the nav, the crumb and a --space-5 margin (--film-room), so a
   portrait film ends inside the first screen; it sits on the column's right edge, the container's. Its top edge drops
   --space-1 to the eyebrow's capitals (Inter's cap top is .41em into the 12px label's 1.55 line, 4.9px), not to the
   label's line box. */
@media (min-width: 901px) {
  .case-top.has-film { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-6);
    --film-room: calc(100svh - var(--nav-h) - var(--space-7) - var(--text-xs) * var(--leading-normal) - var(--space-5) - var(--space-1) - var(--space-5)); }
  .has-film > .crumb { grid-column: 1 / -1; grid-row: 1; }
  .has-film > .case-open { grid-column: 1; grid-row: 2; }
  .has-film > .case-film { grid-column: 2; grid-row: 2; justify-self: end; margin-top: var(--space-1); width: min(100%, calc(var(--film-room) * var(--ar))); }
  .has-film > .case-film.is-portrait { width: min(100%, calc(min(var(--film-room), 720px) * var(--ar))); }
  .has-film > .case-slate-wrap { grid-column: 1 / -1; grid-row: 3; }
  .has-film .case-title { font-size: var(--display-serif-m); }
}

/* ---------- Chapters: each ## is a band under a hairline ---------- */
.case-chapter { margin-top: var(--space-7); padding-top: var(--space-7); border-top: 1px solid var(--border-subtle); }
.case-chapter > h2 { max-width: 21ch; font-size: var(--display-serif-m); line-height: var(--leading-tight); }
.case-chapter > * + * { margin-top: var(--space-6); }
.case-chapter > h2 + .prose { margin-top: var(--space-5); }

/* ---------- The lead pair: the slider (assets/proof.css draws it) ----------
   The two labels sit under the half each one names: the source's on the left, the frame's on the right. */
.proof-figcaption { display: flex; justify-content: space-between; gap: var(--space-2) var(--space-6); }
.proof-figcaption > :last-child { text-align: right; }

/* ---------- Later pairs: side by side, the same height, no letterboxing ----------
   Each picture grows by its own shape (flex-grow is its width over its height), so two pictures of any shapes come out
   the same height and each shows whole. The row is capped so that height fits under the nav: --sum, written by the
   generator, is the two shapes added up. */
.case-pair { display: flex; align-items: flex-start; gap: var(--space-5); max-width: calc(var(--sum, 3.6) * (100svh - var(--nav-h) - var(--space-7) - var(--space-6)) + var(--space-5)); }
.case-pair-item { flex: calc(var(--ar)) 1 0; min-width: 0; margin: 0; }
.case-pair-media { position: relative; aspect-ratio: var(--ar); overflow: hidden; background: var(--surface-sunken);
  border-radius: var(--radius-l); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-glow); }
.case-pair-media :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
/* The tag on a picture (home.css, review B8.5): Source on the art, Animated on the frame. */
.case-tag { position: absolute; top: var(--space-3); left: var(--space-3); z-index: 1; padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill);
  background: var(--scrim-medium); border: 1px solid var(--border-strong); color: var(--text-primary); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: var(--text-2xs); font-weight: var(--weight-semibold); line-height: var(--leading-snug); letter-spacing: var(--tracking-wider); text-transform: uppercase; pointer-events: none; }

/* ---------- Quotes: pages.css sets them in the serif with the cyan rule before the credit ---------- */
.case-quote { max-width: 30ch; }
.case-quote cite { max-width: none; }

/* ---------- The closing call to action: pages.css's, closer to the last chapter than to the end of the page ---------- */
.case-cta { margin-top: var(--space-8); padding-top: var(--space-7); border-top: 1px solid var(--border-subtle); }

/* ---------- Study cards: the homepage Work card (the index, and More case studies at the end of a study) ---------- */
.case-card { display: block; height: 100%; text-decoration: none; color: inherit; border-radius: var(--radius-l); outline-offset: 6px; transition: transform var(--duration-fast) var(--ease-out); }
.case-card-media { position: relative; aspect-ratio: 16 / 9; margin: 0; overflow: hidden; background: var(--surface-raised);
  border-radius: var(--radius-l); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-card);
  transition: transform var(--duration-slow) var(--ease-out), box-shadow var(--duration-slow) var(--ease-out); }
.case-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.case-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--scrim-weak), var(--scrim-none) 45%); pointer-events: none; }
.case-card-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-4); padding: var(--space-5) var(--space-2) 0; }
/* One numeral (review B8.5): Inter bold at --text-lg in even-width figures, cyan, its capitals level with the title's. */
.case-card-num { font-family: var(--font-body); font-size: var(--text-lg); font-weight: var(--weight-bold); line-height: var(--leading-loose); font-variant-numeric: tabular-nums; color: var(--accent); }
.case-card-title { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--display-serif-s); line-height: var(--leading-snug); letter-spacing: var(--tracking-display); color: var(--text-primary); text-wrap: balance; }
.case-card-line, .case-card-facts, .case-card-cta { grid-column: 2; }
.case-card-line { margin-top: var(--space-2); max-width: 52ch; font-size: var(--text-md); line-height: var(--leading-normal); color: var(--text-body); text-wrap: pretty; }
/* Two by two on every card, so the four facts sit in the same places from card to card (a wrapping row put Team on a
   line of its own under Jancroon and kept Sulver's four on one). */
.case-card-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-5); margin-top: var(--space-4); }
.case-card-facts dt { font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: var(--leading-normal); letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--text-secondary); }
.case-card-facts dd { font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--text-primary); }
/* The in-card link (review B8.6): 14px semibold in sentence case, cyan, the arrow nudging on hover. The whole card is
   the link, so the arrow is a mark, not a target. */
.case-card-cta { display: inline-flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: var(--leading-normal); color: var(--accent); }
:is(.case-card-cta, .case-all) svg { flex: none; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--duration-base) var(--ease-out); }
:is(.case-card-cta, .case-all) svg path { vector-effect: non-scaling-stroke; }
.case-card-cta svg { width: 16px; height: 16px; }

/* The index: the cards two across, the homepage container. */
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7) var(--space-5); margin-top: var(--space-7); list-style: none; }

/* More case studies: the previous and the next study; at either end of the list the empty place links to all of them. */
.case-more { margin-top: var(--space-8); }
.case-more-title { font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: var(--leading-normal); letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--text-secondary); }
.case-more-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); margin-top: var(--space-5); list-style: none; }
.case-all { display: flex; align-items: center; justify-content: center; gap: var(--space-3); aspect-ratio: 16 / 9; text-decoration: none; color: var(--text-primary);
  border-radius: var(--radius-l); border: 1px solid var(--border-subtle); background: var(--accent-veil);
  transition: transform var(--duration-fast) var(--ease-out), border-color var(--duration-fast) ease, color var(--duration-fast) ease; }
.case-all-title { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--display-serif-s); line-height: var(--leading-snug); letter-spacing: var(--tracking-display); }
.case-all svg { width: 24px; height: 24px; color: var(--accent); }

/* ---------- States: hover lifts and warms (pointer only), pressed scales, focus is the global ring ---------- */
@media (hover: hover) and (pointer: fine) {
  .case-card:hover .case-card-media { transform: translateY(-4px); box-shadow: var(--shadow-glow), var(--shadow-card); }
  .case-card:hover .case-card-cta svg, .case-all:hover svg { transform: translateX(4px); }
  .case-all:hover { border-color: var(--border-accent); color: var(--accent-bright); }
}
.case-card:active, .case-all:active { transform: scale(var(--state-pressed-scale)); }

/* ---------- Arrival: blocks below the first screen rise into place once (assets/case.js) ----------
   Only with scripts and without reduced motion; case.js adds .reveal-wait only to blocks that start below the fold, so
   nothing on the first screen ever blinks, and a page whose script fails shows everything. Opacity and transform, never
   visibility, so a waiting block stays in the Tab order; focus inside one shows it at once. */
html.js:not(.rm) [data-reveal] { transition: opacity var(--duration-slow) ease, transform var(--duration-slow) var(--ease-out); }
html.js:not(.rm) .reveal-wait { opacity: 0; transform: translateY(24px); pointer-events: none; }
.reveal-now { transition: none !important; }

/* ---------- Narrower screens ---------- */
@media (max-width: 760px) {
  .case-grid, .case-more-list { grid-template-columns: 1fr; }
  .case-grid, .case-more-list { gap: var(--space-6); }
  /* One column: the study comes first and the way to all of them is a plain row under it, not an empty 16:9 box. */
  .case-more-all { order: 1; }
  .case-all { aspect-ratio: auto; justify-content: flex-start; min-height: var(--tap-min); padding: var(--space-4) var(--space-5); }
}
/* The slate two by two, wherever it is too narrow for one row of four. */
@media (max-width: 760px) {
  .case-slate { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-cell:nth-child(odd) { padding-left: 0; border-left: 0; }
  .case-cell:nth-child(n + 3) { border-top: 1px solid var(--border-subtle); }
}
@media (max-width: 640px) {
  .case-top, .case-open--index { padding-top: var(--space-6); }
  .case-top > .case-slate-wrap { margin-top: var(--space-6); }
  .case-top > .case-film { order: 1; } /* a phone keeps its order: the story, the slate, then the film */
  .case-chapter { margin-top: var(--space-6); padding-top: var(--space-6); }
  .case-chapter > * + * { margin-top: var(--space-5); }
  .case-chapter > h2 + .prose { margin-top: var(--space-4); }
  .case-fact { grid-template-columns: 1fr; row-gap: var(--space-1); }
  .case-fact dd { padding-left: 0; }
  .case-film-box, .case-pair-media, .case-card-media, .case-all { border-radius: var(--radius-m); }
  .case-pair { flex-direction: column; max-width: none; }
  .case-pair-item { flex: none; width: 100%; }
  .case-tag { top: var(--space-2); left: var(--space-2); padding: var(--space-1) var(--space-2); }
  .proof-figcaption { flex-direction: column; }
  .proof-figcaption > :last-child { text-align: left; }
  .case-cta { padding-top: var(--space-6); }
}

/* Reduced transparency: solid tags instead of frosted ones. */
@media (prefers-reduced-transparency: reduce) {
  .case-tag { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-glass-solid); }
}
