/* ==========================================================================
   Case studies. Same voice as the landing page: a big headline, a strip of
   facts, then the story in ruled sections with a label down the left.
   ========================================================================== */

.case-hero .shell { padding-block: clamp(40px, 6vw, 88px) var(--s-6); }

.case-hero .data { margin: 0 0 var(--s-4); }

.case-hero h1 { max-width: 14ch; margin-bottom: var(--s-4); }

.case-hero .lede { max-width: 56ch; }

/* Facts strip under every case title. */
.case-block .shell { padding-block: 0; }

.titleblock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-3) var(--s-5);
  margin: 0;
  padding-block: var(--s-4);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.titleblock > div { min-width: 0; }

.titleblock dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-meta);
  color: var(--red);
  margin-bottom: 2px;
}

.titleblock dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -.015em;
  line-height: 1.25;
}

/* --------------------------------------------------------- body */

.case-body { padding-block: clamp(48px, 6vw, 96px) var(--s-7); }

.case-section {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--s-4) var(--s-7);
  align-items: start;
  padding-block: clamp(32px, 4vw, 64px);
  border-top: 1px solid var(--rule);
}

.case-section:first-of-type { border-top: 0; padding-top: 0; }

.case-label {
  margin: 0;
  padding-top: .35em;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -.01em;
  color: var(--red);
  font-variation-settings: "opsz" 12, "wdth" 100;
}

.case-content h3 {
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.5rem);
  margin-bottom: var(--s-3);
}

.case-content > p { color: var(--ink-2); }

.case-content .case-subhead { margin-top: var(--s-6); }

/* Signal chain. Numbered because the order is real. */
.flow {
  list-style: none;
  counter-reset: step;
  margin: var(--s-5) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: var(--s-2);
}

.flow li {
  counter-increment: step;
  background: var(--bone-2);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-3) var(--s-4);
}

.flow li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -.04em;
  color: var(--red);
  margin-bottom: var(--s-2);
}

.flow b {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: 4px;
}

.flow span { font-size: 0.9375rem; color: var(--ink-3); line-height: 1.5; }

/* Measured facts. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 0 var(--s-5);
  margin: var(--s-5) 0 0;
  border-top: 2px solid var(--ink);
}

.facts > div {
  display: flex;
  flex-direction: column;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--rule);
}

.facts dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-meta);
  color: var(--red);
}

.facts dd {
  margin: var(--s-1) 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -.01em;
}

/* Numbered notes. */
.notes {
  list-style: none;
  counter-reset: note;
  margin: var(--s-4) 0 0;
  padding: 0;
}

.notes li {
  counter-increment: note;
  position: relative;
  display: block;
  padding: var(--s-3) 0 var(--s-3) 60px;
  border-top: 1px solid var(--rule);
  font-size: 1.0625rem;
  color: var(--ink-2);
}

.notes li::before {
  content: counter(note, decimal-leading-zero);
  position: absolute;
  top: calc(var(--s-3) + .1em);
  left: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -.04em;
  color: var(--red);
}

.notes b {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
}

/* Status panel, inverted. */
.callout {
  background: var(--navy);
  color: var(--on-navy);
  border-radius: var(--r-md);
  padding: clamp(20px, 2.6vw, 32px);
  margin-top: var(--s-5);
}

.callout .data { color: var(--red-lift); margin: 0 0 var(--s-2); }

.callout .data.next { margin-top: var(--s-4); }

.callout p { color: var(--on-navy); }

.callout .text-link { color: #fff; text-decoration-color: var(--red-lift); }

.callout .text-link:hover { color: var(--red-lift); }

/* Lead photograph under the facts strip. */
.case-lead { margin-top: var(--s-6); }

.case-lead img { aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 45%; }

.case-lead.is-tall img { aspect-ratio: 16 / 10; object-position: 50% 100%; }

/* --------------------------------------------------------- project nav */

.case-nav {
  border-top: 2px solid var(--ink);
  margin-top: var(--s-6);
}

.case-nav .shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0 var(--gutter);
}

.case-nav a {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5) var(--s-3);
  color: var(--ink);
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}

.case-nav a:first-child { padding-left: 0; }

.case-nav a:last-child {
  text-align: right;
  align-items: flex-end;
  border-left: 1px solid var(--rule);
  padding-right: 0;
}

.case-nav a:hover .case-nav-title { color: var(--red); }

.case-nav .data { color: var(--ink-3); }

.case-nav-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -.025em;
  transition: color var(--t-fast) var(--ease);
}

/* --------------------------------------------------------- 404 */

.notfound .shell {
  padding-block: clamp(64px, 10vw, 160px);
  max-width: 760px;
  margin-inline: 0;
  padding-left: var(--gutter);
}

.notfound h1 { margin-bottom: var(--s-4); }

.notfound .lede { margin-bottom: var(--s-6); }

.notfound ul {
  list-style: none;
  margin: var(--s-5) 0 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}

.notfound li { border-bottom: 1px solid var(--rule); }

.notfound li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 56px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  transition: color var(--t-fast) var(--ease), padding-left var(--t-fast) var(--ease);
}

.notfound li a:hover { color: var(--red); padding-left: var(--s-2); }

/* --------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .case-section { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  .case-label { padding-top: 0; }
}

@media (max-width: 720px) {
  .case-nav .shell { grid-template-columns: minmax(0, 1fr); }
  .case-nav a:last-child {
    text-align: left;
    align-items: flex-start;
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-left: 0;
  }
  .notes li { padding-left: 46px; }
}
