/* Case study pages: the components of a case study, drawn with the Blueprint tokens. Loaded after blueprint.css. */
:root {
  --bg: var(--paper); --surface: var(--sheet); --line: var(--rule);
  --accent: var(--ink); --before: var(--muted); --shade: rgba(23, 24, 26, 0.08);
  --display: var(--sans); --body: var(--sans);
  --text: var(--t-body); --small: var(--t-small); --tiny: var(--t-label);
  --h3: 1.35rem; --h2: var(--t-h2); --read: 40rem;
}
.read { max-width: var(--read); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: clamp(2.5rem, 6vw, 4rem) 0; }
.crumb { padding-top: clamp(1rem, 3vw, 2rem); }
.crumb a { font: 500 var(--t-label) var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
article { padding-top: clamp(1.5rem, 4vw, 3rem); }
.case-title { font-size: clamp(2.1rem, 5vw, 4rem); }
/* The case header sits on drafting paper that fades out before the content starts. */
.case-head.paper { --fade-x: 30%; padding-block: 1rem 2rem; }

/* Case study head */
.case-head { display: grid; gap: 1.5rem; }
.case-head .summary { font-size: 1.15rem; }
.meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.meta div { background: var(--surface); padding: 0.9rem 1rem; display: grid; gap: 0.2rem; min-width: 0; }
.meta b { font-weight: 600; font-size: 0.98rem; line-height: 1.35; }
.stats { display: flex; flex-wrap: wrap; gap: 0.5rem 2.25rem; }
.stat { display: grid; }
.stat b { font-family: var(--display); font-stretch: 112%; font-weight: 750; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: var(--small); color: var(--muted); }

section { display: grid; gap: 1.5rem; }
.block { margin-top: clamp(3rem, 7vw, 4.5rem); }
.section-intro { display: grid; gap: 0.6rem; }
.section-intro p { color: var(--muted); }

/* Compare */
.pair { display: grid; gap: 1.1rem; }
.pair + .pair { margin-top: clamp(2.5rem, 6vw, 4rem); }
.pair-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; }
.pair-title .label { white-space: nowrap; }
.compare {
  position: relative; aspect-ratio: 1600 / 816; max-width: 100%;
  border-radius: 6px; overflow: hidden; background: #0d0e10;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px var(--shade);
  touch-action: pan-y; user-select: none; cursor: ew-resize;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; pointer-events: none; }
.compare .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .tag {
  position: absolute; top: 0.75rem; z-index: 2;
  font: 500 var(--tiny) var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.3rem 0.6rem; border-radius: 6px; pointer-events: none;
}
.compare .tag.b { left: 0.75rem; background: #ffffff; color: #17181a; }
.compare .tag.a { right: 0.75rem; background: #17181a; color: #ffffff; }
.handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); z-index: 3;
  width: 2.75rem; margin-left: -1.375rem; display: grid; place-items: center;
  background: none; border: 0; padding: 0; cursor: ew-resize;
}
.handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.handle span {
  position: relative; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: #fff; color: #16181b; display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35); font: 600 0.8rem var(--body);
}
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2rem; }
.note { display: grid; gap: 0.3rem; min-width: 0; }
.note .label.b { color: var(--before); }
.note .label.a { color: var(--accent); }
.note p { font-size: 0.98rem; }
.hint { font-size: var(--small); color: var(--muted); }

/* New modules */
.mods { display: grid; gap: clamp(2rem, 5vw, 3rem); }
.mod { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr); gap: 1.25rem 2rem; align-items: start; }
.mod-text { display: grid; gap: 0.5rem; }
.mod-text p { color: var(--muted); font-size: 0.98rem; }
.shot {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: 6px; overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px var(--shade);
}
.shot img { display: block; width: 100%; height: auto; }

