/* ---------- Reset & base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #1a1b1f;
  --body-text: #333333;
  --muted: rgba(0, 0, 0, 0.6);
  --line: #e4e4e4;
  --bg: #ffffff;
  --panel: #f3f3f3;
  --accent: #ff6b47;
  --max: 1040px;
}

html { scroll-behavior: smooth; background: var(--bg); }

/* ---------- Page transitions (cross-document View Transitions) ----------
   Same-origin navigations crossfade; the clicked card thumbnail morphs into
   the case-study hero media (shared view-transition-name per project). */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo stays anchored while the page crossfades */
.logo { view-transition-name: vt-logo; }

/* Hero morph pairs (home thumb ↔ case-study hero) animate a touch slower */
::view-transition-group(vt-hero-ntop),
::view-transition-group(vt-hero-mc),
::view-transition-group(vt-hero-cubic) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.33, 0, 0.1, 1);
}

/* The home thumbnail and the case-study hero use different crops/aspect ratios.
   Cover (rather than the default stretch) scales each snapshot uniformly as the
   box morphs, so the laptop/iPad reads as a clean zoom-and-crossfade instead of
   a distorted stretch. */
::view-transition-old(vt-hero-ntop),
::view-transition-new(vt-hero-ntop),
::view-transition-old(vt-hero-mc),
::view-transition-new(vt-hero-mc),
::view-transition-old(vt-hero-cubic),
::view-transition-new(vt-hero-cubic) {
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- Scroll reveal ----------
   Content tagged with data-reveal (by js/transitions.js) starts slightly
   lowered + transparent and eases into place when it enters the viewport.
   The hidden state is applied only by JS, so no-JS and reduced-motion users
   always see content. Stagger within a group via the --reveal-delay var. */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
      transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
  }
  [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
  }
}

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--body-text);
  background: transparent;
  font-size: 16px;
  line-height: 1.75;
  position: relative;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
}

/* ---------- Header ---------- */
.site-header {
  padding: 28px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
}

