/* ==========================================================================
   The Annual Report — styles
   Tokens → base → top bar → cover → sections → charts → statements →
   overlays (drawer, popover, modal, toasts) → easter eggs → responsive → print
   ========================================================================== */

/* ---------------------------------------------------------------- Tokens */
:root {
  color-scheme: light;
  --paper: #f7f4ec;
  --paper-2: #fffdf8;
  --paper-3: #efeadf;
  --ink: #16181d;
  --ink-2: #4a4c52;
  --ink-3: #75767b;
  --rule: #d6cfbf;
  --rule-soft: #e7e1d3;
  --brand: #13294b;
  --brand-contrast: #f7f4ec;
  --gold: #9c7c2e;
  --gold-soft: #c9a961;
  --pen: #c0281f;            /* auditor's red pen */
  --good: #1d7a3e;
  --bad: #b3261e;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --grid: #e3ddcf;
  --shadow: 0 1px 2px rgba(22, 24, 29, .05), 0 8px 24px -12px rgba(22, 24, 29, .18);

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: "Mrs Saint Delafield", "Brush Script MT", cursive;

  --wrap: 1160px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16171a;
  --paper-2: #1d1f23;
  --paper-3: #24262b;
  --ink: #eeebe3;
  --ink-2: #bcb9b0;
  --ink-3: #8d8b84;
  --rule: #363840;
  --rule-soft: #2a2c32;
  --brand: #a9bfe6;
  --brand-contrast: #101114;
  --gold: #d4b46a;
  --gold-soft: #b8974f;
  --pen: #ff6b5e;
  --good: #4cbb6c;
  --bad: #ff7a6e;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --grid: #2c2e34;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
}

