/* ============================================================
   RELIQUARY — token layer
   Light Platinum DS Guide. Values mirror DESIGN.md exactly.
   Light is the default theme; dark is additive, not a repaint.
   ============================================================ */

:root {
  /* --- ground & structure ---------------------------------- */
  --light:          oklch(1 0 0);              /* literal pure white, chroma 0 */
  --mount:          oklch(0.985 0.004 250);
  --mount-deep:     oklch(0.965 0.006 250);
  --platinum:       oklch(0.885 0.008 250);    /* hairline rules */
  --platinum-edge:  oklch(0.60 0.014 250);     /* control borders, 3.1:1 */

  /* --- ink -------------------------------------------------- */
  --ink:            oklch(0.24 0.014 250);     /* 11.9:1 */
  --ink-soft:       oklch(0.44 0.016 250);     /*  5.3:1 */
  --ink-quiet:      oklch(0.48 0.014 250);     /*  4.8:1 — the floor. Nothing lighter carries text. */

  /* --- gold: two roles, never interchangeable --------------- */
  --gold:           oklch(0.78 0.142 80);      /* ORNAMENT ONLY. 2.1:1 — never text, never focus. */
  --gold-ink:       oklch(0.485 0.108 72);     /* text + interactive. 4.7:1 */
  --gold-wash:      oklch(0.965 0.028 82);     /* QUARANTINED: legendary callout + home bloom only */
  --on-gold:        var(--ink);                /* dark ink on gold fill = 6.6:1 */

  /* --- semantic --------------------------------------------- */
  --jade:           oklch(0.50 0.088 162);     /* obtained / complete / verified */
  --ember:          oklch(0.51 0.16 32);       /* missable */
  --dread:          oklch(0.42 0.09 300);      /* hack instability */
  --jade-wash:      oklch(0.97 0.018 162);
  --ember-wash:     oklch(0.97 0.020 32);
  --dread-wash:     oklch(0.97 0.016 300);

  /* --- the Plates ------------------------------------------- */
  /* One lightness for all 18. Only hue + chroma move. Ink is --ink,
     which flips with the theme, so contrast holds in both. */
  --plate-l:        0.86;
  --plate-edge-l:   0.62;

  --plate-normal:   oklch(var(--plate-l) 0.015 90);
  --plate-fire:     oklch(var(--plate-l) 0.130 42);
  --plate-water:    oklch(var(--plate-l) 0.110 250);
  --plate-electric: oklch(var(--plate-l) 0.140 95);
  --plate-grass:    oklch(var(--plate-l) 0.115 145);
  --plate-ice:      oklch(var(--plate-l) 0.075 210);
  --plate-fighting: oklch(var(--plate-l) 0.115 30);
  --plate-poison:   oklch(var(--plate-l) 0.100 320);
  --plate-ground:   oklch(var(--plate-l) 0.085 70);
  --plate-flying:   oklch(var(--plate-l) 0.075 265);
  --plate-psychic:  oklch(var(--plate-l) 0.110 5);
  --plate-bug:      oklch(var(--plate-l) 0.105 125);
  --plate-rock:     oklch(var(--plate-l) 0.060 80);
  --plate-ghost:    oklch(var(--plate-l) 0.090 295);
  --plate-dragon:   oklch(var(--plate-l) 0.105 275);
  --plate-dark:     oklch(var(--plate-l) 0.020 60);
  --plate-steel:    oklch(var(--plate-l) 0.025 240);
  --plate-fairy:    oklch(var(--plate-l) 0.090 350);

  /* --- type ------------------------------------------------- */
  --font-display: "Eczar", Georgia, serif;
  --font-text:    "Alegreya Sans", system-ui, sans-serif;

  --size-threshold: clamp(2.5rem, 5.5vw, 4.25rem);
  --size-chapter:   clamp(2rem, 3.6vw, 3rem);
  --size-route:     clamp(1.6rem, 2.4vw, 2.125rem);
  --size-sub:       1.375rem;
  --size-body:      1.1875rem;
  --size-data:      0.9375rem;
  --size-label:     0.875rem;
  --size-caption:   0.8125rem;

  --measure: 68ch;

  /* --- space (4px base, uneven by design) -------------------- */
  --s1: 0.25rem; --s2: 0.5rem;  --s3: 0.75rem; --s4: 1rem;
  --s6: 1.5rem;  --s8: 2rem;    --s12: 3rem;   --s16: 4rem;
  --s24: 6rem;   --s32: 8rem;   --s40: 10rem;

  /* --- radius: metal is not soft ----------------------------- */
  --r-mount: 2px;
  --r-control: 4px;

  /* --- z-index: semantic scale, never arbitrary -------------- */
  --z-rail: 10; --z-sticky: 20; --z-dropdown: 30;
  --z-backdrop: 40; --z-modal: 50; --z-toast: 60; --z-tooltip: 70;

  /* --- motion ------------------------------------------------ */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --t-hover: 120ms; --t-state: 200ms; --t-panel: 320ms; --t-load: 900ms;

  /* --- elevation: light, not shadow -------------------------- */
  /* the matte: the white band a mounted object sits inside. Pure white in
     light; in dark it stays one step above the page ground so the case still
     reads as raised rather than blending into the background. */
  --matte: oklch(1 0 0);
  --inset-mount: inset 0 1px 0 oklch(1 0 0 / 0.9);
  --lift: 0 1px 2px oklch(0.24 0.014 250 / 0.06), 0 4px 12px oklch(0.24 0.014 250 / 0.04);

  color-scheme: light;
}

