/* =====================================================================================
   Selected work on /case-studies: the case grid with its filter, and the case map (pinned scene on
   wide screens, stacked cases with their own maps everywhere else). Behaviour: js/pages/case-scene.js.
   Markup is stamped from js/pages/case-data.js by tools/render-cases.mjs.
   ===================================================================================== */

/* ---------------------------------------------------------------- shared bits */
.cs-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--sage-3); color: var(--sage-3);
  font-family: var(--mono); font-size: .64rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; flex: none; }
.section--ink .cs-tag, .section--deep .cs-tag, .cs-card__map + .cs-tag { border-color: rgba(163, 193, 173, .55); color: var(--sage); }

/* ---------------------------------------------------------------- intro, filter, grid */
.cs-intro .sec-head__body > .lead { max-width: 46em; }
.cs-note { display: flex; align-items: center; gap: 12px; margin-top: clamp(16px, 2vw, 22px); max-width: 46em; color: var(--fg-3); font-size: .92rem; line-height: 1.5; }
.cs-note::before { content: ""; width: .95em; height: .55em; background: var(--sage-3); transform: skewX(var(--slash)); flex: none; }

.cs-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; margin-top: clamp(44px, 5.4vw, 80px); }
.cs-filter { position: relative; display: inline-flex; gap: 2px; padding: 5px; border-radius: 999px; background: var(--white); border: 1px solid var(--line);
  max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cs-filter::-webkit-scrollbar { display: none; }
.cs-filter__btn { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: none;
  font: inherit; font-size: .94rem; font-weight: 500; color: var(--fg-2); cursor: pointer; white-space: nowrap; transition: color .4s var(--ease), background-color .3s; }
.cs-filter__btn:hover:not(:disabled) { color: var(--fg); }
.cs-filter__btn[aria-pressed="true"] { color: var(--white); }
.cs-filter:not(.has-ink) .cs-filter__btn[aria-pressed="true"] { background: var(--ink); }
.cs-filter__btn:disabled { opacity: .4; cursor: default; }
.cs-filter__btn:focus-visible { outline: 2px solid var(--sage-3); outline-offset: 1px; }
.cs-filter__n { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; opacity: .55; }
.cs-filter__ink { position: absolute; z-index: 0; left: 0; top: 0; width: var(--iw, 0); height: var(--ih, 42px); border-radius: 999px; background: var(--ink);
  transform: translate(var(--ix, 5px), var(--iy, 5px)); transition: transform .6s var(--ease), width .6s var(--ease); pointer-events: none; }
.cs-count { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }

.cs-grid { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 1.1vw, 16px); margin-top: 22px; }
.cs-item { min-width: 0; }
.cs-item[hidden] { display: none; }
.cs-card { position: relative; display: flex; flex-direction: column; height: 100%; padding: 14px 14px 18px; border-radius: var(--r); background: var(--white); border: 1px solid var(--line);
  color: var(--fg); text-decoration: none; transition: transform .6s var(--ease), box-shadow .6s var(--ease), border-color .4s; }