/* ---------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
::selection { background: var(--brand); color: var(--brand-contrast); }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
p { margin: 0 0 1em; }
.num, .tnum { font-variant-numeric: tabular-nums lining-nums; }
:focus-visible { outline: 2px solid var(--s1); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; font-family: var(--sans); font-size: 14px; }
.skip:focus { left: 8px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

/* Grain: a faint paper texture made of two gradients, no image. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(201, 169, 97, .10), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(42, 120, 214, .06), transparent 60%);
}
main, .footer, .topbar { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex; align-items: center; gap: 20px;
  height: 60px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  font-family: var(--sans);
  transform: translateY(-100%);
  transition: transform .45s var(--ease), border-color .3s;
}
.topbar.is-visible { transform: none; border-bottom-color: var(--rule-soft); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: var(--brand-contrast);
  font-family: var(--serif); font-style: italic; font-size: 13px;
}
.brand-text { font-size: 14px; color: var(--ink-2); }
.brand-text b { color: var(--ink); font-weight: 600; }
.toc { display: flex; gap: 2px; flex: 1; justify-content: center; overflow: hidden; }
.toc a {
  font-size: 13px; color: var(--ink-3); text-decoration: none;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); background: var(--paper-3); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--paper-2); cursor: pointer;
  font-size: 13px; color: var(--ink-2);
  transition: border-color .2s, transform .2s;
}
.chip:hover { border-color: var(--ink-3); }
.chip-count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.chip.bump { animation: bump .6s var(--ease); }
@keyframes bump { 30% { transform: scale(1.12); } }
.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--paper-2);
  cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: inline; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.progress span { display: block; height: 100%; width: 0; background: var(--brand); }

/* ---------------------------------------------------------------- Cover */
.cover {
  position: relative;
  min-height: 100svh;
  display: grid; align-items: center;
  padding: 96px var(--gutter) 120px;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.cover-curve { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cover-curve .cc-grid { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cover-curve .cc-area { fill: var(--s1); opacity: .07; }
.cover-curve .cc-line { fill: none; stroke: var(--s1); stroke-opacity: .6; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.cover-inner { position: relative; max-width: var(--wrap); width: 100%; margin: 0 auto; }
.cover-eyebrow { margin-bottom: 28px; }
.cover-title {
  font-size: clamp(76px, 15vw, 210px);
  line-height: .86;
  font-weight: 400;
  letter-spacing: -0.045em;
}
.cover-line { display: block; }
.cover-year { font-style: italic; color: var(--brand); font-weight: 300; }
.cover-tagline {
  margin-top: 30px; max-width: 26ch;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.3; font-style: italic; color: var(--ink-2);
}
.cover-meta {
  display: flex; flex-wrap: wrap; gap: 18px 48px;
  margin-top: 48px; padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: 14px;
  max-width: 820px;
}
.cover-meta div { display: flex; flex-direction: column; gap: 4px; }
.meta-k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.meta-v { color: var(--ink); }
.seal {
  position: absolute; right: 0; top: 0;
  width: 112px; height: 112px; padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
  filter: drop-shadow(0 10px 18px rgba(19, 41, 75, .25));
  transition: transform .5s var(--ease);
}
.seal img { display: block; width: 100%; height: 100%; animation: spin 60s linear infinite; }
.seal:hover { transform: rotate(-8deg) scale(1.04); }
.seal:active { transform: scale(.94); }
@keyframes spin { to { transform: rotate(360deg); } }
.illustrative-flag {
  position: absolute; left: var(--gutter); bottom: 32px; margin: 0;
  font-family: var(--sans); font-size: 12px; color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
}
.illustrative-flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-soft); }
.scroll-cue {
  position: absolute; right: var(--gutter); bottom: 28px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--ink-2); text-decoration: none;
  display: flex; gap: 8px; align-items: center;
}
.scroll-cue span { display: inline-block; animation: nudge 2.2s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* Cover entrance */
.cover .cover-line, .cover-tagline, .cover-meta, .cover-eyebrow, .seal {
  opacity: 0; transform: translateY(18px);
  animation: rise 1s var(--ease) forwards;
}
.cover .cover-line:nth-child(2) { animation-delay: .12s; }
.cover-tagline { animation-delay: .3s; }
.cover-meta { animation-delay: .45s; }
.seal { animation-delay: .6s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Sections */
.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(80px, 11vw, 140px) var(--gutter) 0;
}
.section-head {
  display: grid;
  grid-template-columns: 80px 1fr;
  column-gap: 24px;
  margin-bottom: 48px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}
.section-num {
  grid-row: span 2;
  margin: 0;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink-3); letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}
.section-head h2 { font-size: clamp(36px, 5vw, 60px); font-weight: 400; letter-spacing: -0.03em; }
.section-dek { grid-column: 2; margin: 14px 0 0; max-width: 60ch; color: var(--ink-2); font-size: 19px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- Highlights */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.tile {
  position: relative;
  padding: 26px 26px 22px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  min-height: 210px;
  display: flex; flex-direction: column;
  transition: background-color .25s;
}
.tile:hover { background: var(--paper-2); }
.tile-label { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.tile-value {
  align-self: flex-start;
  font-family: var(--serif);
  font-size: clamp(48px, 5.4vw, 72px);
  line-height: 1; font-weight: 400; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums lining-nums;
}
.tile-delta { margin-top: 12px; font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tile-delta .arrow { font-weight: 700; color: var(--good); }
.tile-delta.down .arrow { color: var(--bad); }
.tile-spark { margin-top: auto; padding-top: 18px; height: 54px; }
.tile-spark svg { display: block; width: 100%; height: 36px; overflow: visible; }

/* Footnote markers */
.fn {
  font-family: var(--sans);
  font-size: .62em; font-weight: 600;
  vertical-align: super; line-height: 0;
  margin-left: 2px;
  padding: 0 2px;
  color: var(--s1);
  background: none; border: 0; cursor: pointer;
  border-bottom: 1px dotted currentColor;
}
.fn:hover, .fn[aria-expanded="true"] { color: var(--ink); }

/* ---------------------------------------------------------------- Letter */
.letter {
  max-width: 720px;
  margin-left: 104px;
  font-size: 21px; line-height: 1.68;
}
.letter .salutation { font-style: italic; color: var(--ink-2); margin-bottom: 1.4em; }
.letter p.dropcap::first-letter {
  float: left;
  font-size: 5.1em; line-height: .82;
  padding: .06em .08em 0 0;
  color: var(--brand);
  font-weight: 400;
}
.letter em { color: var(--brand); }
.signature-block { margin-top: 2.2em; }
.signature {
  display: inline-block;
  font-family: var(--script);
  font-size: 68px; line-height: 1.1;
  color: var(--brand);
  padding-right: 20px;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 2.4s cubic-bezier(.45, .1, .3, 1);
}
.signature.is-signed { clip-path: inset(0 -10% 0 0); }
.sig-name { font-family: var(--sans); font-size: 15px; font-weight: 600; margin: 4px 0 0; }
.sig-title { font-family: var(--sans); font-size: 14px; color: var(--ink-3); margin: 0; }

/* ---------------------------------------------------------------- Figures & charts */
.figure-card {
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 32px);
  box-shadow: var(--shadow);
}
.figure-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; font-family: var(--sans); }
.figure-caption { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin: 0 0 8px; min-height: 1.5em; }
.seg-control { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--paper-3); }
.seg-control button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px;
  transition: background-color .2s, color .2s;
}
.seg-control button[aria-selected="true"] { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.text-btn {
  border: 0; background: none; cursor: pointer; padding: 6px 2px;
  font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px;
}
.text-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .baseline { stroke: var(--ink-3); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: var(--s1); opacity: .1; }
.chart .dot { fill: var(--s1); stroke: var(--paper-2); stroke-width: 2; }
.chart .era-band { opacity: .07; }
.chart .era-tick { stroke-width: 3; stroke-linecap: round; }
.chart .era-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart .milestone line { stroke: var(--ink-3); stroke-width: 1; }
.chart .milestone circle { fill: var(--paper-2); stroke: var(--ink-2); stroke-width: 1.5; }
.chart .milestone text { fill: var(--ink-2); font-size: 12px; }
.chart .end-label { fill: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; }
.chart .hover-dot { fill: var(--s1); stroke: var(--paper-2); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .seg-rect { cursor: default; transition: opacity .2s; }
.chart .seg-rect.dim { opacity: .3; }
.chart .seg-in { font-size: 12px; font-weight: 600; pointer-events: none; font-variant-numeric: tabular-nums; }
.chart .row-label { fill: var(--ink); font-size: 14px; font-weight: 600; }

.era-legend, .legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--sans); font-size: 13px; color: var(--ink-2); }
.era-legend { margin-top: 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.swatch-line { width: 16px; height: 3px; border-radius: 2px; }

.s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); } .s4 { background: var(--s4); } .s5 { background: var(--s5); }

