/* ===========================================
   UNDERWORLD OCCUPATIONS — DESIGN TOKENS AND TYPE ROLES
   ===========================================
   The one place the page's colors, font stacks and text styles (section 4,
   the six type roles) are written down. The
   slide deck (underworld-labor-market.html), the treemap dashboard
   (underworld-occupations.html + .css) and ghost-animation.js all read
   from here: CSS with var(--…), scripts with UW.color("--…") from
   underworld-tokens.js (d3's .attr() can't resolve var()). Loaded by
   index.php and by both standalone preview files.

   Three tiers, each built only from the one above it:
     1. Palette   — every raw color the page uses, named by what it is,
                    all prefixed --uw- so none can shadow the site's own
                    variables (style.css already has --ink and --paper).
                    A color used with transparency is written as an
                    r, g, b channel token (--uw-ink-rgb) so CSS can say
                    rgba(var(--uw-ink-rgb), 0.15).
     2. Interface — the existing semantic names (text, borders, grounds,
                    rubrication, shadows, type, spacing).
     3. Charts    — what a color means in a chart (series, grid, axis,
                    ramps, RIASEC). Charts ask for these, never for a
                    palette color directly.

   The twelve near-identical paper shades were merged into four in
   Phase 4. The ten inks are still as found: they set text contrast,
   which is the readability pass's job. */