.cs-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 0; }
.cs-card__num { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; color: var(--fg-3); }
.cs-card__map { position: relative; display: block; margin-top: 12px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 55%, #222240, var(--ink) 60%, var(--ink-2)); }
.cs-card__map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: transform 1.1s var(--ease); }
.cs-card__model { display: inline-flex; align-items: center; gap: .6em; margin: 16px 4px 0; font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-3); }
.cs-card__model::before { content: ""; width: .95em; height: .55em; background: currentColor; transform: skewX(var(--slash)); flex: none; }
.cs-card__title { display: block; margin: 8px 4px 0; font-size: 1.08rem; font-weight: 500; line-height: 1.28; letter-spacing: -.01em; text-wrap: pretty; }
.cs-card__place { display: block; margin: 8px 4px 0; font-size: .86rem; color: var(--fg-3); }
.cs-card__figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: auto 4px 0; padding-top: 18px; font-size: .78rem; line-height: 1.3; color: var(--fg-3); }
.cs-card__figs { align-items: start; min-height: calc(18px + 1.5rem + 4px + 2.6em); }
.cs-card__figs b { display: block; margin-bottom: 4px; font-size: 1.5rem; font-weight: 500; letter-spacing: -.02em; line-height: 1; color: var(--fg); }
.cs-card__go { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 4px 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: .88rem; font-weight: 500; color: var(--fg); }
.cs-card__go .icon { width: 16px; height: 16px; color: var(--sage-3); transition: transform .5s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .cs-card:hover { transform: translateY(-5px); border-color: var(--sage-2); box-shadow: 0 26px 50px -30px rgba(26, 26, 46, .38); }
  .cs-card:hover .cs-card__map canvas { transform: scale(1.07); }
  .cs-card:hover .cs-card__go .icon { transform: translateX(4px); }
}
.cs-card:focus-visible { outline: 2px solid var(--sage-3); outline-offset: 3px; }
@media (max-width: 1240px) { .cs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .cs-bar { flex-direction: column; align-items: stretch; }
  .cs-filter { border-radius: 26px; }
  .cs-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cs-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 14px; padding: 12px; }
  .cs-card__top { grid-column: 1 / -1; padding: 0; }
  .cs-card__map { grid-row: 2 / span 3; margin-top: 12px; aspect-ratio: 1; align-self: start; }
  .cs-card__model { margin: 12px 0 0; }
  .cs-card__title { margin: 6px 0 0; font-size: 1rem; }
  .cs-card__place { margin: 6px 0 0; font-size: .82rem; }
  .cs-card__figs { display: none; }
  .cs-card__go { grid-column: 1 / -1; margin: 12px 0 0; }
}

/* ---------------------------------------------------------------- case card (both modes) */
.cm { --cm-pad: clamp(20px, 2vw, 30px); }
.cm-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cm-card__num { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.cm-card__model { display: flex; align-items: center; gap: .7em; margin-top: 16px; font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.cm-card__model::before { content: ""; width: .95em; height: .55em; background: currentColor; transform: skewX(var(--slash)); flex: none; }
.cm-card__title { margin-top: 10px; font-size: clamp(1.4rem, 1.75vw, 1.8rem); font-weight: 500; line-height: 1.14; letter-spacing: -.018em; text-wrap: balance; }
.cm-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cm-meta dt, .cm-figs dt, .cm-sub, .cm-notes dt { font-family: var(--mono); font-size: .62rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.cm-meta dd { margin-top: 3px; font-size: .9rem; line-height: 1.35; color: var(--fg-2); }
.cm-figs { display: grid; grid-template-columns: repeat(var(--nf, 3), minmax(0, 1fr)); gap: 16px; margin-top: 14px; padding: 14px 0; border-block: 1px solid var(--line); }
.cm-figs > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; }
.cm-figs dd { font-size: clamp(2rem, 2.6vw, 2.6rem); font-weight: 500; line-height: .95; letter-spacing: -.025em; color: var(--fg); white-space: nowrap; }
.cm-figs dt { line-height: 1.45; }
.cm-figs[style*="--nf:1"] { grid-template-columns: minmax(0, 1fr); }
.cm-figs[style*="--nf:1"] > div { flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 16px; }
.cm-figs .fig-pre, .cm-figs .fig-suf { color: var(--sage); }
.cm-roles .cm-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.cm-roles .cm-tags li { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 11px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03);
  font-size: .84rem; line-height: 1.3; color: var(--fg-2); }
.cm--live .cm-tags li { transition: opacity .6s var(--ease), transform .7s var(--ease); transition-delay: calc(.3s + var(--k, 0) * 70ms); }
.cm--live .cm-card:not(.is-on) .cm-tags li { opacity: 0; transform: translate3d(0, 6px, 0); }
.cm--live .cm-tags li:nth-child(2) { --k: 1; } .cm--live .cm-tags li:nth-child(3) { --k: 2; } .cm--live .cm-tags li:nth-child(4) { --k: 3; } .cm--live .cm-tags li:nth-child(5) { --k: 4; }
.cm-roles { margin-top: 14px; }
.cm-roles ul { list-style: none; display: grid; gap: 6px; margin-top: 9px; }
.cm-roles li { --u: min(6px, calc(132px / var(--max))); display: grid; grid-template-columns: minmax(0, 1fr) 136px 2em; align-items: center; gap: 12px; font-size: .86rem; line-height: 1.3; color: var(--fg-2); }
.cm-roles__bar { position: relative; height: 11px; }
.cm-roles__bar::before, .cm-roles__bar i { position: absolute; left: 0; top: 0; bottom: 0;
  background: repeating-linear-gradient(133.2deg, var(--c) 0 calc(var(--u) * .4), transparent calc(var(--u) * .4) calc(var(--u) * .7294)); }
.cm-roles__bar::before { content: ""; --c: rgba(255, 255, 255, .09); width: calc(var(--max) * var(--u)); }
.cm-roles__bar i { --c: var(--sage); width: calc(var(--n) * var(--u)); }
.cm-roles__n { font-family: var(--mono); font-size: .8rem; text-align: right; color: var(--fg); }
.cm-notes { display: grid; gap: 6px; margin-top: 14px; }
.cm-notes > div { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); gap: 12px; align-items: baseline; }
.cm-notes dd { font-size: .86rem; line-height: 1.4; color: var(--fg-2); }
.cm-share { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cm-share__img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.cm-share__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.cm-share__links a { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 500; color: var(--fg); text-decoration: none; transition: color .3s; }
.cm-share__links a span { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; color: var(--fg-3); }
.cm-share__links .icon { width: 14px; height: 14px; color: var(--sage); }
.cm-share__links a:hover { color: var(--sage); }
.cm-share__links a:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; border-radius: 3px; }

