/* ===========================================================================
 * kaliber-site-theme.css — THE SITE PALETTE. ONE DEFINITION, EVERY SHELL.
 * ===========================================================================
 *
 * WHAT THIS FILE IS FOR
 * ---------------------
 * Owner, 2026-08-08, verbatim: "27 legacy pages - we need all pages to match
 * uniform templates and css so yes go ahead and do this please and get rid of
 * overriding monkeypatch bandaid and make sure css is centralized and shared."
 *
 * Two earlier passes on the same day converged the two things a visitor notices
 * first, and each one collapsed N hand-maintained copies into one file:
 *
 *   NAVIGATION  ->  templates/_site_nav_items.html (the destination manifest),
 *                   rendered by _site_nav.html (Jinja) and kaliber-site-nav.php
 *                   (Apache), styled by static/css/kaliber-site-nav.css.
 *                   Was SEVEN copies of the markup and THREE geometries.
 *   BACKDROP    ->  static/css/kaliber-site-backdrop.css, opted into with
 *                   `body class="kaliber-site-backdrop"`.
 *                   Was FOUR different backdrops across four shells.
 *
 * THE PALETTE WAS THE THIRD COPY-PASTE, AND IT WAS STILL OUTSTANDING.
 * Measured on the live site immediately before this file existed, by resolving
 * the cascade for each page's own linked stylesheets (probe harness, 13 URLs
 * across all three renderers):
 *
 *   PAGE(S)                      --glass-bg            --glass-border          --dark-card
 *   ---------------------------  --------------------  ----------------------  ----------
 *   /rules /terms /privacy       rgba(20,0,0,.45)      rgba(255,215,0,.30)     #122432
 *   /meet-the-team /birthday     ^ t7-theme.css:11-12  ^ EMBER + GOLD          ^ NAVY
 *   (+ the other 22 base.html
 *    templates)
 *
 *   /leaderboards /auction       rgba(33,24,59,.82)    rgba(225,217,255,.18)   #1d1636
 *   /intelligence/pals           ^ KALIBER VIOLET      ^ KALIBER               ^ KALIBER
 *   /tournaments (+61 more)         but declared in an INLINE <style> inside
 *                                   kaliber_public_base.html, i.e. reusable
 *                                   only by copying
 *
 *   /purchase                    same Kaliber values a THIRD time, in
 *                                kaliber-purchase-theme.css, scoped to
 *                                `body.kaliber-purchase`
 *
 *   /login /link-account /404    a FOURTH partial copy under DIFFERENT NAMES
 *                                (--ka-ink / --ka-muted / --ka-panel / --ka-line
 *                                / --ka-violet / --ka-pink / --ka-teal) inline in
 *                                kaliber_auth_base.html
 *
 * So the site had a violet navigation bar and a violet backdrop sitting under
 * GOLD-BORDERED, EMBER-FILLED cards on 27 live public pages, and the correct
 * palette itself existed in three-and-a-half hand-maintained copies with two
 * different naming schemes. That is the same failure mode, at the same scale,
 * that produced seven copies of the navigation markup and TWO Cloudflare cache
 * entries for one stylesheet earlier the same day.
 *
 * There is now exactly ONE place in this repository where the Kaliber palette is
 * written down. It is this file.
 *
 * WHY TOKENS AND NOT A RESTYLE
 * ----------------------------
 * The 27 legacy templates do not hardcode their card colours, they READ them:
 * `border: 1px solid var(--glass-border)` appears 8 times in whos_that_pal.html
 * alone, 15 times in custom_pal_creator.html, and `var(--glass-bg)`,
 * `var(--dark-card)`, `var(--primary-color)` and friends are read from
 * style.css, t7-theme.css, cards.css, sale-themes.css, chat.css, compact-view.css
 * and every page's own inline <style>. Re-pointing the PROPERTY therefore
 * restyles all of them at once, with no `!important`, no new selector, and no
 * edit to any page that was already written correctly. That is the same
 * mechanism kaliber-purchase-theme.css used for /purchase and the reason its
 * own header calls the token block "the single highest-leverage rule in the
 * file" — this file is that rule, generalised to the whole site.
 *
 * WHOSE VALUES THESE ARE, AND WHY NOT THE OTHER SET
 * -------------------------------------------------
 * Where the copies DISAGREED, `kaliber_public_base.html` wins, without
 * exception. Three of them disagreed:
 *
 *     TOKEN            public shell (65 pages)   purchase theme (1 page)
 *     ---------------  ------------------------  -----------------------
 *     --gold-light     #f5c451  (a real gold)    #f0abfc  (orchid)
 *     --gold-dark      #b88218                   #7c3aed
 *     --fire-yellow    #f5c451                   #2dd4bf
 *     --glass-border   rgba(225,217,255,.18)     rgba(225,217,255,.20)
 *
 * The rule applied is the one the backdrop pass established and the owner has
 * twice endorsed in practice: THE PAGES THAT ALREADY LOOK RIGHT MUST NOT MOVE.
 * 65 pages render `--gold-light` today (kaliber_public_base.html:320 paints the
 * wallet coin icon with it); one page renders the orchid. Taking the orchid
 * would have restyled 65 correct pages to fix one, and a coin icon that is not
 * gold is a legibility signal lost, not a palette preference. `--glass-border`
 * likewise takes the .18 the 65 pages already resolve.
 *
 * WHAT IS DELIBERATELY *NOT* IN THIS FILE
 * ---------------------------------------
 * 1. GEOMETRY (--radius-*) — RESOLVED BY THE OWNER, 2026-08-09, AND THIS FILE
 *    IS NOW THE SOURCE. It used to say the square-vs-round split was written up
 *    for the owner rather than decided here. The owner decided: DROP
 *    `static/css/square-edges.css`. That sheet redefined --radius-sm/md/lg/xl to
 *    0/2/2/3px and fired `border-radius: 2px !important` from 20 declarations
 *    across 272 selectors, and it was linked by base.html, admin_base.html and
 *    hub/hub_base.html — so 27 legacy pages plus admin plus the hub were square
 *    and the other 71 pages were not. The file is DELETED (backup:
 *    square-edges.css.bak-visual-20260809); its three `:not()` exemptions, which
 *    existed only to stop it squaring the shared nav's `.bottom-nav-container` /
 *    `.nav-list` / `.nav-icon-box`, went with it.
 *    The --radius-* block near the foot of this file is therefore no longer an
 *    inert restatement — on base.html's shell it is now the ONLY declaration of
 *    those tokens, and it is what makes all 98 pages render the same 4/12/18/24px
 *    corners the six PHP prototype pages already used. Do not reintroduce a
 *    flattener; change the four values here instead.
 * 2. LAYOUT, TYPOGRAPHY AND CHROME. Each shell's own identity — the public
 *    shell's Inter body font and 1280px layout, the auth shell's Bootstrap card
 *    overrides, the legacy shell's ticker and account drawer — stays in that
 *    shell. This file is colour only.
 * 3. ANY `!important`. Not one declaration here carries it, and none needs to:
 *    a custom property declared on `:root` in a stylesheet linked after the
 *    sheets it is correcting simply wins on source order. If a future edit
 *    reaches for `!important` in this file, the real problem is the link order
 *    in whichever shell is misbehaving.
 *
 * WHERE IT MUST BE LINKED, IN EACH SHELL
 * --------------------------------------
 *   base.html                  after `{% block extra_css %}`, before
 *                              square-edges.css. AFTER style.css (:root, ember)
 *                              and t7-theme.css (:root, gold) because those
 *                              declare the same property names at the same
 *                              specificity and source order is what decides.
 *                              AFTER extra_css because custom_services.html
 *                              declared its OWN `:root` palette fork there.
 *                              BEFORE square-edges.css so radius stays as-is.
 *   kaliber_public_base.html   in place of the inline `:root` block it used to
 *                              carry; nothing else on that shell declares these.
 *   kaliber_auth_base.html     ditto, for the --ka-* aliases below.
 *   the six PHP pages          beside the backdrop link. They declare none of
 *                              these names today, so this is additive: it gives
 *                              them the shared vocabulary so a future edit does
 *                              not have to invent a seventh copy.
 *
 * CACHE-BUSTER: THE `?v=` ON EVERY LINK TO THIS FILE MUST BE THE SAME STRING
 * -------------------------------------------------------------------------
 * Nine links point here, the same nine that point at kaliber-site-backdrop.css,
 * and they are all the literal `?v=20260808.4`. It is HARDCODED on the Flask
 * side (`url_for(..., v='...')`) rather than left to
 * `@app.url_defaults inject_static_asset_version` (app.py:940), for one reason:
 * PHP cannot call `url_for`, so the Apache half can only ever emit a literal,
 * and if the Flask half emits an mtime token instead then the two halves request
 * two different URLs and Cloudflare caches two objects with two independent
 * invalidation schedules. That is not hypothetical — it happened to
 * kaliber-site-nav.css on 2026-08-08 and produced a site serving two different
 * navigations. That hook returns early when a `v` is supplied, so passing it is
 * the sanctioned opt-out, not a bypass. When this file changes, bump ALL NINE:
 *     grep -rn 'kaliber-site-theme.css' <repo> <docroot>
 * ===========================================================================
 */

