/* argon-theme.css — unified syntax-highlighting theme for the book.
 *
 * The mdbook-bundled Ayu palette gives Argon code blocks a strong
 * cool look (lilac keywords, blue concepts, teal primitives) while
 * the same theme paints TOML and bash blocks in dominant orange
 * (`hljs-section`, `hljs-attr`, `hljs-built_in` all warm). The
 * visual mismatch reads as "different theme per language."
 *
 * The rules below replace the bundled per-class colours for every
 * language used in the book — Argon, TOML, bash. Each language's
 * code blocks render against the same palette, with two languages-
 * specific classes (`hljs-keyword-modifier`, `hljs-type-vocabulary`)
 * that only the Argon highlighter emits.
 *
 * Two philosophical departures from vanilla Ayu:
 *
 *   1. Keywords lift to lilac `#c792ea`. Ayu uses orange for
 *      keywords. Argon's identity colour is its emission line —
 *      pure argon at a few hundred volts glows lilac.
 *
 *   2. `type`, `title`, and `operator` move from Ayu's warm
 *      defaults (yellow / yellow-orange / unstyled) to the cool
 *      half: teal for primitives, blue for concept names, cyan for
 *      structural arrows.
 *
 * The cool half (lilac, blues, teal, cyan) carries language structure;
 * the warm half (orange, yellow, green) carries values and side-
 * effecting things. Comments recede into slate.
 *
 * Class roles used across argon + toml + bash:
 *
 *   keyword            lilac        argon keywords + bash if/then
 *   keyword-modifier   soft violet  argon `pub` (argon-only)
 *   type-vocabulary    light blue   argon `kind`/`subkind`/... (argon-only)
 *   type               teal         primitives (String, Int, Money, ⊤)
 *   title              Ayu blue     concept names + decls
 *   section            lilac        TOML `[project]`, `[package]`
 *   attr               light blue   TOML keys (`name`, `version`, ...)
 *   operator           cyan         arrows + comparisons
 *   built_in           orange       built-ins (today, count, ...) + shell commands
 *   number             yellow       numeric literals
 *   meta               orange       decorator brackets, shebangs
 *   meta-keyword       lilac        common decorator names
 *   variable           yellow it.   `?p` body-fresh + bash `$VAR`
 *   string             green        strings + dates
 *   literal            orange       true/false + axis values
 *   symbol             red          diagnostic codes
 *   comment            slate        line + block + doc comments
 *   doctag             lilac        TODO / FIXME / NOTE / SAFETY
 */

/* ─────────────────────────────────────────────────────────────────
 * Dark themes — ayu, navy, coal.
 * ───────────────────────────────────────────────────────────────── */

html.ayu pre code,
html.navy pre code,
html.coal pre code {
  background: #191f26;
  color: #cbccc6;
}

/* `pub` and other visibility modifiers (argon-only). Same family as
   keywords (lilac / violet) but a softer shade so the modifier reads
   as weight, not as a fresh item-introducing keyword. */
html.ayu pre code .hljs-keyword-modifier,
html.navy pre code .hljs-keyword-modifier,
html.coal pre code .hljs-keyword-modifier {
  color: #9d7cd8;
  font-weight: 500;
}

html.ayu pre code .hljs-keyword,
html.navy pre code .hljs-keyword,
html.coal pre code .hljs-keyword {
  color: #c792ea;          /* lilac — argon emission line */
  font-weight: 500;
}

/* Vocabulary metatypes (argon-only). Distinct from language
   keywords (which are language-defined) and from concept names
   (the things being declared). Lighter, brighter blue places them
   between the keyword family and the concept-name family. */
html.ayu pre code .hljs-type-vocabulary,
html.navy pre code .hljs-type-vocabulary,
html.coal pre code .hljs-type-vocabulary {
  color: #73d0ff;
  font-weight: 500;
}

html.ayu pre code .hljs-type,
html.navy pre code .hljs-type,
html.coal pre code .hljs-type {
  color: #7fdbca;          /* teal — primitive types */
  font-weight: 500;
}

