/* Finclus editorial system. Load fonts in <head>:
   https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap
   Scope: everything lives under .fx so it can sit inside existing pages without collisions. */

:root {
  --fx-ground: #f6f6f2;   /* paper */
  --fx-raise: #ecece5;    /* one tone step up, used instead of borders */
  --fx-ink: #111a15;
  --fx-ink-2: #3a463f;    /* secondary notes only, 9.6:1 on ground */
  --fx-green: #13703a;    /* action + subsidy, 6.2:1 on ground */
  --fx-green-deep: #0c3f22;
  --fx-green-field: #dfeee3;
  --fx-slate: #5b6a75;    /* bank share */
  --fx-warn: #9a3412;     /* "source needed" */
  --fx-on-dark: #f3f4ef;

  --fx-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --fx-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;

  /* three working sizes + two support sizes */
  --fx-s-display: clamp(2.5rem, 1.4rem + 5.2vw, 6rem);
  --fx-s-head: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
  --fx-s-lede: clamp(1.125rem, 1rem + .5vw, 1.375rem);
  --fx-s-body: 1.0625rem;
  --fx-s-note: .875rem;

  --fx-margin: clamp(16px, 4vw, 56px);
  --fx-max: 1240px;
  --fx-gap: clamp(96px, 12vw, 200px);  /* between sections */
  --fx-ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] {
  --fx-ground: #0d1210; --fx-raise: #18201c; --fx-ink: #eef1ec; --fx-ink-2: #b9c3bc;
  --fx-green: #5fcf8a; --fx-green-deep: #9be3b5; --fx-green-field: #15291d; --fx-slate: #8fa0ab; --fx-warn: #fdba74;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fx-ground: #0d1210; --fx-raise: #18201c; --fx-ink: #eef1ec; --fx-ink-2: #b9c3bc;
    --fx-green: #5fcf8a; --fx-green-deep: #9be3b5; --fx-green-field: #15291d; --fx-slate: #8fa0ab; --fx-warn: #fdba74;
  }
}

.fx { background: var(--fx-ground); color: var(--fx-ink); font: 400 var(--fx-s-body)/1.55 var(--fx-sans); -webkit-font-smoothing: antialiased; }
.fx *, .fx *::before, .fx *::after { box-sizing: border-box; }
.fx img { max-width: 100%; height: auto; display: block; }
.fx a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.fx a:hover { color: var(--fx-green); }
.fx :focus-visible { outline: 3px solid var(--fx-green); outline-offset: 3px; }

/* type */
.fx h1, .fx h2, .fx h3 { font-family: var(--fx-serif); font-weight: 600; margin: 0; text-wrap: balance; }
.fx h1 { font-size: var(--fx-s-display); line-height: .98; letter-spacing: -.03em; font-optical-sizing: auto; }
.fx h2 { font-size: var(--fx-s-head); line-height: 1.05; letter-spacing: -.02em; }
.fx h3 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -.01em; }
.fx p { margin: 0; max-width: 64ch; }
.fx-lede { font-size: var(--fx-s-lede); line-height: 1.45; margin-top: 28px !important; }
.fx-note { font-size: var(--fx-s-note); color: var(--fx-ink-2); }
.fx-num { font-family: var(--fx-serif); font-variant-numeric: lining-nums tabular-nums; }

/* grid + rhythm */
.fx-wrap { width: 100%; max-width: calc(var(--fx-max) + 2 * var(--fx-margin)); margin-inline: auto; padding-inline: var(--fx-margin); }
.fx-section { padding-block: calc(var(--fx-gap) / 2); }
.fx-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 40px; }
.fx-grid > * { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .fx-col-7 { grid-column: span 7 !important; } .fx-col-5 { grid-column: span 5 !important; }
  .fx-col-6 { grid-column: span 6 !important; } .fx-col-4 { grid-column: span 4 !important; } .fx-col-8 { grid-column: span 8 !important; }
}
.fx-field { background: var(--fx-raise); }
.fx-field-green { background: var(--fx-green-deep); color: var(--fx-on-dark); }
:root[data-theme="dark"] .fx-field-green { background: #11291b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx-field-green { background: #11291b; } }
.fx-field-green a:hover { color: inherit; }

/* buttons: square, flat, one fill */
.fx .fx-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; font: 600 1rem/1 var(--fx-sans);
  background: var(--fx-green); color: #fff; text-decoration: none; border: 0; cursor: pointer;
  transition: transform .16s var(--fx-ease), background-color .16s; }
