
/* Project pages (/work/<slug>/), in the homepage's look: loads after home.css and uses its
   tokens (--color-bg, --color-text, --color-text-muted, --color-border, --color-bg-subtle), its Type styles and its parts (.label,
   buttons). After shahvirsarkary.com (a quiet facts row, chapters with a small label) and
   svsd.school (serif numbers in outlined ovals, a closing "Start your next chapter").
   Content sits in the site's 1280px column (--content; the grey sections run full width),
   sections are split by a hairline, and body copy is Type/body/s (14/20). */

/* Hero: label, title and intro centred, the results, then the image and the facts */
.case-hero { padding: 176px var(--edge); }
.case-hero__text { display: grid; justify-items: center; gap: var(--space-6); text-align: center; }
.case-title {
  max-width: 1040px;
  font: var(--type-display-xl); letter-spacing: var(--type-display-xl-tracking);
  text-wrap: balance;
}
.case-intro { max-width: 520px; font: var(--type-body-m); color: var(--color-text-muted); text-wrap: pretty; }
.case-hero .frame { margin-top: var(--space-24); }
/* The hero fades up as one, like the homepage intro */
.case-hero__text, .case-hero .case-stats, .case-hero .frame { opacity: 0; translate: 0 16px; }
.is-ready .case-hero__text { opacity: 1; translate: 0; transition: opacity var(--duration-xl) .1s var(--ease), translate var(--duration-xl) .1s var(--ease); }
.is-ready .case-hero .case-stats { opacity: 1; translate: 0; transition: opacity var(--duration-xl) .2s var(--ease), translate var(--duration-xl) .2s var(--ease); }
.is-ready .case-hero .frame { opacity: 1; translate: 0; transition: opacity 1s .25s var(--ease), translate 1s .25s var(--ease); }
:root:not(.js) :is(.case-hero__text, .case-hero .case-stats, .case-hero .frame) { opacity: 1; translate: 0; } /* no script to fade them in */

/* The facts: one quiet row, a mono label over each value (like the work meta) */
.case-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-6) var(--space-8); margin-top: var(--space-10); padding-top: var(--space-6); border-top: 1px solid var(--color-border); }
.case-facts div { display: grid; gap: var(--space-1); align-content: start; }
.case-facts dt { font: var(--type-label); letter-spacing: var(--type-label-tracking); color: var(--color-text-muted); }
.case-facts dd { font-weight: 500; }
.case-facts a { text-decoration: none; }
/* The company link borrows the career rows' link look, but not their stretch over the
   whole row: here there's no row to stop it, so it would cover the page */
.case-facts .career-co::after { content: none; }

/* Results: big serif numbers over what they count, three across (they count up, project.js) */
.case-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-14); margin-top: var(--space-24); }
@media (min-width: 768px) { .case-stats:has(> li:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } } /* two results split the width */
/* centred under the intro, each under a hairline like the homepage's testimonials */
.case-stats li { display: grid; justify-items: center; gap: var(--space-3); align-content: start; padding-top: var(--space-8); border-top: 1px solid var(--color-border); text-align: center; }
.case-stat__num { font: var(--type-display-s); letter-spacing: var(--type-display-s-tracking); font-variant-numeric: tabular-nums; }
.case-stat__label { max-width: 280px; font: var(--type-body-m); color: var(--color-text-muted); text-wrap: balance; }

/* Image frames: the work tiles' corners on the page's grey, which is the grey the artwork
   is drawn on, so each picture sits in it seamlessly. Shown whole at every size; art with
   its own phone version swaps to it under 768px. No border: the grey (or the art's own
   colour) already stands apart from the page. */
.frame { position: relative; overflow: hidden; border-radius: var(--radius-l); background: var(--color-bg-subtle); -webkit-user-select: none; user-select: none; cursor: default; } /* pictures, even ones drawn in text, act as pictures: nothing to select */
.frame img { width: 100%; }
.frame .image-phone { display: none; }
/* Until a picture is ready: the grey frame at the art's shape (--ratio), saying what could go there */
.frame--placeholder { display: grid; place-items: center; aspect-ratio: var(--ratio, 1200 / 560); padding: var(--space-8); }
.frame--placeholder p { display: grid; gap: var(--space-2); max-width: 440px; font: var(--type-body-s); color: var(--color-text-muted); text-align: center; text-wrap: pretty; }
.frame__todo { font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text); }
/* AI Ways of Working, Context: the tribes drawn in type, like a file tree. Real text in the
   label/meta style, so it stays readable however small the frame gets; under 400px wide the
   tribes stack, and on phones the frame drops its shape to fit them. Loop is the one solid shape, set apart by a broken dashed line. */
.tribes { container-type: inline-size; display: grid; place-items: center; aspect-ratio: var(--ratio); padding: var(--space-10) var(--space-8) var(--space-6); } /* more room on top for the comment */
.tribes__inner { display: grid; justify-items: center; width: 100%; font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text-muted); }
.tribes p { margin: 0; }
/* A code comment in the top corner, in the padding, saying the squads are made up */
.tribes__comment { position: absolute; top: var(--space-3); left: var(--space-4); right: var(--space-4); font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text-muted); }
.tribes__loop { display: grid; justify-items: center; gap: var(--space-2); }
.tribes__node { padding: var(--space-1) var(--space-4); border-radius: var(--radius-full); background: var(--color-text); color: var(--color-bg); }
.tribes__break { position: relative; display: grid; place-items: center; height: var(--space-10); margin: var(--space-2) 0; }
.tribes__break::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; translate: -.5px 0; border-left: 1px dashed var(--color-text-muted); mask: linear-gradient(#000 30%, transparent 30% 70%, #000 70%); }
.tribes__break span { display: block; width: 1ch; text-align: center; line-height: 1; color: var(--color-text-muted); }
.tribes__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); width: 100%; }
.tribes__tribe { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-m); background: var(--color-bg); }
.tribes__name { color: var(--color-text); }
.tribes ul { display: grid; margin: 0; padding: 0; list-style: none; }
.tribes li { display: flex; justify-content: space-between; gap: var(--space-2); white-space: nowrap; }
.tribes li span:last-child { color: var(--color-text); }
.tribes li .tribes__none { color: var(--color-text-muted); }
.tribes__key { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1) var(--space-5); margin-top: var(--space-4) !important; }
.tribes__sum { margin-top: var(--space-1) !important; color: var(--color-text); }
@container (max-width: 400px) {
  .tribes__cols { grid-template-columns: minmax(0, 1fr); max-width: 240px; }
  .tribes__break { height: var(--space-8); }
}
@container (max-width: 400px) { .tribes__tribe { padding: var(--space-2) var(--space-3); } }
@media (max-width: 767px) { .tribes { aspect-ratio: auto; } }
/* A screenshot that isn't the frame's shape: shown whole, centred on the grey with room around
   it. It sits in .shot, a box the picture's own shape, so numbered marks can be placed on it by
   percentage (--x, --y); the key under the caption says what each one is. The marks are the
   text colour ringed in the background colour, so they show on the dark screenshot in both themes. */