.cm-story { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 36px); }
.cm-story__block { position: relative; padding-top: 14px; border-top: 1px solid var(--line-2); }
.cm-story__block::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--sage); transform-origin: 0 50%; }
.cm-story h4 { font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.cm-story p { margin-top: 8px; font-size: .96rem; line-height: 1.5; color: var(--fg-2); }
.cm-story__quote { grid-column: 1 / -1; position: relative; padding-left: 22px; }
.cm-story__quote::before { content: ""; position: absolute; left: 0; top: .35em; width: .95em; height: .55em; background: var(--sage); transform: skewX(var(--slash)); }
.cm-story__quote blockquote p { font-size: clamp(1rem, 1.1vw, 1.12rem); line-height: 1.45; color: var(--fg); text-wrap: pretty; max-width: 60em; }
.cm-story__quote figcaption { margin-top: 8px; font-family: var(--mono); font-size: .64rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.cm--live .cm-story__quote { transition: opacity .8s var(--ease) .5s, transform .9s var(--ease) .5s; }
.cm--live .cm-case:not(.is-on) .cm-story__quote, .cm.is-pinned .cm-story:not(.is-on) .cm-story__quote { opacity: 0; transform: translate3d(0, 10px, 0); }
.cm.is-pinned .cm-story.is-on .cm-story__quote { opacity: 1; transform: none; }

/* reveal on activation (JS on; a card counts as active once it is on screen or in the pinned step) */
.cm--live .cm-roles__bar i { transition: width 1s var(--ease); transition-delay: calc(.35s + var(--k, 0) * 90ms); }
.cm--live .cm-roles li:nth-child(2) { --k: 1; } .cm--live .cm-roles li:nth-child(3) { --k: 2; } .cm--live .cm-roles li:nth-child(4) { --k: 3; } .cm--live .cm-roles li:nth-child(5) { --k: 4; }
.cm--live .cm-card:not(.is-on) .cm-roles__bar i { width: 0; }
.cm--live .cm-story__block::before { transform: scaleX(0); transition: transform 1.1s var(--ease); transition-delay: calc(.25s + var(--k, 0) * 120ms); }
.cm--live .cm-story__block:nth-child(2) { --k: 1; } .cm--live .cm-story__block:nth-child(3) { --k: 2; }
.cm--live .cm-case.is-on .cm-story__block::before, .cm--live .cm-story.is-on .cm-story__block::before { transform: scaleX(1); }

/* ---------------------------------------------------------------- stacked (phones, tablets, short screens, reduced motion, no JS) */
.cm:not(.is-pinned) .cm__canvas, .cm:not(.is-pinned) .cm__shade, .cm:not(.is-pinned) .cm__zone, .cm:not(.is-pinned) .cm__cardbg,
.cm:not(.is-pinned) .cm-intro, .cm:not(.is-pinned) .cm__nav, .cm:not(.is-pinned) .cm__coords { display: none; }
.cm:not(.is-pinned) .cm__stage { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.cm:not(.is-pinned) .cm__head { margin-bottom: clamp(22px, 3vw, 36px); }
.cm:not(.is-pinned) .cm__list { display: grid; gap: clamp(14px, 2vw, 24px); }
.cm-case[data-off] { display: none !important; }
.cm:not(.is-pinned) .cm-case { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding: clamp(14px, 2.4vw, 28px); border-radius: var(--r-lg);
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)); scroll-margin-top: calc(var(--header-h) + 16px); }
.cm-case__map { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: radial-gradient(120% 90% at 50% 55%, #222240, var(--ink-3) 70%); border: 1px solid var(--line); }
.cm-case__map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cm-case__place { position: absolute; left: 12px; top: 12px; padding: 5px 9px; border-radius: 6px; background: rgba(15, 15, 32, .78); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: .64rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-2); }
@media (min-width: 760px) {
  .cm:not(.is-pinned) .cm-case { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-areas: "map card" "story story"; column-gap: clamp(22px, 3vw, 44px); }
  .cm:not(.is-pinned) .cm-case__map { grid-area: map; align-self: start; aspect-ratio: 4 / 3.4; }
  .cm:not(.is-pinned) .cm-card { grid-area: card; }
  .cm:not(.is-pinned) .cm-story { grid-area: story; }
}
@media (max-width: 759px) {
  .cm-story { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cm-roles li { grid-template-columns: minmax(0, 1fr) 2em; row-gap: 5px; }
  .cm-roles__bar { grid-column: 1 / -1; grid-row: 2; }
  .cm-figs { gap: 10px; }
  .cm-figs dd { font-size: 2rem; }
  .cm-share { grid-template-columns: 104px minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- pinned scene (wide screens) */
html.js .cm.is-pinned > .pin__stage.cm__stage {
  --cw: clamp(360px, 33vw, 500px);
  --sx: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  display: grid; justify-content: stretch; align-content: stretch;
  grid-template-columns: minmax(0, 1fr) var(--cw);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "head card" "zone card" "story card";
  column-gap: clamp(28px, 3.4vw, 64px);
  padding: calc(var(--header-h) + 6px) var(--sx) clamp(24px, 4.2vh, 44px);
  border-radius: var(--r-lg);
  background: radial-gradient(80% 70% at 36% 46%, #20203c, var(--ink) 62%, var(--ink-2));
}
.cm.is-pinned .cm__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.cm.is-pinned .cm__shade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(0deg, rgba(21, 21, 42, .94) 0, rgba(21, 21, 42, .7) 18%, rgba(21, 21, 42, 0) 36%),
    linear-gradient(180deg, rgba(21, 21, 42, .7) 0, rgba(21, 21, 42, 0) 20%),
    linear-gradient(90deg, rgba(21, 21, 42, 0) 55%, rgba(21, 21, 42, .55) 80%); }
/* a case with a quote has a taller story: deepen the shade behind it */
.cm.is-pinned .cm__shade::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease);
  background: linear-gradient(0deg, rgba(21, 21, 42, .9) 0, rgba(21, 21, 42, .72) 30%, rgba(21, 21, 42, 0) 50%); }
.cm.is-pinned:has(.cm-story.has-quote.is-on) .cm__shade::after { opacity: 1; }
.cm.is-pinned .cm__head .label { white-space: nowrap; }
.cm.is-pinned .cm__head { grid-area: head; z-index: 2; display: flex; align-items: center; gap: clamp(20px, 2.6vw, 40px); min-height: 44px; }
.cm.is-pinned .cm__zone { grid-area: zone; min-height: 0; }
.cm.is-pinned .cm__cardbg { grid-area: 1 / 2 / 4 / 3; z-index: 1; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 34, 64, .78), rgba(21, 21, 42, .86)); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6); }
.cm.is-pinned .cm__list, .cm.is-pinned .cm-case { display: contents; }
.cm.is-pinned .cm-case__map { display: none; }
.cm.is-pinned .cm-card, .cm.is-pinned .cm-intro { grid-area: 1 / 2 / 4 / 3; z-index: 2; align-self: start; padding: var(--cm-pad); min-width: 0; }
.cm.is-pinned .cm-story { grid-area: story; z-index: 2; align-self: end; }