:root[data-theme="dark"] .fx .fx-btn:not(.fx-btn-quiet) { color: #07140c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx .fx-btn:not(.fx-btn-quiet) { color: #07140c; } }
.fx .fx-btn:hover { background: var(--fx-green-deep); color: #fff; }
.fx-btn:active { transform: scale(.97); }
.fx .fx-btn-quiet { background: transparent; color: inherit; text-decoration: underline; padding-inline: 4px; }
.fx .fx-btn-quiet:hover { background: transparent; color: var(--fx-green); }
.fx .fx-field-green .fx-btn { background: var(--fx-on-dark); color: var(--fx-green-deep); }

/* hero: headline left, documentary photo right, full height of the first screen on desktop */
.fx-hero { padding-block: clamp(40px, 6vw, 88px) calc(var(--fx-gap) / 2); }
.fx-hero .fx-actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 36px; }
.fx-hero figure { margin: 0; }
.fx-hero img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (min-width: 900px) { .fx-hero .fx-grid { align-items: end; } }

/* photo + caption (credit is mandatory) */
.fx-photo { margin: 0; }
.fx-photo img { width: 100%; object-fit: cover; }
.fx-photo figcaption { font-size: var(--fx-s-note); color: var(--fx-ink-2); margin-top: 10px; max-width: 70ch; }

/* photo band: three uneven frames, one row on desktop, scroll-snap on phone */
.fx-band { display: grid; grid-template-columns: 5fr 3fr 4fr; gap: 12px; }
.fx-band img { aspect-ratio: 4 / 5; }
.fx-band .fx-photo:nth-child(2) img { aspect-ratio: 3 / 5; }
@media (max-width: 699px) {
  .fx-band { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .fx-band .fx-photo { scroll-snap-align: start; }
}

/* proof strip: real public numbers set large, each with its source underneath */
.fx-proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 32px clamp(24px, 4vw, 64px); }
.fx-proof .fx-num { display: block; font-size: clamp(2.75rem, 2rem + 3vw, 4.5rem); line-height: 1; letter-spacing: -.03em; }
.fx-proof p { margin-top: 12px; }

/* stat row: one figure dominates, its context runs beside it */
.fx-stat { display: grid; gap: 16px 48px; align-items: baseline; }
.fx-stat .fx-num { font-size: clamp(4rem, 2rem + 9vw, 10rem); line-height: .85; letter-spacing: -.04em; color: var(--fx-green); }
@media (min-width: 900px) { .fx-stat { grid-template-columns: auto 1fr; } }

/* fact card: a claim, its figure, its citation. Separated by a tone step only */
.fx-fact { background: var(--fx-raise); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; }
.fx-fact .fx-num { font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem); line-height: 1; color: var(--fx-green); }
.fx-fact blockquote { margin: 0; font-family: var(--fx-serif); font-size: 1.125rem; line-height: 1.45; }
.fx-fact cite { font-style: normal; font-size: var(--fx-s-note); color: var(--fx-ink-2); margin-top: auto; }

/* comparison table: the one place lines are allowed */
.fx-compare { width: 100%; border-collapse: collapse; font-size: 1rem; }
.fx-compare caption { text-align: left; font-family: var(--fx-serif); font-size: 1.375rem; font-weight: 600; padding-bottom: 16px; }
.fx-compare th, .fx-compare td { text-align: left; vertical-align: top; padding: 16px 16px 16px 0; border-bottom: 1px solid color-mix(in srgb, var(--fx-ink) 14%, transparent); }
.fx-compare thead th { font-weight: 600; border-bottom: 2px solid var(--fx-ink); }
.fx-compare td:last-child { color: var(--fx-green); font-weight: 500; }
@media (max-width: 699px) {
  .fx-compare thead { position: absolute; clip: rect(0 0 0 0); }
  .fx-compare tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid color-mix(in srgb, var(--fx-ink) 14%, transparent); }
  .fx-compare th[scope="row"] { grid-column: 1 / -1; border: 0; padding: 0; }
  .fx-compare td { border: 0; padding: 0; }
  .fx-compare td::before { content: attr(data-label); display: block; font-size: var(--fx-s-note); color: var(--fx-ink-2); }
}

/* timeline (plain HTML fallback; infographics.js draws the rich one) */
.fx-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: none; }
.fx-timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 16px; }
.fx-timeline li::before { content: ""; width: 14px; height: 14px; margin-top: 6px; background: var(--fx-green); border-radius: 50%; }

/* CTA band: full field of colour, one sentence, one action */
.fx-cta { padding-block: clamp(72px, 9vw, 140px); }
.fx-cta h2 { max-width: 18ch; }
.fx-cta p { margin-top: 20px; }
.fx-cta .fx-btn { margin-top: 36px; }

/* infographics shell */
.fx-ig { margin: 0; --fx-ig-card: var(--fx-raise); --fx-ig-empty: color-mix(in srgb, var(--fx-ink) 12%, transparent); }
.fx-field .fx-ig { --fx-ig-card: var(--fx-ground); }
.fx-ig svg { width: 100%; height: auto; display: block; overflow: visible; }
.fx-ig svg text { font-family: var(--fx-sans); fill: var(--fx-ink); }
.fx-ig .fx-ig-serif { font-family: var(--fx-serif); }
.fx-ig figcaption { margin-top: 16px; }
.fx-ig ol.fx-src { margin: 14px 0 0; padding-left: 1.4em; font-size: var(--fx-s-note); color: var(--fx-ink-2); overflow-wrap: anywhere; }
.fx-ig .fx-missing { fill: var(--fx-warn); }
.fx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* motion: infographics draw in once (bars grow, arcs sweep). Content is never hidden waiting for scroll:
   today's redesign left whole sections blank until an observer fired. */
@keyframes fx-grow { from { transform: scaleX(0); } }
@keyframes fx-sweep { from { stroke-dashoffset: var(--fx-len, 0); } }
.fx-ig .fx-anim-x { transform-box: fill-box; transform-origin: left; animation: fx-grow .9s var(--fx-ease) both; }
.fx-ig .fx-anim-arc { animation: fx-sweep 1.2s var(--fx-ease) both; }
@media (prefers-reduced-motion: reduce) {
  .fx *, .fx *::before, .fx *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
