/* ============================================================
   Shared case-study layout, narrative/editorial format.

   Used by every case study in /work. White canvas, everything
   left-aligned, a sticky chapter rail on the left and a content
   column that scrolls past it. Type is deliberately flat:
   28 / 24 / 18 / 16. No display sizes; the visuals carry the
   scale, the words stay quiet.

   Per-project pages override ONLY --accent (and occasionally
   --well) in a small inline <style>. Everything structural
   lives here, so a layout change is one edit and not five.
   ============================================================ */
:root{
  --bg:#FFFFFF;
  --ink:#2C2C2C;
  --ink-deep:#181818;
  --ink-soft:#6B6B6B;
  --ink-quiet:#9C9CA9;
  --well:#F8F8F9;
  --line:#ECECEF;
  --accent:#1e3a8a;
  --ease:cubic-bezier(0.22,1,0.36,1);
}

html{ background:var(--bg); }
body.dv-page{
  background:var(--bg);
  color:var(--ink);
  font-family:'Switzer',sans-serif;
  font-weight:400;
}

/* ---------- type scale ---------- */
.dv-title{ font-size:28px; font-weight:600; line-height:1.15; margin:0; color:var(--ink); }
.dv-h2{ font-size:24px; font-weight:600; line-height:1.25; margin:0; color:var(--ink); }
.dv-body{ font-size:16px; font-weight:400; line-height:1.75; margin:0; color:var(--ink); }
.dv-meta{ font-size:16px; font-weight:300; line-height:1.6; margin:0; color:var(--ink-soft); }
.dv-body + .dv-body{ margin-top:18px; }
.dv-body em{ font-style:normal; font-weight:500; color:var(--ink-deep); }
.dv-body strong{ font-weight:600; color:var(--ink-deep); }

/* ---------- layout ----------
   Two columns for the whole page: a sticky chapter rail on the left
   that stays put, and the content column that scrolls past it. */
.dv-shell{
  max-width:1268px;
  margin:0 auto;
  padding:0 24px;
  display:grid;
  grid-template-columns:230px minmax(0,1fr);
  column-gap:70px;
  align-items:start;
}
.dv-rail{
  position:sticky;
  top:96px;
  align-self:start;
  /* margin, not padding: the box must START level with the hero title
     (150) and only pin once scrolling brings it up to 96. */
  margin-top:150px;
}
.dv-content{ min-width:0; }
.dv-wrap{ max-width:none; margin:0; padding:0; }

/* ---------- the chapter nav ---------- */
.dv-rail-label{ margin-bottom:18px; }
.dv-nav{ display:flex; flex-direction:column; }
.dv-nav a{
  display:grid;
  grid-template-columns:26px 1fr;
  gap:8px;
  align-items:baseline;
  padding:7px 0 7px 12px;
  margin-left:-13px;
  font-size:15px;
  font-weight:400;
  line-height:1.4;
  color:var(--ink-soft);
  text-decoration:none;
  border-left:1px solid transparent;
  transition:color .35s var(--ease), border-color .35s var(--ease);
}
.dv-nav a .n{ font-size:11px; font-weight:400; color:var(--ink-quiet); transition:color .35s var(--ease); }
.dv-nav a:hover{ color:var(--ink); }
.dv-nav a.is-active{ color:var(--ink-deep); font-weight:500; border-left-color:var(--accent); }
.dv-nav a.is-active .n{ color:var(--accent); }
.dv-rail-role{
  margin-top:24px;
  padding-top:18px;
  border-top:1px solid var(--line);
  font-size:11px;
  font-weight:300;
  line-height:1.6;
  color:var(--ink-quiet);
}

/* ---------- chapters ---------- */
.dv-chapter{ margin-top:132px; scroll-margin-top:90px; }
.dv-ch-head{ border-top:1px solid var(--line); padding-top:22px; margin-bottom:30px; }
.dv-ch-kicker{
  display:block;
  font-size:11px;
  font-weight:400;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--ink-quiet);
  margin-bottom:14px;
}
.dv-ch-kicker .n{ color:var(--accent); margin-right:10px; }
.dv-ch-head .dv-h2{ max-width:24ch; }
.dv-ch-problem{ background:var(--well); padding:22px 24px; margin-top:22px; }
.dv-ch-problem p{ margin:0; font-size:18px; font-weight:500; line-height:1.55; color:var(--ink-deep); }
.dv-ch-problem .lbl{
  display:block;
  font-size:11px;
  font-weight:400;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--ink-quiet);
  margin-bottom:9px;
}