html.ayu pre code .hljs-title,
html.navy pre code .hljs-title,
html.coal pre code .hljs-title {
  color: #36a3d9;          /* Ayu blue — concept names + decls */
}

/* TOML — `[project]`, `[package]` section headers. Structural like
   keywords, so they take the keyword colour. */
html.ayu pre code .hljs-section,
html.navy pre code .hljs-section,
html.coal pre code .hljs-section {
  color: #c792ea;
  font-weight: 500;
}

/* TOML — keys (`name`, `version`, ...) and similar attribute-position
   identifiers in other languages. Field-like positional identifiers,
   so they take the same colour as Argon vocabulary metatypes. */
html.ayu pre code .hljs-attr,
html.navy pre code .hljs-attr,
html.coal pre code .hljs-attr {
  color: #73d0ff;
}

html.ayu pre code .hljs-operator,
html.navy pre code .hljs-operator,
html.coal pre code .hljs-operator {
  color: #5ccfe6;          /* cyan — :- => -> :: comparisons */
}

html.ayu pre code .hljs-built_in,
html.navy pre code .hljs-built_in,
html.coal pre code .hljs-built_in {
  color: #ffb454;          /* Ayu orange — built-ins, shell commands */
}

html.ayu pre code .hljs-number,
html.navy pre code .hljs-number,
html.coal pre code .hljs-number {
  color: #ffee99;
}

html.ayu pre code .hljs-meta,
html.navy pre code .hljs-meta,
html.coal pre code .hljs-meta {
  color: #ffb454;          /* decorator brackets, shebangs */
}

html.ayu pre code .hljs-meta-keyword,
html.navy pre code .hljs-meta-keyword,
html.coal pre code .hljs-meta-keyword {
  color: #c792ea;
  font-weight: 600;
}

html.ayu pre code .hljs-variable,
html.navy pre code .hljs-variable,
html.coal pre code .hljs-variable {
  color: #ffee99;
  font-style: italic;
}

html.ayu pre code .hljs-string,
html.navy pre code .hljs-string,
html.coal pre code .hljs-string {
  color: #b8cc52;          /* Ayu green — strings + dates */
}

html.ayu pre code .hljs-literal,
html.navy pre code .hljs-literal,
html.coal pre code .hljs-literal {
  color: #ff7733;          /* Ayu orange — true/false + axis values */
}

html.ayu pre code .hljs-symbol,
html.navy pre code .hljs-symbol,
html.coal pre code .hljs-symbol {
  color: #d96c75;          /* Ayu deletion red — diagnostic codes */
  font-weight: 600;
}

html.ayu pre code .hljs-comment,
html.navy pre code .hljs-comment,
html.coal pre code .hljs-comment {
  color: #5c6773;
  font-style: italic;
}

