/* Oil Reserve Drawdown: one stylesheet, no network. Fonts are vendored (Public Sans, OFL). */
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/PublicSans-Regular.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/PublicSans-Italic.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/PublicSans-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/PublicSans-Bold.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --page: #eff1ec;
  --surface: #fbfbf9;
  --ink: #141618;
  --ink-2: #4b4f55;
  --muted: #7d8289;
  --rule: #d9dcd4;
  --baseline: #bcc0b8;
  --link: #1c5cab;
  --focus: #2a78d6;
  --critical: #d03b3b;
  --warning: #b97a00;
  --ghost: rgba(42, 120, 214, 0.12);
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --tip-bg: #141618;
  --tip-ink: #f4f4f0;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 42rem;
  --wide: 68rem;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #101211;
    --surface: #1a1c1a;
    --ink: #eeeeea;
    --ink-2: #c2c4bb;
    --muted: #8d9089;
    --rule: #2a2d2a;
    --baseline: #3d403c;
    --link: #7fb2ee;
    --focus: #3987e5;
    --critical: #e66767;
    --warning: #fab219;
    --ghost: rgba(57, 135, 229, 0.18);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --tip-bg: #f0efec;
    --tip-ink: #141618;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101211; --surface: #1a1c1a; --ink: #eeeeea; --ink-2: #c2c4bb; --muted: #8d9089; --rule: #2a2d2a; --baseline: #3d403c;
  --link: #7fb2ee; --focus: #3987e5; --critical: #e66767; --warning: #fab219; --ghost: rgba(57, 135, 229, 0.18);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --tip-bg: #f0efec; --tip-ink: #141618;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-feature-settings: "kern";
}
@media (max-width: 480px) { body { font-size: 1rem; } }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5rem; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.65rem); margin-top: 0; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; background: var(--surface); padding: 0.05em 0.3em; border-radius: 3px; }
.muted { color: var(--muted); }

/* header / footer */
.site-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; padding: 1rem var(--gutter); max-width: var(--wide); margin: 0 auto; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.site-head nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-head nav a { color: var(--ink-2); text-decoration: none; padding: 0.15rem 0; border-bottom: 2px solid transparent; }
.site-head nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.site-foot { max-width: var(--wide); margin: 3rem auto 2rem; padding: 1.5rem var(--gutter) 0; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 0.9rem; }

main { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* hero */
.hero { padding: 1.5rem 0 1rem; max-width: var(--measure); }
.lede { font-size: clamp(1.2rem, 1rem + 1.1vw, 1.6rem); line-height: 1.35; font-weight: 400; color: var(--ink); margin: 0.75rem 0 1.25rem; text-wrap: balance; }
.hero-meta { color: var(--ink-2); font-size: 0.95rem; }
.meter { margin: 0 0 1.25rem; }
.meter-bar { height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--s1); border-radius: 4px; }
.meter-text { margin: 0.5rem 0 0; font-size: 0.95rem; color: var(--ink-2); }
.meter-text strong { color: var(--ink); font-weight: 600; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1.5rem; margin: 1rem 0 2.5rem; border-top: 1px solid var(--rule); }
.tile { padding: 1rem 0 1rem; border-top: 3px solid var(--ink); margin-top: -1px; }
.tile-value { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); font-weight: 600; line-height: 1.1; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.tile-value .of { font-size: 0.55em; font-weight: 400; color: var(--ink-2); }
.tile-label { margin: 0 0 0.35rem; color: var(--ink); font-size: 0.95rem; line-height: 1.3; }
.tile-meta { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.tile-meta a { color: var(--muted); }

/* sections */
.block { margin: 0 0 3rem; }
.sub { color: var(--ink-2); max-width: var(--measure); margin-bottom: 1rem; }
.asof { white-space: nowrap; color: var(--muted); font-size: 0.9em; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.05em 0.45em; border-radius: 3px; vertical-align: middle; }
.badge.stale { background: var(--warning); color: #141618; }
.badge.critical { background: var(--critical); color: #fff; }
.prose { max-width: var(--measure); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.indent { padding-left: 1.5rem; }

/* charts */
.chart { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 0.75rem 0.5rem 0.5rem; }
.chart-body { position: relative; width: 100%; min-height: 160px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.chart text { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .axis path, .chart .axis line { stroke: var(--rule); shape-rendering: crispEdges; }
.chart .axis .domain { stroke: var(--baseline); }
.chart .grid line { stroke: var(--rule); shape-rendering: crispEdges; }
.chart .zero { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }
.chart .marker-line { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }
.chart .marker-label { fill: var(--muted); font-size: 11px; }
.chart .value-label { fill: var(--ink); font-size: 12px; }
.chart .label { fill: var(--ink); font-size: 12px; }
.chart .label.muted { fill: var(--muted); }
.chart .row-label { fill: var(--ink); font-size: 12.5px; }
.chart .leader { stroke: var(--baseline); stroke-width: 1; fill: none; }
.chart .fill-s1 { fill: var(--s1); } .chart .fill-s2 { fill: var(--s2); } .chart .fill-s3 { fill: var(--s3); } .chart .fill-s4 { fill: var(--s4); }
.chart .stroke-s1 { stroke: var(--s1); } .chart .stroke-s2 { stroke: var(--s2); } .chart .stroke-s3 { stroke: var(--s3); } .chart .stroke-s4 { stroke: var(--s4); }
.chart .fill-muted { fill: var(--muted); }
.chart .fill-critical { fill: var(--critical); }
.chart .ghost { fill: var(--ghost); stroke: var(--s1); stroke-dasharray: 3 3; stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .burn { fill: none; stroke-width: 1.5; stroke-dasharray: 5 4; stroke-linecap: round; }
.chart .ring { stroke: var(--surface); stroke-width: 2; }
.chart .hollow { fill: var(--surface); stroke-width: 2; }
.chart .connector { stroke: var(--baseline); stroke-width: 2; stroke-linecap: round; }
.chart .hit { fill: transparent; pointer-events: all; }
.chart .hit:hover + .mark, .chart .mark.hover { filter: brightness(1.12); }
.chart .crosshair { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.chart .threshold { stroke: var(--ink); stroke-width: 2; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0 0 0.5rem; padding: 0 0.25rem; font-size: 0.85rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .sw { display: inline-block; width: 14px; height: 10px; border-radius: 2px; flex: none; }
.legend .sw.line { height: 3px; border-radius: 2px; }
.legend .sw.dash { height: 0; border-top: 2px dashed currentColor; background: none; }
.legend .sw.dot { width: 10px; height: 10px; border-radius: 50%; }
.legend .sw.hollow { width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--s1); }
.legend .sw.ghost { background: var(--ghost); border: 1px dashed var(--s1); }
.legend .sw.tick { width: 2px; height: 12px; background: var(--ink); border-radius: 0; }
.chart-note { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0.25rem 0; }

/* toggles */
.toggles { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0 0 0.75rem; }
.toggles fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.toggles legend { float: left; padding: 0; margin-right: 0.5rem; color: var(--ink-2); font-size: 0.9rem; }
.toggles label { font-size: 0.95rem; display: inline-flex; align-items: center; gap: 0.3rem; }
.toggles input { accent-color: var(--s1); width: 1.05rem; height: 1.05rem; margin: 0; }

/* tables */
.table-view { margin: 0.6rem 0 0; }
.table-view summary { cursor: pointer; color: var(--link); font-size: 0.95rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0.5rem 0 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
table.num td { font-variant-numeric: tabular-nums; }
tr.below td { background: color-mix(in srgb, var(--critical) 8%, transparent); }
tr.derivation td { padding-top: 0; border-bottom: 1px solid var(--rule); background: var(--surface); }
tr.derivation details { font-size: 0.9rem; }
tr.derivation summary { color: var(--link); cursor: pointer; padding: 0.3rem 0; }
tr.derivation ul { margin: 0.25rem 0 0.5rem; padding-left: 1.2rem; }
tr.derivation li { margin: 0.2rem 0; }
table.countries tbody tr:not(.derivation) td { border-bottom: 0; padding-bottom: 0.2rem; }
.source-list li { margin-bottom: 0.6rem; overflow-wrap: anywhere; }

/* timeline */
.timeline { margin: 0; max-width: var(--measure); }
.timeline div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem; padding: 0.35rem 0; border-top: 1px solid var(--rule); }
.timeline dt { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.timeline dd { margin: 0; }
@media (max-width: 480px) { .timeline div { grid-template-columns: 1fr; gap: 0.1rem; } }

/* tooltip */
.tip { position: fixed; z-index: 10; max-width: min(20rem, calc(100vw - 2 * var(--gutter))); background: var(--tip-bg); color: var(--tip-ink); padding: 0.5rem 0.65rem; border-radius: 6px; font-size: 0.85rem; line-height: 1.35; pointer-events: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.tip[hidden] { display: none; }
.tip .t { font-weight: 600; margin-bottom: 0.2rem; }
.tip .r { display: flex; gap: 0.5rem; align-items: baseline; }
.tip .k { display: inline-block; width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tip .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip .n { opacity: 0.85; }

@media (prefers-reduced-motion: no-preference) {
  .meter-fill { transition: width 600ms ease-out; }
}
@media print {
  .site-head nav, .toggles, .tip { display: none; }
  .chart { border: 0; }
}
