/* ================================================================
   THE HABIT CREW: character select. Works on both sites through their
   shared tokens (--noir, --bone, --sand, --crimson, --flare, --surface,
   --dim, --hairline, --f-display, --f-body, --f-mono).
   ================================================================ */
.crew {
  --crew-accent: var(--crimson);
  --crew-px: 4;
  --crew-dir: 1;
  --crew-tile: #1b191d;
  --crew-chop: steps(7, end);
  position: relative;
  padding-block: var(--sec-pad);
  overflow-x: clip;
}
html[dir="rtl"] .crew { --crew-dir: -1; }
.crew-head { max-width: 760px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.crew-note { margin-top: clamp(1.6rem, 3vw, 2.4rem); color: var(--sand); text-align: center; }

.crew-arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: stretch;
}

/* ---------------- the stage ---------------- */
.crew-stagecol { display: flex; flex-direction: column; min-width: 0; }
.crew-stage {
  position: relative;
  flex: 1;
  min-height: 500px;
  container-type: inline-size;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.crew-ground {
  position: absolute; left: 50%; bottom: calc(60px - 5px * var(--crew-px));
  width: calc(96px * var(--crew-px)); height: calc(20px * var(--crew-px));
  transform: translateX(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 10' shape-rendering='crispEdges'%3E%3Cpath fill='%237A1020' fill-opacity='.28' d='M14 1h20v1h-20zM8 2h32v1h-32zM4 3h40v1h-40zM3 4h42v1h-42zM3 5h42v1h-42zM4 6h40v1h-40zM8 7h32v1h-32zM14 8h20v1h-20z'/%3E%3Cpath fill='%23D11A2A' fill-opacity='.2' d='M15 1h1v1h-1zM17 1h1v1h-1zM19 1h1v1h-1zM21 1h1v1h-1zM23 1h1v1h-1zM25 1h1v1h-1zM27 1h1v1h-1zM29 1h1v1h-1zM31 1h1v1h-1zM33 1h1v1h-1zM8 2h1v1h-1zM10 2h1v1h-1zM12 2h1v1h-1zM14 2h1v1h-1zM16 2h1v1h-1zM18 2h1v1h-1zM20 2h1v1h-1zM22 2h1v1h-1zM24 2h1v1h-1zM26 2h1v1h-1zM28 2h1v1h-1zM30 2h1v1h-1zM32 2h1v1h-1zM34 2h1v1h-1zM36 2h1v1h-1zM38 2h1v1h-1zM5 3h1v1h-1zM7 3h1v1h-1zM9 3h1v1h-1zM11 3h1v1h-1zM13 3h1v1h-1zM15 3h1v1h-1zM17 3h1v1h-1zM19 3h1v1h-1zM21 3h1v1h-1zM23 3h1v1h-1zM25 3h1v1h-1zM27 3h1v1h-1zM29 3h1v1h-1zM31 3h1v1h-1zM33 3h1v1h-1zM35 3h1v1h-1zM37 3h1v1h-1zM39 3h1v1h-1zM41 3h1v1h-1zM43 3h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM8 4h1v1h-1zM10 4h1v1h-1zM12 4h1v1h-1zM14 4h1v1h-1zM16 4h1v1h-1zM18 4h1v1h-1zM20 4h1v1h-1zM22 4h1v1h-1zM24 4h1v1h-1zM26 4h1v1h-1zM28 4h1v1h-1zM30 4h1v1h-1zM32 4h1v1h-1zM34 4h1v1h-1zM36 4h1v1h-1zM38 4h1v1h-1zM40 4h1v1h-1zM42 4h1v1h-1zM44 4h1v1h-1zM3 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM9 5h1v1h-1zM11 5h1v1h-1zM13 5h1v1h-1zM15 5h1v1h-1zM17 5h1v1h-1zM19 5h1v1h-1zM21 5h1v1h-1zM23 5h1v1h-1zM25 5h1v1h-1zM27 5h1v1h-1zM29 5h1v1h-1zM31 5h1v1h-1zM33 5h1v1h-1zM35 5h1v1h-1zM37 5h1v1h-1zM39 5h1v1h-1zM41 5h1v1h-1zM43 5h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM8 6h1v1h-1zM10 6h1v1h-1zM12 6h1v1h-1zM14 6h1v1h-1zM16 6h1v1h-1zM18 6h1v1h-1zM20 6h1v1h-1zM22 6h1v1h-1zM24 6h1v1h-1zM26 6h1v1h-1zM28 6h1v1h-1zM30 6h1v1h-1zM32 6h1v1h-1zM34 6h1v1h-1zM36 6h1v1h-1zM38 6h1v1h-1zM40 6h1v1h-1zM42 6h1v1h-1zM9 7h1v1h-1zM11 7h1v1h-1zM13 7h1v1h-1zM15 7h1v1h-1zM17 7h1v1h-1zM19 7h1v1h-1zM21 7h1v1h-1zM23 7h1v1h-1zM25 7h1v1h-1zM27 7h1v1h-1zM29 7h1v1h-1zM31 7h1v1h-1zM33 7h1v1h-1zM35 7h1v1h-1zM37 7h1v1h-1zM39 7h1v1h-1zM14 8h1v1h-1zM16 8h1v1h-1zM18 8h1v1h-1zM20 8h1v1h-1zM22 8h1v1h-1zM24 8h1v1h-1zM26 8h1v1h-1zM28 8h1v1h-1zM30 8h1v1h-1zM32 8h1v1h-1z'/%3E%3Cpath fill='%23D11A2A' d='M14 0h20v1h-20zM8 1h6v1h-6zM34 1h6v1h-6zM4 2h4v1h-4zM40 2h4v1h-4zM2 3h2v1h-2zM44 3h2v1h-2zM1 4h2v1h-2zM45 4h2v1h-2zM1 5h2v1h-2zM45 5h2v1h-2zM2 6h2v1h-2zM44 6h2v1h-2zM4 7h4v1h-4zM40 7h4v1h-4zM8 8h6v1h-6zM34 8h6v1h-6zM14 9h20v1h-20z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
.crew-sprite {
  position: absolute; left: 50%; bottom: 60px;
  width: 0; height: 0;
  background: none; border: 0; padding: 0;
  transition: transform .56s var(--crew-chop), filter .56s var(--crew-chop), opacity .56s var(--crew-chop);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.crew-sprite canvas {
  position: absolute; left: 0; bottom: 0;
  display: block;
  transform: translate(-50%, calc((var(--h) - var(--foot)) * var(--crew-px) * 1px));
  width: calc(var(--w) * var(--crew-px) * 1px);
  height: calc(var(--h) * var(--crew-px) * 1px);
  image-rendering: pixelated;
  pointer-events: none;
}
/* the part you can actually touch: the body, not the transparent headroom */
.crew-hit {
  position: absolute; left: 0; bottom: 0;
  width: calc(var(--w) * var(--crew-px) * .8px);
  height: calc(var(--foot) * var(--crew-px) * .72px);
  transform: translateX(-50%);
  background: none; border: 0; padding: 0;
  cursor: pointer;
}
.crew-sprite[data-d="0"]  { transform: none; z-index: 5; }
.crew-sprite[data-d="1"]  { transform: translate(calc(var(--crew-dir) * 39cqw), -44px) scale(.46); filter: blur(2.5px) brightness(.62); z-index: 3; }
.crew-sprite[data-d="-1"] { transform: translate(calc(var(--crew-dir) * -39cqw), -44px) scale(.46); filter: blur(2.5px) brightness(.62); z-index: 3; }
.crew-sprite[data-d="2"]  { transform: translate(calc(var(--crew-dir) * 22cqw), -128px) scale(.3); filter: blur(4px) brightness(.42); z-index: 2; }
.crew-sprite[data-d="-2"] { transform: translate(calc(var(--crew-dir) * -22cqw), -128px) scale(.3); filter: blur(4px) brightness(.42); z-index: 2; }
.crew-sprite[data-d="1"]:hover, .crew-sprite[data-d="-1"]:hover,
.crew-sprite[data-d="2"]:hover, .crew-sprite[data-d="-2"]:hover { filter: blur(1px) brightness(.85); }

.crew-arrow {
  position: absolute; bottom: 150px; z-index: 8;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  color: var(--bone);
  background: var(--crew-tile);
  border: 0;
  box-shadow: 0 -3px 0 var(--noir), 0 3px 0 var(--noir), -3px 0 0 var(--noir), 3px 0 0 var(--noir),
              0 -6px 0 var(--hairline-strong, #4a4650), 0 6px 0 var(--hairline-strong, #4a4650), -6px 0 0 var(--hairline-strong, #4a4650), 6px 0 0 var(--hairline-strong, #4a4650);
  cursor: pointer;
  transition: transform .12s steps(2), background-color .12s steps(2), color .12s steps(2);
}
.crew-arrow svg { width: 24px; height: 24px; display: block; }
.crew-prev { inset-inline-start: 6px; }
.crew-next { inset-inline-end: 6px; }
html[dir="rtl"] .crew-arrow svg { transform: scaleX(-1); }
.crew-arrow:hover { background: var(--crimson); color: var(--bone); }
.crew-arrow:active { transform: translateY(3px); }

.crew-hint {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .55em;
  white-space: nowrap;
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim);
}
.crew-hint svg { width: 14px; height: 14px; color: var(--sand); animation: crew-tap 1.2s steps(2, jump-none) infinite; }
@keyframes crew-tap { from { transform: translateY(0); } to { transform: translateY(-3px); } }

/* roster */
.crew-roster { display: flex; justify-content: center; gap: 10px; margin-top: 14px; padding: 6px; flex-wrap: wrap; }
.crew-pick {
  position: relative;
  width: 56px; height: 56px; padding: 0;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--crew-tile);
  border: 0;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.1), inset -2px -2px 0 rgba(0,0,0,.55), 0 0 0 2px var(--noir);
  cursor: pointer;
  transition: box-shadow .12s steps(2), transform .12s steps(2);
}
.crew-pick img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; opacity: .55; filter: grayscale(.4); }
.crew-pick:hover img { opacity: .9; filter: none; }
.crew-pick[aria-current="true"] { box-shadow: inset 2px 2px 0 rgba(255,255,255,.14), inset -2px -2px 0 rgba(0,0,0,.55), 0 0 0 2px var(--noir), 0 0 0 4px var(--crimson); transform: translateY(-3px); }
.crew-pick[aria-current="true"] img { opacity: 1; filter: none; }

/* ---------------- the skill card ---------------- */
.crew-cards { display: grid; min-width: 0; }
.crew-card {
  grid-area: 1 / 1;
  position: relative;
  padding: clamp(1.1rem, 2.2vw, 1.6rem);
  --notch: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
  isolation: isolate;
}
.crew-card::before, .crew-card::after { content: ""; position: absolute; clip-path: var(--notch); z-index: -1; }
.crew-card::before { inset: 0; background: var(--crimson); }
.crew-card::after { inset: 2px; background: var(--surface); }
html.js .crew-card { visibility: hidden; opacity: 0; }
html.js .crew-card.is-on { visibility: visible; opacity: 1; }
html.js .crew-card.is-on .crew-pop { animation: crew-pop .34s steps(4) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes crew-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.crew-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: .7rem; }
.crew-count, .crew-tag, .crew-label {
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
}
.crew-count { color: var(--dim); }
.crew-tag { padding: .22em .6em; color: var(--bone); background: var(--crew-tile); box-shadow: 0 0 0 1px var(--hairline); text-transform: none; letter-spacing: .04em; }
.crew-name { font-family: var(--f-display); font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.02; color: var(--bone); margin: 0 0 .35rem; letter-spacing: .01em; }
.crew-cls { font-size: .86rem; color: var(--dim); margin: 0 0 .55rem; line-height: 1.35; }
.crew-habit { font-size: 1.05rem; line-height: 1.35; color: var(--bone); margin: 0; font-weight: 500; }

.crew-gear { display: flex; flex-wrap: wrap; gap: 5px; margin: .85rem 0 0; padding: 0; list-style: none; }
.crew-gear li { width: 30px; height: 30px; display: grid; place-items: center; color: var(--sand); background: var(--crew-tile); box-shadow: inset 1px 1px 0 rgba(255,255,255,.09), inset -1px -1px 0 rgba(0,0,0,.6); }
.crew-gear svg { width: 18px; height: 18px; display: block; }

.crew-block { margin-top: 1.05rem; padding-top: .9rem; border-top: 2px dashed var(--hairline); }
.crew-label { display: flex; align-items: center; gap: .5em; color: var(--dim); margin: 0 0 .65rem; }
.crew-label svg { width: 15px; height: 15px; color: var(--sand); flex: none; }

.crew-zones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; position: relative; }
.crew-zones li { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; font-size: .69rem; line-height: 1.2; color: var(--dim); position: relative; }
.crew-zones li:not(:last-child)::after { content: ""; position: absolute; top: 15px; inset-inline-start: calc(50% + 18px); width: calc(100% - 30px); border-top: 2px dotted var(--hairline); }
.crew-z { width: 34px; height: 34px; display: grid; place-items: center; color: var(--dim); background: var(--crew-tile); box-shadow: inset 1px 1px 0 rgba(255,255,255,.08), inset -1px -1px 0 rgba(0,0,0,.6); --crew-accent: var(--dim); }
.crew-z svg { width: 20px; height: 20px; display: block; }
.crew-zones li.is-hit { color: var(--bone); }
.crew-zones li.is-hit .crew-z { color: var(--bone); background: var(--blood, #7A1020); --crew-accent: var(--bone); box-shadow: inset 1px 1px 0 rgba(255,255,255,.18), inset -1px -1px 0 rgba(0,0,0,.45), 0 0 0 2px var(--crimson); animation: crew-blink 1.1s steps(2, jump-none) infinite; }
@keyframes crew-blink { from { filter: none; } to { filter: brightness(1.35); } }

.crew-problems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem .85rem; margin: 0; padding: 0; list-style: none; }
.crew-problems li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: .6rem; align-items: start; }
.crew-ico { width: 40px; height: 40px; display: grid; place-items: center; color: var(--bone); background: var(--crew-tile); box-shadow: inset 2px 2px 0 rgba(255,255,255,.1), inset -2px -2px 0 rgba(0,0,0,.6); transition: background-color .12s steps(2); }
.crew-ico svg { width: 24px; height: 24px; display: block; }
.crew-problems li:hover .crew-ico { background: var(--blood, #7A1020); --crew-accent: var(--bone); }
.crew-problems b { display: block; font-size: .9rem; font-weight: 700; line-height: 1.2; color: var(--bone); margin-bottom: .15rem; }
.crew-problems span { display: block; font-size: .81rem; line-height: 1.33; color: var(--sand); }

.crew-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.crew-foot .crew-label { margin-bottom: .35rem; }
.crew-foot p:not(.crew-label) { margin: 0; font-size: .85rem; line-height: 1.35; color: var(--sand); }
.crew-voice { font-style: italic; color: var(--bone) !important; }
.crew-cost { grid-column: 1 / -1; padding: .7rem .8rem; background: color-mix(in srgb, var(--crimson) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--crimson) 45%, transparent); }
.crew-cost p:not(.crew-label) { color: var(--bone); font-weight: 500; }
.crew-cost .crew-label { color: var(--bone); }

.crew :is(button):focus-visible { outline: 3px solid var(--bone); outline-offset: 3px; }

/* Arabic: every label through the site's Arabic font, no mono caps */
html[lang="ar"] .crew :is(.crew-count, .crew-tag, .crew-label, .crew-hint) { font-family: var(--f-body); letter-spacing: 0; font-size: .78rem; }
html[lang="ar"] .crew-name { direction: ltr; text-align: right; }

/* no JS: a plain readable list, each character on a still */
html:not(.js) .crew-stagecol { display: none; }
html:not(.js) .crew-arena { grid-template-columns: 1fr; }
html:not(.js) .crew-cards { gap: 1.5rem; }
html:not(.js) .crew-card { grid-area: auto; }
.crew-still { display: none; }
html:not(.js) .crew-still { display: block; width: 138px; height: auto; image-rendering: pixelated; margin-bottom: .6rem; }

/* ---------------- sizes ---------------- */
@media (max-width: 1180px) {
  .crew { --crew-px: 3; }
  .crew-stage { min-height: 420px; }
  .crew-problems { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .crew-arena { grid-template-columns: minmax(0, 1fr); }
  .crew-stage { flex: none; height: 410px; min-height: 0; }
  .crew-problems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crew-sprite[data-d="1"]  { transform: translate(calc(var(--crew-dir) * 42cqw), -40px) scale(.42); }
  .crew-sprite[data-d="-1"] { transform: translate(calc(var(--crew-dir) * -42cqw), -40px) scale(.42); }
  .crew-sprite[data-d="2"]  { transform: translate(calc(var(--crew-dir) * 24cqw), -100px) scale(.27); }
  .crew-sprite[data-d="-2"] { transform: translate(calc(var(--crew-dir) * -24cqw), -100px) scale(.27); }
}
@media (max-width: 520px) {
  .crew-stage { height: 390px; }
  .crew-arrow { width: 42px; height: 42px; bottom: 120px; }
  .crew-problems { grid-template-columns: 1fr; }
  .crew-zones li { font-size: .62rem; }
  .crew-pick { width: 50px; height: 50px; }
  .crew-pick img { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .crew-sprite, .crew-arrow, .crew-pick { transition: none; }
  .crew-hint svg, .crew-zones li.is-hit .crew-z { animation: none; }
  html.js .crew-card.is-on .crew-pop { animation: none; }
}

/* ================================================================
   DESIGN SYSTEM · STEP 4 (7 Nov 2026): the centred stage (plan §2 item 9; Hiba, 7 Nov: characters, scroll and
   arrows centred, the information below).
   Row 1: label, H2, lede, centred. Row 2: the selected character big in the centre; the previous and next ones at
   half its pixel size on either side, dimmed to about 40% with a pixel dither (a 4×4 mask that lines up with the
   sprite's own pixels), never CSS opacity or blur; stepped arrows at the far edges; the counter and dots under it.
   Row 3: the card, centred, max 720. Every sprite is drawn at a whole number of CSS px per pixel.
   ================================================================ */
.crew { --crew-side: 2; }                                   /* side characters: 2 px per pixel */
.crew-head { max-width: var(--narrow, 720px); margin: 0 auto var(--s-48, 48px); text-align: center; }
.crew-head .intro { margin: 0 auto; }
.crew-arena { grid-template-columns: minmax(0, 1fr); gap: var(--s-48, 48px); }
.crew-stagecol { align-items: center; }

/* the stage: tall enough for the tallest character at its size */
.crew-stage { flex: none; width: 100%; min-height: 0; height: calc(var(--crew-px) * 92px + 150px); }  /* sized to the idle characters (12 Nov 2026) */
.crew-sprite { --s: var(--crew-px); }
.crew-sprite canvas {
  transform: translate(-50%, calc((var(--h) - var(--foot)) * var(--s) * 1px));
  width: calc(var(--w) * var(--s) * 1px); height: calc(var(--h) * var(--s) * 1px);
}
.crew-hit { width: calc(var(--w) * var(--s) * .8px); height: calc(var(--foot) * var(--s) * .72px); }
.crew-sprite[data-d="0"] { transform: none; filter: none; }
.crew-sprite[data-d="1"], .crew-sprite[data-d="-1"] { --s: var(--crew-side); filter: none; z-index: 3; }
.crew-sprite[data-d="1"]  { transform: translateX(calc(var(--crew-dir) * 33cqw)); }
.crew-sprite[data-d="-1"] { transform: translateX(calc(var(--crew-dir) * -33cqw)); }
.crew-sprite[data-d="2"], .crew-sprite[data-d="-2"] { visibility: hidden; filter: none; transform: none; }
.crew-sprite[data-d]:hover { filter: none; }
/* about 40%: 6 of every 16 pixels, Bayer order, one mask cell per sprite pixel */
.crew-sprite[data-d="1"] canvas, .crew-sprite[data-d="-1"] canvas {
  --dither: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM2 0h1v1H2zM1 1h1v1H1zM0 2h1v1H0zM2 2h1v1H2zM3 3h1v1H3z'/%3E%3C/svg%3E");
  -webkit-mask-image: var(--dither); mask-image: var(--dither);
  -webkit-mask-size: calc(4px * var(--s)) calc(4px * var(--s)); mask-size: calc(4px * var(--s)) calc(4px * var(--s));
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
  -webkit-mask-position: 0 0; mask-position: 0 0;
}
.crew-sprite[data-d="1"]:hover canvas, .crew-sprite[data-d="-1"]:hover canvas { -webkit-mask-image: none; mask-image: none; }

/* stepped arrows at the far edges, centred on the character, 48 px */
.crew-arrow { width: 48px; height: 48px; bottom: calc(60px + var(--crew-px) * 60px - 24px); }
.crew-prev { inset-inline-start: 6px; }
.crew-next { inset-inline-end: 6px; }

/* under the stage: the counter, then the dots (the same buttons as the old roster) */
.crew-counter { margin: var(--s-16, 16px) 0 var(--s-8, 8px); text-align: center; font-family: var(--f-mono); font-size: var(--fs-label, 12px); letter-spacing: var(--ls-label, .14em); color: var(--mut, var(--dim)); }
.crew-roster { gap: 0; margin-top: 0; padding: 0; }
.crew-pick { width: 32px; height: 32px; background: none; box-shadow: none; overflow: visible; }
.crew-pick img { display: none; }
.crew-pick::before { content: ""; width: 10px; height: 10px; background: var(--mut, var(--dim)); }
.crew-pick:hover::before { background: var(--bone); }
.crew-pick[aria-current="true"] { box-shadow: none; transform: none; }
.crew-pick[aria-current="true"]::before { background: var(--crimson); box-shadow: 0 0 0 2px var(--noir), 0 0 0 4px var(--crimson); }

/* row 3: the card, centred, max 720; the counter now lives under the stage */
.crew-cards { width: 100%; max-width: var(--narrow, 720px); margin-inline: auto; }
.crew-card .crew-count { visibility: hidden; }
.crew-problems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crew-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* two parts left: inner voice, what it costs (Hiba, 12 Nov 2026) */
.crew-cost { grid-column: auto; }

/* tablet: the centre character at 3 px per pixel */
@media (max-width: 1023px) {
  .crew { --crew-px: 3; }
}
/* phone: the character alone, the arrows beside it, the card in one column */
@media (max-width: 599px) {
  .crew { --crew-px: 2; }
  .crew-sprite[data-d="1"], .crew-sprite[data-d="-1"] { visibility: hidden; }
  .crew-prev { inset-inline-start: calc(50% - 160px); }
  .crew-next { inset-inline-end: calc(50% - 160px); }
  .crew-problems, .crew-foot { grid-template-columns: 1fr; }
}

/* ================================================================
   HIBA'S REVIEW (8 Nov 2026): the name above the stage, a wide horizontal card
   - The selected character's name sits at the top of the stage, centred over the character, in Anton; it changes
     with the selection through a quick 4×4 dither (crew.js), no blur. The card no longer shows it (kept for screen
     readers: the card is labelled by it). The "Illustration" tag is gone from the markup.
   - The card is as wide as the page (--wrap): row A the class and habit lines, the gear on the right; row B the four
     zones in one row; row C the four problems in one row; row D inner voice, proud of, what it costs. 48 px between
     rows with a hairline in the middle, 32 px gutters, 48 px padding.
   - Phone: the rows stack, and inside each row the items go two by two (the three notes stacked).
   ================================================================ */
.crew-stage-name {
  margin: 0 0 var(--s-8, 8px); text-align: center; font-family: var(--f-display); font-weight: 400;
  font-size: 2rem; line-height: 1.08; color: var(--bone); letter-spacing: .01em; text-transform: none;
  max-width: none;
}
.crew-stage-name[data-d] { -webkit-mask-size: 4px 4px; mask-size: 4px 4px; -webkit-mask-repeat: repeat; mask-repeat: repeat; }
.crew-stage-name[data-d="0"] { visibility: hidden; }
.crew-stage-name[data-d="1"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM2 0h1v1H2zM2 2h1v1H2zM0 2h1v1H0z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM2 0h1v1H2zM2 2h1v1H2zM0 2h1v1H0z'/%3E%3C/svg%3E");
}
.crew-stage-name[data-d="2"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM2 0h1v1H2zM2 2h1v1H2zM0 2h1v1H0zM1 1h1v1H1zM3 1h1v1H3zM3 3h1v1H3zM1 3h1v1H1z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM2 0h1v1H2zM2 2h1v1H2zM0 2h1v1H0zM1 1h1v1H1zM3 1h1v1H3zM3 3h1v1H3zM1 3h1v1H1z'/%3E%3C/svg%3E");
}
.crew-stage-name[data-d="3"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM2 0h1v1H2zM2 2h1v1H2zM0 2h1v1H0zM1 1h1v1H1zM3 1h1v1H3zM3 3h1v1H3zM1 3h1v1H1zM1 0h1v1H1zM3 0h1v1H3zM3 2h1v1H3zM1 2h1v1H1z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1H0zM2 0h1v1H2zM2 2h1v1H2zM0 2h1v1H0zM1 1h1v1H1zM3 1h1v1H3zM3 3h1v1H3zM1 3h1v1H1zM1 0h1v1H1zM3 0h1v1H3zM3 2h1v1H3zM1 2h1v1H1z'/%3E%3C/svg%3E");
}
html:not(.js) .crew-stage-name { display: none; }

/* the card: wide, in rows */
.crew-cards { max-width: var(--wrap, 1088px); }
.crew-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-32, 32px); align-items: start;
  padding: var(--s-48, 48px);
}
.crew-card-top { display: none; }
.crew-card .crew-name {   /* shown above the stage now; kept for screen readers */
  position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
html:not(.js) .crew-card .crew-name { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; grid-column: 1 / -1; margin-bottom: var(--s-8, 8px); }
.crew-cls { grid-column: 1; }
.crew-habit { grid-column: 1; }
.crew-gear { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0; justify-content: flex-end; max-width: 280px; }
html.js .crew-cls { grid-row: 1; }
html.js .crew-habit { grid-row: 2; }
.crew-block, .crew-foot { grid-column: 1 / -1; margin-top: var(--s-24, 24px); padding-top: var(--s-24, 24px); border-top: 1px solid var(--hairline); }
/* row B: the four zones evenly across the width */
.crew-zones { gap: var(--s-32, 32px); }
.crew-zones li:not(:last-child)::after { inset-inline-start: calc(50% + 18px); width: calc(100% - 4px); }
/* row C: the four problems in one row; each one icon, title, line */
.crew-problems { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-32, 32px); }
.crew-problems li { display: flex; flex-direction: column; gap: var(--s-12, 12px); }
/* row D: inner voice, proud of, what it costs */
.crew-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-32, 32px); }

