/* FEZEY V12 prototypes · case/case.css: the case-study template's own blocks (PLAN-SITE A4), on V3e's text system
   (home-v3e/css/base.css: zones, glass, the motion grammar) and the kit's site.css (chrome, flow panels, credits).
   1 type in the clusters  2 the result's figures  3 the work strip (the screen hand-off)  4 the record card
   5 the Closing  6 the carries  7 phones  8 reduced motion and no WebGL
   Motion: transform, opacity and clip-path only; the kit's --ease-out; never ease-in, scale(0) or transition: all. */

/* ============================================================ 1 · type in the clusters */
/* a beat's statement (the problem, what we noticed): reading size, the measure of a caption */
.cs .cs-say { font: 400 clamp(17px, 1.38vw, 21px)/1.42 var(--v3-body); color: var(--signal, #ece9f1); }
/* the measure (C2: a body's lines at most 52 characters, 34 on a phone): these sentences set about 1.5 characters a ch */
.cs .xp[data-story] .xp__body, .cs .xp[data-story] .cs-say { max-width: min(34ch, var(--z-title-w, 34ch)); }
/* what changed: one line of work per callout */
.cs .cs-do { font: 500 clamp(16.5px, 1.3vw, 20px)/1.34 var(--v3-body); color: var(--signal, #ece9f1); max-width: 34ch; }
.cs .cs-do + .cs-do { margin-top: -2px; }
html:not(.v3-reduced):not(.v3-nogl) .cs .cs-changes { display: contents; }
.cs .cs-changes { margin: 0; padding: 0; list-style: none; }
/* the short cuts' one beat (PD-15): what we noticed follows the problem in the same voice, a breath below it; the
   strategy follows the objective in the band */
.cs .cs-say--then { margin-top: 10px; }
.cs .cs-eb--then { margin-top: 12px; }

/* ============================================================ 2 · the result: lit figures in the world, their words here */
/* (the figures' own lines are for screen readers while the lit type stands in the sky: case.js adds .fz-sr) */
.cs .cs-figs { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.cs .cs-fig { font: 500 14px/1.35 var(--v3-body); color: var(--signal, #ece9f1); }
.cs .cs-fig__v { font: 800 clamp(28px, 2.6vw, 40px)/0.95 var(--v3-title); letter-spacing: -0.035em; margin-right: 6px; }
.cs .cs-fig__qq { font: 500 11px/1.4 var(--v3-mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(236, 233, 241, 0.86); }
.cs .cs-fig__d { max-width: 34ch; }
.cs .cs-fig__by { margin-top: 2px; }
.cs .cs-res__media { width: min(300px, 100%); border-radius: 8px; overflow: hidden; background: var(--graphite, #121017); box-shadow: 0 0 0 1px rgba(255, 220, 180, 0.16); margin: 4px 0 2px; }
.cs .cs-res__media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cs .cs-explore { justify-self: start; margin-top: 4px; }

/* ============================================================ 3 · the work strip: the hero's media takes over from its
   screen pixel for pixel (case.js sets the first media's transform from the projected screen), then the strip runs */
html[data-layout="land"] .xp[data-land="wall"], html[data-layout="port"] .xp[data-port="wall"] { inset: 0; padding: 0; z-index: 2; }
.cs-strip { position: absolute; inset: 0; overflow: hidden; }
.cs-strip__veil { position: absolute; inset: 0; background: #07060a; opacity: 0; pointer-events: none; }
.cs-strip__row { position: absolute; left: 0; top: 0; bottom: 0; margin: 0; padding: 0 0 0 0; list-style: none; display: flex; align-items: center; gap: clamp(28px, 4vw, 64px); will-change: transform; }
.cs-item { flex: none; margin: 0; }
.cs-item__fig { margin: 0; display: grid; gap: 12px; justify-items: start; }
.cs-item__media { position: relative; display: block; height: min(50vh, calc(70vw / var(--ar, 1.78))); width: auto; overflow: hidden; border-radius: 6px; background: #0b0a10; box-shadow: 0 0 0 1px rgba(236, 233, 241, 0.08), 0 18px 60px rgba(0, 0, 0, 0.45); opacity: var(--cs-in, 0); }
.cs-item__media img, .cs-item__media video { display: block; width: 100%; height: 100%; object-fit: contain; }
/* each caption arrives with its picture centred (body grammar: 8 px, 480 ms in; 280 ms out) */
.cs-item__cap { font: 500 10.5px/1.5 var(--v3-mono); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(236, 233, 241, 0.9); max-width: min(52ch, 100%); opacity: 0; transform: translate3d(0, 8px, 0); transition: opacity 280ms var(--v3-ease), transform 280ms var(--v3-ease); }
.cs-item.is-near .cs-item__cap { opacity: 1; transform: none; transition-duration: 480ms; transition-delay: 120ms; }

/* "The work" stands over the strip's own pictures, the Closing's words over the next case's lit screen: darker glass */
.cs .xp[data-story="work-h"] { --gl-fill: rgba(12, 9, 18, 0.84); --gl-tint: rgba(12, 9, 18, 0.86); }
.cs .xp[data-story="cta"] { --gl-fill: rgba(12, 9, 18, 0.6); --gl-tint: rgba(12, 9, 18, 0.66); }

/* ============================================================ 4 · the record card (a flow section, the reading glass) */
.cs .cs-facts { min-height: 0; padding-bottom: clamp(32px, 6vh, 56px); }
.cs .cs-card { width: min(100%, 900px); gap: 18px; }
.cs .cs-card__h { max-width: none; }
.cs .cs-dl { display: grid; margin: 0; border-top: 1px solid var(--v3-line-2); }
.cs .cs-dl__row { display: grid; grid-template-columns: minmax(120px, 0.26fr) 1fr; gap: 6px 24px; padding: 12px 0 13px; border-bottom: 1px solid var(--v3-line); align-items: baseline; }
.cs .cs-dl dt { font: 500 10.5px/1.5 var(--v3-mono); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(236, 233, 241, 0.78); }
.cs .cs-dl dd { margin: 0; font: 400 16px/1.5 var(--v3-body); color: var(--signal, #ece9f1); }
.cs .cs-dl dd a { color: var(--signal, #ece9f1); text-decoration: underline; text-decoration-color: var(--v3-line-2); text-underline-offset: 3px; transition: color 180ms var(--v3-ease), text-decoration-color 180ms var(--v3-ease); }
@media (hover: hover) and (pointer: fine) { .cs .cs-dl dd a:hover { color: var(--filament, #c9b6ea); text-decoration-color: currentColor; } }
.cs .cs-dl dd b { font-weight: 700; }
.cs .cs-sep { color: rgba(236, 233, 241, 0.5); }
/* the way on from the record: the related reading (where there is one), then every case study */
.cs .cs-card__rel { margin: 0; font: 400 16px/1.5 var(--v3-body); color: var(--signal, #ece9f1); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.cs .cs-card__rel span { font: 500 10.5px/1.5 var(--v3-mono); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(236, 233, 241, 0.78); }
.cs .cs-card__rel a { color: var(--signal, #ece9f1); text-decoration: underline; text-decoration-color: var(--v3-line-2); text-underline-offset: 3px; transition: color 180ms var(--v3-ease), text-decoration-color 180ms var(--v3-ease); }
@media (hover: hover) and (pointer: fine) { .cs .cs-card__rel a:hover { color: var(--filament, #c9b6ea); text-decoration-color: currentColor; } }
.cs .cs-card__all { margin: 2px 0 0; }
.cs .cs-card__all a { padding: 10px 0; display: inline-block; }

/* ============================================================ 5 · the Closing: the case's last line, the next case */
.cs .xp[data-story="cta"] .cs-cta__h { max-width: 14ch; font-size: clamp(24px, 2.5vw, 40px); line-height: 1; }
.cs .cs-cta__by { margin-top: -2px; }
.cs .cs-nocase { text-transform: none; }
.cs .cs-similar { padding: 10px 0; }
/* the next case's name can be long (Burj Al Arab Auto Care): the button wraps inside the frame, never past it */
.cs .xp[data-story="cta"] .xp__mag { max-width: 100%; }
.cs .cs-next { white-space: normal; max-width: 100%; text-align: center; line-height: 1.25; padding-block: 12px; }

/* ============================================================ 6 · the carries (kit/v3e/transition.js): the next case's
   tile rides its device in the Closing (case.js places it on the device's screen, invisible until it is carried);
   the hero's landing place shows only while a carry lands on it */
.cs-next-carry { position: fixed; left: 0; top: 0; width: 1px; height: 1px; object-fit: contain; opacity: 0; pointer-events: none; z-index: 1; }
.cs-next-carry.fz-carrying { opacity: 1; }
.cs-land { position: fixed; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 420ms var(--ease-out); left: 51vw; top: 25vh; width: 38vw; }
.cs-land img { display: block; width: 100%; height: auto; border-radius: 4px; }
html[data-carry="tile"] .cs-land { opacity: 1; transition: none; }

/* ============================================================ 7 · phones (the zones' own numbers come from explain/zones.js) */
@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .cs .cs-say, .cs .xp__body { font-size: 16.5px; }
  .cs .cs-do { font-size: 16px; }
  .cs .xp[data-story] .xp__body, .cs .xp[data-story] .cs-say, .cs .xp[data-story] .cs-do { max-width: 21ch; }
  /* the short cuts' one beat sits over its lit object on a phone: a darker glass under its words */
  .cs .cs-diag, .cs .xp[data-story="problem"], .cs .xp[data-story="noticed"], .cs .xp[data-story="objective"] { --gl-fill: rgba(12, 9, 18, 0.62); --gl-tint: rgba(12, 9, 18, 0.68); }
  .cs .xp[data-story="noticed"] { --gl-fill: rgba(12, 9, 18, 0.72); --gl-tint: rgba(12, 9, 18, 0.76); }
  /* a change's counter crosses its own lit screen on a phone (SATisfactory's creatives): the callouts' glass a little darker */
  .cs .xp[data-story^="ch-"] { --gl-fill: rgba(12, 9, 18, 0.5); --gl-tint: rgba(12, 9, 18, 0.56); }
  .cs .cs-res__media { width: min(180px, 100%); }
  /* a phone's strip is a column moving up through the frame (V3e's wall on a phone): nothing runs past a side */
  html[data-layout="port"] .cs-strip__row { left: 0; right: 0; bottom: auto; flex-direction: column; align-items: center; gap: 30px; padding: 0 var(--g-m, 20px); }
  html[data-layout="port"] .cs-item__fig { justify-items: center; }
  .cs-item__media { height: min(50svh, calc((100vw - 2 * var(--g-m, 20px)) / var(--ar, 1.78))); }
  .cs-item__cap { max-width: calc(100vw - 2 * var(--g-m, 20px)); text-align: center; }
  .cs .cs-dl__row { grid-template-columns: 1fr; gap: 4px; }
  .cs .xp[data-story="cta"] .cs-cta__h { font-size: clamp(22px, 6.4vw, 30px); max-width: 14ch; }
  .cs-land { left: 8vw; top: 52svh; width: 84vw; }
}

/* ============================================================ 8 · reduced motion and no WebGL: every word, one still
   per section, the strip a static grid of posters */
.v3-reduced .cs-strip, .v3-nogl .cs-strip { position: relative; inset: auto; overflow: visible; }
.v3-reduced .cs-strip__veil, .v3-nogl .cs-strip__veil, .v3-reduced .cs-next-carry, .v3-nogl .cs-next-carry, .v3-reduced .cs-land, .v3-nogl .cs-land { display: none; }
.v3-reduced .cs-strip__row, .v3-nogl .cs-strip__row { position: relative; inset: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); align-items: start; gap: 22px; transform: none !important; max-width: 1100px; }
.v3-reduced .cs-item__media, .v3-nogl .cs-item__media { height: auto; width: 100%; aspect-ratio: var(--ar, 1.78); opacity: 1; transform: none !important; }
.v3-reduced .cs-item__cap, .v3-nogl .cs-item__cap { opacity: 1; transform: none; transition: none; }
.v3-reduced .e-sec--work .xp--block, .v3-nogl .e-sec--work .xp--block { max-width: 1120px !important; width: 100% !important; }
@media (prefers-reduced-motion: reduce) {
  .cs-item__cap, .cs-land { transition: none !important; }
}
