/* ==========================================================================
   Case study (game) page
   ========================================================================== */

.case-hero { position: relative; margin: 34px 0 40px; }
.case-num { margin: 0; color: var(--muted); }
.case-title {
  margin: 12px 0 20px;
  font-size: clamp(50px, 10vw, 118px);
  font-weight: 800;
  font-stretch: 78%;
  line-height: .86;
  letter-spacing: -.038em;
}
.case-pitch { max-width: 24em; margin: 0; font-size: clamp(21px, 2.8vw, 29px); font-weight: 500; line-height: 1.25; letter-spacing: -.015em; }

.spec {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));   /* each tag's span is set in case.js (tagSpans) */
  margin: 30px 0 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 16px;
}
/* Three cells per row. Dividers are left/top shadows (painted over the previous cell); the container's overflow:hidden clips the ones on its outer edges. Phones stack them: see responsive.css */
.spec > div { padding: 12px 14px; background: var(--paper); box-shadow: -2px 0 0 var(--ink), 0 -2px 0 var(--ink); }
.spec dt { color: var(--muted); font: 600 10px/1 var(--mono); letter-spacing: .1em; }
.spec dd { margin: 6px 0 0; font-weight: 700; font-size: 15px; line-height: 1.3; }

.case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 26px; }
.case-hero .sticker { top: 4px; right: 0; }

.case-body { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 44px; margin-top: 56px; }

.toc {
  position: sticky;
  top: 28px;
  align-self: start;
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--paper-3);
}
.toc-label { padding: 0 0 10px 14px; color: var(--muted); font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.toc button {
  all: unset;
  cursor: var(--cur-hand, pointer);
  padding: 8px 12px 8px 14px;
  color: var(--muted);
  font: 600 11.5px/1.35 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .3s, transform .3s var(--out);
}
.toc button:hover { color: var(--ink); transform: translateX(3px); }
.toc button.active { color: var(--ink); }
.toc-ind {
  position: absolute;
  left: -2px; top: 0;
  width: 4px; height: 0;
  background: var(--accent);
  border-radius: 4px;
  transition: transform .45s var(--ease), height .45s var(--ease);
}

.blocks { counter-reset: sec; min-width: 0; }
.blocks > * + * { margin-top: 24px; }
.blocks > .blk-h { margin-top: 64px; }
.blocks > .blk-h:first-child { margin-top: 0; }

.blk-h {
  counter-increment: sec;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.035em;
  scroll-margin-top: 24px;
}
.blk-h::before {
  content: counter(sec, decimal-leading-zero);
  flex: none;
  padding: 5px 7px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  font: 700 11px/1 var(--mono);
  letter-spacing: .06em;
  transform: translateY(-6px);
}

.blk-text p { max-width: 64ch; margin: 0 0 1em; }
.blk-text p:last-child { margin-bottom: 0; }
.blk-text em, .callout em { font-style: italic; }
.blk-text strong { font-weight: 750; }
/* Inline links: a thick accent underline that fills in behind the word on hover */
.blk-text a { font-weight: 750; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .3em; text-underline-offset: -.12em; text-decoration-skip-ink: none; border-radius: 4px; transition: background-color .15s; }
.blk-text a:hover { background: var(--accent); color: var(--ink); }
.blk-text--lg p { max-width: 26em; font-size: clamp(24px, 3.2vw, 34px); font-weight: 700; line-height: 1.18; letter-spacing: -.025em; }

/* Page without sections: no contents sidebar, one column */
.case-body--single { grid-template-columns: minmax(0, 1fr); }

/* Section names crossed out: "this page skips the usual structure" */
.struck { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.struck s {
  padding: 7px 11px;
  border: 2px dashed var(--paper-3);
  border-radius: 999px;
  color: var(--muted);
  font: 600 11.5px/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--ink);
}

/* Big centered Play button that ends the page */
.blocks > .play-big { margin-top: 44px; }
.play-big { display: grid; justify-items: center; gap: 16px; padding-block: 8px 12px; }
.btn--big {
  position: relative;
  padding: 22px 42px;
  border-width: var(--bw);
  box-shadow: 7px 7px 0 var(--ink);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.btn--big:hover { box-shadow: 10px 10px 0 var(--ink); }
/* Ring that ripples out while idle, same as the video play button */
.btn--big::after {
  content: "";
  position: absolute;
  inset: calc(var(--bw) * -1);
  border: 2px solid var(--accent);
  border-radius: inherit;
  animation: play-ring 2.4s var(--out) infinite;
  pointer-events: none;
}
@keyframes play-ring { from { scale: 1; opacity: .9; } to { scale: 1.25 1.6; opacity: 0; } }
.play-note { margin: 0; color: var(--muted); font: 600 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }

.blk-list { max-width: 64ch; margin: 0; padding-left: 1.2em; }
.blk-list li::marker { color: var(--accent); content: "✱  "; }

.callout {
  position: relative;
  margin-top: 36px !important;
  padding: 28px 24px 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 18px;
}
.callout-label {
  position: absolute;
  top: -14px;
  left: 18px;
  padding: 5px 10px;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font: 700 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}
.callout--problem .callout-label { background: var(--ink); color: var(--paper); }
.callout--fix .callout-label { background: var(--accent); transform: rotate(1.5deg); }
.callout--next .callout-label { background: var(--white); }
.callout p { margin: 0 0 .8em; max-width: 62ch; }
.callout p:last-child { margin-bottom: 0; }

.pull { margin: 44px 0 !important; padding: 4px 0 4px 26px; border-left: 8px solid var(--accent); }
.pull p { margin: 0; font-size: clamp(24px, 3.3vw, 34px); font-weight: 700; line-height: 1.18; letter-spacing: -.025em; }
.pull cite { display: block; margin-top: 14px; color: var(--muted); font: 600 11px/1.4 var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; }

.gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 14px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: st; }
.steps li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  align-items: start;
  margin-left: calc(var(--k) * 26px);
  padding: 18px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  transition: transform .4s var(--spring);
}
.steps li:hover { transform: translateX(6px); }
.steps li::before {
  counter-increment: st;
  content: counter(st);
  width: 54px; height: 54px;
  display: grid; place-items: center;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-size: 26px;
  font-weight: 800;
}
.steps h4 { margin: 2px 0 4px; font-size: 20px; letter-spacing: -.02em; }
.steps p { margin: 0; }

