/* =========================================================
   Case study pages — same language as the story:
   a coloured chapter-style hero where the hand draws a prop and he walks in,
   then a white editorial page with the same headline, rule and image motion.
   ========================================================= */

/* ---------- hero ---------- */
.case-hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden;
  background: var(--bg); color: var(--line);
}
.case-hero .hero-line, .case-hero .hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-line path { fill: none; stroke: var(--line); stroke-linecap: round; stroke-linejoin: round; }
.hero-copy {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1.25fr 1fr; column-gap: 5vw;
  padding: clamp(96px, 15vh, 140px) var(--pad) 0;
}
.hero-copy .eyebrow { grid-column: 1 / -1; opacity: .75; }
.hero-copy h1 { font-size: clamp(2.6rem, 5.4vw, 5.2rem); line-height: 1; letter-spacing: -0.05em; font-weight: 400; margin: 0; }
.hero-side { padding-top: .5em; max-width: 27rem; }
.hero-side .tagline { font-size: clamp(18px, 1.6vw, 22px); letter-spacing: -0.02em; margin: 0 0 12px; }
.hero-side p { margin: 0; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.5; opacity: .82; }
.hero-hud {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 18px var(--pad) 22px; font-size: 11.5px;
}
.hero-hud a { text-decoration: none; opacity: .75; }
.hero-hud a:hover { opacity: 1; }
.hero-hud .hud-count { opacity: .55; font-variant-numeric: tabular-nums; }
.hero-hud .hud-scroll { justify-self: end; opacity: .75; }

/* ---------- facts + summary ---------- */
.case-intro { padding: clamp(80px, 12vh, 140px) var(--pad) 0; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px clamp(20px, 3vw, 40px); margin: 0 0 clamp(64px, 10vh, 110px); }
.facts > div { position: relative; padding-top: 16px; }
.facts dt { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.facts dd { margin: 0; font-size: 15px; line-height: 1.4; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); }
.summary > div { position: relative; padding-top: 22px; }
.summary h2 { font-size: 10.5px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.summary p { margin: 0; font-size: clamp(18px, 1.6vw, 23px); line-height: 1.32; letter-spacing: -0.02em; }
.rule { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: left; }

/* ---------- media ---------- */
.media { margin: 0 auto; width: 100%; max-width: min(100%, var(--w, 100%)); }   /* never wider than the image's own pixels */
.media .frame { position: relative; overflow: hidden; background: #F2F2F0; }
.media img, .media video { display: block; width: 100%; height: auto; }
.media figcaption { font-size: 12.5px; color: var(--muted); margin-top: 12px; max-width: 46rem; }
.cover { padding: clamp(64px, 10vh, 120px) var(--pad) 0; }
.cover .frame img { transform-origin: 50% 50%; }

/* tall screenshots scroll inside a window as you pass them */
.media.tall .frame { height: min(82vh, 900px); }
.media.tall img { position: absolute; left: 0; top: 0; width: 100%; height: auto; will-change: transform; }
.media.tall .frame::after {
  content: "Scroll"; position: absolute; right: 12px; bottom: 12px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  background: rgba(255, 255, 255, .9); color: var(--ink); padding: 6px 10px; border-radius: 99px;
}

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 28px); }
.row { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); align-items: start; }
.phones { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: clamp(16px, 3vw, 48px); max-width: 980px; margin-inline: auto; }
.phones[style*="--n:4"] { max-width: 1240px; }
.phones .frame { border-radius: 28px; background: #EDEBE6; }
.media.video .frame { background: var(--ink); }
.media.video video { aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- sections ---------- */
.cs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 6vw; row-gap: clamp(32px, 5vh, 56px); padding: clamp(96px, 15vh, 170px) var(--pad) 0; }
.cs-head .eyebrow { color: var(--muted); margin-bottom: 18px; }
.cs-head h2 { font-size: clamp(2.1rem, 3.7vw, 3.6rem); line-height: 1.02; letter-spacing: -0.05em; font-weight: 400; margin: 0; }
.cs-text { grid-column: 2; max-width: 38rem; }
.cs-text > * + * { margin-top: 18px; }
.cs-text p { margin: 0; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.55; color: #3A3A3A; }
.cs-text p.note { font-size: 13px; color: var(--muted); }
.cs-wide { grid-column: 1 / -1; }
.cs-list { list-style: none; padding: 0; margin: 0; }
.cs-list li { position: relative; padding: 14px 0 14px 28px; border-top: 1px solid var(--rule); font-size: 16px; line-height: 1.5; }
.cs-list li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }
.points { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; counter-reset: pt; }
.points > div { position: relative; padding-top: 18px; counter-increment: pt; }
.points h3 { font-size: 19px; font-weight: 400; letter-spacing: -0.02em; margin: 0 0 8px; }
.points h3::before { content: counter(pt, decimal-leading-zero); display: block; font-size: 10.5px; letter-spacing: .18em; color: var(--muted); margin-bottom: 10px; }
.points p { font-size: 15px !important; }
.quote { grid-column: 1 / -1; margin: 0; padding: clamp(24px, 4vh, 48px) 0; }
.quote p { font-size: clamp(1.8rem, 3.6vw, 3.4rem) !important; line-height: 1.1 !important; letter-spacing: -0.04em; color: var(--ink) !important; max-width: 32ch; margin: 0; }
.quote cite { display: block; margin-top: 20px; font-style: normal; font-size: 12.5px; color: var(--muted); }
.notes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.notes article { border: 1px solid var(--rule); padding: 24px; }
.notes .eyebrow { color: var(--muted); }
.notes strong { display: block; font-weight: 400; font-size: 22px; letter-spacing: -0.02em; margin: 14px 0 10px; }
.notes p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* colour swatches */
.swatches { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); max-width: calc(var(--n, 5) * 260px); gap: clamp(12px, 1.6vw, 24px); }
.swatch { margin: 0; }
.swatch .chip { display: block; aspect-ratio: 4 / 5; border: 1px solid var(--rule); }
.swatch figcaption { display: grid; gap: 4px; margin-top: 12px; font-size: 13px; }
.swatch strong { font-weight: 400; font-size: 15px; letter-spacing: -0.01em; }
.swatch span { font-variant-numeric: tabular-nums; color: var(--muted); letter-spacing: .04em; }
.swatch em { font-style: normal; color: var(--muted); }