@media (max-width: 1023px) {
  .crew-problems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .crew-stage-name { font-size: 1.75rem; }
  .crew-card { grid-template-columns: minmax(0, 1fr); padding: var(--s-24, 24px); }
  .crew-gear { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: var(--s-16, 16px); max-width: none; }
  .crew-zones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-16, 16px); }
  .crew-zones li:not(:last-child)::after { display: none; }
  .crew-problems { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-24, 24px) var(--s-16, 16px); }
  .crew-foot { grid-template-columns: minmax(0, 1fr); gap: var(--s-24, 24px); }
}

/* the name just above the selected character's head, 24 px clear (Hiba's review, 8 Nov 2026). The head is the top of
   the sprite's frame: 60 px + foot × pixel size above the stage's bottom. The stage grows by the name's height so the
   tallest character's name still fits. */
.crew-stage { height: calc(var(--crew-px) * 136px + 72px + 40px); }
.crew-stage-name {
  position: absolute; left: 0; right: 0; margin: 0; z-index: 4; pointer-events: none;
  bottom: calc(60px + var(--name-foot, 128) * var(--crew-px) * 1px + 14px);
}

/* the name plate (Hiba, 8 Nov 2026: "some sort of border to the names"; the ramp from pixel.css, approved the same day): the name sits
   in a noir plate inside a stepped frame of the pixel ramp. It dithers in with the name. */
.crew-stage-name { width: fit-content; max-width: calc(100% - 32px); margin-inline: auto; padding: 10px 22px 9px; isolation: isolate; }
.crew-stage-name::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--px-ramp); clip-path: var(--px-9); }
.crew-stage-name::after { content: ""; position: absolute; inset: 4px; z-index: -1; background: var(--noir); clip-path: var(--px-6); }
@media (max-width: 599px) { .crew-stage-name { padding: 8px 16px 7px; } }

/* smaller characters (Hiba, 12 Nov 2026: "make the characters smaller and bring their name closer to them"):
   3 px per pixel on desktop, 2 on tablets and phones; the name hides while the taller hover animation plays */
.crew { --crew-px: 3; }
@media (max-width: 1023px) { .crew { --crew-px: 2; } }
.crew-stage.is-acting .crew-stage-name { visibility: hidden; }
.crew-stage { height: calc(var(--crew-px) * 92px + 150px); }  /* sized to the idle characters and their name */