/* ============================================================
   DARK — the void before creation. Gold stops being ornament
   and becomes the light source, so it may carry text here.
   ============================================================ */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --light:         oklch(0.145 0.006 255);
    --mount:         oklch(0.185 0.008 255);
    --mount-deep:    oklch(0.225 0.009 255);
    --platinum:      oklch(0.32 0.012 255);
    --platinum-edge: oklch(0.55 0.014 255);

    --ink:           oklch(0.95 0.006 255);
    --ink-soft:      oklch(0.76 0.010 255);
    --ink-quiet:     oklch(0.66 0.012 255);

    --gold:          oklch(0.80 0.145 82);
    --gold-ink:      oklch(0.82 0.135 82);
    --gold-wash:     oklch(0.26 0.048 82);
    --on-gold:       oklch(0.16 0.010 82);

    --jade:          oklch(0.74 0.100 162);
    --ember:         oklch(0.73 0.140 40);
    --dread:         oklch(0.72 0.110 300);
    --jade-wash:     oklch(0.24 0.032 162);
    --ember-wash:    oklch(0.25 0.040 32);
    --dread-wash:    oklch(0.24 0.034 300);

    --plate-l:       0.34;
    --plate-edge-l:  0.56;

    --matte:         oklch(0.185 0.008 255);
    --inset-mount:   inset 0 1px 0 oklch(1 0 0 / 0.05);
    --lift:          0 1px 2px oklch(0 0 0 / 0.4), 0 4px 16px oklch(0 0 0 / 0.3);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --light:         oklch(0.145 0.006 255);
  --mount:         oklch(0.185 0.008 255);
  --mount-deep:    oklch(0.225 0.009 255);
  --platinum:      oklch(0.32 0.012 255);
  --platinum-edge: oklch(0.55 0.014 255);

  --ink:           oklch(0.95 0.006 255);
  --ink-soft:      oklch(0.76 0.010 255);
  --ink-quiet:     oklch(0.66 0.012 255);

  --gold:          oklch(0.80 0.145 82);
  --gold-ink:      oklch(0.82 0.135 82);
  --gold-wash:     oklch(0.26 0.048 82);
  --on-gold:       oklch(0.16 0.010 82);

  --jade:          oklch(0.74 0.100 162);
  --ember:         oklch(0.73 0.140 40);
  --dread:         oklch(0.72 0.110 300);
  --jade-wash:     oklch(0.24 0.032 162);
  --ember-wash:    oklch(0.25 0.040 32);
  --dread-wash:    oklch(0.24 0.034 300);

  --plate-l:       0.34;
  --plate-edge-l:  0.56;

  --matte:         oklch(0.185 0.008 255);
  --inset-mount:   inset 0 1px 0 oklch(1 0 0 / 0.05);
  --lift:          0 1px 2px oklch(0 0 0 / 0.4), 0 4px 16px oklch(0 0 0 / 0.3);

  color-scheme: dark;
}