.frame--window { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; aspect-ratio: var(--ratio, 588 / 560); padding: var(--space-8); }
.shot { position: relative; display: block; height: 100%; max-width: 100%; aspect-ratio: 859 / 1000; }
.frame--window .shot img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-s); }
.shot__mark, .shot-notes__num { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--color-text); color: var(--color-bg); font: var(--type-label-meta); line-height: 1; }
.shot__mark { position: absolute; left: var(--x); top: var(--y); translate: 4px -50%; outline: 1.5px solid var(--color-bg); }
.shot-notes { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text-muted); }
.shot-notes li { display: flex; align-items: flex-start; gap: var(--space-2); }
.shot-notes__num { flex: none; margin-top: 1px; letter-spacing: 0; } /* level with the first line when it wraps */

/* AI Ways of Working's drawn pictures, in the hero's style: plain windows with three dots,
   mono text in the label/meta style, ticks and dotted links, all in the page's own colours.
   Real text, so it stays readable at any size; on phones each frame drops its shape and
   takes the height it needs, and wide layouts stack (container queries). */
.art { container-type: inline-size; display: grid; place-items: center; aspect-ratio: var(--ratio); padding: var(--space-8); font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text-muted); text-align: left; }
:where(.art) :where(p, ul, ol) { margin: 0; padding: 0; list-style: none; } /* weak, so the parts below can set their own padding */
.art .ink { color: var(--color-text); }
.win { overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-m); background: var(--color-bg); }
.win__bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); }
.win__dots { flex: none; width: 36px; height: 8px; background: radial-gradient(circle at 4px 4px, var(--color-border) 4px, transparent 4.5px) 0 0 / 14px 8px repeat-x; }
.win__name { color: var(--color-text); }
.win__app { margin-left: auto; }
.win__body { display: grid; padding: var(--space-3) var(--space-4); }
/* A tick drawn in the text colour, centred on the line */
.art .ok::before { content: ""; display: inline-block; width: 9px; height: 4.5px; margin: 0 var(--space-2) 0 1px; border-left: 1.5px solid var(--color-text); border-bottom: 1.5px solid var(--color-text); rotate: -45deg; translate: 0 -4px; }
.art__caret { display: inline-block; width: 7px; height: 14px; margin-left: 2px; background: var(--color-text); vertical-align: -2px; }

/* Setup: one terminal */
.setup .win { width: min(420px, 100%); }
.setup .win__body p { white-space: pre; }
.secret { filter: blur(3px); }

/* Key decision: Option A and Option B, marked like the diff above */
.decide__inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); width: 100%; }
.decide__side { display: grid; gap: var(--space-3); align-content: start; }
.decide__side--del .decide__art text { fill: var(--color-text-muted); } /* the option not taken, in the muted grey: quieter, but every label still 5:1 or more */
.decide__mark--add { color: var(--color-text); }
.decide__art { display: block; width: 100%; height: auto; border: 1px solid var(--color-border); border-radius: var(--radius-m); background: var(--color-bg); }
.decide__art text { font-family: var(--mono); font-size: 15px; fill: var(--color-text); }
.decide__art text.small { font-size: 13px; }
.decide__art text.m { fill: var(--color-text-muted); }
.decide__art text.on-ink { fill: var(--color-bg); }
.decide__tribe { fill: var(--color-bg); stroke: var(--color-border); }
.decide__loop { fill: var(--color-text); }
.decide__loop-off { fill: none; stroke: var(--color-text-muted); stroke-dasharray: 4 3; }
.decide__trail { fill: none; stroke: var(--color-text-muted); stroke-dasharray: 3 4; }
.decide__ring { fill: none; stroke: var(--color-border); }
.decide__ring--outer { stroke-dasharray: 4 4; }
.decide__spoke { fill: none; stroke: var(--color-text-muted); }
@container (max-width: 640px) { .decide__inner { grid-template-columns: minmax(0, 1fr); max-width: 420px; justify-self: center; } }

/* Outcome: who does what, joined like the hero's windows */
.roles__inner { display: grid; justify-items: center; gap: var(--space-6); width: min(1040px, 100%); }
.roles__row { display: grid; grid-template-columns: minmax(0, 1fr) var(--space-14) minmax(0, 1fr) var(--space-14) minmax(0, 1fr); align-items: center; width: 100%; }
.roles__verb { margin-bottom: var(--space-2); font: var(--type-heading-pull); letter-spacing: var(--type-heading-pull-tracking); color: var(--color-text); }
.roles__who { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--color-border); }
.roles__link { position: relative; display: grid; justify-items: center; }
.roles__link::before { content: ""; position: absolute; top: 50%; left: var(--space-1); right: var(--space-1); border-top: 1px dashed var(--color-text-muted); }
.roles__link span { translate: 0 -16px; }
.roles__sum { color: var(--color-text); }
@container (max-width: 760px) {
  .roles__row { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto var(--space-12) auto var(--space-12) auto; max-width: 360px; }
  .roles__link::before { top: var(--space-1); bottom: var(--space-1); left: 50%; right: auto; border-top: 0; border-left: 1px dashed var(--color-text-muted); }
  .roles__link { justify-items: start; padding-left: calc(50% + var(--space-3)); }
  .roles__link span { translate: none; }
}
@media (max-width: 767px) { .art { aspect-ratio: auto; padding: var(--space-6) var(--space-4); } }