/* Data tables (table view of every chart) */
.table-wrap { margin-top: 18px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule-soft); }
th { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Segments */
.segment-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin-top: 36px; background: var(--rule); border: 1px solid var(--rule); }
.segment-card { background: var(--paper); padding: 20px 18px; font-family: var(--sans); font-size: 14px; color: var(--ink-2); transition: background-color .2s; }
.segment-card:hover, .segment-card.is-hot { background: var(--paper-2); }
.segment-card h3 { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; line-height: 1.3; }
.segment-card .seg-share { font-family: var(--serif); font-size: 34px; color: var(--ink); line-height: 1; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.segment-card .seg-change { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; }
.segment-card p:last-child { margin: 0; line-height: 1.5; }

/* ---------------------------------------------------------------- MD&A */
.cases { display: grid; gap: 28px; }
.case {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(22px, 3.4vw, 40px);
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.case::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--case-color, var(--s1)); }
.case-kicker { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.case h3 { font-size: clamp(26px, 3vw, 36px); font-weight: 400; letter-spacing: -0.02em; margin-bottom: 22px; }
.case dl { margin: 0; display: grid; gap: 16px; }
.case dt { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.case dd { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.case dd.outcome { color: var(--ink); }
.case-side { display: flex; flex-direction: column; gap: 20px; }
.case-chart-label { font-family: var(--sans); font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.case-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule-soft); border-radius: 10px; overflow: hidden; margin-top: auto; }
.case-kpi { background: var(--paper-2); padding: 14px 12px; }
.case-kpi b { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.case-kpi span { font-family: var(--sans); font-size: 12px; color: var(--ink-3); line-height: 1.35; display: block; margin-top: 4px; }
.case .more-btn { justify-self: start; margin-top: 4px; }
.case .case-extra { display: none; }
.case.is-open .case-extra { display: block; }

/* ---------------------------------------------------------------- Balance sheet */
.statement {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(24px, 5vw, 72px);
  font-family: var(--sans);
  font-size: 15px;
}
.statement-col h3 { font-family: var(--serif); font-size: 26px; font-weight: 500; padding-bottom: 10px; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
.st-group { margin: 18px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.st-row { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); transition: background-color .2s; }
.st-row:hover { background: linear-gradient(90deg, transparent, var(--paper-3) 20%, var(--paper-3) 80%, transparent); }
.st-row .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-sub { font-weight: 600; border-bottom: 1px solid var(--ink-3); }
.st-total { font-weight: 700; font-size: 16px; border-bottom: 3px double var(--ink); border-top: 1px solid var(--ink); margin-top: 10px; }
.st-misprint { cursor: help; border-radius: 4px; padding: 0 4px; margin: 0 -4px; transition: background-color .2s, color .2s; }
.st-misprint:hover { background: rgba(192, 40, 31, .08); }
.st-misprint.restated { color: var(--good); }
.st-misprint .was { text-decoration: line-through; color: var(--pen); margin-right: 6px; font-weight: 500; }
.statement-foot { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin-top: 22px; }
.check { color: var(--good); font-weight: 700; margin-left: 6px; }

/* ---------------------------------------------------------------- Risks */
.risks { border-top: 1px solid var(--rule); counter-reset: risk; }
.risk { border-bottom: 1px solid var(--rule); }
.risk summary {
  list-style: none;
  display: grid; grid-template-columns: 60px 1fr 28px; align-items: baseline;
  padding: 22px 0; cursor: pointer;
  font-size: clamp(21px, 2.3vw, 27px); line-height: 1.3;
}
.risk summary::-webkit-details-marker { display: none; }
.risk summary::before { counter-increment: risk; content: counter(risk, decimal-leading-zero); font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink-3); }
.risk summary::after { content: "+"; font-family: var(--sans); font-size: 22px; color: var(--ink-3); text-align: right; transition: transform .3s var(--ease); }
.risk[open] summary::after { transform: rotate(45deg); }
.risk summary:hover { color: var(--brand); }
.risk p { margin: -6px 28px 24px 60px; color: var(--ink-2); max-width: 64ch; }

/* ---------------------------------------------------------------- Auditor */
.auditor { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.opinion { position: relative; font-size: 22px; line-height: 1.55; padding: 8px 0 0; }
.opinion-firm { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin-top: 18px; }
.stamp {
  display: inline-block;
  margin-top: 26px;
  padding: 10px 18px;
  border: 3px solid var(--good);
  border-radius: 8px;
  color: var(--good);
  font-family: var(--sans); font-weight: 800; font-size: 15px; letter-spacing: .14em; text-transform: uppercase;
  transform: rotate(-6deg) scale(2.2);
  opacity: 0;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .stamp { mix-blend-mode: normal; }
.stamp.is-stamped { animation: stamp .5s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes stamp { to { transform: rotate(-6deg) scale(1); opacity: .9; } }
.quotes { display: grid; gap: 16px; }
.quote { margin: 0; padding: 22px 24px; background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 12px; }
.quote p { font-size: 19px; font-style: italic; margin: 0 0 10px; }
.quote footer { font-family: var(--sans); font-size: 13px; color: var(--ink-3); }

/* ---------------------------------------------------------------- Notes */
.notes { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 56px; font-size: 16px; }
.note { break-inside: avoid; padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--rule-soft); transition: background-color .6s; }
.note h3 { font-family: var(--sans); font-size: 13px; font-weight: 600; margin-bottom: 6px; display: flex; gap: 10px; }
.note h3 span { color: var(--s1); font-variant-numeric: tabular-nums; }
.note p { margin: 0; color: var(--ink-2); line-height: 1.55; }
.note.flash { background: color-mix(in srgb, var(--gold-soft) 22%, transparent); }

/* ---------------------------------------------------------------- Investor relations */
.ir-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 20px; }
.ir-card { padding: 26px; border: 1px solid var(--rule); border-radius: 14px; background: var(--paper-2); }
.ir-card h3 { font-size: 24px; margin-bottom: 10px; }
.ir-card p { font-size: 16px; color: var(--ink-2); }
.ir-primary { background: var(--brand); color: var(--brand-contrast); border-color: transparent; }
.ir-primary p { color: color-mix(in srgb, var(--brand-contrast) 80%, transparent); }
.ir-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper);
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink);
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink-3); }
.ir-primary .btn { background: transparent; color: var(--brand-contrast); border-color: color-mix(in srgb, var(--brand-contrast) 40%, transparent); }
.ir-primary .btn-primary { background: var(--brand-contrast); color: var(--brand); border-color: transparent; }
.archive { list-style: none; padding: 0; margin: 0; font-family: var(--sans); font-size: 14px; }
.archive li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); }
.archive li:last-child { border-bottom: 0; }
.archive .yr { font-weight: 600; }
.archive .lbl { color: var(--ink-3); flex: 1; }
.archive button { border: 0; background: none; padding: 0; color: var(--ink-3); font-size: 12px; cursor: default; }
.archive button.secret { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.archive button.secret:hover { color: var(--ink); }
.archive .current { font-size: 12px; color: var(--good); font-weight: 600; }

/* ---------------------------------------------------------------- Footer */
.footer { margin-top: clamp(90px, 12vw, 150px); border-top: 1px solid var(--rule); background: var(--paper-3); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gutter) 56px; font-family: var(--sans); font-size: 13px; color: var(--ink-3); display: grid; gap: 12px; }
.footer-legal { max-width: 80ch; line-height: 1.6; }
.footer-legal b { color: var(--ink-2); }
.footer-editions a { color: var(--ink-2); }
.footer-hint { opacity: .55; }