.dv-sec{ margin-top:56px; }
.dv-sec > * + *{ margin-top:22px; }
img,video{ max-width:100%; display:block; }

/* fixed chrome */
.dv-back{
  position:fixed; top:24px; left:24px; z-index:60;
  display:inline-flex; align-items:center; gap:8px;
  background:#fff; border:1px solid var(--line); border-radius:40px;
  padding:9px 18px; font-size:16px; font-weight:300; color:var(--ink-soft);
  text-decoration:none; transition:color .4s var(--ease), transform .4s var(--ease);
}
.dv-back:hover{ color:var(--ink); transform:translateX(-3px); }
.dv-logo{
  position:fixed; top:28px; right:32px; z-index:60;
  font-size:20px; font-weight:500; color:var(--ink); text-decoration:none;
}
.dv-logo .logo-accent{ color:#57bd5a; }

/* ---------- hero ---------- */
.dv-hero{ max-width:none; margin:0; padding:150px 0 0; }
.dv-hero .dv-title{ margin-bottom:20px; }
.dv-hero .dv-body{ max-width:62ch; }

/* ---------- media ---------- */
.dv-well{ background:var(--well); padding:56px 40px; display:flex; justify-content:center; }
/* Capped like .dv-media below: a portrait hero at full well width runs taller
   than the screen, and a hero you cannot see all of is not a hero. */
.dv-well video, .dv-well img{
  display:block; width:auto; height:auto; max-width:100%; max-height:72vh;
}
/* Cap the height as well as the width. A 9:16 placement at full content
   width renders around 1600px tall, which is the "very big image" problem:
   the piece stops being a figure in a page and becomes the page. */
.dv-media{ margin-top:26px; text-align:center; }
.dv-media img, .dv-media video{
  display:block; margin:0 auto; width:auto; height:auto;
  max-width:100%; max-height:72vh;
}
/* A featured-style frame: same 16/10 and 14px radius as the home page
   cards, for when a piece should sit in the layout rather than lead it. */
.dv-frame{
  display:block; position:relative; overflow:hidden;
  border-radius:14px; background:var(--well); aspect-ratio:16/10; margin-top:26px;
}
.dv-frame img, .dv-frame video{ width:100%; height:100%; object-fit:cover; display:block; }
.dv-two{ display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:26px; }
.dv-two img{ width:100%; height:auto; }

/* ---------- figures + lightbox (Endeavor media pass) ---------- */
.dv-fig{ margin:26px 0 0; }
.dv-fig > .dv-well, .dv-fig > .dv-media, .dv-fig > .dv-diagram{ margin-top:0; }
.dv-fig figcaption{ margin-top:10px; font-size:12.5px; line-height:1.55; color:var(--ink-quiet); }
.dv-two figure{ margin:0; }
a.dv-zoom{ display:block; cursor:zoom-in; }
a.dv-zoom:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }
/* One visible ring for every keyboard stop on the page. */
.dv-nav a:focus-visible, .dv-back:focus-visible, .dv-logo:focus-visible,
.dv-cta:focus-visible, .dv-next-card:focus-visible, .dv-foot a:focus-visible{
  outline:2px solid var(--accent); outline-offset:3px;
}
.dv-lightbox{
  position:fixed; inset:0; z-index:90; background:rgba(20,18,15,0.93);
  display:flex; align-items:center; justify-content:center; padding:4vh 4vw;
  opacity:0; pointer-events:none; transition:opacity .22s ease;
}
.dv-lightbox.open{ opacity:1; pointer-events:auto; }
.dv-lightbox img{ max-width:100%; max-height:100%; display:block; cursor:zoom-out; }
@media (prefers-reduced-motion: reduce){ .dv-lightbox{ transition:none; } }