/* swapping: the card frame stays, its contents and the story trade places */
.cm.is-pinned .cm-card, .cm.is-pinned .cm-intro, .cm.is-pinned .cm-story { transition: opacity .3s var(--ease), visibility 0s linear 0s; }
.cm.is-pinned .cm-card:not(.is-on), .cm.is-pinned .cm-intro:not(.is-on), .cm.is-pinned .cm-story:not(.is-on) { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s var(--ease), visibility 0s linear .25s; }
.cm.is-pinned .cm-card > *, .cm.is-pinned .cm-intro > *, .cm.is-pinned .cm-story__block > * { transition: opacity .7s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--k, 0) * 55ms + 60ms); }
.cm.is-pinned :is(.cm-card, .cm-intro):not(.is-on) > *, .cm.is-pinned .cm-story:not(.is-on) .cm-story__block > * { opacity: 0; transform: translate3d(0, 16px, 0); transition-duration: .2s; transition-delay: 0s; }
.cm.is-pinned .cm-card > :nth-child(2) { --k: 1; } .cm.is-pinned .cm-card > :nth-child(3) { --k: 2; } .cm.is-pinned .cm-card > :nth-child(4) { --k: 3; }
.cm.is-pinned .cm-card > :nth-child(5) { --k: 4; } .cm.is-pinned .cm-card > :nth-child(6) { --k: 5; } .cm.is-pinned .cm-card > :nth-child(7) { --k: 6; } .cm.is-pinned .cm-card > :nth-child(8) { --k: 7; }
.cm.is-pinned .cm-intro > :nth-child(2) { --k: 1; } .cm.is-pinned .cm-intro > :nth-child(3) { --k: 2; }
.cm.is-pinned .cm-story__block > * { transition-delay: calc(var(--k, 0) * 110ms + 220ms); }