/* Games: gameplay screens in a grid, and posters */
.shots-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.shots-grid figure, .posters figure { margin: 0; display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.shots-grid figcaption, .posters figcaption { font-size: 0.9rem; color: var(--muted); line-height: 1.4; }
.screens { display: grid; gap: 1.5rem; }
.screens figure { margin: 0; }
.posters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1.25rem; align-items: start; }
@media (max-width: 760px) { .shots-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Player app */
.app-pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 2.75rem 2.5rem; }
.app-pair { display: grid; gap: 0.9rem; align-content: start; }
.phones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.phone { display: grid; gap: 0.5rem; min-width: 0; align-content: start; }
.phone .shot { border-radius: 14px; background: #000; }
.phone p { font-size: 0.92rem; }
.phone .label.b { color: var(--before); }
.phone .label.a { color: var(--accent); }

/* Build notes */
.decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.decision { background: var(--surface); padding: 1.25rem; display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.decision h3 { font-size: 1.05rem; font-stretch: 105%; }
.decision p { font-size: 0.95rem; color: var(--muted); }
.stack { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; padding: 0; margin: 0; }
.stack li { font: 500 0.78rem var(--mono); border: 1px solid var(--line); border-radius: 6px; padding: 0.25rem 0.55rem; background: var(--surface); }

.privacy { font-size: var(--small); color: var(--muted); border-left: 2px solid var(--line); padding-left: 0.9rem; }

footer { position: relative; display: grid; gap: 1rem; }
footer p { color: var(--muted); }

/* Lightbox */
dialog.lb { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1600px); width: 100%; }
dialog.lb::backdrop { background: rgba(8, 9, 10, 0.86); }
dialog.lb img { display: block; width: auto; max-width: 100%; height: auto; max-height: 86vh; margin: 0 auto; border-radius: 8px; }
dialog.lb form { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
dialog.lb button { font: 600 var(--small) var(--body); background: #fff; color: #16181b; border: 0; border-radius: 999px; padding: 0.4rem 0.9rem; cursor: pointer; }

@media (max-width: 760px) {
  .mod, .notes { grid-template-columns: minmax(0, 1fr); }
  .compare .tag { top: 0.5rem; font-size: 0.62rem; }
  .compare .tag.b { left: 0.5rem; }
  .compare .tag.a { right: 0.5rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .compare.nudge .after, .compare.nudge .handle { transition: clip-path 0.6s ease, left 0.6s ease; }
}

/* Rows of designed phone screens (U GIFT). The images carry their own rounded phone frame. */
.screen-group { display: grid; gap: 1rem; }
.screen-group + .screen-group { margin-top: clamp(2rem, 5vw, 3rem); }
.phone-row { display: flex; flex-wrap: wrap; gap: 1.5rem 1.25rem; align-items: start; }
.phone-row .phone { margin: 0; display: grid; gap: 0.55rem; width: clamp(8.5rem, 13vw, 10.5rem); }
.phone-row .shot { background: transparent; box-shadow: none; border-radius: 0; }
.phone-row .shot img { filter: drop-shadow(0 12px 16px rgba(23, 24, 26, 0.12)); }
.phone-row figcaption { font-size: 0.9rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 560px) { .phone-row .phone { width: calc(50% - 0.65rem); } }

/* Decision grids never leave a hole: six cards sit three by two, four cards two by two until there's room for four. */
@media (min-width: 900px) {
  .decisions:has(> .decision:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 600px) and (max-width: 1199px) {
  .decisions:has(> .decision:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone screenshots that are bare screens (no frame in the image) get a drawn phone edge. */
.phone-row.framed .shot img { border-radius: 22px; border: 3px solid #0b0c0e; filter: none; box-shadow: 0 16px 30px -18px rgba(23, 24, 26, 0.45); }

/* Report tables on the programme pages (the table itself is styled in blueprint.css as .pva). */
.pva.wide { max-width: 44rem; margin: 1.25rem 0 0; }
.pva.wide td { text-align: left; }
.pva.wide td:last-child { text-align: right; }
.table-note { color: var(--muted); font-size: var(--small); margin-top: 0.75rem; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.gallery figure { margin: 0; }
.gallery img { aspect-ratio: 3 / 2; object-fit: cover; }
@media (max-width: 820px) { .gallery { grid-template-columns: minmax(0, 1fr); } }
