/* CUMULUS edition colour tokens — the single definition.
 *
 * Before this file the five editions' colours existed in four separate
 * maps: a JS object in the teams lobby, a CSS block in the create-team
 * picker, a PHP array in the home page, and the lockup's own tokens.
 * Four places to edit, four places to drift. Everything now reads from
 * here.
 *
 * Four tokens per edition:
 *
 *   --edition-ink-dark    ink on a dark surface (the app header when a
 *                         layout paints it purple)
 *   --edition-ink-light   ink on a light surface (pills, light chrome)
 *   --edition-tint        pill/band background. Explicit hex, never an
 *                         opacity: a translucent wash shifts with
 *                         whatever sits behind it, and these land on
 *                         white cards, tinted bands and dark cards.
 *   --edition-chrome      the dark structural colour — monogram tiles,
 *                         card backgrounds. Relocated verbatim from the
 *                         lobby's EDITION_PALETTE.primary.
 *
 * CONTRAST. The pill runs 11.2px/600, which needs 4.5:1, so ink-light
 * is measured against its own tint:
 *
 *   framework   5.10:1     ports       5.77:1     resilience  5.02:1
 *   insurance   4.91:1     aquaculture 4.54:1  <- almost no margin
 *
 * Aquaculture has ~0.04 of headroom. Lightening --edition-aquaculture-
 * tint or lightening its ink drops it below AA. Re-measure before
 * touching either.
 *
 * Framework's ink-light is #7A6020, not the #8A6D22 in the brand kit's
 * on-light column: that value gave 4.18:1 on the tint and failed.
 * #7A6020 is 5.10:1 on tint, 5.96:1 on white.
 *
 * USAGE. Raw values live on :root. An element opts into a set by
 * carrying data-edition="<code>", which resolves the four generic
 * names for that element and its subtree:
 *
 *   <span data-edition="ports" style="background: var(--edition-tint);
 *                                     color: var(--edition-ink-light)">
 *
 * The attribute selector is deliberately unqualified. It sets custom
 * properties only — it paints nothing by itself — so it is safe on any
 * element, and it means a card that already carries data-edition for
 * other reasons needs no extra markup.
 */

:root {
    --edition-framework-ink-dark:    #C8A04B;
    --edition-framework-ink-light:   #7A6020;
    --edition-framework-tint:        #F2EDDF;
    --edition-framework-chrome:      #2C3845;

    --edition-ports-ink-dark:        #B49BCB;
    --edition-ports-ink-light:       #6B4E85;
    --edition-ports-tint:            #EFE9F3;
    --edition-ports-chrome:          #2D1F3D;

    --edition-resilience-ink-dark:   #7FA8C4;
    --edition-resilience-ink-light:  #2E6B8A;
    --edition-resilience-tint:       #E6EFF4;
    --edition-resilience-chrome:     #0B3041;

    --edition-aquaculture-ink-dark:  #7FC49B;
    --edition-aquaculture-ink-light: #2F7A52;
    --edition-aquaculture-tint:      #E7F2EB;
    --edition-aquaculture-chrome:    #1C3326;

    --edition-insurance-ink-dark:    #6FB3B3;
    --edition-insurance-ink-light:   #2E7070;
    --edition-insurance-tint:        #E4F0F0;
    --edition-insurance-chrome:      #1F4045;
}

/* Framework is also the fallback: an unknown or absent edition code
   resolves to it rather than to nothing. */
[data-edition] {
    --edition-ink-dark:  var(--edition-framework-ink-dark);
    --edition-ink-light: var(--edition-framework-ink-light);
    --edition-tint:      var(--edition-framework-tint);
    --edition-chrome:    var(--edition-framework-chrome);
}

[data-edition="ports"] {
    --edition-ink-dark:  var(--edition-ports-ink-dark);
    --edition-ink-light: var(--edition-ports-ink-light);
    --edition-tint:      var(--edition-ports-tint);
    --edition-chrome:    var(--edition-ports-chrome);
}

[data-edition="resilience"] {
    --edition-ink-dark:  var(--edition-resilience-ink-dark);
    --edition-ink-light: var(--edition-resilience-ink-light);
    --edition-tint:      var(--edition-resilience-tint);
    --edition-chrome:    var(--edition-resilience-chrome);
}

[data-edition="aquaculture"] {
    --edition-ink-dark:  var(--edition-aquaculture-ink-dark);
    --edition-ink-light: var(--edition-aquaculture-ink-light);
    --edition-tint:      var(--edition-aquaculture-tint);
    --edition-chrome:    var(--edition-aquaculture-chrome);
}

[data-edition="insurance"] {
    --edition-ink-dark:  var(--edition-insurance-ink-dark);
    --edition-ink-light: var(--edition-insurance-ink-light);
    --edition-tint:      var(--edition-insurance-tint);
    --edition-chrome:    var(--edition-insurance-chrome);
}