.main-nav {
  display: flex;
  gap: 32px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.main-nav a:hover { color: var(--muted); }

/* Minimal back-to-home control used on case-study pages in place of the nav */
.back-home {
  display: inline-flex;
  align-items: center;
  margin-left: -20px;
  color: var(--ink);
  transition: color 0.15s ease;
}
.back-home svg { display: block; }
.back-home:hover { color: var(--accent); }
.back-home:hover svg { transform: translateX(-2px); transition: transform 0.15s ease; }

/* Case-study pages: align the header to the hero column (so the logo sits over
   the media's left edge and the nav over the copy's right edge) and lighten it
   so the hero stays the focal point. */
body:has(.cs-hero:not(.pw-hero)) .site-header .wrap { max-width: 1300px; }
body:has(.cs-hero:not(.pw-hero)) .logo {
  font-size: 18px;
  color: var(--muted);
  transition: color 0.15s ease;
}
body:has(.cs-hero:not(.pw-hero)) .logo:hover { color: var(--ink); }
body:has(.cs-hero:not(.pw-hero)) .main-nav a { color: var(--muted); }
body:has(.cs-hero:not(.pw-hero)) .main-nav a:hover { color: var(--ink); }

/* ---------- Eyebrow label (accent, uppercase) ---------- */
.eyebrow {
  text-transform: uppercase;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* ---------- Hero (home) ---------- */
.hero {
  padding: 88px 0 72px;
}

/* Full-page cursor-follow dot field (homepage). Absolute + full document height
   so it scrolls with the page and spans behind the nav and all content. */
.bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Content sits above the dot field; opaque panels (cards) hide dots behind
   them, transparent areas (hero, nav, gaps, footer) let them show through. */
body > *:not(.bg-canvas) {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  color: var(--accent);
}

.hero .lede {
  margin-top: 16px;
  max-width: 620px;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
}

.hero .current-role {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 300;
  color: var(--muted);
}

/* ---------- Case study blocks (home) ---------- */
.cs-divider {
  text-align: center;
  padding: 40px 0 8px;
}

.cs-divider-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.cs-divider-arrow {
  display: block;
  margin: 12px auto 0;
  color: var(--muted);
  opacity: 0.75;
}

@media (prefers-reduced-motion: no-preference) {
  .cs-divider-arrow { animation: cs-bob 2.2s ease-in-out infinite; }
}

@keyframes cs-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.case-studies {
  display: flex;
  flex-direction: column;
  gap: 84px;                 /* 3 rows of the 28px dot grid between cards */
  padding: 24px 0 72px;
  max-width: 880px;          /* narrower than the content column so the card feels */
  margin: 0 auto;            /* centred on the page, freeing the left margin for the rail */
}

.case-study-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 32px;
  /* No fill/border — the dot grid around the card reads as its boundary. */
  background: transparent;
  border-radius: 10px;
  padding: 32px 48px;
  height: 420px;             /* 15 rows of the 28px grid; edges land on dot rows */
}

.case-study-block .thumb {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-study-block .thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.card-eyebrow {
  text-transform: uppercase;
  color: #9a9a9a;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* Timeline rail: the year + company for each case study. On wide screens a real
   grid dot marks the card's top-left CORNER and the label sits in one line to the
   right of that dot, resting on top of the card (DOM label + grid dot coincide).
   Consecutive corner dots are joined by a vertical connector down the left edge.
   Below 900px it falls back to an inline eyebrow above the card and the canvas
   rail drops away (its column leaves the canvas). */
.case-study-block { position: relative; }

.rail-label {
  position: absolute;
  left: 0;                    /* JS sets left just right of the corner dot */
  top: 0;                     /* JS nudges this onto the dot's grid row */
  transform: translateY(-50%);
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
}
.rail-year {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #9a9a9a;
  font-variant-numeric: tabular-nums;
}
.rail-co {
  font-size: 15px;
  font-weight: 600;
  color: #6b6b6b;
}

@media (max-width: 900px) {
  .rail-label {
    position: static;
    transform: none;
    margin-bottom: 10px;
  }
}

.case-study-block h2 {
  font-size: 28px;
  margin: 12px 0 10px;
  color: #6b6b6b;
}

.case-study-block:hover h2 { color: var(--accent); }

.case-study-block .tagline {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.case-study-block.placeholder { opacity: 0.6; pointer-events: none; }

.case-study-block.placeholder .thumb,
.case-study-block .thumb.is-placeholder {
  background: #ececec;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .case-study-block { grid-template-columns: 1fr; padding: 28px; gap: 20px; }
  .case-study-block .thumb { height: 220px; }
}

.coming-soon-tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}

/* Locked case study (Higharc) — reads as a real, gated study, not a placeholder */
.case-study-block.locked .thumb.is-locked {
  flex-direction: column;
  gap: 12px;
  background: #ececec;
  border-radius: 8px;
  padding: 0 24px;
  color: #9a9a9a;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}
.case-study-block.locked .lock-glyph { color: #b4b4b4; }
.case-study-block.locked:hover h2 { color: #6b6b6b; }

.press-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.press-link:hover { border-bottom-color: currentColor; }

/* ---------- Secondary link (Spaces & Objects) ---------- */
.secondary-link-row {
  padding: 0 0 72px;
}

.secondary-link-row a {
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.secondary-link-row a:hover { color: var(--accent); border-color: #dcdcdc; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 0 60px;
  border-top: 1px solid var(--line);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer .foot-links {
  display: flex;
  gap: 24px;
}

.site-footer .foot-links a:hover { color: var(--accent); }

/* ---------- About page ---------- */
.about-content {
  padding: 48px 0 96px;
}

.about-grid {
  --about-disc: #c6d8e6;              /* soft studio-blue, matched to the headshot bg */
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 56px;
  align-items: center;
}

/* Circular portrait: the photo is cropped to a circle so its blue studio
   background reads as a disc behind the head, sitting on a slightly larger
   matching disc for a soft halo. */
.about-photo-wrap {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-photo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--about-disc);
  z-index: 0;
}

.about-photo {
  position: relative;
  z-index: 1;
  width: 88%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 18%;          /* frame head + shoulders inside the circle */
  border-radius: 50%;
  display: block;
}

.about-text { max-width: 560px; }

.about-text h1 {
  font-size: 48px;
  margin-bottom: 12px;
}

.about-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.about-location svg { flex: none; }

.about-content p {
  margin-bottom: 20px;
  font-size: 17px;
}

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; justify-items: center; text-align: center; }
  .about-photo-wrap { max-width: 320px; width: 100%; }
}

/* ---------- Project page: intro ---------- */
.project-subtitle {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--body-text);
  margin-top: 8px;
  max-width: 740px;
}

.intro-info {
  margin: 28px 0 48px;
}

.intro-info p {
  font-size: 16px;
  margin-bottom: 4px;
}

.intro-info strong {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Case-study hero (stacked: title → media → meta, one band) ----------
   Shared across all case studies. Each page sets the band/header background
   per its theme (light grey or dark). */
.cs-hero { padding: 48px 0 80px; }

.cs-hero h1 { font-size: clamp(28px, 3vw, 36px); margin-top: 6px; }

/* Align the title block to the same 800px centered column as the media/meta,
   so the eyebrow, headline and subtitle line up with the hero image edges. */
.cs-hero .eyebrow,
.cs-hero h1,
.cs-hero .project-subtitle {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.cs-hero .project-subtitle {
  margin-top: 8px;
  margin-bottom: 28px;
  font-size: 17px;
}

/* Text-only Prior Work hero: left-align the title block to the wrap edge so it
   lines up with the content sections below (not centered in the 800px column). */
.pw-hero .eyebrow,
.pw-hero h1,
.pw-hero .project-subtitle {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.cs-hero-media {
  display: block;
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto;
}

.cs-meta {
  max-width: 800px;
  margin: 32px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 40px;
}

.cs-meta p { font-size: 14px; margin-bottom: 0; color: var(--muted); }
.cs-meta p strong { color: var(--muted); }

@media (max-width: 760px) {
  .cs-meta { grid-template-columns: 1fr; }
}

/* ---------- Split hero: media left, copy (title/subtitle/meta) right ----------
   Applied to case studies that have a hero media (not the text-only pw-hero). */
.cs-hero:not(.pw-hero) .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  column-gap: 56px;
  align-items: center;
  max-width: 1200px;
}

/* Media fills its column; drop the centered 800px cap/auto-margins. */
.cs-hero:not(.pw-hero) .cs-hero-media {
  max-width: 100%;
  margin: 0;
}

/* Copy column: left-aligned stack, full column width. */
.cs-hero-copy { min-width: 0; }
.cs-hero-copy .eyebrow,
.cs-hero-copy h1,
.cs-hero-copy .project-subtitle {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}
.cs-hero-copy .cs-meta {
  max-width: none;
  margin: 44px 0 0;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (max-width: 860px) {
  .cs-hero:not(.pw-hero) .wrap { grid-template-columns: 1fr; row-gap: 28px; }
}

/* ---------- Hero image band (light grey, full width) ---------- */
.hero-band {
  background: var(--panel);
  padding: 64px 24px;
}

.hero-band img,
.hero-band video {
  display: block;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.hero-band.flush {
  padding: 0;
}

.hero-band.flush img,
.hero-band.flush video {
  max-width: var(--max);
}

/* ---------- Case study sections (lite) ---------- */
.cs {
  padding: 96px 0 0;
}

.cs-label {
  text-transform: uppercase;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.cs h2 {
  font-size: clamp(23px, 3vw, 29px);
  margin-bottom: 14px;
  max-width: 760px;
}

/* Narrow text measure, wide media — editorial rhythm */
.cs p {
  max-width: 680px;
  font-size: 16px;
  margin-bottom: 12px;
}

/* ---------- Media blocks (video / gif / image) ---------- */
.media-block {
  margin-top: 44px;
}

.media-block video,
.media-block img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* For media with its own framing (illustrations, diagrams):
   drop the border but keep the shared 10px radius */
.media-block.bare video,
.media-block.bare img {
  border: none;
}

/* Illustrations & near-square media: constrain and center */
.media-block.narrow video,
.media-block.narrow img {
  max-width: 720px;
  margin: 0 auto;
}

.media-caption {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.media-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  margin-top: 44px;
}

.media-pair > div { min-width: 0; }

.media-pair video,
.media-pair img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Borderless pair: white-bg diagrams blend into the page */
.media-pair.bare video,
.media-pair.bare img {
  border: none;
  border-radius: 0;
}

/* Equalize heights when the two media have different aspect ratios */
.media-pair.equal video,
.media-pair.equal img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
}

@media (max-width: 760px) {
  .media-pair { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Stats row (grey panel, like live .results-grid) ---------- */
.stat-row {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 44px;
  background: var(--panel);
  border-radius: 10px;
  padding: 44px 48px;
}

.stat-row .stat { flex: 1 1 160px; text-align: center; }

.stat-row .stat .num {
  font-size: 48px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.1;
}

.stat-row .stat .cap {
  font-size: 14px;
  color: var(--muted);
  margin: 8px auto 0;
  max-width: 240px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .stat-row { padding: 32px; gap: 28px; }
}

/* ---------- Full-case-study note ---------- */
.full-cs-note {
  margin: 112px 0 0;
  padding: 0 24px 96px;
  text-align: center;
}

.full-cs-note .cs-label {
  margin-bottom: 8px;
}

.full-cs-note p {
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto;
  font-size: 15px;
}

.full-cs-note a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}

/* ============================================================
   PRIOR-WORK SLIDESHOWS (.pw-*)
   A scrolling page of themed sections; each project is a row of
   horizontally sliding cards. Touch/trackpad swipe is native via
   scroll-snap; arrow buttons enhance desktop. Reusable: wrap slides
   in .pw-slide inside .pw-track inside .pw-slideshow.
   ============================================================ */
.pw-section { padding-top: 72px; }
.pw-section:last-of-type { padding-bottom: 88px; }

/* Divider: a rule that extends from the section label so the two
   read as one connected element between consecutive main sections. */
.pw-section + .pw-section .cs-label {
  display: flex;
  align-items: center;
  gap: 20px;
}
.pw-section + .pw-section .cs-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.pw-section-intro {
  color: var(--muted);
  max-width: 680px;
  margin: 10px 0 0;
}

.pw-project { margin-top: 44px; }

.pw-project-head { max-width: 680px; margin-bottom: 20px; }
.pw-project-head h2 { margin-bottom: 8px; }
.pw-project-head p { color: var(--muted); margin: 0; }

.pw-slideshow { position: relative; }

.pw-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overflow-anchor: none;
  padding-bottom: 4px;
}
.pw-track::-webkit-scrollbar { display: none; }

.pw-slide {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
}

/* Filmstrip: every slide shares one height, widths follow the media's
   natural aspect — no letterboxing across mixed portrait/landscape. */
.pw-slide img,
.pw-slide video {
  display: block;
  height: clamp(300px, 46vh, 440px);
  width: auto;
  max-width: min(760px, 86vw);
  object-fit: cover;
  background: var(--panel, #f1f1f1);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Wide diagrams: show the whole image (no side-cropping) within a slightly
   roomier cap; the panel bg fills the letterbox. */
.pw-slide img.pw-wide {
  object-fit: contain;
  max-width: min(960px, 92vw);
}

/* Chair profile: tighten the wide empty margins, biased a touch to the left. */
.pw-slide img.pw-crop-chair {
  aspect-ratio: 1.55 / 1;
  object-position: 58% 50%;
}

.pw-slide figcaption {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
/* In case-study slideshows the captions carry real explanation, so cap their
   width to a readable measure — otherwise a long one-liner sizes the slide. */
.cs .pw-slide figcaption { max-width: 560px; white-space: normal; }

/* Arrow controls — centered over the media, just inside the edges */
.pw-arrow {
  position: absolute;
  top: clamp(150px, 23vh, 220px);
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: opacity 0.2s ease, background 0.2s ease;
}
/* The ‹ › glyphs carry asymmetric side bearings; nudge each back toward
   the optical center of the circle. */
.pw-prev { left: -26px; padding-right: 2px; }
.pw-next { right: -26px; padding-left: 2px; }
.pw-arrow:hover { background: #fafafa; }
.pw-arrow:disabled { opacity: 0; pointer-events: none; }
.pw-no-overflow .pw-arrow { display: none; }

@media (max-width: 600px) {
  .pw-section { padding-top: 56px; }
  .pw-slide { width: 86%; }
  .pw-arrow { display: none; }
}

/* ============================================================
   RESPONSIVE SCALE & BREAKPOINTS
   One documented breakpoint set, used across the component
   library below so every case study scales the same way:
     Wide desktop  >= 1680px  roomier content column + hero media
     Base/desktop  <= 1040px  content column (--max)
     Tablet        <= 900px   3-col grids collapse to 2
     Mobile        <= 600px   grids/splits collapse to 1, tighter gutters
   (Existing home/about/meta components keep their 760px collapse.)
   ============================================================ */
@media (min-width: 1680px) {
  :root { --max: 1160px; }
  .cs-hero-media { max-width: 960px; }
  .hero-band img,
  .hero-band video { max-width: 1000px; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  .cs { padding-top: 64px; }
  .stat-row { padding: 28px 24px; gap: 24px; }
}

/* ============================================================
   CASE-STUDY COMPONENT LIBRARY
   Reusable building blocks. Compose with the base case-study
   rhythm (.cs / .cs-label / .cs h2 / .cs p). Each block lists
   its intended markup so new case studies can reuse it directly.
   ============================================================ */

/* Light-grey hero theme — add class="cs-theme-grey" to <body>.
   Header + hero share the band colour so grey "fills the top".
   Override the shade per page with --hero-band. */
.cs-theme-grey .site-header,
.cs-theme-grey .cs-hero { background: var(--hero-band, #f1f1f1); }

/* Full-bleed band — runs a background edge-to-edge while its
   content stays within --max. Set --band-bg to theme the fill.
   <div class="cs-band"><div class="cs-band-inner">…</div></div> */
.cs-band {
  background: var(--band-bg, var(--panel));
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: clamp(40px, 5vw, 64px) 24px;
  margin-top: 44px;
}
.cs-band-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.cs-band-inner img,
.cs-band-inner video { display: block; width: 100%; }

/* Responsive captioned figure grid — default 3 cols; add .cols-2
   or .cols-4, or set --cols. Collapses 3→2→1.
   <div class="cs-grid cols-2"><figure><img><figcaption>…</figure></div> */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.cs-grid.cols-2 { --cols: 2; }
.cs-grid.cols-4 { --cols: 4; }
.cs-grid figure { margin: 0; display: flex; flex-direction: column; }
.cs-grid img,
.cs-grid video { width: 100%; display: block; border-radius: 10px; }
.cs-grid figcaption {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 900px) { .cs-grid:not(.cols-2) { --cols: 2; } }
@media (max-width: 600px) { .cs-grid { --cols: 1; } }

/* Evidence split — framed media beside stacked quote cards,
   aligned top & bottom.
   <div class="cs-evidence">
     <figure class="figure-overlay">…</figure>
     <div class="quote-stack"><figure class="quote-card">
       <p>…</p><figcaption>…</figcaption></figure></div>
   </div> */
.cs-evidence {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 32px;
  align-items: stretch;
  margin-top: 32px;
}
/* The support quotes read as one card rather than competing boxes. */
.quote-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 24px;
}
.quote-card {
  margin: 0;
  padding: 22px 0;
}
.quote-card p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink); max-width: none; }
.quote-card cite,
.quote-card figcaption {
  margin-top: 10px;
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
@media (max-width: 720px) {
  .cs-evidence { grid-template-columns: 1fr; gap: 24px; }
  .cs-evidence .figure-overlay { max-width: 360px; }
}

/* Media figure with an overlaid caption pill (e.g. "Original interface").
   <figure class="figure-overlay"><video>…<figcaption>…</figcaption></figure> */
.figure-overlay { position: relative; margin: 0; }
.figure-overlay > img,
.figure-overlay > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.figure-overlay figcaption {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
}

/* Diagram fill — a soft panel behind a diagram/illustration.
   <div class="diagram-fill"><img …></div> */
.diagram-fill {
  background: var(--panel);
  border-radius: 10px;
  padding: clamp(24px, 4vw, 40px) 24px;
  margin-top: 32px;
}
.diagram-fill img { display: block; width: 100%; height: auto; margin: 0 auto; }
.diagram-fill:has(.mc-before-after) { padding: clamp(14px, 2vw, 22px) 16px; }
