/* Case study pages. Same tokens as home.css. The design panel (npm run design)
   swaps the @section regions below, so edit options in design/templates/case.css. */
:root {
  --bg: #111213;
  --surface: #1b1c1e;
  --fg: #ecedee;
  --muted: #8d9095;
  --accent: #ecedee;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --side: clamp(16px, 5vw, 64px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, figure, dl, dd { margin: 0; font-weight: inherit; }
h1, h2, h3 { text-wrap: balance; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 16px; top: 16px; }
.wrap { max-width: 1440px; margin: 0 auto; padding-left: max(var(--side), env(safe-area-inset-left, 0px)); padding-right: max(var(--side), env(safe-area-inset-right, 0px)); }
.ln, .body a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--muted); transition: color .2s, text-decoration-color .2s; }
.ln:hover, .body a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
figcaption { color: var(--muted); font-size: 15px; margin-top: 12px; }
.back { font-size: 15px; color: var(--muted); }
.back:hover { color: var(--fg); }

/* Spacing between components */
[data-section="facts"] { padding-top: 72px; }
[data-section="story"] { padding-top: 112px; }
[data-section="images"] { padding-top: 48px; }
[data-section="next"] { padding-top: 144px; }

/* Shared pieces */
.hero-pic { background: var(--surface); overflow: hidden; }
.hero-pic img { width: 100%; height: 100%; object-fit: cover; }
.hero-pic.contain { display: grid; place-items: center; }
.hero-pic.contain img { width: auto; height: 88%; object-fit: contain; }
img.phone { border-radius: 8% / 3.5%; }
.imgs img.phone { max-width: 360px; }
.hero-pic.stat { display: grid; place-items: center; background: #1f4d47; font-size: clamp(56px, 8vw, 120px); font-weight: 600; }
.frame { background: var(--surface); overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame.contain { display: grid; place-items: center; }
.frame.contain img { width: auto; height: 88%; object-fit: contain; }
.frame.stat { display: grid; place-items: center; background: #1f4d47; font-size: clamp(48px, 6vw, 96px); font-weight: 600; }
[data-section="facts"] dd a { text-decoration: underline; text-underline-offset: 4px; }
.snippet { color: var(--muted); font-size: 15px; margin-top: 40px; max-width: 70ch; }

/* Story text */
[data-section="story"] h2 { font-size: 22px; font-weight: 600; }
.lead { font-size: clamp(22px, 2.1vw, 28px); line-height: 1.3; color: var(--fg); margin-top: 1em; }
.body { margin-top: 24px; color: var(--muted); }
.body > * + * { margin-top: 1em; }
.body strong { color: var(--fg); font-weight: 600; }
.body h3 { color: var(--fg); font-size: 18px; font-weight: 600; margin-top: 2em; }
.body h3 + p { margin-top: .5em; }
.body h3:first-child { margin-top: 0; }
.body .methods { font-size: 15px; }
.body .note { background: var(--surface); padding: 20px 24px; }
.pair { display: grid; grid-template-columns: minmax(0, var(--a, 1fr)) auto minmax(0, var(--b, 1fr)); align-items: start; gap: clamp(16px, 2.5vw, 40px); margin-top: 56px; }
.pair .arrow { width: 32px; height: 32px; color: var(--muted); align-self: center; }
.list li { padding-left: 1.2em; position: relative; }
.list li + li { margin-top: 6px; }
.list li::before { content: ""; position: absolute; left: 0; top: .74em; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-block: 96px 48px; color: var(--muted); font-size: 15px; }
.foot .ln { color: var(--fg); }

/* @section header: Split with tall image (option 2) */
.head-2 { padding-top: 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px clamp(24px, 5vw, 80px); }
.head-2 .txt { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding-bottom: 8px; }
.head-2 h1 { font-family: var(--serif); font-size: clamp(40px, 5vw, 76px); line-height: 1.04; }
.head-2 .intro { color: var(--muted); max-width: 44ch; margin-top: 24px; }
.head-2 .hero-pic { aspect-ratio: 4 / 5; }
@media (max-width: 820px) { .head-2 { grid-template-columns: 1fr; } .head-2 .hero-pic { aspect-ratio: 4 / 3; } }
/* @end header */

/* @section facts: Four columns (option 1) */
.facts-1 dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
.facts-1 dt { color: var(--muted); font-size: 15px; }
.facts-1 dd { margin-top: 6px; }
@media (max-width: 820px) { .facts-1 dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* @end facts */

/* @section story: Text with images (option 3) */
.story-3 .text { max-width: 640px; }
.story-3.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px clamp(24px, 5vw, 80px); align-items: start; }
.story-3 .imgs { display: grid; gap: 32px; position: sticky; top: 32px; }
@media (max-width: 820px) { .story-3.split { grid-template-columns: 1fr; } .story-3 .imgs { position: static; } }
/* @end story */

/* @section images: Steps row (option 5) */
.imgs-5 .row { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 20px; }
.imgs-5 .frame { aspect-ratio: 1; background: #f4f4f4; overflow: hidden; display: grid; place-items: center; }
.imgs-5 .frame img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 820px) { .imgs-5 .row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* @end images */

/* @section next: All projects (option 3) */
.next-3 h2 { font-size: 22px; font-weight: 600; margin-bottom: 16px; }
.next-3 a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding-block: 10px; font-size: clamp(22px, 2.4vw, 32px); transition: color .2s; }
.next-3 a span { color: var(--muted); font-size: 16px; align-self: center; }
.next-3 a.cur { color: var(--muted); pointer-events: none; }
.next-3 a:not(.cur):hover { color: var(--accent); }
/* @end next */

@media (max-width: 820px) {
  [data-section="story"] { padding-top: 88px; }
  .pair { grid-template-columns: 1fr; justify-items: center; }
  .pair .arrow { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