:root {
  /* ===========================================
     1. PALETTE
     =========================================== */

  /* --- Inks, darkest first --- */
  --uw-ink-rgb: 26, 20, 8;
  --uw-ink: rgb(var(--uw-ink-rgb)); /* #1a1408 iron-gall ink */
  --uw-ink-deep-rgb: 20, 14, 8; /* lightbox backdrop only */
  --uw-ink-deep: rgb(var(--uw-ink-deep-rgb));
  --uw-ink-brown-rgb: 44, 26, 8;
  --uw-ink-brown: rgb(var(--uw-ink-brown-rgb)); /* #2c1a08 dashboard wage panel */
  --uw-ink-soft: #2c2014;
  --uw-umber-rgb: 61, 43, 24;
  --uw-umber: rgb(var(--uw-umber-rgb)); /* #3d2b18 */
  --uw-umber-light: #4a3a28;
  --uw-sepia-rgb: 90, 62, 40;
  --uw-sepia: rgb(var(--uw-sepia-rgb)); /* #5a3e28 sepia ink: rules, borders */
  --uw-graphite: #5a5347; /* treemap cell stroke */
  --uw-sepia-faint: #5c4a38;
  --uw-graphite-light: #5c5347;
  --uw-pewter: #7a7167; /* deck loading message */
  --uw-black-rgb: 0, 0, 0;
  --uw-black: rgb(var(--uw-black-rgb));

  /* --- Accents --- */
  --uw-vermillion-rgb: 179, 58, 43;
  --uw-vermillion: rgb(var(--uw-vermillion-rgb)); /* #b33a2b rubrication */
  --uw-vermillion-dark: #a64224; /* deck work-context "negative" label */
  --uw-verdigris-deep: #2e7358; /* "increase", positive change */
  --uw-gold: #c49a2a; /* ghost-tooltip timeline dot */
  --uw-blue-deep: #1e3f7a; /* ghost-tooltip timeline dot */

  /* --- Papers, lightest first: four shades (twelve near-identical ones
         were merged into these in Phase 4, 2026-11-25) --- */
  --uw-white: #ffffff;
  --uw-paper-light: #e4dac0; /* cards, chart surfaces, tooltips */
  --uw-paper-light-hover: #e2d4ba; /* red 4% over light, opaque: the sticky
                                      first cell of a hovered table row */
  --uw-paper: #ddd0b3; /* parchment: frame headers, table headers */
  --uw-paper-ground: #d6c9ad; /* woodcut ground, callouts, buttons */
  --uw-paper-dark: #cfc2a0; /* stain in the parchment gradients, button hover */
  --uw-bone-rgb: 255, 250, 240; /* ghost bodies in the deck's strip plots */
  --uw-bone: rgb(var(--uw-bone-rgb));
  --uw-bone-ghost: #f0e8d8; /* ghost body in ghost-animation.js */
  --uw-stain-dark-rgb: 100, 75, 40; /* paper-texture gradients */
  --uw-stain-dark: rgb(var(--uw-stain-dark-rgb));
  --uw-stain-warm-rgb: 120, 90, 50;
  --uw-stain-warm: rgb(var(--uw-stain-warm-rgb));

  /* --- Renaissance pigments: four tones each, full pigment first.
         The treemap's major groups cycle through these families. --- */
  --uw-pigment-vermillion-1: #a65c53;
  --uw-pigment-vermillion-2: #b47d6e;
  --uw-pigment-vermillion-3: #c09885;
  --uw-pigment-vermillion-4: #cbb199;
  --uw-pigment-ultramarine-1: #576d84;
  --uw-pigment-ultramarine-2: #747d86;
  --uw-pigment-ultramarine-3: #979894;
  --uw-pigment-ultramarine-4: #b7b1a1;
  --uw-pigment-verdigris-1: #5c7a68;
  --uw-pigment-verdigris-2: #81927d;
  --uw-pigment-verdigris-3: #9fa58e;
  --uw-pigment-verdigris-4: #bbb89e;
  --uw-pigment-minium-1: #b5704a;
  --uw-pigment-minium-2: #c48c68;
  --uw-pigment-minium-3: #cfa383;
  --uw-pigment-minium-4: #d9b89c;
  --uw-pigment-tyrian-1: #75526b;
  --uw-pigment-tyrian-2: #92767f;
  --uw-pigment-tyrian-3: #aa938f;
  --uw-pigment-tyrian-4: #c1af9e;
  --uw-pigment-sienna-1: #8c6e56;
  --uw-pigment-sienna-2: #a28970;
  --uw-pigment-sienna-3: #b5a086;
  --uw-pigment-sienna-4: #c6b59a;
  --uw-pigment-madder-1: #8a5a6e;
  --uw-pigment-madder-2: #a17b81;
  --uw-pigment-madder-3: #b49791;
  --uw-pigment-madder-4: #c5b19f;
  --uw-pigment-woad-1: #507880;
  --uw-pigment-woad-2: #769194;
  --uw-pigment-woad-3: #98a8a4;
  --uw-pigment-woad-4: #b5bcb2;
  --uw-pigment-sapgreen-1: #6a7a52;
  --uw-pigment-sapgreen-2: #8a926d;
  --uw-pigment-sapgreen-3: #a5a584;
  --uw-pigment-sapgreen-4: #beb899;
  --uw-pigment-orpiment-1: #b09858;
  --uw-pigment-orpiment-2: #bba772;
  --uw-pigment-orpiment-3: #c5b387;
  --uw-pigment-orpiment-4: #cebe9a;
  --uw-pigment-pumice-1: #7e7a6d;
  --uw-pigment-pumice-2: #989480;
  --uw-pigment-pumice-3: #adaa92;
  --uw-pigment-pumice-4: #c0bda4;

  /* --- Font stacks --- */
  --uw-font-cormorant: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --uw-font-cormorant-sc: "Cormorant SC", "Cormorant Garamond", Georgia, serif;
  --uw-font-fell-sc: "IM Fell Great Primer SC", "Cormorant SC", Georgia, serif;
  --uw-font-fell: "IM Fell Great Primer", "Cormorant Garamond", Georgia, serif;
  --uw-font-georgia: Georgia, serif; /* manicules ☜ ☞, which Cormorant lacks */
  --uw-font-generic-serif: serif; /* the strip plot's × close button */

  /* ===========================================
     2. INTERFACE
     =========================================== */

  /* --- Grounds --- */
  --color-bg-page: var(--uw-white);
  --color-bg-parchment: var(--uw-paper);
  --color-bg-card: var(--uw-paper-light);
  --color-bg-subtle: var(--uw-paper);
  --color-bg-button: var(--uw-paper-ground);
  --color-bg-button-hover: var(--uw-paper-dark);
  --color-bg-table-header: var(--uw-paper);
  --color-bg-table-alt: var(--uw-paper-light);
  /* The dashboard's framed panels: the same light paper as the deck's
     chart cards and the tooltips, so every data surface on the page is one
     color (was the dark paper; lightened for contrast, owner 2026-11-25). */
  --color-bg-frame-inset: var(--uw-paper-light);

  /* --- Borders (sepia ink) --- */
  --color-border-light: rgba(var(--uw-sepia-rgb), 0.18);
  --color-border-medium: var(--uw-sepia);
  --color-border-subtle: rgba(var(--uw-sepia-rgb), 0.15);
  --color-border-hover: rgba(var(--uw-sepia-rgb), 0.22);

  /* --- Text (iron-gall ink) --- */
  --color-text-primary: var(--uw-ink);
  --color-text-secondary: var(--uw-ink-soft);
  --color-text-tertiary: var(--uw-umber);
  --color-text-muted: var(--uw-umber-light);
  --color-text-subtle: var(--uw-graphite-light);
  --color-text-faint: var(--uw-sepia-faint);

  /* --- Rubrication (vermillion) --- */
  --color-rubrication: var(--uw-vermillion);
  --color-rubrication-light: rgba(var(--uw-vermillion-rgb), 0.15);
  --color-rubrication-border: rgba(var(--uw-vermillion-rgb), 0.2);

  /* --- Status --- */
  --color-status-positive: var(--uw-verdigris-deep);
  --color-status-negative: var(--uw-vermillion);

  /* --- Shadows --- */
  --shadow-card:
    0 2px 8px -2px rgba(var(--uw-ink-rgb), 0.15),
    0 1px 3px -1px rgba(var(--uw-ink-rgb), 0.1);
  --shadow-tooltip:
    0 8px 24px -4px rgba(var(--uw-ink-rgb), 0.2),
    0 2px 8px -2px rgba(var(--uw-ink-rgb), 0.12);

  /* --- Type --- */
  --font-family: var(--uw-font-cormorant);
  --font-family-sc: var(--uw-font-cormorant-sc);
  --font-family-display: var(--uw-font-fell-sc);
  --font-family-display-body: var(--uw-font-fell);
  --font-family-data: var(--uw-font-cormorant);
  --font-family-glyph: var(--uw-font-georgia);

  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 13px;
  --font-size-md: 14px;
  --font-size-lg: 15px;
  --font-size-xl: 16px;
  --font-size-2xl: 20px;
  /* --font-size-2xs retired; alias kept at 11px for any lingering references. */
  --font-size-2xs: 11px;

  /* --- Spacing, motion, layout --- */
  --spacing-xs: 4px;
  --spacing-sm: 6px;
  --spacing-md: 8px;
  --spacing-lg: 12px;
  --spacing-xl: 16px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
  --width-panel-riasec: 270px;
  --width-panel-employment: 180px;

  /* ===========================================
     3. CHARTS
     =========================================== */

  /* --- Series. One rule for every chart in the deck and the dashboard:
         RED is the thing under examination (the underworld in the deck;
         the current selection, or whatever the reader is hovering, in
         the dashboard). INK/SEPIA is the U.S. workforce it is measured
         against. A chart that shows only one series without a
         comparison uses the neutral bar below, so red keeps its meaning.
         -line  outlines, polylines, box strokes, median ticks
         -fill  translucent areas: radar polygons, density curves, boxes
         -bar   solid bars and marks (bar chart, strip-plot blobs)
         -rule  the U.S. median reference line, drawn dashed 6,3 --- */
  --series-focus-line: var(--uw-vermillion);
  --series-focus-fill: rgba(var(--uw-vermillion-rgb), 0.2);
  --series-focus-bar: var(--uw-pigment-vermillion-1);
  --series-benchmark-line: var(--uw-ink);
  --series-benchmark-fill: rgba(var(--uw-ink-rgb), 0.18);
  --series-benchmark-bar: var(--uw-pigment-sienna-3);
  --series-benchmark-rule: rgba(var(--uw-ink-rgb), 0.45);
  --chart-bar-neutral: var(--uw-pigment-sienna-1);

  /* --- Axes and gridlines, the same on every chart: the axis line 1.5px
         ink with 1px tick marks, tick numbers in --chart-tick-text, and
         gridlines 1px, dashed 3,3. SVG charts get them from UW.axis() and
         UW.gridlines() in underworld-tokens.js; the HTML work-context
         charts from these tokens directly. --- */
  --chart-axis: var(--uw-ink);
  --chart-axis-width: 1.5px;
  --chart-grid: rgba(var(--uw-ink-rgb), 0.2);
  --chart-tick-text: var(--color-text-tertiary);

  /* --- Chart boxes (Phase 4, the owner's pick 2026-11-25). Deck charts
         sit on the flat light card (--color-bg-card), no border. A callout
         inside a chart (the strip plots' explainers, the Diogenes tags)
         is the ground with a 1px sepia rule, drawn at 92% so the marks
         behind it show faintly. The dashboard's framed panels keep their
         double rule (--color-bg-frame-inset, the light card): they sit on the colored
         treemap frames and need an edge. --- */
  --callout-fill: var(--uw-paper-ground);
  --callout-rule: var(--color-border-medium);

  /* --- Work-context answers, worst answer first: the vermillion
         pigment family fading to the woodcut ground. --- */
  --ramp-undesirable-1: var(--uw-pigment-vermillion-1);
  --ramp-undesirable-2: var(--uw-pigment-vermillion-2);
  --ramp-undesirable-3: var(--uw-pigment-vermillion-3);
  --ramp-undesirable-4: var(--uw-pigment-vermillion-4);
  --ramp-undesirable-5: var(--uw-paper-ground);

  /* --- RIASEC interest areas (drawn from the pigments) --- */
  --riasec-realistic: var(--uw-pigment-vermillion-1);
  --riasec-investigative: var(--uw-pigment-ultramarine-1);
  --riasec-artistic: var(--uw-pigment-sapgreen-1);
  --riasec-social: var(--uw-pigment-minium-1);
  --riasec-enterprising: var(--uw-pigment-madder-1);
  --riasec-conventional: var(--uw-pigment-orpiment-1);

  /* --- Treemap cell labels (were used but never defined, so they fell
         back to black) --- */
  --color-text-label: var(--uw-ink);
  --color-text-value: var(--uw-ink);

  /* ===========================================
     4. TYPE ROLES (sizes; the rules are below)
     =========================================== */
  --type-eyebrow-size: 12px;
  --type-eyebrow-tracking: 0.12em;
  --type-headline-size: 18px; /* the dashboard's panels use 14px */
  --type-tick-size: 12px;
  --type-value-size: 12px;
  --type-category-size: 12px;
  --type-legend-size: 11px;
  --type-legend-tracking: 0.08em;
}

