/* Depletion Ledger (depletion.org) look: paper background, Archivo + IBM Plex Mono
   chrome, Georgia chart text, hairline rules, ink/faint/crude/alarm/calm palette. */

:root {
  color-scheme: light;

  --sans-serif: "Archivo", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --monospace: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --oil-paper: #f2f1ec;
  --oil-paper-deep: #e9e7de;
  --oil-ink: #1c1b17;
  --oil-muted: #625e52;
  --oil-faint: #8a867a;
  --oil-rule: #d8d4c6;
  --oil-rule-chart: #d0ccbe;
  --oil-crude: #b4690e;
  --oil-alarm: #b3261e;
  --oil-calm: #3d6b64;

  --theme-background-a: var(--oil-paper);
  --theme-background-b: var(--oil-paper-deep);
  --theme-background: var(--oil-paper);
  --theme-background-alt: var(--oil-paper-deep);
  --theme-foreground: var(--oil-ink);
  --theme-foreground-alt: var(--oil-ink);
  --theme-foreground-muted: var(--oil-muted);
  --theme-foreground-faint: var(--oil-faint);
  --theme-foreground-fainter: #b8b3a4;
  --theme-foreground-faintest: var(--oil-rule);
  --theme-foreground-focus: var(--oil-crude);
  --theme-foreground-focus-alt: var(--oil-calm);
  --theme-blue: #4e79a7;
  --theme-green: var(--oil-calm);
  --theme-red: var(--oil-alarm);
  --theme-yellow: #8a6a1f;

  --observablehq-max-width: 1280px;
}

html {
  background: var(--oil-paper);
}

body {
  font: 15.5px/1.7 var(--sans-serif);
  color: var(--oil-ink);
}

/* Prose column matches the ledger's 760px reading width; figures stay wide. */
p,
ul,
ol,
blockquote,
table,
figcaption,
h1,
h2,
h3,
h4,
h5,
h6 {
  max-width: 760px;
}

figure {
  max-width: none;
}

a[href] {
  color: var(--oil-crude);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--oil-crude) 40%, transparent);
  text-underline-offset: 4px;
}

a[href]:hover,
a[href]:focus {
  color: var(--oil-crude);
  text-decoration: underline;
  text-decoration-color: var(--oil-crude);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--sans-serif);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Framework's serif subtitle convention doesn't fit the ledger type. */
h1 + h2 {
  color: var(--oil-faint);
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: normal;
}

@media (max-width: 639px) {
  h1 {
    font-size: 32px;
  }
}

/* ---- hero ---- */

.hero {
  margin: 3rem 0 0;
  padding: 0 0 3rem;
  border-bottom: 1px solid var(--oil-rule);
}

.hero h1 {
  margin: 0;
  max-width: 760px;
}

.hero .lede {
  margin-top: 0.75rem;
  max-width: 760px;
}

.hero .lede p {
  margin: 0.75rem 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: color-mix(in srgb, var(--oil-ink) 80%, transparent);
}

.hero .meta {
  margin: 1rem 0 0;
  font: 500 12px/1.5 var(--monospace);
  color: var(--oil-faint);
  font-variant-numeric: tabular-nums;
}

.hero .jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 1.5rem 0 0;
  font-size: 14px;
}

.hero .jumps a {
  color: var(--oil-ink);
  text-decoration: underline;
  text-decoration-color: var(--oil-rule);
  text-underline-offset: 4px;
}

.hero .jumps a:hover,
.hero .jumps a:focus {
  color: var(--oil-ink);
  text-decoration-color: var(--oil-crude);
}

/* ---- sections and chart chrome ---- */

.section {
  margin: 3.5rem 0 0;
  padding: 0 0 3rem;
}

.section > h2 {
  margin: 0 0 2.5rem;
}

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

.chart-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chart-note {
  margin: 0;
  font: 500 11px/1.5 var(--monospace);
  color: var(--oil-faint);
  font-variant-numeric: tabular-nums;
}

.chart {
  margin: 0;
}

.caption {
  margin: 0.75rem 0 0;
  font: 400 10.5px/1.7 var(--monospace);
  color: var(--oil-faint);
  font-variant-numeric: tabular-nums;
}

/* ---- plot: ledger chart text is Georgia, ticks faint, no chart junk ---- */

svg.plot-d6a7b5 {
  --plot-background: var(--oil-paper);
  font-family: var(--serif);
  font-size: 11px;
}

svg.plot-d6a7b5 g[aria-label^="x-axis tick"] text,
svg.plot-d6a7b5 g[aria-label^="y-axis tick"] text,
svg.plot-d6a7b5 g[aria-label$="axis tick label"] {
  fill: var(--oil-faint);
}

svg.plot-d6a7b5 g[aria-label^="x-axis tick"] line,
svg.plot-d6a7b5 g[aria-label^="y-axis tick"] line {
  stroke: var(--oil-rule-chart);
}

svg.plot-d6a7b5 g[aria-label$="axis label"] text {
  fill: var(--oil-faint);
  font-size: 10px;
  font-family: var(--sans-serif);
}

svg.plot-d6a7b5 g[aria-label="color swatches"] text {
  font-family: var(--sans-serif);
}

/* ---- app chrome ---- */

#observablehq-header {
  background: var(--oil-paper);
  border-bottom: 1px solid var(--oil-rule);
  font: 500 14px var(--sans-serif);
}

#observablehq-header a {
  color: var(--oil-ink);
  text-decoration: none;
}

#observablehq-footer {
  margin-top: 6rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--oil-rule);
  font: 12px/1.7 var(--sans-serif);
  color: var(--oil-faint);
}

#observablehq-footer a {
  color: var(--oil-faint);
  text-decoration: underline;
  text-decoration-color: var(--oil-rule);
  text-underline-offset: 2px;
}

#observablehq-footer a:hover {
  color: var(--oil-ink);
  text-decoration-color: var(--oil-crude);
}

#observablehq-footer nav a {
  border: none;
  border-top: 1px solid var(--oil-rule);
  border-radius: 0;
  padding: 1rem 0;
}

/* ---- prose furniture ---- */

pre,
code,
tt {
  font-family: var(--monospace);
}

pre {
  background: var(--oil-paper-deep);
  border-radius: 2px;
}

code {
  background: var(--oil-paper-deep);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

pre code {
  background: none;
  padding: 0;
}

table {
  font: 13px/1.5 var(--sans-serif);
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--oil-rule);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--oil-paper-deep);
  font-weight: 600;
}

td {
  font-variant-numeric: tabular-nums;
}

tr:not(:last-child),
thead tr {
  border-bottom: none;
}

blockquote {
  border-left: 3px solid var(--oil-rule);
  margin: 1em 0 0;
  padding-left: 1em;
  color: color-mix(in srgb, var(--oil-ink) 78%, transparent);
}

hr {
  background: var(--oil-rule);
}

.card {
  background: var(--oil-paper);
  border: 1px solid var(--oil-rule);
  border-radius: 0;
  font: 14px/1.7 var(--sans-serif);
}

/* ---- tooltip: paper-white box, muted keys, ink values (ledger style) ---- */

svg.plot-d6a7b5 path[filter^="drop-shadow"] {
  fill: rgba(255, 255, 248, 0.97);
  stroke: none;
  filter: drop-shadow(0 1px 2px rgba(28, 27, 23, 0.15));
}

svg.plot-d6a7b5 tspan[font-weight="bold"] {
  fill: #6b675c;
}

/* The tooltip row already names the series; the swatch is redundant. */
svg.plot-d6a7b5 tspan[style*="user-select"] {
  display: none;
}
