/*
 * dark.css — the dark theme, GENERATED. Do not hand-edit.
 *
 *     python3 tools/dark-palette.py            # rewrite this file
 *     python3 tools/dark-palette.py --check    # verify it is current
 *
 * Linked after athenana.css, so its rule overrides win on source order at
 * equal specificity. It redefines organic.css's OWN tokens rather than
 * introducing a parallel set under new names — the thing athenana.css's
 * header rules out is aliasing the design system, not re-tuning it.
 *
 * Every value below is solved for CONTRAST PARITY: each token sits at the
 * same contrast against the dark ground that its light counterpart sits at
 * against the light one (the Denison cream #f4e9d3 since 4 November 2026),
 * except the W3 tokens, pinned at the values step 3 measured. That is why
 * athenana.css's rules need no dark variants — the ramps' step numbers mean distance from the ground
 * (100..300 background, 700..900 text), and that reading is true in both
 * themes. See tools/dark-palette.py for the derivation.
 *
 * There is deliberately NO [data-theme] selector and no toggle: nothing
 * would consume it yet. Adding one later is a change to the generator.
 */

@media (prefers-color-scheme: dark) {
  :root {
    /* Tells the browser to render form controls, scrollbars and the default
       ::selection dark. Without it a dark page keeps light native widgets. */
    color-scheme: dark;

    --color-bg: #221a14;
    --color-surface: #2a2019;
    --color-text: #efe0c4;
    --color-accent: #e0744c;
    --color-accent-2: #c4b296;

    /* Derived from --color-text so it follows the ground. organic.css
       hardcodes #201e1d here, which is invisible on a dark ground. */
    --color-divider: color-mix(in srgb, var(--color-text) 16%, transparent);

    --color-neutral-100: #2a2019;
    --color-neutral-200: #3a2d23;
    --color-neutral-300: #4a3b2e;
    --color-neutral-400: #5e4e3f;
    --color-neutral-500: #7a6957;
    --color-neutral-600: #a08e78;   /* 5.41:1 */
    --color-neutral-700: #c4b296;   /* 8.28:1 */
    --color-neutral-800: #dccbaf;
    --color-neutral-900: #efe0c4;

    --color-accent-100: #33211a;
    --color-accent-200: #3d261c;
    --color-accent-300: #4e3022;
    --color-accent-400: #6e3f2b;
    --color-accent-500: #9a5235;
    --color-accent-600: #ec8a65;
    --color-accent-700: #e0744c;   /* 5.52:1 */
    --color-accent-800: #eda585;
    --color-accent-900: #f7d6c4;

    --color-accent-2-100: #2a2019;
    --color-accent-2-200: #3a2d23;
    --color-accent-2-300: #4a3b2e;
    --color-accent-2-400: #5e4e3f;
    --color-accent-2-500: #7a6957;
    --color-accent-2-600: #a08e78;
    --color-accent-2-700: #c4b296;   /* 8.28:1 */
    --color-accent-2-800: #dccbaf;
    --color-accent-2-900: #efe0c4;

    /* Decoration, not text: the mark and the sundown scene. */
    --color-mark-sun: #e0ad45;
    --color-sundown-hills: #4d3829;
    --color-sundown-water: #c75c38;
    --color-holiday-blue: #8fb0e0;
    --color-holiday-red: #e0505f;
    --color-holiday-brown: #b07a52;

    /* organic.css's shadows are #2e2b25 at 14/16/22% — a dark shadow on a
       dark ground is invisible. Near-black at a higher alpha reads as depth
       again; the geometry is unchanged. */
    --shadow-sm: 0 1px 2px color-mix(in srgb, #000 40%, transparent);
    --shadow-md: 0 3px 10px color-mix(in srgb, #000 46%, transparent);
    --shadow-lg: 0 12px 32px color-mix(in srgb, #000 58%, transparent);
  }

  /* .washed lifts publisher images toward a LIGHT ground (brightness 1.1).
     On a dark one that makes every card image glare. Same treatment, damped
     instead of lifted — the saturate/contrast halves are unchanged. */
  .washed { filter: saturate(0.6) contrast(0.85) brightness(0.82) opacity(0.92); }

  /* A tag chip's tint is dark here, so darkening it further on hover is
     nearly invisible. Same 6% step, the other way. */
  a.tag:hover { filter: brightness(1.18); }

  /* THE TWO SCRIMS. Both derive from an ink token — .savedialog::backdrop from
     --color-text, organic's .dialog-backdrop from --color-neutral-900 — which
     inverts to near-white here and LIGHTENED the page behind the dialog
     instead of dimming it. Caught by looking, not by the token maths: a
     scrim's job is a fixed direction, so it is pinned to black rather than
     derived. Raised a little because the ground it dims is already dark.

     Every other color-mix overlay in both files is a hover tint or muted ink
     and is correct unchanged — those SHOULD move away from the ground, which
     is exactly what deriving them from --color-text does. These two are the
     only backgrounds among them; checked by listing every overlay >= 25%.
     The quick box (#107) borrowed .savedialog's recipe, and so its fault. */
  .savedialog::backdrop { background: color-mix(in srgb, #000 60%, transparent); }
  .quickbox::backdrop { background: color-mix(in srgb, #000 60%, transparent); }
  .dialog-backdrop { background: color-mix(in srgb, #000 65%, transparent); }
}