/* ---------------------------------------------------------------- Tooltip */
.tooltip {
  position: fixed; z-index: 70; pointer-events: none;
  min-width: 150px; max-width: 260px;
  padding: 10px 12px;
  background: var(--ink); color: var(--paper);
  border-radius: 10px;
  font-family: var(--sans); font-size: 13px; line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.tooltip .tt-title { font-weight: 600; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-row span:first-child { display: inline-flex; align-items: center; gap: 6px; opacity: .8; }
.tooltip .tt-row b { font-variant-numeric: tabular-nums; }
.tooltip .tt-note { margin-top: 6px; opacity: .7; font-size: 12px; }

/* ---------------------------------------------------------------- Footnote popover */
.popover {
  position: absolute; z-index: 60;
  width: min(340px, calc(100vw - 32px));
  padding: 16px 18px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow), 0 20px 40px -20px rgba(0, 0, 0, .3);
  font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink-2);
}
.popover h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink); }
.popover h4 span { color: var(--s1); margin-right: 6px; }
.popover p { margin: 0; }
.popover a { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- Ledger drawer */
.drawer-scrim, .modal-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 16, .35); backdrop-filter: blur(2px); animation: fade .3s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81;
  width: min(480px, 100vw);
  background: var(--paper);
  border-left: 1px solid var(--rule);
  padding: 26px 28px;
  overflow-y: auto;
  font-family: var(--sans);
  animation: slide-in .4s var(--ease);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .15);
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.drawer-head h2 { font-family: var(--serif); font-size: 34px; margin-top: 4px; }
.drawer-dek { color: var(--ink-3); font-size: 14px; }
.ledger-table td { vertical-align: top; }
.ledger-table td:first-child { color: var(--ink-3); width: 44px; font-variant-numeric: tabular-nums; }
.ledger-table .entry-name { font-weight: 600; color: var(--ink); }
.ledger-table .entry-desc { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.ledger-table tr.locked .entry-name { color: var(--ink-3); }
.ledger-table tr.locked .entry-desc { font-style: italic; }
.ledger-table tr.unlocked td:last-child { color: var(--good); font-weight: 600; }
.ledger-table tr.fresh { animation: flash-row 1.6s var(--ease); }
@keyframes flash-row { 0% { background: color-mix(in srgb, var(--gold-soft) 35%, transparent); } }
.drawer-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; font-size: 14px; border-top: 3px double var(--ink); margin-top: 6px; font-weight: 600; }