/* Hero: Figma to GitLab (AI Ways of Working). An SVG in the page's own colours, so it serves
   both themes; on phones it pans from window to window as it plays (see Mobile). At rest it's the
   finished picture. Once in view (project.js adds .is-on, then drops .is-paused) the selection
   draws round the button, the links fill in and the code types out under covers in the
   window's colour, then the merge request is reviewed and merged. The art's text sizes are
   its own (it scales as a picture), like the speech bubble's. */
.flow { --pace: .75; display: block; width: 100%; height: auto; aspect-ratio: 1200 / 560; } /* --pace scales the whole run: about 6s */
.flow text { font-family: var(--mono); font-size: 12px; fill: var(--color-text); }
.flow text.small { font-size: 11px; }
.flow text.s { font-family: var(--sans); font-size: 14px; }
.flow text.title { font-size: 16px; }
.flow .m, .flow tspan.m { fill: var(--color-text-muted); }
.flow__win { fill: var(--color-bg); stroke: var(--color-border); }
.flow__rule { stroke: var(--color-border); }
.flow__dot { fill: var(--color-border); }
.flow__btn { fill: var(--color-text); }
.flow text.flow__btn-text { fill: var(--color-bg); }
.flow__sel { fill: none; stroke: var(--color-text); stroke-width: 1.5; stroke-dasharray: 5 4; }
.flow__handle { fill: var(--color-bg); stroke: var(--color-text); }
.flow__link { stroke: var(--color-text-muted); stroke-dasharray: 3 4; }
.flow__end { fill: var(--color-text-muted); }
.flow__tick { fill: none; stroke: var(--color-text); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.flow__tick--inverse { stroke: var(--color-bg); }
.flow__pill-line { fill: none; stroke: var(--color-border); }
.flow__review { opacity: 0; }
.flow__cover { fill: var(--color-bg); transform-box: fill-box; transform-origin: right; scale: 0 1; }
.flow__cover--grey { fill: var(--color-bg-subtle); }
.flow.is-on .flow__cover { animation: flow-uncover calc(var(--t) * var(--pace)) steps(var(--n)) calc((var(--d) + var(--lag, 0s)) * var(--pace)) both; }
.flow.is-on .flow__fade { animation: flow-in var(--duration-m) var(--ease) calc((var(--d) + var(--lag, 0s)) * var(--pace)) both; }
.flow.is-on .flow__review { animation: flow-out var(--duration-s) var(--ease) calc((var(--d) + var(--lag, 0s)) * var(--pace)) both; }
.flow.is-on .flow__draw { animation: flow-draw calc(.7s * var(--pace)) var(--ease) calc(var(--d) * var(--pace)) both; }
.flow.is-paused, .flow.is-paused * { animation-play-state: paused !important; }
:root[data-motion="paused"] .flow, :root[data-motion="paused"] .flow * { animation: none !important; }
@keyframes flow-uncover { from { scale: 1 1; } to { scale: 0 1; } }
@keyframes flow-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes flow-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes flow-pan { /* phones: Figma → Kiro → GitLab, timed in the run's own seconds (8.2s) */
  0%, 19.5% { translate: 35% 0; animation-timing-function: var(--ease); }
  29.3%, 89% { translate: 0 0; animation-timing-function: var(--ease); }
  100% { translate: -35% 0; }
}
@keyframes flow-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Hero motion: each hero plays once as it comes into view (project.js adds .is-playing for one
   run), then rests on the picture underneath. The layer is the art's own shape, centred, so it
   lines up with the trimmed phone crop too. Positions are in the art's 1200 × 560 units. */
@property --split { syntax: '<percentage>'; inherits: true; initial-value: 41.667%; }
.hero-motion { position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: 1200 / 560; translate: -50% 0; visibility: hidden; pointer-events: none; }
.hero-motion.is-playing { visibility: visible; animation: hero-run var(--run) linear; }
.frame .hero-motion img { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes hero-run { to { opacity: 1; } } /* only times the run; project.js waits for its end */

/* Debug: the divider slides left (all in debug mode), right (all normal), then home. Its layers
   have no tags, and it's held over the picture from the start (.is-held), so the Normal and
   Debug mode tags only fade in once it's done (.is-leaving) */
.hero-split { --run: 6s; }
.hero-split:is(.is-held, .is-playing, .is-leaving) { visibility: visible; }
.hero-split.is-held:not(.is-playing) { animation: hero-fade .4s var(--ease) both; } /* a replay fades the tags out first */
.hero-split.is-leaving { animation: hero-fade .9s var(--ease) reverse both; }
@keyframes hero-fade { from { opacity: 0; } to { opacity: 1; } }
.hero-split__debug { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split)); }
.hero-split__line { position: absolute; inset-block: 0; left: var(--split); width: calc(100% / 600); translate: -50% 0; background: #0d97ec; }
.hero-split.is-playing { animation: hero-run var(--run) linear, hero-split var(--run) linear; }
@keyframes hero-split {
  0% { --split: 41.667%; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  26%, 32% { --split: 8%; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  64%, 70% { --split: 92%; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  100% { --split: 41.667%; }
}

/* Plusnet: each phone's page scrolls and comes straight back, under its status bar, inside the
   screen's own rounded shape (Figma "Paste design here 1"): the middle one down to the latest
   update, the left one up to it, the right one down to the time and Continue, a beat apart */
.hero-scroll { --run: 6.4s; }
.hero-scroll__screen { position: absolute; left: calc(100% * var(--x) / 1200); top: calc(100% * 80 / 560); width: calc(100% * 271 / 1200); height: calc(100% * 480 / 560); overflow: visible; }
.hero-scroll__screen--middle { --to: -326px; }
.hero-scroll__screen--left { --to: 233px; }
.hero-scroll__screen--right { --to: -227px; }
.hero-scroll.is-playing .hero-scroll__page { animation: hero-scroll 6s both; }
.hero-scroll.is-playing .hero-scroll__screen--left .hero-scroll__page { animation-delay: .2s; }
.hero-scroll.is-playing .hero-scroll__screen--right .hero-scroll__page { animation-delay: .4s; }
@keyframes hero-scroll {
  0%, 8% { translate: 0 0; animation-timing-function: cubic-bezier(.45, 0, .25, 1); }
  42%, 52% { translate: 0 var(--to); animation-timing-function: cubic-bezier(.45, 0, .25, 1); }
  90%, 100% { translate: 0 0; }
}

/* Multi-brand: "Loop Design" fades as EE and Plusnet step out from behind BT, which stays
   just as it is in the lockup; then a dashed selection is dragged out from the top left round
   all three (Figma "Brands (BT · EE · Plusnet)", without its fill), each brand colouring in
   behind its edge as it passes; the box lets go, and it all folds back into the lockup.
   The box is in pieces that slide rather than stretch, so the dashes keep their size: its
   right side and corners move across (.mb-x), its bottom side and corners move down (.mb-y),
   and the top and left sides are uncovered as they go (the two clip paths) */
.hero-brands { --run: 5s; --mb-bg: var(--color-bg-subtle); --mb-ink: #3768c7; --mb-on: #fff; --mb-out: cubic-bezier(.3, 1.45, .6, 1); --mb-in: cubic-bezier(.55, 0, .45, 1); --mb-flick: cubic-bezier(.15, .7, .3, 1); --mb-settle: cubic-bezier(.4, 0, .4, 1); }
[data-theme="dark"] .hero-brands { --mb-ink: #fff; --mb-on: var(--color-bg-subtle); }
.hero-brands__art { position: absolute; left: calc(100% * 450 / 1200); top: calc(100% * 21 / 560); width: calc(100% * 300 / 1200); aspect-ratio: 300 / 124; overflow: visible; }
.hero-brands__cover { fill: var(--mb-bg); }
.hero-brands__cover--word { opacity: 0; }
.hero-brands__box, .hero-brands__tint { opacity: 0; } /* the tint: each brand in its colour, showing only inside the box, so the colour sweeps across behind it */
.hero-brands__tint use { fill: #fff; }
.hero-brands__tint .hero-brands__tint-bt { fill: #5514b4; } /* BT keeps its ring: only its colour changes. Inside the box the
   picture’s BT is covered first, and EE and Plusnet’s discs are a hair bigger (r 37, not 36), so no edge shows round them */
.hero-brands__pick-line { fill: none; stroke: #3768c7; stroke-width: 2.33; stroke-dasharray: 3.087 5.4171; }
.hero-brands .mb-fill { fill: var(--mb-ink); }
.hero-brands .mb-mark { fill: var(--mb-on); }
.hero-brands__logo--ee, .hero-brands__logo--plusnet { transform: translate(-76px, 0) scale(.6667); opacity: 0; }
.hero-brands.is-playing :is(.hero-brands__cover--word, .hero-brands__box, .hero-brands__tint, .mb-x, .mb-y, .hero-brands__logo) { animation-duration: var(--run); animation-fill-mode: both; }
.hero-brands.is-playing .hero-brands__cover--word { animation-name: mb-word; }
.hero-brands.is-playing :is(.hero-brands__box, .hero-brands__tint) { animation-name: mb-box; }
.hero-brands.is-playing .mb-x { animation-name: mb-x; }
.hero-brands.is-playing .mb-y { animation-name: mb-y; }
.hero-brands.is-playing .mb-x.mb-y { animation-name: mb-x, mb-y; } /* across on translate, down on transform, so they add up */
.hero-brands.is-playing .hero-brands__logo--ee { animation-name: mb-ee; }
.hero-brands.is-playing .hero-brands__logo--plusnet { animation-name: mb-plusnet; }
@keyframes mb-word { 0% { opacity: 0; } 8%, 86% { opacity: 1; } 96%, 100% { opacity: 0; } }
/* They spring out, a beat apart, and tuck back in */
@keyframes mb-ee {
  0%, 6% { transform: translate(-76px, 0) scale(.6667); opacity: 0; animation-timing-function: var(--mb-out); }
  10% { opacity: 1; animation-timing-function: var(--mb-out); }
  20%, 78% { transform: translate(-1.33px, 0) scale(.6667); opacity: 1; animation-timing-function: var(--mb-in); }
  88% { opacity: 1; }
  90%, 100% { transform: translate(-76px, 0) scale(.6667); opacity: 0; }
}
@keyframes mb-plusnet {
  0%, 9% { transform: translate(-76px, 0) scale(.6667); opacity: 0; animation-timing-function: var(--mb-out); }
  13% { opacity: 1; animation-timing-function: var(--mb-out); }
  25%, 76% { transform: translate(73.33px, 0) scale(.6667); opacity: 1; animation-timing-function: var(--mb-in); }
  87% { opacity: 1; }
  89%, 100% { transform: translate(-76px, 0) scale(.6667); opacity: 0; }
}
/* The drag, like a hand: a quick flick that runs a little past and settles back, the down
   movement a touch ahead of the across, so the corner travels on a slight curve */
@keyframes mb-box { 0%, 27% { opacity: 0; } 28%, 68% { opacity: 1; } 74%, 100% { opacity: 0; } }
@keyframes mb-x {
  0%, 28% { translate: 0 0; animation-timing-function: var(--mb-flick); }
  45% { translate: 248.12px 0; animation-timing-function: var(--mb-settle); }
  54%, 100% { translate: 240.89px 0; }
}
@keyframes mb-y {
  0%, 28% { transform: translate(0, 0); animation-timing-function: var(--mb-flick); }
  41% { transform: translate(0, 57.47px); animation-timing-function: var(--mb-settle); }
  51%, 100% { transform: translate(0, 54.22px); }
}

/* Chapters: a small label, a serif title and the story beside it, then the pictures */
.chapter { display: grid; gap: var(--space-24); padding: var(--space-44) var(--edge); border-top: 1px solid var(--color-border); }
.chapter-head {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: var(--space-20); row-gap: var(--space-6);
  align-items: start;
}
.chapter-head__title { display: grid; gap: var(--space-6); }
.chapter-title { max-width: 520px; font: var(--type-display-s); letter-spacing: var(--type-display-s-tracking); text-wrap: balance; }
.chapter-body { display: grid; gap: var(--space-5); max-width: 560px; padding-top: 44px; font: var(--type-body-m); color: var(--color-text-muted); text-wrap: pretty; }
.chapter-body a { color: var(--color-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* A link in the copy keeps its underline, and highlights like every other link: an ink fill
   sweeps across from the left and the words turn to the page colour, line by line */
.chapter-body a {
  background: linear-gradient(var(--color-text), var(--color-text)) left / 0 100% no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size var(--duration-m) var(--ease), color var(--duration-s) var(--ease);
}
.chapter-body a:focus-visible { background-size: 100% 100%; color: var(--color-bg); }
@media (hover: hover) { .chapter-body a:hover { background-size: 100% 100%; color: var(--color-bg); } }
@media (prefers-reduced-motion: reduce) { .chapter-body a { transition: none; } }
/* Context: the story on the left, the picture beside it */
.chapter-head--fig { align-items: center; }
.chapter-head--fig .chapter-body { padding-top: var(--space-2); }
/* The brief: the question, big and centred, like the homepage statement */
.chapter--brief .chapter-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.chapter--brief .chapter-head__title { justify-items: center; }
.chapter--brief .chapter-title { max-width: 900px; font: var(--type-display-m); letter-spacing: var(--type-display-m-tracking); }
.chapter--brief .chapter-body { max-width: 480px; padding-top: var(--space-2); }

/* Columns, kept apart by space */
.cols { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: var(--space-16) var(--space-20); }
.cols--3 { --cols: 3; }
.col { display: grid; gap: var(--space-3); align-content: start; }
.col h3:not(.label) { font: var(--type-heading-pull); letter-spacing: var(--type-heading-pull-tracking); }
.col p { font: var(--type-body-m); color: var(--color-text-muted); }
.col > .label { margin-bottom: var(--space-2); }
/* Lists: each line led by a muted arrow */
.ticks { display: grid; gap: var(--space-3); }
.ticks li { display: flex; gap: var(--space-3); font: var(--type-body-m); }
.ticks li::before { content: "→"; color: var(--color-text-muted); }
/* svsd.school's numbers: a serif figure in an outlined oval */
.step-num {
  justify-self: start; display: inline-grid; place-items: center;
  min-width: 64px; height: 40px; padding: 0 18px; margin-bottom: var(--space-5);
  border: 1px solid var(--color-text); border-radius: var(--radius-full);
  font: var(--type-heading-pull); letter-spacing: var(--type-heading-pull-tracking);
}

/* Key decision as a diff, like the homepage hero's "- users + people": a mono "- Option A"
   or "+ Option B · chosen" line (Type/label/meta) over each title. The option left out is
   muted and struck through on a card in the page colour; the one picked is an ink card with
   inverse text, so both flip with the theme. */
.cols:has(> .option) { gap: var(--space-8); } /* the cards sit as close as the side-by-side pictures (.fig-row) */
.option { gap: var(--space-4); padding: var(--space-10); border-radius: var(--radius-l); }
.option--del { background: var(--color-bg); color: var(--color-text-muted); }
.option--del .diff__mark, .option--del .diff__text, .option--del p { color: var(--color-text-muted); } /* muted, not faded */
.option--add { background: var(--color-text); color: var(--color-bg); }
.option--add :is(p, .diff__text, .diff__mark) { color: var(--color-bg); }
.diff { display: block; }
.diff__mark { display: block; margin-bottom: var(--space-3); font: var(--type-label-meta); letter-spacing: var(--type-label-meta-tracking); color: var(--color-text-muted); }
.option--del .diff__text {
  /* The strike draws across once it's typed (project.js); simply struck without motion */
  background: linear-gradient(currentColor, currentColor) left 0 top 55% / var(--strike, 100%) 1px no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; /* struck line by line, only under the words */
  transition: background-size var(--duration-l) var(--ease);
}

/* Figures: a small muted caption under each picture (Type/body/xs); a label can
   sit above a group, like Before and After */
.fig { display: grid; gap: var(--space-4); align-content: start; }
.fig figcaption { max-width: 520px; font: var(--type-body-s); color: var(--color-text-muted); }
.figs { display: grid; gap: var(--space-20); }
.fig-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
.fig-group { display: grid; gap: var(--space-5); }

/* Testimonial: the quote big in the serif, centred, the name in the receipts' caption style */
.case-quote { display: grid; justify-items: center; gap: var(--space-10); padding: var(--space-44) var(--edge); text-align: center; }
.case-quote blockquote { max-width: 920px; font: var(--type-display-s); letter-spacing: var(--type-display-s-tracking); text-wrap: balance; }
.case-quote figure { display: grid; justify-items: center; gap: var(--space-10); }
.case-quote figcaption { font: var(--type-body-m); color: var(--color-text-muted); } /* the role, as on the homepage */
.case-quote .who { font-weight: 500; }

/* The page's drawing signs off the contact section, under the buttons */
.case-art { display: flex; justify-content: center; width: 100%; margin-top: var(--space-24); }
.case-art:has(.panic) { margin-top: var(--space-16); } /* Plusnet: his burst of lines already makes room above */

/* Key decision and the quote sit on the media grey (--color-bg-subtle), full width, with the
   page's own text colours */
.tinted { background: var(--color-bg-subtle); border-top: 0; }
.tinted + .chapter { border-top: 0; }
/* The receipts-style hairline over each column of a list */
.cols:not(.cols--3) > .col:not(.option) { padding-top: var(--space-6); border-top: 1px solid var(--color-border); }

.case-cta { display: flex; flex-direction: column; align-items: center; gap: var(--space-5); padding: var(--space-35) var(--edge) var(--space-30); text-align: center; } /* the homepage Contact's padding: 140 above, 120 below */
.chapter + .case-cta { border-top: 1px solid var(--color-border); } /* no grey quote section above it: a hairline across the page, as between chapters */
.case-cta__title { max-width: 760px; font: var(--type-display-l); letter-spacing: var(--type-display-l-tracking); text-wrap: balance; } /* Type/display/l */
.case-cta__sub { color: var(--color-text-muted); }
.case-cta .contact-buttons { margin-top: var(--space-3); }

/* ---------- On scroll (project.js), in the 404's terminal voice ----------
   Section labels type in with a caret, the Key decision diff types its two lines and then
   strikes the option left out, the results count up, and the pictures fade up. Each holds
   its room from the start, so nothing moves. Reduce motion or paused: all simply there. */
.diff__mark.is-typing .key:not(.is-typed) { visibility: hidden; }
.diff__mark .caret::after { top: -11px; height: 13px; }
.js-reveal .chapter .frame { opacity: 0; translate: 0 24px; transition: opacity var(--duration-xl) var(--ease), translate var(--duration-xl) var(--ease); }
.js-reveal .chapter .frame.is-in { opacity: 1; translate: 0; }

/* ---------- Closing drawings (moved from the old project pages, in the muted grey) ---------- */
/* Plusnet: the headless man from the old testimonial card, half as tall again as the queue (238).
   He hops on the spot twice, arms flapping from the elbows, the "!" jolting with each hop (and
   once more in the breather) and the burst of lines flashing over his head. */
.panic { width: 106.2px; max-width: 100%; height: auto; aspect-ratio: 290.2 / 650.5; overflow: visible; }
.panic__line { fill: var(--color-text-muted); }
.panic__shade { fill: var(--color-illustration-shade); }
.panic g { transform-box: view-box; }
.panic__hop { transform-origin: 200px 659px; }
.panic__arm--1 { transform-origin: 100px 292px; } /* elbows */
.panic__arm--2 { transform-origin: 305px 272px; }
.panic__bang { transform-origin: 100px 228px; } /* under the dot */
.panic__burst { transform-origin: 200px 250px; } /* his head */
@media (prefers-reduced-motion: no-preference) {
  .panic__hop { animation: panic-hop 4s ease-in-out infinite; }
  .panic__arm--1 { animation: panic-flap 4s ease-in-out infinite; }
  .panic__arm--2 { animation: panic-flap 4s ease-in-out -.12s infinite reverse; }
  .panic__bang { animation: panic-bang 4s ease-out infinite; }
  .panic__burst { animation: panic-burst 4s ease-in-out infinite; }
  .panic__tick { animation: panic-tick 4s ease-in-out infinite; }
  .panic:not(.is-playing) * { animation-play-state: paused; }
}
:root[data-motion="paused"] .panic * { animation: none !important; }
/* Up, tap, up, tap, and down again */
@keyframes panic-hop { 0%, 50%, 100% { translate: 0 0; scale: 1 1; } 6% { translate: 0 0; scale: 1.02 .97; } 14% { translate: 0 -18px; scale: .99 1.02; } 24% { translate: 0 0; scale: 1.02 .97; } 34% { translate: 0 -14px; scale: .99 1.02; } 44% { translate: 0 0; scale: 1 1; } }
@keyframes panic-flap { 0%, 50%, 100% { rotate: 0deg; } 14% { rotate: -6deg; } 24% { rotate: 4deg; } 34% { rotate: -5deg; } 44% { rotate: 2deg; } }
/* A sharp kick up with each hop, a judder as it lands, and one more on its own */
@keyframes panic-bang {
  0%, 10%, 22%, 30%, 42%, 70%, 82%, 100% { translate: 0 0; scale: 1; rotate: 0deg; }
  13% { translate: 0 -14px; scale: 1.18; rotate: -12deg; }
  16% { translate: 0 0; scale: 1; rotate: 7deg; }
  19% { rotate: -4deg; }
  33% { translate: 0 -12px; scale: 1.14; rotate: -10deg; }
  36% { translate: 0 0; scale: 1; rotate: 6deg; }
  39% { rotate: -3deg; }
  73% { translate: 0 -8px; scale: 1.1; rotate: 9deg; }
  76% { translate: 0 0; scale: 1; rotate: -5deg; }
  79% { rotate: 2deg; }
}
@keyframes panic-burst { 0%, 50%, 100% { opacity: 1; scale: 1; } 8%, 28% { opacity: .3; scale: .94; } 16%, 36% { opacity: 1; scale: 1.05; } }
@keyframes panic-tick { 0%, 50%, 100% { translate: 0 0; } 14%, 34% { translate: -3px -4px; } 24%, 44% { translate: 0 0; } }

/* The closing drawings are kept small, about the 404 spectators' size (160 wide; the queue's row 500, and the crowd's row as tall as it) */
.queue-wrap { width: min(500px, 100%); }
.queue { display: block; width: 100%; height: auto; overflow: visible; }
.queue__line { fill: var(--color-text-muted); }
.queue__shade { fill: var(--color-illustration-shade); }
.queue :is(.queue__person, .queue__eyes, .queue__brows) { transform-box: view-box; }
@media (prefers-reduced-motion: no-preference) {
  .queue__person { --idle-loop: var(--idle) ease-in-out var(--delay, 0s) infinite; animation: var(--idle-loop); }
  .queue__eyes { animation: queue-blink var(--blink) ease-in-out var(--delay, 0s) infinite; }
  .queue__brows { animation: queue-brows var(--brows) ease-in-out var(--delay, 0s) infinite; }
  .queue__person:nth-of-type(1) { --idle: person-breathe 3.3s; --delay: -1.4s; --blink: 5.1s; --brows: 6.2s; }
  .queue__person:nth-of-type(2) { --idle: person-lean 6.4s; --delay: -2.6s; --blink: 3.9s; --brows: 8.3s; }
  .queue__person:nth-of-type(3) { --idle: person-sway 5.4s; --delay: -.8s; }
  .queue__person:nth-of-type(4) { --idle: person-bob 2.8s; --delay: -1.9s; --blink: 4.7s; --brows: 5.6s; }
  .queue__person:nth-of-type(5) { --idle: person-breathe 3.9s; --delay: -3.1s; --blink: 5.6s; --brows: 7.9s; }
  .queue__person:nth-of-type(6) { --idle: person-sway 6s; --delay: -2.2s; --blink: 4.4s; --brows: 6.8s; }
  @media (hover: hover) { .queue__person:hover { animation: var(--idle-loop), person-jump .6s ease-out; } }
}
:root[data-motion="paused"] .queue * { animation: none !important; }
@keyframes queue-blink { 0%, 92%, 100% { scale: 1 1; } 95% { scale: 1 .1; } }
@keyframes queue-brows { 0%, 50%, 78%, 100% { translate: 0 0; } 56%, 70% { translate: 0 -2.5px; } }

.crowd { width: 509px; max-width: 100%; height: auto; aspect-ratio: 1225 / 382; overflow: visible; }
.crowd__line { fill: var(--color-text-muted); }
.crowd__shade { fill: var(--color-illustration-shade); }
.crowd__lids { opacity: 0; }
.crowd__lids ellipse { fill: var(--color-bg); }
.crowd__lids path { fill: none; stroke: var(--color-text-muted); stroke-width: 4; stroke-linecap: round; }
.crowd__person { transform-box: view-box; transform-origin: var(--feet); --blink: 4.4s; --blink-lag: 0s; }
.crowd__brows { transform-box: view-box; }
/* Moves like the queue: each its own idle, blink and brows (only torch and yoyo have brows),
   and a jump on hover. The rocket is a prop, so it has no idle and stays put. */
.crowd__person--torch { --idle: person-sway 4.6s; --delay: -.6s; --blink: 4.1s; --blink-lag: -1.2s; --brows: 7.4s; }
.crowd__person--yoyo { --idle: person-breathe 3.3s; --delay: -1.4s; --blink: 4.6s; --blink-lag: -4s; --brows: 6.2s; }
.crowd__person--box { --idle: person-lean 6.4s; --delay: -2.6s; --blink: 5.3s; --blink-lag: -3.4s; }
.crowd__person--argyle { --idle: person-sway 5.4s; --delay: -.8s; --blink: 5s; --blink-lag: -.9s; }
.crowd__person--handstand { --idle: person-breathe 3.9s; --delay: -3.1s; --blink: 4.9s; --blink-lag: -2.6s; }
.crowd__person--flute { --idle: person-bob 2.8s; --delay: -1.9s; --blink: 6.1s; --blink-lag: -4.7s; }
.crowd__person--sweep { --idle: person-sway 6s; --delay: -2.2s; --blink: 4.3s; --blink-lag: -3s; }
@media (prefers-reduced-motion: no-preference) {
  .crowd__person:not(.crowd__person--rocket) { --idle-loop: var(--idle) ease-in-out var(--delay, 0s) infinite; animation: var(--idle-loop); }
  .crowd__brows { animation: crowd-brows var(--brows) ease-in-out var(--delay, 0s) infinite; }
  .crowd__lids { animation: crowd-blink var(--blink) step-end var(--blink-lag) infinite; }
  @media (hover: hover) { .crowd__person:not(.crowd__person--rocket):hover { animation: var(--idle-loop), person-jump .6s ease-out; } }
  .crowd:not(.is-playing) * { animation-play-state: paused; }
}
:root[data-motion="paused"] .crowd * { animation: none !important; }
/* The queue's lift, in the crowd's units (it's drawn at a smaller scale) */
@keyframes crowd-brows { 0%, 50%, 78%, 100% { translate: 0 0; } 56%, 70% { translate: 0 -3.5px; } }
@keyframes crowd-blink { 0% { opacity: 0; } 94% { opacity: 1; } 97% { opacity: 0; } }

/* AI Ways of Working: the golfers from the old 404 page (and once under "The receipts"), back
   as they were: a swing and a miss, a friend and a caddie looking on. About as tall as the queue. */
.golf { display: block; width: min(280px, 70vw); height: auto; overflow: visible; }
.golf__line { fill: var(--color-text-muted); }
.golf__fill { fill: var(--color-bg); }
.golf__shade { fill: var(--color-illustration-shade); }
.golf__lid { fill: none; stroke: var(--color-text-muted); stroke-width: 3; stroke-linecap: round; opacity: 0; } /* over the friend's eyes while shut */
.golf :is(.golf__golfer, .golf__whoosh, .golf__marks, .golf__ball, .golf__man, .golf__caddie, .golf__blink, .golf__glance) { transform-box: view-box; }
.golf__golfer { transform-origin: 400px 829px; } /* the planted foot */
.golf__ball { transform-origin: 669px 826px; } /* the foot of the tee */
.golf__caddie { transform-origin: 725px 795px; }
.golf__blink { transform-origin: 104px 516px; }
/* The golfer sways on the planted foot after the miss, the ball wobbles on its tee, the
   friend and the caddie jolt as it whooshes past, and the friend blinks now and then */
@media (prefers-reduced-motion: no-preference) {
  .golf__golfer { animation: golf-sway 5s cubic-bezier(.37, 0, .63, 1) -1.25s infinite; }
  .golf__whoosh { animation: golf-whoosh 5s cubic-bezier(.37, 0, .63, 1) -1.25s infinite; }
  .golf__marks { animation: golf-flick 6s ease-in-out -.6s infinite; }
  .golf__ball { animation: golf-wobble 6s ease-in-out -.6s infinite; }
  .golf__man { animation: golf-jolt 5s ease-out -1.25s infinite; }
  .golf__caddie { animation: golf-lean 10s ease-in-out -3s infinite, golf-jolt 5s ease-out -1.05s infinite; }
  .golf__glance { animation: golf-glance 8s ease-in-out -2s infinite; }
  .golf__blink { animation: golf-blink 4.6s ease-in-out -1s infinite; }
  .golf__lid { animation: golf-lid 4.6s ease-in-out -1s infinite; }
  .golf:not(.is-playing) * { animation-play-state: paused; }
}
:root[data-motion="paused"] .golf * { animation: none !important; }
@keyframes golf-sway { 0%, 100% { rotate: -1.5deg; } 50% { rotate: 1.5deg; } }
@keyframes golf-whoosh { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes golf-lean { 0%, 15%, 85%, 100% { rotate: 0deg; } 35%, 65% { rotate: -1.2deg; } }
@keyframes golf-jolt { 0%, 44%, 60%, 100% { translate: 0 0; } 47% { translate: 0 -5px; } 52% { translate: 0 0; } 55% { translate: 0 -1.5px; } }
@keyframes golf-lid { 0%, 89%, 95%, 100% { opacity: 0; } 90%, 94% { opacity: 1; } }
@keyframes golf-flick { 0%, 18%, 60%, 100% { opacity: 1; } 36% { opacity: .2; } }
@keyframes golf-wobble { 0%, 28%, 70%, 100% { rotate: 0deg; } 34% { rotate: 4deg; } 42% { rotate: -3deg; } 50% { rotate: 2deg; } 58% { rotate: -1deg; } }
@keyframes golf-glance { 0%, 10%, 55%, 100% { translate: 0 0; } 18%, 45% { translate: 2px .5px; } }
@keyframes golf-blink { 0%, 88%, 96%, 100% { scale: 1 1; } 92% { scale: 1 .1; } }

/* M: two facts columns fewer, the head stacks */
@media (max-width: 1023px) {
  .case-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chapter-head { grid-template-columns: 1fr; }
  .cols--3 { --cols: 1; }
  .cols--3 { gap: var(--space-14); }
  .chapter-body { padding-top: 0; }
}

/* Mobile (XS + S, under 768px) */
@media (max-width: 767px) {
  main { overflow-x: clip; } /* the queue runs off both edges */
  /* Text runs the full width (home.css turns off the even-line wrapping) */
  .case-title, .case-intro, .case-stat__label, .chapter-title, .chapter-body,
  .chapter--brief .chapter-title, .chapter--brief .chapter-body,
  .fig figcaption, .case-quote blockquote, .case-cta__title { max-width: none; }
  .case-hero { padding-block: var(--space-30); }
  .case-hero .frame { margin-top: var(--space-12); }
  .frame { border-radius: var(--radius-m); }
  .frame .image-wide { display: none; }
  .frame .image-phone { display: block; }
  [data-theme="dark"] .frame .image-phone.on-light, :root:not([data-theme="dark"]) .frame .image-phone.on-dark { display: none; }
  /* Wide art with no phone version (Plusnet's hero): the middle of it, trimmed at the sides */
  .frame--crop { aspect-ratio: 680 / 560; }
  .frame--placeholder { aspect-ratio: 600 / 698; padding: var(--space-6); } /* the phone art's shape, with room for its words */
  .frame--crop img { height: 100%; object-fit: cover; }
  /* AI's hero: Kiro whole in the middle with room either side (viewBox 340–860 × 40–520);
     the mcp and push links run off the edges towards Figma and GitLab, which sit just out of frame */
  .frame--crop:has(> .flow) { aspect-ratio: 520 / 480; }
  .frame--crop .flow { width: calc(100% * 1200 / 520); max-width: none; margin: calc(-100% * 40 / 520) 0 0 calc(-100% * 340 / 520); }
  /* Too narrow for all three windows, so the run pans: it opens on Figma, moves to Kiro once the
     button's selected and the mcp link's in, then to GitLab once the push link's in, and stays there.
     Each window's steps wait (--lag) for the pan before them. The windows' centres are 420 units
     apart, 35% of the drawing's width. At rest and with motion off it's Kiro, as above. */
  .flow__kiro, .flow__push { --lag: .8s; }
  .flow__gitlab { --lag: 1.8s; }
  .flow.is-on { animation: flow-pan calc(8.2s * var(--pace)) both; }
  .flow.is-done { translate: -35% 0; }
  /* Multi-brand's phone art is 680 × 560, with the lockup larger and lower */
  .hero-brands { aspect-ratio: 680 / 560; }
  .hero-brands__art { left: calc(100% * 152.5 / 680); top: calc(100% * 54 / 560); width: calc(100% * 375 / 680); }
  .case-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-stats { grid-template-columns: 1fr; gap: var(--space-10); margin-top: var(--space-14); }
  .chapter { gap: var(--space-16); padding: var(--space-30) var(--gutter); }
  .cols, .fig-row { grid-template-columns: 1fr; }
  .cols { gap: var(--space-12); }
  .option { padding: var(--space-8) var(--space-6); }
  .figs { gap: var(--space-14); }
  .case-quote { padding: var(--space-30) var(--gutter); }
  .case-cta { padding: var(--space-30) var(--gutter); } /* as the homepage Contact on phones */
}

@media (prefers-reduced-motion: reduce) {
  .case-hero__text, .case-hero .case-stats, .case-hero .frame, .js-reveal .chapter .frame { opacity: 1; translate: 0; }
}
:root[data-motion="paused"] .js-reveal .chapter .frame { opacity: 1; translate: 0; transition: none; }
