/* ICONOCRACIA — Color tokens · MNEMOSYNE VIVA
   Editorial house for the archive, atlas and ICONOCRACIA research.
   Print black on cream paper, sienna as the single accent, old gold for
   ornament, aged ink as the secondary voice. No corporate gradients.
   Canonical source: tokens/source/mnemosyne-viva-design-tokens.json

   NOTE: this file is consumed by apresentacao/ only. iconocracia/tokens/colors.css
   is a byte-identical copy consumed by iconocracia/styles.css — keep them in sync.
   Root styles.css does NOT import this file; it carries its own :root. */

:root {
  color-scheme: light;
  /* ── Mnemosyne Viva canonical palette ───────── */
  --mv-ink:         #111111;
  --mv-paper:       #F5F0E6;
  --mv-cream:       #FFF9EF;
  --mv-sienna:      #8B3A1A;
  --mv-sienna-dark: #632713;
  --mv-ochre:       #D4AF37;
  --mv-aged:        #7B5E3C;
  --mv-soft:        #E8DDC8;
  --mv-line:        #2A211A;
  --mv-muted:       #756451;
  --mv-night:       #15110E;

  /* ── Base · grounds ─────────────────────────── */
  --paper:        var(--mv-paper); /* papel creme — primary page ground    */
  --cream:        var(--mv-cream); /* card / panel surface                 */
  --ghost:        var(--mv-cream); /* document folio surface (codex pages) */
  --ivory:        var(--mv-soft);  /* warm ivory — text on dark grounds    */
  --ivory-light:  color-mix(in srgb, var(--mv-cream) 70%, var(--mv-paper));
  --muted:        var(--mv-soft);  /* image placeholder / inert fill       */

  /* ── Base · inks ────────────────────────────── */
  --ink:          var(--mv-ink);   /* preto de impressão                   */
  --warm-gray:    var(--mv-muted); /* secondary prose                      */
  --marble:       color-mix(in srgb, var(--mv-muted) 70%, var(--mv-paper));
  --faded:        var(--mv-muted); /* labels, meta, disabled               */
  --faded-on-dark:var(--mv-soft);  /* muted text over dark grounds         */

  /* ── Brand mark · lockups ────────────────────
     Kept as distinct names because the mark is rendered from them, but they
     now resolve to the Mnemosyne palette so the lockup matches the site. */
  --brand-paper:    var(--mv-paper);
  --brand-indigo:   var(--mv-night);   /* mark line / wordmark ink         */
  --brand-lacre:    var(--mv-sienna);  /* seal fill — was wax-seal red     */
  --brand-ocre:     var(--mv-ochre);   /* brass — secondary mark accent    */
  --brand-amethyst: var(--mv-aged);    /* archival voice — was amethyst    */

  /* ── Base · juridical accents ───────────────── */
  --terracotta:     var(--mv-sienna);      /* primary act                  */
  --terracotta-deep:var(--mv-sienna-dark);
  --deep-blue:      var(--mv-night);       /* institutional ground         */
  --navy-mid:       color-mix(in srgb, var(--mv-night) 80%, var(--mv-aged));
  --gold:           var(--mv-ochre);       /* ouro antigo — rules, frames  */
  --gold-bright:    color-mix(in srgb, var(--mv-ochre) 78%, var(--mv-cream));

  /* ── Base · borders ─────────────────────────── */
  --light-border:  var(--mv-soft);         /* hairline on light grounds    */
  --hairline-dark: color-mix(in srgb, var(--mv-ochre) 32%, transparent);

  /* ── Cabinet chrome ──────────────────────────
     The dark tier framing the light reading surface: header, sidebar,
     plate captions. Flat night ground — no corporate gradient. */
  --cabinet-top:    var(--mv-night);
  --cabinet-bottom: var(--mv-night);
  --cabinet-grad:   linear-gradient(180deg, var(--cabinet-top), var(--cabinet-bottom));
  --plumb-line:     linear-gradient(180deg, var(--gold-bright), color-mix(in srgb, var(--mv-ochre) 16%, transparent));
  --plumb-node:     var(--brand-amethyst);
  --plumb-halo:     color-mix(in srgb, var(--mv-aged) 22%, transparent);
  --plumb-bob:      var(--brand-lacre);

  /* ── Regimes (iconocratic classification) ─────
     DELIBERATELY NOT rebranded. These encode a categorical variable — the
     regime a corpus item belongs to — so they must stay mutually
     distinguishable. Collapsing them onto the brand palette would destroy
     the classification. Revisit only as a considered data-viz decision. */
  --fundacional:  #5B3FA0; /* foundational — revolutionary corpus        */
  --normativo:    #2A7A5A; /* normative — bureaucratic stabilization     */
  --militar:      #A02828; /* military — ENDURECIMENTO                    */
  --contra-alegoria:#A04030; /* counter-allegory / fissures              */

  /* ── Semantic aliases ───────────────────────── */
  --surface-page:    var(--paper);
  --surface-card:    var(--cream);
  --surface-folio:   var(--ghost);
  --surface-cabinet: var(--deep-blue); /* dark "cabinet" tier (Atlas)    */
  --surface-cabinet-2: var(--navy-mid);

  --text-primary:  var(--ink);
  --text-secondary:var(--warm-gray);
  --text-tertiary: var(--faded);
  --text-on-dark:  var(--ivory);
  --text-on-dark-muted: var(--faded-on-dark);

  /* ── Semantic accents (the system's two-voice rule) ──
     sienna = the LIVE MARGIN: primary action, the rule down the side of a
              record, alerts/contra-allegory.
     aged   = SELECTION / ACTIVE STATE: the chosen nav node, the selected
              row, the feminine archival voice. */
  --accent:         var(--terracotta); /* primary action / live margin    */
  --accent-gold:   var(--gold);       /* archival mark / frame           */
  --accent-navy:   var(--deep-blue);
  --state-active:  var(--brand-amethyst); /* selected / active node       */
  --state-active-halo: var(--plumb-halo);
  --alert:         var(--terracotta);  /* warnings / fissures             */

  --border:        var(--light-border);
  --border-on-dark:var(--hairline-dark);

  --selection:     color-mix(in srgb, var(--mv-sienna) 18%, transparent);

  /* ── Country accents (corpus geography) ───────
     Also a categorical scale — left intact for the same reason as regimes. */
  --country-fr:#1D3A6E; --country-uk:#7C2D12; --country-de:#3A3A3A;
  --country-us:#2A4D7A; --country-be:#8A6D1F; --country-br:#2A7A5A;
}

/* ── Dark mode — "sala de leitura à noite" (2026-08) ─────────────────────
   Light by default; <html data-theme="dark"> explicitly enables dark mode.
   Only the --mv-* base tokens flip — every alias recomputes from them.
   The on-dark text tokens (--ivory, --ivory-light, --faded-on-dark,
   --gold-bright) are pinned light because the cabinet chrome (--mv-night)
   stays dark in both themes. --brand-indigo follows the ink so the
   wordmark stays legible on dark grounds. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --mv-ink: #EDE4D3;
  --mv-paper: #1C1712;
  --mv-cream: #26201A;
  --mv-sienna: #C96F45;
  --mv-sienna-dark: #A85436;
  --mv-aged: #A68A64;
  --mv-soft: #322820;
  --mv-line: #D8CCB4;
  --mv-muted: #A89780;
  --mv-night: #14100C;
  --ivory: #E8DDC8;
  --ivory-light: #FAF6EB;
  --faded-on-dark: #E8DDC8;
  --gold-bright: color-mix(in srgb, var(--mv-ochre) 78%, #FFF9EF);
  --brand-indigo: #EDE4D3;
  --selection: color-mix(in srgb, var(--mv-sienna) 32%, transparent);
}