/* plates: one large image and its note, alternating sides */
.plate { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: end; padding: clamp(80px, 12vh, 140px) var(--pad) 0; }
.plate:nth-of-type(even) { grid-template-columns: 1fr 1.4fr; }
.plate:nth-of-type(even) .media { order: 2; }
.plate .eyebrow { color: var(--muted); margin-bottom: 14px; }
.plate h2 { font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: 1.04; letter-spacing: -0.045em; font-weight: 400; margin: 0 0 14px; }
.plate p { margin: 0; color: #3A3A3A; max-width: 26rem; }

/* ---------- next project ---------- */
.next {
  display: block; position: relative; overflow: hidden; margin-top: clamp(120px, 18vh, 200px);
  padding: clamp(80px, 14vh, 150px) var(--pad); background: var(--next); color: #fff; text-decoration: none;
}
.next .eyebrow { opacity: .75; margin-bottom: 22px; }
.next h2 { font-size: clamp(2.8rem, 7vw, 7rem); line-height: .96; letter-spacing: -0.055em; font-weight: 400; margin: 0; }
.next .next-kind { display: block; margin-top: 18px; font-size: 14px; opacity: .75; }
.next svg { display: block; width: 100%; height: 60px; margin-top: clamp(40px, 7vh, 72px); overflow: visible; }
.next svg path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.next .arrow { transition: transform .5s var(--ease); }
@media (hover: hover) and (pointer: fine) { .next:hover .arrow { transform: translateX(14px); } }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero-copy { grid-template-columns: 1fr; }
  .hero-side { padding-top: 16px; }
  .hero-hud { grid-template-columns: 1fr auto; }
  .hero-hud .hud-count { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .summary { grid-template-columns: 1fr; }
  .cs { grid-template-columns: 1fr; }
  .cs-text { grid-column: 1; }
  .pair, .notes { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row { --n: 2 !important; }
  .points { grid-template-columns: 1fr; }
  .plate, .plate:nth-of-type(even) { grid-template-columns: 1fr; }
  .plate:nth-of-type(even) .media { order: 0; }
}
@media (max-width: 820px) {
  .phones[style*="--n:4"] { --n: 2 !important; max-width: 560px; }
}
@media (max-width: 600px) {
  .row { --n: 1 !important; }
}
@media (max-width: 480px) {
  .phones, .phones[style*="--n:4"] { --n: 1 !important; max-width: 300px; }
}
