/* ==========================================================================
   KORYOS skin for MOVIM — v3 (July 2026)
   WRITTEN AGAINST THE PINNED BUILD'S ACTUAL CSS (harvested from
   /var/www/html/public/theme/css). No guessed names.

   How Movim's theming actually works (verified in color.css):
     • Custom properties hold RGB TRIPLETS, not colors:
         --movim-background-main: 255, 255, 255;
       consumed as rgb(var(--x)) and rgba(var(--x), alpha).
       Setting them to hex silently breaks — that was the v2 no-op.
     • They are declared on `body`, not :root.
     • --movim-accent is NOT in the CSS (PHP sets it inline per user);
       it IS consumed as a plain color, so it takes a normal hex.
     • Night mode redeclares the same vars on body.nightmode AND inside
       @media (prefers-color-scheme: dark) — both must be overridden or
       dark-mode browsers ignore the skin entirely.

   What each variable paints (verified by usage):
     --movim-background        page background AND the nav rail (body>nav)
     --movim-background-main   cards, dialogs, drawer, context menus
     --movim-font              ALL text, via rgba(...,.87/.54/.12) — also
                               hairlines and dividers
     --movim-element-action    hover/active tints on list items + nav
     --movim-gray              code blocks, notification chips, grid fills
     --movim-header-font       header text colour
     --movim-accent            buttons, counters, focus outlines, FAB

   STRUCTURAL RULES: exactly one, and it works WITH the system rather than
   against it — the dark nav rail is achieved by redeclaring the font
   variable inside body>nav, so Movim's own `color: rgba(var(--movim-font))`
   rules resolve to paper ink there. No selector fighting; this is why v1's
   cream-on-cream cannot recur.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wdth,wght@0,62..125,100..900;1,62..125,100..900&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* --- Palette: Koryos tokens as RGB triplets --- */
body,
body.nightmode {
  --movim-background:        239, 233, 218;  /* #EFE9DA paper */
  --movim-background-main:   250, 247, 238;  /* #FAF7EE card cream */
  --movim-font:               33,  29,  20;  /* #211D14 warm ink */
  --movim-element-action:     33,  29,  20;  /* hover tints = pressed paper */
  --movim-gray:              221, 210, 184;  /* #DDD2B8 paper-3 */
  --movim-header-font:       239, 233, 218;  /* paper ink on dark headers */
  --movim-accent:            #B8442F;        /* Koryos red (plain colour) */
}

/* Dark-mode browsers: Movim redeclares in a media query, so we must too. */
@media (prefers-color-scheme: dark) {
  body,
  body.nightmode {
    --movim-background:        239, 233, 218;
    --movim-background-main:   250, 247, 238;
    --movim-font:               33,  29,  20;
    --movim-element-action:     33,  29,  20;
    --movim-gray:              221, 210, 184;
    --movim-header-font:       239, 233, 218;
    --movim-accent:            #B8442F;
  }
}

/* --- Typography: Koryos faces --- */
body,
body input,
body textarea,
body select,
body button {
  font-family: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
body h1, body h2, body h3, body h4 {
  font-family: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.01em;
}
body time,
body code,
body pre,
body kbd {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

/* --- The one structural rule: dark navigation rail ---
   Redeclaring --movim-font INSIDE the rail makes Movim's own
   `color: rgba(var(--movim-font), .87)` resolve to paper on dark.
   Icons, labels and hover tints all follow automatically. */
body > nav {
  background-color: #26221A;                 /* --panel-dark */
  --movim-font:            239, 233, 218;    /* paper ink inside the rail */
  --movim-element-action:  239, 233, 218;    /* hover tint = light wash */
  --movim-background-main:  38,  34,  26;    /* rail sub-surfaces stay dark */
}
