/* ── Problem section ──────────────────────────────────────────────
   Typographic cells, no card chrome. The accent colour appears once per
   cell, on the risk phrase only. The proof block below mirrors the MJOP risk
   card from pipeline/templates/report.html.j2 (amber left border and badge
   for a "medium" finding) and carries the page's only scroll reveal.

   Single source of truth for src/components/ProblemSection.tsx (homepage
   "THE PROBLEM" section) AND /{lang}/data (scripts/build-data-pages.mjs),
   which links a copy of this exact file (dist/problem-section.css, written
   by runDataBuild) instead of forking these rules. Only depends on custom
   properties this file defines itself (--problem-bg/--paper/--paper-rule/
   --mark, scoped to .problem-section) plus --muted/--border/--amber, which
   both src/index.css's :root and the static pages' own stylesheet
   (public/nl/vve-quickscan/styles.css) already define at the same values. */
.problem-section {
  --problem-bg: #faf7f1;
  --paper: #fffdf8;
  --paper-rule: #ece5d8;
  --mark: rgba(217, 119, 6, 0.2);
  background: var(--problem-bg);
  padding: 6rem 0;
}

.problem-inner {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.problem-eyebrow,
.problem-cell-label,
.proof-doc-label,
.proof-report-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.problem-title {
  max-width: 820px;
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.problem-sub {
  max-width: 620px;
  margin: 0 0 3.5rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.problem-cells {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4rem;
}

.problem-cell {
  padding: 2rem 0;
  border-top: 1px solid var(--paper-rule);
}

.problem-cell h3 {
  margin: 0 0 0.6rem;
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.problem-cell p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.problem-accent {
  font-style: normal;
  font-weight: 600;
  color: #b45309; /* darker than --amber so body-size text keeps AA contrast */
}

.problem-proof {
  margin: 3rem 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

/* /{lang}/data reuses problem-cells' even 2-column grid for its four
   proof-finding cards, combined with problem-proof's reveal (is-armed/
   is-shown, below). The class pair needs its own column split: the
   1.15fr/1fr ratio above is built for exactly two children (an MJOP-table
   paper on the left, one finding card on the right), not four equal cards.
   It also needs align-items back to the grid default (start): .problem-proof
   sets align-items: center for its own two children of differing height,
   which — across a row of two cards where one has a proof-finding-evidence
   line and the other doesn't — pushed the shorter card's top border/label
   down out of alignment with its row partner. */
.problem-cells.problem-proof {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.proof-paper {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--paper-rule);
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: 0 1px 0 var(--paper-rule);
}

.proof-table {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.proof-row {
  position: relative;
  display: grid;
  grid-template-columns: 6ch minmax(0, 1fr) 5ch 9ch;
  gap: 1rem;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--paper-rule);
}

.proof-row > span {
  position: relative; /* sit above the highlight */
  white-space: nowrap;
}

.proof-row > span:last-child {
  text-align: right;
}

.proof-item {
  overflow: hidden;
  text-overflow: ellipsis;
}

.proof-head {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.proof-row.is-hit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--mark);
  transform-origin: left center;
}

.proof-finding {
  min-width: 0;
}

.proof-finding-card {
  background: white;
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  padding: 1rem 1.15rem;
}

.proof-finding-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}

.proof-finding-name {
  font-weight: 700;
}

.proof-finding-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b45309;
}

.proof-finding-work {
  margin: 0 0 0.5rem;
  font-variant-numeric: tabular-nums;
}

.proof-nowrap {
  white-space: nowrap;
}

.proof-finding-evidence {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.proof-caption {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8rem;
}

.problem-closer {
  margin: 3rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 620px;
}

/* Reveal: only after ProblemSection (or /{lang}/data's data-counters.js) has
   armed it on the client. */
.problem-proof.is-armed .proof-paper,
.problem-proof.is-armed .proof-finding {
  opacity: 0;
}

.problem-proof.is-armed .proof-finding {
  transform: translateY(10px);
}

.problem-proof.is-armed .proof-row.is-hit::before {
  transform: scaleX(0);
}

.problem-proof.is-armed.is-shown .proof-paper {
  opacity: 1;
  transition: opacity 300ms ease-out;
}

.problem-proof.is-armed.is-shown .proof-row.is-hit::before {
  transform: scaleX(1);
  transition: transform 250ms ease-out 300ms;
}

.problem-proof.is-armed.is-shown .proof-finding {
  opacity: 1;
  transform: none;
  transition: opacity 200ms ease-out 700ms, transform 200ms ease-out 700ms;
}

@media (max-width: 767px) {
  .problem-section {
    padding: 4rem 0;
  }

  .problem-cells,
  .problem-proof,
  .problem-cells.problem-proof {
    grid-template-columns: 1fr;
  }

  .proof-paper {
    padding: 1rem 0.75rem;
  }

  .proof-row {
    gap: 0.6rem;
    grid-template-columns: 5ch minmax(0, 1fr) 4ch 8ch;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .problem-proof .proof-paper,
  .problem-proof .proof-finding,
  .problem-proof .proof-row.is-hit::before {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
