/* git-traffic observatory — same chrome as the Depletion Ledger reports: paper
   background, Archivo + IBM Plex Mono, Georgia chart text, hairline rules.
   Palette is lifted from the ledger (--oil-* tokens) plus per-class hues that stay in
   the same warm/ink family: ambers and browns for AI crawlers, alarm red for the
   unidentified rotator, teal and green for browsers and social, slate for search,
   greys for clients and unknowns. No invented brights. */

: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;
  /* link text: --oil-crude is 3.74:1 on paper, below the 4.5:1 floor for body text */
  --oil-link: #9d5a0a;

  --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);
}

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

body {
  font-family: var(--sans-serif);
  color: var(--oil-ink);
}

p,
ul,
ol,
blockquote,
table,
figcaption,
h1,
h2,
h3,
h4,
h5,
h6 {
  max-width: 760px;
}

figure {
  max-width: none;
}

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

h1 + h2 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--oil-muted);
  font-size: 1.1rem;
  margin-top: 0.4rem;
}

a[href] {
  color: var(--oil-link);
  text-decoration-color: var(--oil-rule);
  text-underline-offset: 2px;
}

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

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

code {
  font-size: 0.875em;
  background: var(--oil-paper-deep);
  border: 1px solid var(--oil-rule);
  border-radius: 3px;
  padding: 0.05em 0.3em;
}

pre {
  background: var(--oil-paper-deep);
  border: 1px solid var(--oil-rule);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

/* ---- lede and deck ---- */
/* Markup uses <p class="hero lede"> on the overview and <p class="lede"> elsewhere, so
   these rules match the element itself, not a descendant. The earlier .hero .lede form
   matched nothing and left every page's opening paragraph unstyled. */

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

p.lede {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--oil-muted);
  max-width: 720px;
}

p.meta {
  font-family: var(--monospace);
  font-size: 0.82rem;
  color: var(--oil-muted);
  margin-top: 0.9rem;
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  max-width: 760px;
}

/* ---- tiles ---- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--oil-rule);
  border: 1px solid var(--oil-rule);
  margin: 1.6rem 0 2.2rem;
  max-width: none;
}

.tile {
  background: var(--oil-paper);
  padding: 0.85rem 0.95rem 0.95rem;
}

.tile .k {
  font-family: var(--monospace);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--oil-muted);
}

.tile .v {
  font-size: 1.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-top: 0.15rem;
}

.tile .n {
  font-family: var(--serif);
  font-size: 0.86rem;
  color: var(--oil-muted);
  margin-top: 0.2rem;
}

.tile .v.alarm {
  color: var(--oil-alarm);
}

.tile .v.calm {
  color: var(--oil-calm);
}

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

.section {
  margin: 2.6rem 0 0;
}

.chart-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.chart-note {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--oil-muted);
  margin: 0.25rem 0 0.8rem;
}

figure.chart {
  margin: 0 0 1.2rem;
}

.caption {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--oil-muted);
  margin-top: 0.6rem;
  max-width: 760px;
}

/* chart text: Georgia ticks, faint rules, no chart junk */
figure svg text {
  font-family: var(--serif);
}

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

/* ---- tables ---- */

table {
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.8rem 0 1.2rem;
  max-width: none;
}

th,
td {
  text-align: left;
  padding: 0.35rem 0.7rem 0.35rem 0;
  border-bottom: 1px solid var(--oil-rule);
  vertical-align: top;
}

thead th {
  font-family: var(--monospace);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--oil-muted);
  border-bottom: 1px solid var(--oil-faint);
}

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

td.num,
th.num {
  text-align: right;
  padding-right: 1rem;
}

td.mono {
  font-family: var(--monospace);
  font-size: 0.78rem;
  word-break: break-all;
}

/* ---- class pill ---- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0.2rem 0 1rem;
  max-width: 900px;
  font-size: 0.82rem;
  color: var(--oil-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  white-space: nowrap;
}

.legend .swatch {
  width: 0.7em;
  height: 0.7em;
  border-radius: 1px;
  display: inline-block;
}

.legend-note {
  font-family: var(--serif);
  color: var(--oil-muted);
}

.pill {
  display: inline-block;
  font-family: var(--monospace);
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0 0.4em;
  border-radius: 2px;
  color: #fff;
  white-space: nowrap;
}

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

#observablehq-header,
#observablehq-sidebar {
  background: var(--oil-paper);
}

#observablehq-footer {
  font-family: var(--serif);
  font-size: 0.82rem;
  color: var(--oil-muted);
  border-top: 1px solid var(--oil-rule);
  margin-top: 3rem;
}

.note {
  border-left: 3px solid var(--oil-rule);
  padding: 0.1rem 0 0.1rem 0.9rem;
  color: var(--oil-muted);
  font-family: var(--serif);
  font-size: 0.92rem;
}

.warn {
  border-left: 3px solid var(--oil-alarm);
}