html.ayu pre code .hljs-doctag,
html.navy pre code .hljs-doctag,
html.coal pre code .hljs-doctag {
  color: #c792ea;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
 * Light themes — light, rust. Same split, paper-tuned palette.
 * ───────────────────────────────────────────────────────────────── */

html.light pre code,
html.rust pre code {
  background: #fafafa;
  color: #5c6773;
}

html.light pre code .hljs-keyword-modifier,
html.rust pre code .hljs-keyword-modifier {
  color: #8957d5;
  font-weight: 500;
}

html.light pre code .hljs-keyword,
html.rust pre code .hljs-keyword {
  color: #6f42c1;
  font-weight: 500;
}

html.light pre code .hljs-type-vocabulary,
html.rust pre code .hljs-type-vocabulary {
  color: #0969da;
  font-weight: 500;
}

html.light pre code .hljs-type,
html.rust pre code .hljs-type {
  color: #00838f;
  font-weight: 500;
}

html.light pre code .hljs-title,
html.rust pre code .hljs-title {
  color: #1976d2;
}

html.light pre code .hljs-section,
html.rust pre code .hljs-section {
  color: #6f42c1;
  font-weight: 500;
}

html.light pre code .hljs-attr,
html.rust pre code .hljs-attr {
  color: #0969da;
}

html.light pre code .hljs-operator,
html.rust pre code .hljs-operator {
  color: #00838f;
}

html.light pre code .hljs-built_in,
html.rust pre code .hljs-built_in {
  color: #d97706;
}

html.light pre code .hljs-number,
html.rust pre code .hljs-number {
  color: #b58900;
}

html.light pre code .hljs-meta,
html.rust pre code .hljs-meta {
  color: #d97706;
}

html.light pre code .hljs-meta-keyword,
html.rust pre code .hljs-meta-keyword {
  color: #6f42c1;
  font-weight: 600;
}

html.light pre code .hljs-variable,
html.rust pre code .hljs-variable {
  color: #b58900;
  font-style: italic;
}

html.light pre code .hljs-string,
html.rust pre code .hljs-string {
  color: #22863a;
}

html.light pre code .hljs-literal,
html.rust pre code .hljs-literal {
  color: #cc4400;
}

html.light pre code .hljs-symbol,
html.rust pre code .hljs-symbol {
  color: #b91c1c;
  font-weight: 600;
}

html.light pre code .hljs-comment,
html.rust pre code .hljs-comment {
  color: #6a737d;
  font-style: italic;
}

html.light pre code .hljs-doctag,
html.rust pre code .hljs-doctag {
  color: #6f42c1;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
 * RFD metadata block — top of each RFD page.
 *
 * A subtle horizontal strip directly under the H1: a colored status
 * pill on the left, dates and supersession info trailing in muted
 * text, separated from the body by a thin underline. State colors
 * map to outcome semantics — green for committed (in force), yellow
 * for discussion (open), slate for superseded (replaced), orange
 * for abandoned (dropped).
 * ───────────────────────────────────────────────────────────────── */

.rfd-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.85rem;
  row-gap: 0.4rem;
  margin: -0.5rem 0 2.25rem 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.18);
  font-size: 0.92rem;
  line-height: 1.4;
}

.rfd-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.75em;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  position: relative;
  top: -0.05rem;
}

/* Committed — settled, in force */
.rfd-status-committed {
  color: #c2d94c;
  background: rgba(194, 217, 76, 0.12);
  border: 1px solid rgba(194, 217, 76, 0.4);
}

/* Discussion — open, drafting */
.rfd-status-discussion {
  color: #ffb454;
  background: rgba(255, 180, 84, 0.12);
  border: 1px solid rgba(255, 180, 84, 0.4);
}

/* Superseded — replaced by a later RFD */
.rfd-status-superseded {
  color: #b3b1ad;
  background: rgba(179, 177, 173, 0.10);
  border: 1px solid rgba(179, 177, 173, 0.3);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(179, 177, 173, 0.5);
}

/* Abandoned — dropped without resolution */
.rfd-status-abandoned {
  color: #ff7733;
  background: rgba(255, 119, 51, 0.10);
  border: 1px solid rgba(255, 119, 51, 0.4);
}

.rfd-meta-line {
  color: #6f7680;
  font-size: 0.88rem;
}

.rfd-meta-line a {
  color: inherit;
  border-bottom: 1px dotted currentColor;
  text-decoration: none;
}
.rfd-meta-line a:hover {
  color: #39bae6;
  border-bottom-color: #39bae6;
}

/* Light theme adjustments — softer pill backgrounds, darker pill text. */
html.light .rfd-meta {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
html.light .rfd-meta-line {
  color: #898f95;
}
html.light .rfd-status-committed {
  color: #4d7300;
  background: rgba(77, 115, 0, 0.08);
  border-color: rgba(77, 115, 0, 0.3);
}
html.light .rfd-status-discussion {
  color: #b35900;
  background: rgba(179, 89, 0, 0.08);
  border-color: rgba(179, 89, 0, 0.3);
}
html.light .rfd-status-superseded {
  color: #828c99;
  background: rgba(130, 140, 153, 0.08);
  border-color: rgba(130, 140, 153, 0.25);
}
html.light .rfd-status-abandoned {
  color: #b32d00;
  background: rgba(179, 45, 0, 0.08);
  border-color: rgba(179, 45, 0, 0.3);
}