/* title: a slash wipe as each case arrives */
.cm.is-pinned .cm-card__title { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.cm.is-pinned .cm-card:not(.is-on) .cm-card__title { clip-path: polygon(0 0, 0 0, -40% 100%, -40% 100%); }
.cm.is-pinned .cm-card.is-on .cm-card__title { transition: opacity .7s var(--ease) .12s, transform .9s var(--ease) .12s, clip-path 1s var(--ease) .12s; }

/* head: label, ticks, coordinates */
.cm__nav { display: flex; align-items: center; gap: 16px; }
.cm__count { font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .1em; color: var(--fg); white-space: nowrap; }
.cm__of { color: var(--fg-3); }
.cm__ticks { list-style: none; display: flex; align-items: center; }
.cm__ticks li { display: flex; align-items: center; }
.cm__ticks li[hidden] { display: none; }
.cm__ticks li + li::before { content: ""; width: clamp(10px, 1.4vw, 22px); height: 1px; background: var(--line-2); margin: 0 4px; }
.cm__tick { position: relative; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--fg-3); cursor: pointer; }
.cm__tick-mark { display: block; width: 16px; height: 9px; border: 1px solid currentColor; transform: skewX(var(--slash)); transition: width .5s var(--ease), background-color .4s, border-color .4s; }
.cm__tick.is-past { color: rgba(163, 193, 173, .7); }
.cm__tick.is-past .cm__tick-mark { background: rgba(163, 193, 173, .4); border-color: transparent; }
.cm__tick.is-on { color: var(--sage); }
.cm__tick.is-on .cm__tick-mark { width: 28px; background: var(--sage); border-color: var(--sage); }
.cm__tick-label { position: absolute; top: 100%; left: 50%; margin-top: 2px; padding: 3px 7px; border-radius: 4px; background: rgba(15, 15, 32, .86); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .6rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-2); white-space: nowrap;
  opacity: 0; transform: translate(-50%, -4px); transition: opacity .3s, transform .4s var(--ease); pointer-events: none; }
.cm__tick:hover .cm__tick-label, .cm__tick:focus-visible .cm__tick-label { opacity: 1; transform: translate(-50%, 0); }
.cm__tick:hover { color: var(--fg); }
.cm__tick:focus-visible { outline: 2px solid var(--sage); outline-offset: 0; }
.cm__coords { margin-left: auto; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; color: var(--fg-3); white-space: nowrap; }