/* ===========================================
   4. TYPE ROLES
   ===========================================
   Every piece of text in the deck and the dashboard belongs to one of six
   roles. The rule for a role, here, owns the text's face, weight, case,
   tracking and (where the role has one) size and color; the rule that
   places an element (in the deck's <style> or underworld-occupations.css)
   keeps only layout. To restyle a role, change it here. Scripts give
   the text they draw the role's .uw-* class instead of inline font
   styles, because an inline style would beat the role.

     1 Display   slide titles, the dashboard's level title, bio titles
                 IM Fell Great Primer SC, regular, tracked 0.04em. Size
                 and color stay with the element (30px title slide, 22px
                 slide titles, 20px dashboard, 28px ink bio titles).
     2 Eyebrow   section and panel headings, table headers, callout heads
                 Cormorant SC bold, capitals, tracked, red, one size.
     3 Headline  a chart's own title
                 Cormorant Garamond bold, ink, sentence or title case.
     4 Body      running text and annotations: Cormorant Garamond, which
                 every text inherits from the roots below.
     5 Data      ticks, values printed on marks, category labels
                 Cormorant Garamond with lining figures (numbers sit on
                 the line instead of bobbing like old-style figures).
     6 Legend    legend entries and axis titles
                 Cormorant SC semibold, capitals, tracked, small. Chart
                 legends are unboxed: UW.legend() in underworld-tokens.js
                 draws them in SVG, the swatch rule below in HTML.

   Not covered on purpose: the treemap's labels (sized to fit each cell),
   the Diogenes specimen tags (an annotation card with its own measured
   wrapping), the RIASEC letter glyphs, buttons, and the epigraph styling
   inside the Rabelais excerpt. */

