/* =====================================================================
   CASE STUDY — Magic Lesson: screens, evidence, findings, scores.
   Loaded only by magic-lesson.html, on top of styles.css.
   ===================================================================== */

/* section rhythm */
.case-sec { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) clamp(64px, 10vh, 128px); }
.case-sec > h3 { margin: 0 0 18px; font-weight: 400; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.case-lead {
  margin: 0 0 clamp(18px, 3vh, 28px);
  font-weight: 600; font-variation-settings: "wdth" 88, "opsz" 40;
  font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.12; letter-spacing: -.02em; max-width: 24ch;
}
.case-p { font-size: clamp(1.02rem, 1.3vw, 1.2rem); line-height: 1.55; color: var(--ink-2); max-width: 60ch; margin: 0; }
.case-p + .case-p { margin-top: 1em; }
.case-p + .screens, .case-p + .tasks, .case-p + .photos, .case-p + .bars { margin-top: clamp(20px, 3vh, 32px); }

/* phone screens */
.screen { position: relative; aspect-ratio: 796 / 1384; overflow: hidden; background: var(--signal-deep); border: 1px solid var(--line); }
.screen img, .screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.screens { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); }
.screens figure, .pair figure, .photos figure { margin: 0; }
.screens figcaption, .pair figcaption { margin-top: 10px; }

/* the three tasks, as they were read out */
.tasks { list-style: none; margin: 0; padding: 0; counter-reset: t; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.tasks li { counter-increment: t; background: var(--screen-2); border-top: 3px solid var(--signal); padding: 18px; font-size: 1.05rem; line-height: 1.45; }
.tasks li::before { content: "Task " counter(t); display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }

/* session photos and the note-taker sheets */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); }
.photos .frame-art { border: 0; }
.sheets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); margin-top: clamp(12px, 2vw, 22px); }
.sheet { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--screen-2); }
.sheet img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheets-note { margin-top: 12px; color: var(--ink-2); }

/* evidence: the finding, the heatmap, the clean screen */
.pair { display: grid; grid-template-columns: 5fr 3fr 3fr; gap: clamp(16px, 2.6vw, 40px); align-items: start; padding: clamp(24px, 4vh, 40px) 0; border-top: 1px solid var(--line); }
.pair:first-of-type { border-top: 0; padding-top: 0; }
.pair h4 { margin: 0 0 12px; font-weight: 700; font-variation-settings: "wdth" 90, "opsz" 40; font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.15; letter-spacing: -.02em; }

/* the number */
.bignum { display: grid; grid-template-columns: auto 1fr; gap: clamp(16px, 3vw, 40px); align-items: baseline; margin-bottom: clamp(20px, 3vh, 32px); }
.bignum b { font-weight: 800; font-variation-settings: "wdth" 75, "opsz" 96; font-size: clamp(5rem, 14vw, 12rem); line-height: .85; letter-spacing: -.04em; color: var(--signal); }
.bignum b small { font-size: .42em; font-weight: 600; letter-spacing: -.02em; }
.bignum p { margin: 0; font-weight: 600; font-variation-settings: "wdth" 88, "opsz" 40; font-size: clamp(1.4rem, 2.8vw, 2.4rem); line-height: 1.1; letter-spacing: -.02em; max-width: 18ch; }

/* ranked issues: number · issue + where · fix · severity */
.issues { list-style: none; margin: clamp(20px, 3vh, 32px) 0 0; padding: 0; counter-reset: i; }
.issues li { counter-increment: i; display: grid; grid-template-columns: 3ch 1.2fr 1fr auto; gap: clamp(12px, 2vw, 28px); align-items: start; padding: 16px 0; border-top: 1px solid var(--line); font-size: 1rem; line-height: 1.45; }
.issues li::before { content: counter(i, decimal-leading-zero); font-family: var(--mono); font-size: 12px; letter-spacing: .18em; color: var(--ink-2); padding-top: 5px; }
.issues b { display: block; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.issues b + span { display: block; color: var(--ink-2); font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-top: 5px; }
.issues .fix { margin: 0; color: var(--ink-2); }
.sev { justify-self: end; border: 1px solid var(--signal); border-radius: 999px; padding: 4px 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.sev-high { background: var(--signal); color: var(--on-signal); }

/* survey bars */
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(0, 24ch) 1fr 8ch; gap: 14px; align-items: center; font-size: .95rem; }
.bar > span:first-child { color: var(--ink-2); }
.bar em { display: block; height: 14px; background: var(--screen-2); position: relative; font-style: normal; }
.bar em i { position: absolute; inset: 0; width: calc(var(--v) / 5 * 100%); background: var(--signal); transform-origin: left center; }
.bar > span:last-child { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar > span:last-child small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-left: 6px; }
.legend { display: flex; align-items: center; gap: 14px; margin-top: 18px; color: var(--ink-2); }
.legend img { width: clamp(150px, 16vw, 220px); height: auto; }

/* what held up */
.held { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 44px); }
.held li { padding: 14px 0; border-top: 1px solid var(--line); font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.held b { display: block; color: var(--ink); font-weight: 700; margin-bottom: 4px; }

/* Nielsen's ten */
.heur { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.heur li { border: 1px solid var(--line); padding: 14px 14px 12px; font-size: .95rem; line-height: 1.3; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 104px; }
.heur li span { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.heur li.is-bad { background: var(--signal); color: var(--on-signal); border-color: var(--signal); }
.heur li.is-bad span { color: var(--on-signal); opacity: .8; }

@media (max-width: 1040px) {
  .screens { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .heur { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pair { grid-template-columns: 1fr 1fr; }
  .pair > div { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .tasks, .photos, .held { grid-template-columns: 1fr; }
  .sheets, .screens, .heur { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issues li { grid-template-columns: 3ch 1fr; }
  .issues .fix, .sev { grid-column: 2; }
  .sev { justify-self: start; }
  .bar { grid-template-columns: 1fr; gap: 6px; }
  .bar > span:last-child { text-align: left; }
  .bignum { grid-template-columns: 1fr; }
}

/* two vertical reels, side by side */
.reels-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); gap: clamp(16px, 2.6vw, 40px); }
.reels-2 figure { margin: 0; }
.reels-2 figcaption { margin-top: 10px; }
.reels-2 figcaption a { border-bottom: 1px solid var(--line); transition: border-color 150ms ease; }
.reels-2 figcaption a:hover { border-color: var(--ink); }
.reel-9x16 { aspect-ratio: 9 / 16; }
@media (max-width: 480px) { .reels-2 { grid-template-columns: 1fr; } }