/* intro card (before the first case) */
.cm-intro__title { margin-top: 12px; font-size: clamp(1.4rem, 1.75vw, 1.8rem); font-weight: 500; line-height: 1.16; letter-spacing: -.018em; text-wrap: balance; }
.cm-legend { list-style: none; display: grid; gap: 10px; margin-top: 22px; font-size: .9rem; color: var(--fg-2); }
.cm-legend li { display: flex; align-items: center; gap: 14px; }
.cm-legend li > span { position: relative; width: 22px; height: 16px; flex: none; }
.cm-legend__hq::before, .cm-legend__case::before { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--on-dark); }
.cm-legend__hq::after, .cm-legend__case::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; border: 1px solid rgba(238, 240, 242, .55); }
.cm-legend__case::before { background: var(--sage); }
.cm-legend__case::after { width: 18px; height: 18px; margin: -9px; border-color: var(--sage); }
.cm-legend__arc::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 22px; border: 1.4px solid var(--sage); border-color: var(--sage) transparent transparent transparent; border-radius: 50%; }

.cm-intro__list { list-style: none; margin-top: 20px; border-top: 1px solid var(--line); }
.cm-intro__list li { border-bottom: 1px solid var(--line); }
.cm-intro__list li[hidden] { display: none; }
.cm-intro__case { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; width: 100%; padding: 11px 2px; border: 0; background: none;
  font: inherit; text-align: left; color: var(--fg); cursor: pointer; transition: color .3s, padding .5s var(--ease); }
.cm-intro__num { font-family: var(--mono); font-size: .72rem; color: var(--fg-3); }
.cm-intro__name { font-size: .98rem; font-weight: 500; }
.cm-intro__model { font-family: var(--mono); font-size: .62rem; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); text-align: right; }
.cm-intro__case .icon { width: 15px; height: 15px; color: var(--sage); opacity: .5; transition: transform .5s var(--ease), opacity .3s; }
.cm-intro__case:hover, .cm-intro__case:focus-visible { color: var(--sage); padding-left: 8px; }
.cm-intro__case:hover .icon, .cm-intro__case:focus-visible .icon { opacity: 1; transform: translateX(3px); }
.cm-intro__case:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 4px; }
.cm.is-pinned .cm-intro > :nth-child(4) { --k: 3; }

@media (max-width: 1199px) {
  .cm.is-pinned .cm__coords { display: none; }
  .cm.is-pinned .cm-story p { font-size: .88rem; }
  .cm.is-pinned .cm-roles li { grid-template-columns: minmax(0, 1fr) 100px 2em; --u: min(5px, calc(96px / var(--max))); }
}

/* short screens: tighter card */
@media (max-height: 860px) {
  .cm.is-pinned .cm-meta { gap: 8px 18px; margin-top: 12px; padding-top: 12px; }
  .cm.is-pinned .cm-meta dd { font-size: .84rem; }
  .cm.is-pinned .cm-figs { margin-top: 12px; padding: 12px 0; }
  .cm.is-pinned .cm-figs dd { font-size: 2rem; }
  .cm.is-pinned .cm-roles { margin-top: 12px; }
  .cm.is-pinned .cm-roles ul { gap: 4px; }
  .cm.is-pinned .cm-notes { display: none; }
  .cm.is-pinned .cm-share { margin-top: 12px; padding-top: 12px; grid-template-columns: 96px minmax(0, 1fr); }
  .cm.is-pinned .cm-story p { font-size: .9rem; }
  .cm.is-pinned .cm-card__title { font-size: 1.4rem; }
}
@media (max-height: 740px) {
  .cm { --cm-pad: 18px; }
  .cm.is-pinned .cm-meta > div:nth-child(2) { display: none; }
  .cm.is-pinned .cm-share__img { display: none; }
  .cm.is-pinned .cm-share { grid-template-columns: minmax(0, 1fr); }
  .cm.is-pinned .cm-card__model { margin-top: 10px; }
}

/* the section rail steps aside while the case map is on screen */
.cm-in-view .gs-rail { opacity: 0 !important; visibility: hidden !important; transition: opacity .3s, visibility 0s linear .3s; }