/* ---------- numbered objective rows ---------- */
.dv-rows{ margin-top:30px; }
.dv-row{
  background:var(--well);
  display:flex; align-items:center; justify-content:space-between; gap:32px;
  padding:26px 28px; min-height:101px;
}
.dv-row + .dv-row{ margin-top:20px; }
.dv-row p{ margin:0; font-size:16px; line-height:1.6; color:var(--ink); max-width:70ch; }
.dv-row-num{ font-size:40px; font-weight:600; line-height:1; color:#D9D9DE; flex:none; }

/* ---------- deep-dive: heading left, body right ---------- */
.dv-dive{
  display:grid;
  grid-template-columns:330px minmax(0,1fr);
  gap:0 70px;
  align-items:start;
  margin-top:72px;
}
.dv-dive .dv-h2{ line-height:1.33; font-size:20px; }
.dv-dive-body > * + *{ margin-top:18px; }

/* ---------- side-by-side definitions ---------- */
.dv-defs{ display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-top:26px; }
.dv-def{ padding-left:12px; border-left:2px solid var(--line); }
.dv-def p{ margin:0; font-size:16px; line-height:1.65; color:#212121; }

/* ---------- diagrams ---------- */
.dv-diagram{ background:var(--well); padding:44px 40px; margin-top:26px; }
.dv-diagram svg{ width:100%; height:auto; display:block; }

/* ---------- outcome stat rows ---------- */
.dv-stat{
  background:var(--well);
  display:flex; align-items:center; justify-content:space-between; gap:32px;
  padding:30px 28px; min-height:124px;
}
.dv-stat + .dv-stat{ margin-top:16px; }
.dv-stat p{ margin:0; font-size:16px; line-height:1.6; color:var(--ink); max-width:64ch; }
.dv-stat-num{ font-size:40px; font-weight:600; line-height:1; color:var(--ink); flex:none; }
/* Statement-first display item (Endeavor 06: changes, not counts). */
.dv-stat-line{ font-size:24px; font-weight:600; line-height:1.3; letter-spacing:-0.01em; color:var(--ink); flex:none; max-width:16ch; text-wrap:balance; }
.dv-stat-line + p{ max-width:44ch; }
.dv-h2 + .dv-list{ margin-top:18px; }

/* ---------- next project ---------- */
.dv-next{ margin-top:110px; padding-bottom:110px; }
.dv-next-card{ margin-top:26px; }
.dv-next-card img{ width:100%; height:auto; }
.dv-cta{
  display:inline-block; margin-top:30px;
  font-size:16px; font-weight:500; color:var(--accent); text-decoration:none;
  border-bottom:1px solid rgba(30,58,138,.3); padding-bottom:2px;
  transition:border-color .3s var(--ease);
}
.dv-cta:hover{ border-color:var(--accent); }
.dv-foot{
  border-top:1px solid var(--line);
  margin-top:90px; padding:34px 0 0;
  font-size:12px; font-weight:300; color:var(--ink-quiet);
}

/* ---------- brand: colour palette ----------
   Swatch over spec. The hex values on these pages were sampled out of the
   artwork itself rather than picked afterwards, so the palette documents
   what was actually used. */
.dv-pal{ display:grid; grid-template-columns:repeat(5,1fr); gap:16px; margin-top:26px; }
.dv-sw{ margin:0; }
.dv-sw-chip{ display:block; height:104px; border-radius:3px; border:1px solid rgba(24,22,19,.08); }
.dv-sw b{ display:block; margin-top:12px; font-size:14px; font-weight:500; color:var(--ink); }
.dv-sw span{ display:block; margin-top:3px; font-size:11px; letter-spacing:.12em; color:var(--ink-quiet); }
.dv-sw em{ display:block; margin-top:7px; font-style:normal; font-size:13px; line-height:1.5; color:var(--ink-soft); }

/* ---------- brand: type specimen ---------- */
.dv-spec{ background:var(--well); padding:34px 32px; margin-top:26px; }
.dv-spec + .dv-spec{ margin-top:16px; }
.dv-spec-face{ margin:0; color:var(--ink-deep); line-height:1.05; letter-spacing:-.02em; }
.dv-spec-meta{ margin:16px 0 0; font-size:13px; letter-spacing:.1em; color:var(--ink-quiet); }

/* ---------- brand: rules ---------- */
.dv-rules{ display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:26px; }
.dv-rule{ padding:20px 22px; background:var(--well); }
.dv-rule .lbl{
  display:block; font-size:11px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--ink-quiet); margin-bottom:12px;
}
.dv-rule ul{ margin:0; padding-left:18px; }
.dv-rule li{ font-size:15px; line-height:1.65; color:var(--ink); }
.dv-rule li + li{ margin-top:8px; }

/* Bulleted body copy (Endeavor rebuild: lists carry most of the body). */
.dv-list{ margin:0; padding-left:22px; list-style:none; }
.dv-list li{
  font-size:16px; font-weight:400; line-height:1.75; color:var(--ink);
  position:relative; max-width:70ch;
}
.dv-list li::before{ content:"\00B7"; position:absolute; left:-18px; font-weight:600; color:var(--ink-quiet); }
.dv-list li + li{ margin-top:12px; }
.dv-body + .dv-list, .dv-list + .dv-body{ margin-top:18px; }

/* ---------- brand: tile grid for a set of pieces ---------- */
.dv-tiles{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-top:26px; }
.dv-tiles figure{ margin:0; }
.dv-tiles img, .dv-tiles video{ width:100%; height:auto; display:block; border-radius:3px; }
/* Uniform tiles: every piece in the same frame regardless of its source
   ratio, so a row reads as a set rather than a ragged pile. */
.dv-tiles--tall img, .dv-tiles--tall video{ aspect-ratio:9/16; object-fit:cover; }
.dv-tiles--wide img, .dv-tiles--wide video{ aspect-ratio:16/10; object-fit:cover; }
.dv-tiles figcaption{ margin-top:10px; font-size:12px; letter-spacing:.1em; color:var(--ink-quiet); }
.dv-tiles--three{ grid-template-columns:repeat(3,1fr); }

/* A ratio comparison must NOT normalise the ratios. Matched height, natural
   width, so the actual shape of each placement is the thing being shown. */
.dv-ratios{
  display:flex; align-items:flex-end; justify-content:flex-start;
  gap:22px; margin-top:26px; flex-wrap:wrap;
}
.dv-ratios figure{ margin:0; }
/* 250px is the height at which 0.563 + 1 + 1.777 plus the gaps still fits
   one line of content width. Taller and the wide unit wraps, which reads as
   three unrelated images rather than one ad in three shapes. */
.dv-ratios img, .dv-ratios video{
  display:block; height:250px; width:auto; max-width:100%;
  border-radius:3px; background:var(--well);
}
.dv-ratios figcaption{ margin-top:10px; font-size:12px; letter-spacing:.1em; color:var(--ink-quiet); }
@media (max-width:940px){
  .dv-ratios img, .dv-ratios video{ height:240px; }
}
@media (max-width:640px){
  /* Stack rather than shrink. Flex was letting the three compete for one
     row and each settled at a different scale, which loses the comparison. */
  .dv-ratios{ display:block; }
  .dv-ratios figure + figure{ margin-top:20px; }
  .dv-ratios img, .dv-ratios video{ height:auto; width:100%; }
}

@media (max-width:940px){
  .dv-pal{ grid-template-columns:repeat(3,1fr); }
  .dv-tiles{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:640px){
  .dv-pal{ grid-template-columns:repeat(2,1fr); }
  .dv-rules{ grid-template-columns:1fr; }
  .dv-spec{ padding:22px 18px; }
}

/* ---------- responsive ---------- */
@media (max-width:1080px){
  .dv-shell{ grid-template-columns:1fr; column-gap:0; }
  .dv-rail{ position:static; margin-top:130px; margin-bottom:44px; }
  .dv-nav{ display:grid; grid-template-columns:1fr 1fr; gap:2px 26px; }
  .dv-nav a{ margin-left:0; padding-left:0; border-left:0; }
  .dv-nav a.is-active{ border-left:0; text-decoration:underline; text-underline-offset:4px; }
  .dv-rail-role{ margin-top:18px; }
  .dv-hero{ padding-top:0; }
}
@media (max-width:940px){
  .dv-dive{ grid-template-columns:1fr; gap:20px; margin-top:56px; }
  .dv-chapter{ margin-top:96px; }
}
@media (max-width:640px){
  .dv-shell{ padding:0 22px; }
  .dv-rail{ margin-top:96px; margin-bottom:36px; }
  .dv-two, .dv-defs{ grid-template-columns:1fr; }
  .dv-row, .dv-stat{ flex-direction:column; align-items:flex-start; gap:14px; }
  .dv-well, .dv-diagram{ padding:24px 18px; }
  /* Scroll the diagram rather than scale it: at 360 the SVG labels
     would render around 6px, which fails the readable-screens bar. */
  .dv-diagram{ overflow-x:auto; }
  .dv-diagram svg{ min-width:560px; }
  .dv-title{ font-size:24px; }
  .dv-h2{ font-size:20px; }
  .dv-back{ position:absolute; top:14px; left:14px; }
  .dv-logo{ position:absolute; top:18px; right:16px; }
  .dv-hero{ padding-top:0; }
}