/* ---------------------------------------------------------------- Toasts */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px 12px 12px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .35);
  font-family: var(--sans); font-size: 14px;
  animation: toast-in .5s var(--ease);
}
.toast.out { animation: toast-out .4s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
.toast-stamp {
  flex-shrink: 0;
  padding: 5px 8px;
  border: 2px solid var(--pen);
  border-radius: 5px;
  color: var(--pen);
  font-weight: 800; font-size: 11px; letter-spacing: .12em;
  transform: rotate(-7deg);
  animation: stamp-in .45s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes stamp-in { from { transform: rotate(-7deg) scale(2); opacity: 0; } }
.toast b { display: block; }
.toast span.sub { color: var(--ink-3); font-size: 13px; }

/* ---------------------------------------------------------------- Archive modal (FY2011) */
.archive-modal {
  position: fixed; z-index: 81;
  left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-1.2deg);
  width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 44px 48px 36px;
  background: #efe3c4;
  color: #2c2416;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px; line-height: 1.6;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(120, 80, 20, .16), transparent 30%),
    radial-gradient(circle at 85% 75%, rgba(120, 80, 20, .2), transparent 35%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(80, 60, 20, .08) 27px 28px);
  animation: paper-in .6s var(--ease);
}
@keyframes paper-in { from { opacity: 0; transform: translate(-50%, -46%) rotate(-4deg); } }
.archive-modal h2 { font-family: inherit; font-size: 22px; letter-spacing: .2em; text-transform: uppercase; text-align: center; margin-bottom: 6px; }
.archive-modal .sub { text-align: center; font-size: 12px; letter-spacing: .3em; margin-bottom: 26px; }
.archive-modal .coffee { position: absolute; right: 26px; top: 18px; width: 92px; height: 92px; border-radius: 50%; border: 5px solid rgba(110, 70, 20, .22); box-shadow: inset 0 0 0 2px rgba(110, 70, 20, .08); pointer-events: none; }
.archive-modal pre { font-family: inherit; white-space: pre-wrap; margin: 0 0 1em; }
.archive-modal button { margin-top: 10px; font-family: inherit; background: none; border: 1px dashed #2c2416; padding: 6px 14px; cursor: pointer; color: inherit; }

/* ---------------------------------------------------------------- Easter eggs */
/* Audit mode: red-pen tick marks on every figure */
.audit-banner {
  position: fixed; z-index: 45; left: 50%; top: 72px; transform: translateX(-50%);
  padding: 8px 16px; border-radius: 999px;
  background: var(--pen); color: #fff;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 20px rgba(192, 40, 31, .35);
}
.audit-banner kbd { font-family: inherit; background: rgba(255, 255, 255, .2); padding: 1px 6px; border-radius: 4px; }
body.audit .tile-value, body.audit .st-row .v, body.audit .case-kpi b, body.audit .seg-share { position: relative; }
body.audit .tile-value::after, body.audit .st-row .v::after, body.audit .case-kpi b::after, body.audit .seg-share::after {
  content: "✓";
  position: absolute; right: -0.9em; top: -0.35em;
  font-family: var(--script); font-size: .55em; font-style: normal; font-weight: 400;
  color: var(--pen);
  transform: rotate(-10deg);
  animation: rise .4s var(--ease) both;
}
body.audit .st-row .v::after, body.audit .case-kpi b::after { font-size: 1.2em; right: -1em; top: -0.5em; }
body.audit .section-head h2 { text-decoration: underline wavy var(--pen); text-decoration-thickness: 1.5px; text-underline-offset: 10px; }
body.audit .audit-note {
  display: block;
  font-family: var(--script); font-size: 30px; line-height: 1; color: var(--pen);
  transform: rotate(-3deg); margin: 6px 0 0;
}
.audit-note { display: none; }

/* Coin rain for the special dividend */
.coin {
  position: fixed; top: -40px; z-index: 95; pointer-events: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fbe7a1, #c9a961 55%, #8d6e26);
  box-shadow: inset 0 0 0 2px rgba(110, 80, 20, .45);
  display: grid; place-items: center;
  font: 700 13px/1 var(--serif); color: #6b4f14;
  animation: coin-fall linear forwards;
}
@keyframes coin-fall { to { transform: translateY(calc(100vh + 80px)) rotate(720deg); } }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1080px) {
  .toc { display: none; }
  .segment-cards { grid-template-columns: repeat(2, 1fr); }
  .segment-card:last-child:nth-child(odd) { grid-column: span 2; }
  .ir-grid { grid-template-columns: 1fr 1fr; }
  .ir-primary { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  body { font-size: 18px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .case { grid-template-columns: 1fr; }
  .statement { grid-template-columns: 1fr; }
  .statement-col + .statement-col { margin-top: 40px; }
  .auditor { grid-template-columns: 1fr; }
  .notes { columns: 1; }
  .letter { margin-left: 0; font-size: 19px; }
  .section-head { grid-template-columns: 1fr; }
  .section-num { grid-row: auto; margin-bottom: 8px; }
  .section-dek { grid-column: 1; }
  .seal { width: 76px; height: 76px; top: -10px; }
  .cover-eyebrow { padding-right: 92px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .segment-cards { grid-template-columns: 1fr; }
  .segment-card:last-child:nth-child(odd) { grid-column: auto; }
  .ir-grid { grid-template-columns: 1fr; }
  .chip-label { display: none; }
  .brand-text { display: none; }
  .scroll-cue { display: none; }
  .risk summary { grid-template-columns: 44px 1fr 24px; }
  .risk p { margin-left: 44px; margin-right: 0; }
  .archive-modal { padding: 32px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .signature { clip-path: none; }
}

/* ---------------------------------------------------------------- Print */
@page { size: letter; margin: 18mm 16mm; }
@media print {
  :root, :root[data-theme="dark"] {
    --paper: #fff; --paper-2: #fff; --paper-3: #f4f4f4; --ink: #000; --ink-2: #333; --ink-3: #666;
    --rule: #bbb; --rule-soft: #ddd; --brand: #13294b; --grid: #e5e5e5;
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  }
  body { font-size: 11.5pt; background: #fff; }
  body::before, .topbar, .scroll-cue, .toasts, .tooltip, .drawer, .drawer-scrim, .popover, .audit-banner,
  .text-btn, .seg-control, .ir-actions, #print-btn, .footer-hint, .seal { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .cover { min-height: 0; height: 245mm; page-break-after: always; border: 0; }
  .cover .cover-line, .cover-tagline, .cover-meta, .cover-eyebrow { opacity: 1 !important; transform: none !important; animation: none !important; }
  .section { padding-top: 0; page-break-before: always; }
  .figure-card, .case, .quote, .ir-card { box-shadow: none; break-inside: avoid; }
  .signature { clip-path: none; }
  .stamp { opacity: .9; transform: rotate(-6deg); }
  .table-wrap[hidden] { display: block !important; }
  .footer { background: none; }
  a { text-decoration: none; }
}
