/* ==========================================================================
   Case study page
   The handoff has no board for this page, so it is assembled out of the
   pieces the boards do define: the 56px inner gutter, the bloom field, the
   glass-rimmed shot, Archivo Narrow index numbers, and the tag pills.
   ========================================================================== */

.case-page { padding: 0 0 0; }

/* --- Back link ---------------------------------------------------------- */

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0 var(--gutter);
  font-family: var(--narrow);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--slate);
}

.case-back:hover { color: var(--crowdflower); }
.case-back svg { display: block; transition: transform 240ms var(--ease-zoom); }
.case-back:hover svg { transform: translateX(-4px); }

/* --- Case hero ---------------------------------------------------------- */

.case-hero { padding: 34px var(--gutter) 0; }

.case-hero__title {
  margin: 0 0 0 -0.081em;   /* same measured bearing as the homepage h1 */
  font-size: clamp(38px, 6.6vw, 145px);
  font-weight: 600;
  letter-spacing: -0.052em;
  line-height: 0.92;
  max-width: 17ch;
}

.case-hero__lede {
  margin: 30px 0 0;
  max-width: 620px;
  font-size: 19px;
  font-weight: 450;
  letter-spacing: -0.014em;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* --- Meta rail ---------------------------------------------------------- */

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin-top: 46px;
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.case-meta__cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.case-meta__key {
  font-family: var(--narrow);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--grey-mid);
}

.case-meta__val {
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.012em;
}

.case-meta__val a { color: var(--crowdflower); }
.case-meta__val a:hover { color: var(--ultramarine); }

/* --- Figures ------------------------------------------------------------ */

.case-figure {
  --grain-alpha: 0.11;
  position: relative;
  margin: 46px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
  padding: clamp(20px, 4vw, 56px);

  /* The same sky as the cards on the homepage, in this case's colour.
     It also retires the `--neutral` workaround: David's figures were
     given a flat grey field because his brand blue was a near-miss
     against the site's own blue. With the ground in his teal there is
     nothing left to clash with. */
  --case-accent: #2A3A6B;
  background-color: var(--case-accent);
  background-image: url('../assets/case-clouds.jpg');
  background-size: cover;
  background-position: 50% 42%;
  background-blend-mode: luminosity;
}

.case-figure::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 46%,
    rgba(0, 0, 0, 0) 38%,
    rgba(0, 0, 0, 0.22) 78%,
    rgba(0, 0, 0, 0.38) 100%);
}

.case-page--prevencion .case-figure { --case-accent: #2A3A6B; }
.case-page--david      .case-figure { --case-accent: #0C4F5E; }
.case-page--balerco    .case-figure { --case-accent: #A85516; }

.case-figure--tall { min-height: 440px; }

.case-figure__shot {
  position: relative;
  width: 980px;
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.78);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 2px 8px -2px rgba(12,18,40,0.18),
    0 34px 70px -28px rgba(12,18,40,0.52);
}

.case-figure__shot img { display: block; width: 100%; height: auto; }

.case-figure__caption {
  margin: 14px var(--gutter) 0;
  font-family: var(--narrow);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--grey-mid);
}

/* An image that has not been exported yet. Deliberately a placeholder, in
   the same language as the photography tiles and the CTA portrait. */
.case-slot {
  position: relative;
  width: 100%;
  min-height: 300px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.7);
  background: linear-gradient(152deg, #27304A 0%, #151B2B 50%, #0D1018 100%);
  display: flex;
  align-items: flex-end;
  padding: 18px;
}

.case-slot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(86% 66% at 28% 20%, rgba(176,196,255,0.26) 0%, rgba(176,196,255,0) 70%);
}

.case-slot span {
  position: relative;
  z-index: 1;
  font-family: var(--narrow);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.68);
}

.case-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  position: relative;
}

/* Slides sit in the grid as flat artwork, rimmed the same way the hero
   shot is so the two figures read as one family. */
.case-slots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 2px 8px -2px rgba(12,18,40,0.22), 0 24px 50px -22px rgba(12,18,40,0.45);
}

/* --- Body chapters ------------------------------------------------------ */

.case-chapter {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 0 56px;
  padding: 64px var(--gutter) 0;
  max-width: 1440px;
}

.case-chapter__index {
  font-family: var(--narrow);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--slate);
  padding-top: 10px;
}

.case-chapter__index b {
  display: block;
  color: var(--ultramarine);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 7px;
}

.case-chapter__body { max-width: 680px; }

.case-chapter__head {
  margin: 0 0 0 -0.078em;
  font-size: clamp(28px, 3.1vw, 68px);
  font-weight: 600;
  letter-spacing: -0.042em;
  line-height: 1.02;
}

.case-chapter__body p {
  margin-top: 22px;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}

.case-chapter__body p strong { color: var(--onyx); font-weight: 560; }

/* --- Built list --------------------------------------------------------- */

.built {
  margin-top: 30px;
  border-top: 1px solid var(--hairline);
}

.built__row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-faint);
}

.built__no {
  flex-shrink: 0;
  width: 34px;
  font-family: var(--narrow);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--grey-mid);
  font-variant-numeric: tabular-nums;
}

.built__what { font-size: 15.5px; letter-spacing: -0.012em; }
.built__what i { display: block; font-style: normal; color: var(--slate); font-size: 14px; margin-top: 4px; }

/* --- Result stats ------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 34px;
}

.stats__cell {
  border-top: 2px solid var(--onyx);
  padding-top: 16px;
}

.stats__n {
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stats__n--empty { color: var(--dot-off); }

.stats__k {
  margin-top: 12px;
  font-family: var(--narrow);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--slate);
  line-height: 1.45;
}

.placeholder-note {
  margin: 18px 0 0;
  font-family: var(--narrow);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--grey-mid);
}

/* --- Scope strip -------------------------------------------------------- */

.scope {
  margin: 72px var(--gutter) 0;
  border-top: 1px solid var(--hairline);
  padding-top: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}

.scope__tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Next case ---------------------------------------------------------- */

.next-case {
  display: block;
  margin-top: 64px;
  padding: 54px var(--gutter) 60px;
  background: var(--onyx);
  color: var(--paper);
}

.next-case__label {
  font-family: var(--narrow);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--grey-dark);
}

.next-case__row {
  margin-top: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.next-case__name {
  margin: 0 0 0 -0.062em;
  font-size: clamp(34px, 4.6vw, 101px);
  font-weight: 600;
  letter-spacing: -0.048em;
  line-height: 0.96;
}

.next-case__arrow {
  flex-shrink: 0;
  color: var(--signal);
  transition: transform 300ms var(--ease-zoom);
}

.next-case:hover .next-case__arrow { transform: translateX(10px); }
.next-case:hover .next-case__name { color: var(--signal); }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 900px) {
  .case-chapter {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding-top: 48px;
  }
  .case-chapter__index { padding-top: 0; }
  .case-chapter__index b { display: inline; margin: 0 8px 0 0; }

  .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .case-slots { grid-template-columns: minmax(0, 1fr); }
  .case-figure--tall { min-height: 0; }
  .stats { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .next-case__row { gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .case-back svg,
  .next-case__arrow { transition: none; }
}

/* Was a style attribute on the paragraph itself. Moved here so the pages
   carry no inline style at all, which is what lets the CSP ship without
   `style-src 'unsafe-inline'`. Same values, same rendering. */
.scope__note {
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--ink-soft);
}