/* --- The roots. The site's style.css sets p and h1–h6 to Spectral in
       near-black #111, with tight heading tracking; any paragraph or
       heading here that didn't set its own font picked that up (the
       Rabelais excerpt, the Diogenes callout). :where() keeps this at
       element weight, so any class below still wins; it beats the site's
       rules because this sheet loads after style.css. --- */
.umlm-context,
#dashboard-container,
.tooltip,
.gt-tooltip {
  font-family: var(--font-family);
  /* Only the weights each font really has: IM Fell is regular-only, so a
     bold Fell title would otherwise be smeared into a fake bold. */
  font-synthesis: none;
}
:where(.umlm-context, #dashboard-container, .tooltip, .gt-tooltip) :is(p, li, h1, h2, h3, h4, h5, h6) {
  font-family: inherit;
  color: inherit;
  letter-spacing: inherit;
}
:where(.umlm-context, #dashboard-container, .tooltip, .gt-tooltip) :is(h1, h2, h3, h4, h5, h6) {
  font-weight: inherit;
}

/* --- 1 Display --- */
.slide-title,
.title-slide-title,
.bio-slide-title,
.dashboard-frame-header .level-title,
.uo-mobile-title {
  font-family: var(--font-family-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* --- 2 Eyebrow --- */
.uw-eyebrow,
.nuremberg-title-banner,
.industry-chart-title,
.detail-section-title,
.ban-header,
.wage-stats-table th,
.wage-stats-table .row-label,
.ct-tier-label,
.uo-mobile-eyebrow,
.riasec-card-header,
.riasec-control-bar label,
.classify-section-header,
.sources-section-header,
.wc-compare-col-header,
.wc-compare-carousel-counter,
.wc-all-counter,
.workforce-table thead th,
.epi-viewer-book,
.epi-viewer-folio,
.epi-block-label,
.gt-label {
  font-family: var(--font-family-sc);
  font-size: var(--type-eyebrow-size);
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: var(--type-eyebrow-tracking);
  color: var(--color-rubrication);
  -webkit-text-stroke: 0;
}
svg .uw-eyebrow {
  fill: var(--color-rubrication);
}

/* --- 3 Headline --- */
.uw-headline,
.wc-compare-title,
.wc-slide-card-title,
.wc-card-title {
  font-family: var(--font-family);
  font-size: var(--type-headline-size);
  font-weight: 700;
  font-style: normal;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-text-primary);
}
svg .uw-headline {
  fill: var(--color-text-primary);
}
.wc-card-title {
  font-size: 14px;
}

/* --- 5 Data --- */
.umlm-context svg,
#dashboard-container svg,
.tooltip svg,
.gt-tooltip svg,
.uw-tick,
.uw-value,
.uw-category,
.wc-bar-pct,
.wc-slide-bar-pct,
.wc-compare-pct,
.wc-axis-label,
.wc-slide-axis-label,
.wc-compare-axis-label,
.gt-axis-tick,
.gt-wage-amount,
.gt-wage-delta,
.gt-box-row-value,
.ban-cell-value,
.ban-cell-value-small,
.ban-cell-sub,
.emp-year-label-b,
.wc-nav-counter,
.slide-indicator {
  font-variant-numeric: lining-nums;
}
.workforce-table,
.wage-stats-table {
  font-variant-numeric: lining-nums tabular-nums;
}
/* Ticks: the numbers along an axis. */
svg .uw-tick {
  fill: var(--chart-tick-text);
}
.uw-tick,
.wc-axis-label,
.wc-slide-axis-label,
.wc-compare-axis-label,
.gt-axis-tick {
  font-family: var(--font-family-data);
  font-size: var(--type-tick-size);
  font-weight: 400;
}
/* Values printed on or beside a mark. */
.uw-value,
.wc-bar-pct,
.wc-slide-bar-pct,
.wc-compare-pct {
  font-family: var(--font-family-data);
  font-size: var(--type-value-size);
  font-weight: 500;
}
/* Category labels: what a bar or row is. */
.uw-category,
.wc-bar-label,
.wc-slide-bar-label,
.wc-compare-cat-label {
  font-family: var(--font-family);
  font-size: var(--type-category-size);
  font-weight: 600;
}

/* --- 6 Legend --- */
.uw-legend,
.riasec-slide-legend,
.riasec-legend {
  font-family: var(--font-family-sc);
  font-size: var(--type-legend-size);
  font-weight: 600;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: var(--type-legend-tracking);
}
/* ===========================================
   5. TOOLTIPS
   ===========================================
   One card for every tooltip on the page: the deck's (#umlm-tooltip,
   .gt-tooltip), the dashboard's and the ghosts' (.tooltip). Each kind
   keeps only its width. Inside, one anatomy:
     <header class="gt-header">           the hovered thing, ruled off
       <span class="gt-name">…</span>     .is-underworld for a figure (red)
       <span class="gt-role">— …</span>   an optional epithet
     </header>
     <span class="gt-label">…</span>       an eyebrow over a section
     <p class="gt-line"><strong>Label:</strong> value</p>
   The dashboard's classification-tree and ghost-spine tooltips keep their
   own insides inside this card. */
.tooltip,
.gt-tooltip {
  box-sizing: border-box;
  background-color: var(--color-bg-card);
  border: 2px solid var(--color-border-medium);
  border-radius: 0;
  box-shadow: var(--shadow-tooltip);
  padding: 12px;
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
  line-height: 1.5;
}
.gt-tooltip {
  width: 320px;
}
.gt-header {
  display: block;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--color-rubrication-border);
}
.gt-name {
  color: var(--color-text-primary);
  font-family: var(--font-family-display-body);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.gt-name.is-underworld {
  color: var(--color-rubrication);
}
.gt-role {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-base);
  margin-left: 4px;
}
.gt-section {
  margin-bottom: 12px;
}
.gt-section:last-child {
  margin-bottom: 0;
}
.gt-line {
  margin: 0 0 6px;
  line-height: 1.5;
}
.gt-line:last-child {
  margin-bottom: 0;
}
.gt-line strong {
  font-weight: 700;
  color: var(--color-text-primary);
}
.gt-line em,
.gt-content em {
  font-style: italic;
}
.gt-label {
  display: block;
  margin-bottom: 4px;
}

/* The line sample in an HTML legend (the radars), the same 14×3 stroke
   and 6px gap that UW.legend() draws in the SVG charts. */
.riasec-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