.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* Top padding leaves room for the verb label straddling the border */
.key { position: relative; padding: 26px 18px 18px; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; }
/* The verb ("Jump", "Bind / Unbind") sits on the top border, the paper background breaking the line */
.key-verb {
  position: absolute;
  top: calc(-1 * var(--verb-h) / 2 - 1px);   /* half the label sits above the 2px border */
  left: 16px;
  --verb-h: 14px;
  height: var(--verb-h);
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 32px);
  padding: 0 8px;
  background: var(--paper);
  color: var(--ink);
  font: 700 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.keycap {
  display: inline-block;
  margin-bottom: 14px;
  min-width: 42px;
  padding: 10px 14px;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 6px 0 var(--ink);
  font: 700 15px/1 var(--mono);
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
  transition: transform .12s, box-shadow .12s;
}
.key:hover .keycap { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.key p { margin: 0; }

/* Team credits: one row per person, role on the left, name (link) in that person's colour */
.credits { list-style: none; margin: 0; padding: 0; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; }
.credits li { background: var(--paper); }
.credits li + li { border-top: 2px solid var(--ink); }
.credit {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px;
  color: var(--ink);
  transition: background-color .25s;
}
.credit:hover { background: var(--c); }   /* each person's colour only shows on hover */
.credit-role { opacity: .7; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.credit-name { font-size: 22px; font-weight: 800; font-stretch: 85%; letter-spacing: -.02em; }
.credits .arr { display: inline-block; transition: transform .45s var(--spring); }
.credit:hover .arr { transform: translate(3px, -3px); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 18px 18px 16px; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; }
.stat b { display: block; font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -.045em; }
.stat span { display: block; margin-top: 8px; font: 600 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }

/* Next-game banner */
.next {
  position: relative;
  display: block;
  margin-top: 88px;
  padding: 26px 110px 30px 28px;
  overflow: hidden;
  background: var(--c);
  color: var(--on-c, var(--ink));
  border: var(--bw) solid var(--ink);
  border-radius: 22px;
  text-decoration: none;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .4s var(--spring), box-shadow .4s var(--spring);
}
.next:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.next small { display: block; margin-bottom: 10px; }
.next strong { display: block; font-size: clamp(36px, 6.5vw, 68px); font-weight: 800; font-stretch: 80%; line-height: .92; letter-spacing: -.045em; }
.next .arrow { position: absolute; right: 30px; top: 50%; font-size: 60px; font-weight: 800; transform: translateY(-50%); transition: transform .5s var(--spring); }
.next:hover .arrow { transform: translate(10px, -50%) rotate(-45deg); }