:root {
    /* ── KALIBER CORE ─────────────────────────────────────────────────────
       The five hues the whole identity is built from, plus the two neutrals.
       Verbatim from kaliber_public_base.html's retired inline block, so the 65
       pages on that shell resolve byte-identical values before and after this
       file existed. Do not "harmonise" these with a colour picker: the
       navigation stylesheet, the backdrop stylesheet and six PHP pages were all
       eyeballed against exactly these numbers. */
    --kaliber-ink: #f8f6ff;
    --kaliber-muted: #c6c1d8;
    --kaliber-panel: rgba(22, 18, 41, .90);
    --kaliber-line: rgba(225, 217, 255, .16);
    --kaliber-violet: #8b5cf6;
    --kaliber-purple: #a855f7;
    --kaliber-pink: #ec4899;
    --kaliber-teal: #20d6c7;
    --kaliber-teal-light: #2dd4bf;

    /* Composite surfaces. These were only ever declared inside
       kaliber-purchase-theme.css, which meant /purchase was the one page on the
       site that could say "a Kaliber card" without spelling out a gradient. */
    --kaliber-gradient: linear-gradient(135deg, #7c3aed 0%, #db2777 54%, #14b8a6 100%);
    --kaliber-gradient-soft: linear-gradient(135deg, rgba(124, 58, 237, .26), rgba(219, 39, 119, .20) 54%, rgba(20, 184, 166, .17));
    --kaliber-card: linear-gradient(135deg, rgba(33, 24, 59, .94) 0%, rgba(18, 14, 33, .95) 100%);

    /* ── AUTH-SHELL ALIASES ───────────────────────────────────────────────
       `kaliber_auth_base.html` declared the SAME seven colours under SHORTER
       names (--ka-ink, --ka-muted, …) in its own inline <style>. That is a
       fourth copy of the palette AND a second vocabulary for it: an edit to one
       name silently left the other behind, and a reader grepping for
       `--kaliber-ink` would never find the login page.

       Aliased here rather than renamed in that template, because the names are
       read by ~14 declarations across the auth shell and by nothing else, and a
       rename is a diff with no upside and one way to fail (a missed occurrence
       resolves to nothing, and an unresolvable var() throws away the WHOLE
       declaration — that is exactly how the Item Market ended up rendering as
       "borderless square transparent boxes", see kaliber_public_base.html:116).
       Defined by reference, so they cannot drift: there is still ONE value. */
    --ka-ink: var(--kaliber-ink);
    --ka-muted: var(--kaliber-muted);
    --ka-panel: var(--kaliber-panel);
    --ka-line: var(--kaliber-line);
    --ka-violet: var(--kaliber-violet);
    --ka-pink: var(--kaliber-pink);
    --ka-teal: var(--kaliber-teal);

    /* ── style.css TOKEN SET, REPOINTED ───────────────────────────────────
       static/css/style.css:1 is literally headed "xDREAM Gaming" and publishes
       the retired tenant's ember-and-gold system on `:root`:
       --primary-color #ff6b4a (ember red), --secondary-color #ffd700 (gold),
       --dark-card #122432 (a NAVY left over from an even earlier palette),
       --muted-text #a8bfcf. base.html links that sheet on all 27 legacy pages
       and ~4,000 lines of shared CSS read these names.

       They are REPOINTED here rather than edited in style.css, and that is
       deliberate. style.css is also linked by templates outside this pass's
       remit (admin_base.html's tree, map_embed_base.html's siblings) where
       another agent is working; changing the file itself would reach them.
       Repointing at :root from a later sheet changes exactly the documents that
       link THIS file, which is the set of pages the owner asked about.

       VALUES ARE NOT INVENTED. Every one is already published by
       kaliber-purchase-theme.css:84-104 under the same names, so /purchase and
       the other 26 legacy pages resolve identically instead of /purchase being
       the one restyled page. */
    --primary-color: #a855f7;
    --primary-dark: #7c3aed;
    --primary-light: #c4a5fd;
    --primary-glow: rgba(168, 85, 247, .22);
    --secondary-color: #2dd4bf;
    --secondary-dark: #0d9488;
    --secondary-light: #99f6e4;
    --secondary-glow: rgba(45, 212, 191, .18);
    /* "Premium gold" is orchid on Kaliber. The name is kept because ~20 rules
       across style.css, sale-themes.css and the shop templates read it; renaming
       it would leave every one of them on its ember fallback. */
    --premium-gold: #f0abfc;
    --premium-gold-dark: #c026d3;
    --premium-gold-light: #f5d0fe;
    --premium-glow: rgba(217, 70, 239, .18);
    --accent-purple: #a855f7;
    --accent-purple-glow: rgba(168, 85, 247, .18);
    --info-color: #2dd4bf;
    --info-glow: rgba(45, 212, 191, .3);
    --dark-bg: #100d20;
    --dark-bg-alt: #171130;
    --dark-card: #1d1636;
    --dark-card-hover: #271c48;
    --dark-border: rgba(225, 217, 255, .16);
    --dark-border-light: rgba(225, 217, 255, .26);

    /* INK. `--light-text` and `--muted-text` are aliased to the Kaliber
       neutrals by REFERENCE, not by value, for the same anti-drift reason as
       the --ka-* block: two names, one number. This is also the pair the
       accessibility floor is measured on — see the CONTRAST note at the foot of
       this file before changing either. */
    --light-text: var(--kaliber-ink);
    --muted-text: var(--kaliber-muted);
    --text-color: var(--kaliber-ink);
    /* style.css:36 publishes --error-color #ff0055, a pure signal red that is
       indistinguishable from the retired ember accent on a violet field. The
       public shell already used #ff778e; matched here so an error message reads
       as an error on all 98 pages and not as "the theme". */
    --error-color: #ff778e;

    /* ── t7-theme.css TOKEN SET, REPOINTED ────────────────────────────────
       static/css/t7-theme.css:3-15 is the "T7 design system … tokens verbatim
       from Mainpage.php" and is the source of the gold card border this pass
       exists to remove: `--glass-border: rgba(255,215,0,.3)` and
       `--glass-bg: rgba(20,0,0,.45)`, read by the card surfaces on every one of
       the 27 legacy templates.

       THE NAMES ARE KEPT ON PURPOSE. Roughly 40 rules across t7-theme.css,
       style.css, cards.css, sale-themes.css and the pages' own inline <style>
       read --fire-red / --fire-orange / --gold-light / --glass-* / --boss-*.
       Renaming them would not restyle those rules, it would strand them on
       whatever fallback each `var()` happens to carry — and most carry the gold
       literal, so a rename would have made the problem PERMANENT and
       unfixable-by-token. kaliber-purchase-theme.css reached the same
       conclusion for the same reason and says so at its own token block.

       --fire-dark is now the backdrop floor (#100d20), the same value
       kaliber-site-backdrop.css publishes as --kaliber-backdrop-floor, so
       t7-theme.css's `body { background: var(--fire-dark); }` degrades to the
       right colour on any shell that loads t7 WITHOUT the backdrop sheet
       (map_embed_base.html is the live example). */
    --fire-dark: #100d20;
    --fire-red: #8b5cf6;
    --fire-orange: #ec4899;
    --fire-yellow: #f5c451;
    --gold-light: #f5c451;
    --gold-dark: #b88218;
    --glass-bg: rgba(33, 24, 59, .82);
    --glass-border: rgba(225, 217, 255, .18);
    --boss-bg: rgba(28, 20, 48, .72);
    --boss-border: rgba(236, 72, 153, .34);
    /* Left at its real brand value: Discord's blurple is Discord's, not ours,
       and every rule that reads it is painting a Discord control. */
    --discord-purple: #5865F2;

    /* ── GEOMETRY AND ELEVATION THE PUBLIC SHELL HAS TO RESTATE ───────────
       These are NOT a palette and they are here for one narrow reason:
       `kaliber_public_base.html` does not link style.css (that sheet is the
       retired tenant's 4,000 lines of ember chrome), so the ~60 pages on that
       shell had no --radius-*, no --spacing-xxl and no --shadow-xl at all, and
       an unresolvable var() discards the ENTIRE declaration. That is the
       measured cause of the Item Market rendering as "borderless square
       transparent boxes" (66 unresolved var() reads on the live HTML of
       /shop/flea-market). The values are restated VERBATIM from style.css:58-70
       so those pages get back exactly the geometry they were authored against.

       ON THE 27 LEGACY PAGES THESE ARE IMMEDIATELY OVERRIDDEN, AND THAT IS
       CORRECT: base.html links square-edges.css AFTER this file, and that sheet
       sets --radius-sm/md/lg/xl to 0/2/2/3px. So this file changes nothing about
       the corners on those pages — they stay square, exactly as today. See
       "WHAT IS DELIBERATELY NOT IN THIS FILE" in the header for why the
       square-vs-round split is an owner decision and not a bug fixed here. */
    --radius-sm: 4px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --spacing-xxl: 3rem;
    --shadow-xl: 0 34px 72px rgba(0, 0, 0, .34);
}

/* ===========================================================================
 * CONTRAST — MEASURED, NOT EYEBALLED
 * ===========================================================================
 * An earlier pass on 2026-08-08 measured muted ink on the legacy shell at
 * 2.11:1 against the T7 fire backdrop — below every WCAG floor there is — and
 * the backdrop change lifted it to 3.69:1. This file must not give that back,
 * so every ink and every fill was alpha-composited over the REAL backdrop and
 * measured before it was adopted. Method: mean pixel of the actual .webp, under
 * the actual gradient stack, WCAG 2.x relative luminance. Three columns because
 * two separate things changed on these pages today and conflating them hides
 * which one did what — T7-ERA is before the backdrop pass, TODAY is the ember
 * TOKENS on the new Kaliber BACKDROP (i.e. the state this file changes), AFTER
 * is this file:
 *
 *   composited backdrop    T7-ERA #36211b   TODAY #2c213b   AFTER #2c213b
 *   composited card fill   T7-ERA #27120f   TODAY #211221   AFTER #231a3b
 *   composited border      T7-ERA #684d0a   TODAY #644d17   AFTER #453c5e
 *
 *   PAIR                                        T7-ERA   TODAY   AFTER
 *   ------------------------------------------  -------  ------  ------
 *   body ink on backdrop                         14.21   14.17   14.10
 *   muted ink on backdrop                         7.94    7.92    8.64
 *   body ink on card fill                        16.73   16.77   15.33
 *   muted ink on card fill                        9.35    9.37    9.39
 *   card fill vs backdrop (surface separation)    1.18    1.18    1.09
 *   card BORDER vs backdrop                       1.91    1.88    1.48
 *   card BORDER vs card fill                      2.25    2.23    1.61
 *
 * EVERY TEXT PAIR CLEARS WCAG AA (4.5:1) AND AAA (7:1) BY A WIDE MARGIN, and
 * the one that was closest to a floor — muted ink, the token that was measured
 * at 2.11:1 in the T7 era — IMPROVES again, 7.92 -> 8.64, because #c6c1d8 is a
 * lighter neutral than the #a8bfcf it replaces. Body ink on a card falls 16.77
 * -> 15.33 only because the Kaliber card fill is LESS black than the ember one
 * (.82 violet glass vs .45 near-black); 15.33:1 is more than three times the AA
 * requirement and the trade buys a card that is visibly a surface rather than a
 * hole.
 *
 * THE NUMBER THAT GETS WORSE, STATED PLAINLY: the card border drops from 2.23:1
 * to 1.61:1 against its own fill, because a gold hairline on near-black is
 * simply louder than a cool-white one on violet. 1.61 IS EXACTLY THE VALUE THE
 * 65 PAGES ON kaliber_public_base.html ALREADY RENDER — this is the 27 pages
 * converging on the site's existing number, not a new defect introduced here,
 * and matching it is the assignment. It is also below WCAG 1.4.11's 3:1
 * non-text floor, which those 65 pages have been below all along. That floor
 * applies to the boundary of an INTERACTIVE component; a decorative card edge is
 * exempt, and these cards are additionally separated by fill and elevation. It
 * is nevertheless a real accessibility finding and it is FLAGGED FOR THE OWNER
 * rather than fixed unilaterally, because fixing it means changing all 98 pages:
 * `--glass-border` would need roughly alpha .34 to reach 2.3:1 and roughly .55
 * to reach 3:1. Raising it here is a one-line change; it was not made because
 * this pass's contract is that the pages which already look right do not move.
 *
 * If you change an ink or a fill above, re-measure. Do not substitute a
 * screenshot and an opinion.
 */
