/* Foxcairn — Stardust high-fantasy design tokens
 *
 * Every value is SAMPLED FROM THE MASCOT (art/anchor8/west.png, anchor
 * 608fc8cc-6918-4917-8adb-60d429e1ff4a) rather than invented. The asset defines the brand;
 * that is what makes the forum, the clients and the icon tiers read as one system.
 *
 * ONE FILE, EVERY TARGET: the NodeBB theme, the web front end, and the Tauri desktop and
 * Android shells all consume this. That is the whole argument for Tauri over Electron --
 * the same tokens reach all four surfaces without being reimplemented.
 *
 * Theme states are three, not two: an explicit choice stamps data-theme on <html>, and the
 * default "system" setting stamps nothing at all -- so bare :root must be complete, and the
 * media query must be guarded against an explicit light choice.
 */

:root {
  /* ---- raw pigment, straight off the fox ------------------------------- */
  --fc-pelt:          #cf601a;   /* rust orange, the largest area of the mascot */
  --fc-pelt-lit:      #e17c1f;   /* sunlit fur */
  --fc-pelt-shade:    #b54922;
  --fc-pelt-deep:     #a23e25;
  --fc-leather:       #692618;   /* boots, strapping */
  --fc-cloth:         #232b5a;   /* midnight caparison */
  --fc-cloth-lit:     #2e4172;   /* indigo, the lit face of the cloth */
  --fc-gold:          #f1a93c;   /* the radiant star -- the only true accent */
  --fc-gold-deep:     #c2801f;
  --fc-parchment:     #efddc0;   /* muzzle, chest */
  --fc-parchment-dim: #d8b694;
  --fc-ink:           #1d0711;   /* near-black with a plum bias, not neutral */

  /* ---- semantic surface, LIGHT (parchment and ink) --------------------- */
  --fc-bg:            #f7f2e8;
  --fc-surface:       #fffdf8;
  --fc-surface-2:     #efe6d5;
  --fc-line:          #ddcfb6;
  --fc-line-soft:     #eae0cd;
  --fc-text:          #1d0711;
  --fc-text-2:        #4a3b3a;
  --fc-muted:         #7d6c63;

  --fc-accent:        #8a5a10;   /* gold darkened until it passes on parchment */
  --fc-accent-bg:     #f7ead0;
  --fc-link:          #7a3417;

  --fc-ok:            #2c6042;
  --fc-ok-bg:         #dcecdf;
  --fc-warn:          #8a5a10;
  --fc-warn-bg:       #f7ead0;
  --fc-danger:        #9c3320;
  --fc-danger-bg:     #f7e0d8;

  /* ---- form --------------------------------------------------------- */
  --fc-radius:        6px;
  --fc-radius-lg:     10px;
  --fc-shadow:        0 1px 2px rgba(29,7,17,.07), 0 8px 24px -14px rgba(29,7,17,.28);

  --fc-font-display:  "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --fc-font-body:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fc-font-mono:     ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Pixel art must never be smoothed. Applies to the mascot at every tier. */
  --fc-pixel:         pixelated;
}

/* ---- DARK: the default look, and where the palette actually comes alive ---
 * Guarded so an explicit light choice still beats a dark OS preference. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fc-bg:          #100a18;
    --fc-surface:     #191128;
    --fc-surface-2:   #221a33;
    --fc-line:        #342844;
    --fc-line-soft:   #281e39;
    --fc-text:        #f0e6d8;
    --fc-text-2:      #c3b5ab;
    --fc-muted:       #8d7f86;

    --fc-accent:      #f1a93c;   /* full-strength gold; it only needs dimming on parchment */
    --fc-accent-bg:   #2b2113;
    --fc-link:        #e8944a;

    --fc-ok:          #6cc79a;
    --fc-ok-bg:       #14291f;
    --fc-warn:        #f1a93c;
    --fc-warn-bg:     #2b2113;
    --fc-danger:      #e88a63;
    --fc-danger-bg:   #2e1712;

    --fc-shadow:      0 1px 2px rgba(0,0,0,.5), 0 8px 24px -14px rgba(0,0,0,.75);
  }
}

/* Explicit dark choice must win over a light OS preference too. */
:root[data-theme="dark"] {
  --fc-bg:            #100a18;
  --fc-surface:       #191128;
  --fc-surface-2:     #221a33;
  --fc-line:          #342844;
  --fc-line-soft:     #281e39;
  --fc-text:          #f0e6d8;
  --fc-text-2:        #c3b5ab;
  --fc-muted:         #8d7f86;
  --fc-accent:        #f1a93c;
  --fc-accent-bg:     #2b2113;
  --fc-link:          #e8944a;
  --fc-ok:            #6cc79a;
  --fc-ok-bg:         #14291f;
  --fc-warn:          #f1a93c;
  --fc-warn-bg:       #2b2113;
  --fc-danger:        #e88a63;
  --fc-danger-bg:     #2e1712;
  --fc-shadow:        0 1px 2px rgba(0,0,0,.5), 0 8px 24px -14px rgba(0,0,0,.75);
}

/* Never smooth the mascot, at any tier or size. */
.fc-pixel, .fc-mark img, img.fc-mark {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
