/* ─────────────────────────────────────────────────────────────────────────────
   editorial.css — the case-study design language
   Ink on white paper (light, default) · the same restraint on near-black (dark).
   Chunking is done with typography, whitespace, and hairline rules — no cards,
   no gradients, no pills, no border-radius. Each case study links this after
   shared.css and overrides only --accent / --accent-dim (both themes) plus its
   page-specific components in css/{slug}-case-study.css.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --text: #111110;              /* headings: near black */
  --text-muted: #3f3e39;        /* body text: dark gray */
  --faint: #6e6c64;             /* labels, captions, meta — 5.3:1 on white (AA small text) */
  --accent: #111110;            /* pages override with their ink-strength color */
  --accent-dim: rgba(17, 17, 16, 0.05);
  --border: #e8e6e0;            /* hairlines */
  --ph-bg: #fbfaf8;             /* media placeholder / code fill */
  --nav-bg: rgba(255, 255, 255, 0.88);
  --shadow: 0 1px 2px rgba(17, 17, 16, 0.05), 0 12px 32px rgba(17, 17, 16, 0.09);
}

[data-theme="dark"] {
  --bg: #101114;
  --text: #f4f2ec;
  --text-muted: #b4b2aa;
  --faint: #8b897f;             /* 5.4:1 on the dark bg (AA small text) */
  --accent: #f4f2ec;
  --accent-dim: rgba(244, 242, 236, 0.05);
  --border: #25262b;
  --ph-bg: #16171b;
  --nav-bg: rgba(16, 17, 20, 0.86);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5);
}

body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.wrap {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(24px, 8vw, 120px);
}

/* ── Text links (the only "button") ── */
.text-link {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Hero: one column, type does the work ── */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: calc(64px + clamp(56px, 9vw, 112px)) clamp(24px, 8vw, 120px) 0;
}

.hero-meta {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin-bottom: 1.75rem;
}

.hero-copy h1 {
  font-family: "Syne", sans-serif;
  font-size: clamp(3rem, 8vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.hero-copy h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-desc {
  max-width: 38rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.65;
  color: var(--text-muted);
}

.hero-tools {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.hero-visual {
  margin: clamp(48px, 7vw, 80px) 0 0;
}

.hero-visual img {
  width: 100%;
  box-shadow: var(--shadow);
}

/* ── Media placeholders (removed once real assets land) ── */
.media-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1.5rem;
  border: 1px dashed var(--faint);
  background: var(--ph-bg);
}

.media-ph p {
  font-size: 0.85rem;
  color: var(--faint);
  max-width: 26rem;
}

.media-ph-tag {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.media-ph--hero  { aspect-ratio: 16 / 9; }
.media-ph--video { aspect-ratio: 16 / 9; }
.media-ph--shot  { aspect-ratio: 4 / 3; }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.shot-grid img {
  width: 100%;
  box-shadow: var(--shadow);
}

/* ── Dividers: hairlines, plus one short editorial break ── */
.page-divider,
.s-divider {
  border: 0;
  border-top: 1px solid var(--border);
  max-width: 1080px;
  margin-inline: auto;
}

.page-divider { margin-top: clamp(48px, 7vw, 80px); }

.sub-divider {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: clamp(24px, 8vw, 120px);
  display: flex;
  justify-content: center;
}

.sub-divider span {
  width: 48px;
  height: 2px;
  background: var(--text);
}

.top-block { margin-top: clamp(48px, 7vw, 80px); }

/* ── Stats: bare numbers between hairlines ── */
.stat-wrap { margin: clamp(40px, 6vw, 64px) auto clamp(32px, 5vw, 56px); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat { text-align: left; }

.stat-value {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin-top: 0.2rem;
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ── Section layout: marginal label + reading column ── */
.layout {
  max-width: 1080px;
  padding: 0 clamp(24px, 8vw, 120px);
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: clamp(22px, 4vw, 48px);
}

.section-gap { margin: clamp(72px, 10vw, 120px) auto; }

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  padding-top: 0.5rem;
}

.section-body h2 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  max-width: 24em;
}

.section-body p { max-width: 64ch; }

.section-body p + p,
.section-body p + .phase-list,
.section-body p + .decision-grid,
.section-body p + .bullet-list,
.section-body p + .media-ph,
.section-body p + .shot-grid,
.section-body .phase-list + p,
.section-body .decision-grid + p,
.section-body .bullet-list + p,
.section-body .callout + p,
.section-body .media-ph + p,
.section-body .deep-dive {
  margin-top: 1rem;
}

.section-body .decision-grid + .callout,
.section-body .bullet-list + .callout,
.section-body p + .callout {
  margin-top: 2rem;
}

.section-body h3.diagram-title {
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.01em;
  margin: 2.5rem 0 1rem;
}

.section-body h3.diagram-title:first-of-type { margin-top: 1.75rem; }

.section-body p,
.tldr-text,
.bullet-list li,
.decision-card p,
.phase-content p {
  color: var(--text-muted);
}

.section-body code {
  font-size: 0.85em;
  padding: 0.05em 0.3em;
  border: 1px solid var(--border);
  background: var(--ph-bg);
}

/* ── Callouts: a thin rule in the margin, nothing else ── */
.callout {
  padding: 0.2rem 0 0.2rem 1.4rem;
  border-left: 2px solid var(--text);
}

.callout--accent { border-left-color: var(--accent); }

.callout p { max-width: 60ch; }

/* ── Decisions: two columns of type, ruled like a broadsheet ── */
.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 2.5rem;
  align-items: start;
}

.decision-card {
  border-top: 1px solid var(--text);
  padding-top: 1rem;
}

.decision-card h4,
.phase-content h4 {
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  line-height: 1.25;
  margin-bottom: 0.55rem;
}

.decision-card p { font-size: 0.92rem; }

/* ── Phase list: bare numerals, hairline rows ── */
.phase-list { list-style: none; }

.phase-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
}

.phase-item:last-child { border-bottom: 1px solid var(--border); }

.phase-num {
  font-family: "Syne", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.bullet-list { padding-left: 1.15rem; }
.bullet-list li { max-width: 62ch; }
.bullet-list li + li { margin-top: 0.65rem; }
.bullet-list li::marker { color: var(--faint); }

/* ── CTA: an ending, not a banner ── */
.cta-section {
  max-width: 1080px;
  margin: 0 auto clamp(64px, 9vw, 96px);
  padding: 0 clamp(24px, 8vw, 120px);
}

.cta-inner {
  border-top: 1px solid var(--text);
  padding-top: clamp(28px, 4vw, 40px);
}

.cta-inner h2 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
}

.cta-inner p {
  color: var(--text-muted);
  margin-top: 0.6rem;
  max-width: 40rem;
}

.cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.6rem;
}

footer { margin-top: 2rem; }

/* ── Responsive ── */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .section-label { padding-top: 0; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2rem; }
}

@media (max-width: 680px) {
  .hero { padding-inline: 1.25rem; }

  .wrap,
  .layout,
  .cta-section,
  .sub-divider { padding-inline: 1.25rem; }

  .decision-grid,
  .shot-grid { grid-template-columns: 1fr; }

  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1.5rem; }

  .phase-item { grid-template-columns: 40px 1fr; }
}

@media (max-width: 767px) {
  .tldr-strip,
  .decision-grid { grid-template-columns: 1fr; }

  .tldr-item { border-bottom: 0; }

  .hero,
  .wrap,
  .layout,
  .cta-section { width: 100%; max-width: 100%; }

  .hero-copy h1,
  .section-body h2,
  .cta-inner h2 { overflow-wrap: anywhere; }
}
