/* Site color tokens (--t-*): light/dark palettes, manual overrides and high contrast.
   Shared by app.css and by pages that only need the palette (rjuhsd.school). */
:root {
  --t-bg: #f6f7f3;
  --t-bg2: #ffffff;
  --t-bg3: #e9ede5;
  --t-fg: #202622;
  --t-fg2: #657062;
  --t-fg3: #657062;
  --t-ac: #f75383;
  --t-ac-ink: #ffffff;
  --t-ac2: #e03d6c;
  --t-ac3: #e03d6c;
  --t-bd: #dce2d8;
  --t-bda: #c5cfc0;
  --t-gl: transparent;
  --t-gls: #fdeef3;
  --t-gr: #f75383;
  --t-bgr: none;
  --t-radius: 10px;
  --t-radius-sm: 7px;
  --t-motion: 0.14s;
  --t-display: 'DM Sans', system-ui, -apple-system, sans-serif;
  --t-font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --sheet-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ink-shadow: none;
  --mobile-dock-space: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --t-bg: #17191b;
    --t-bg2: #222527;
    --t-bg3: #2b2f31;
    --t-fg: #f4f5f1;
    --t-fg2: #a6adaf;
    --t-fg3: #828b8c;
    --t-ac: #ff6f99;
    --t-ac-ink: #ffffff;
    --t-ac2: #ff8bad;
    --t-ac3: #ff8bad;
    --t-bd: #363a3c;
    --t-bda: #4b5355;
    --t-gls: #332127;
    --t-gr: #ff6f99;
  }
}

/* Manual light/dark override (site-theme.js sets data-theme from the
   "theme" cookie via the preferences page's Theme Preset). Both blocks sit
   outside the media query and key off an attribute selector so they outrank
   the query regardless of actual OS preference or source order. */
:root[data-theme="light"] {
  --t-bg: #f6f7f3;
  --t-bg2: #ffffff;
  --t-bg3: #e9ede5;
  --t-fg: #202622;
  --t-fg2: #657062;
  --t-fg3: #657062;
  --t-ac: #f75383;
  --t-ac-ink: #ffffff;
  --t-ac2: #e03d6c;
  --t-ac3: #e03d6c;
  --t-bd: #dce2d8;
  --t-bda: #c5cfc0;
  --t-gl: transparent;
  --t-gls: #fdeef3;
  --t-gr: #f75383;
}
:root[data-theme="dark"] {
  --t-bg: #17191b;
  --t-bg2: #222527;
  --t-bg3: #2b2f31;
  --t-fg: #f4f5f1;
  --t-fg2: #a6adaf;
  --t-fg3: #828b8c;
  --t-ac: #ff6f99;
  --t-ac-ink: #ffffff;
  --t-ac2: #ff8bad;
  --t-ac3: #ff8bad;
  --t-bd: #363a3c;
  --t-bda: #4b5355;
  --t-gls: #332127;
  --t-gr: #ff6f99;
}

/* High contrast mode (Preferences → Appearance, or OS "increase contrast").
   Darkens/lightens text and borders well past the normal palette and swaps
   the accent for a more AA-compliant shade; background tokens are left
   alone since text/border contrast is what actually hurts readability. */
:root[data-contrast="high"] {
  --t-fg: #000000;
  --t-fg2: #1a1a1a;
  --t-fg3: #000000;
  --t-bd: #3d3d42;
  --t-bda: #19191c;
  --t-ac: #c81855;
  --t-ac2: #a10f43;
  --t-ac3: #a10f43;
}
@media (prefers-contrast: more) {
  :root {
    --t-fg: #000000;
    --t-fg2: #1a1a1a;
    --t-fg3: #000000;
    --t-bd: #3d3d42;
    --t-bda: #19191c;
    --t-ac: #c81855;
    --t-ac2: #a10f43;
    --t-ac3: #a10f43;
  }
}
@media (prefers-color-scheme: dark) {
  :root[data-contrast="high"] {
    --t-fg: #f6f7f3;
    --t-fg2: #f0f0f0;
    --t-fg3: #f6f7f3;
    --t-bd: #9a9aa0;
    --t-bda: #c7c7cc;
    --t-ac: #ffb3c9;
    --t-ac2: #ffd1df;
    --t-ac3: #ffd1df;
  }
  @media (prefers-contrast: more) {
    :root {
      --t-fg: #f6f7f3;
      --t-fg2: #f0f0f0;
      --t-fg3: #f6f7f3;
      --t-bd: #9a9aa0;
      --t-bda: #c7c7cc;
      --t-ac: #ffb3c9;
      --t-ac2: #ffd1df;
      --t-ac3: #ffd1df;
    }
  }
}
:root[data-theme="light"][data-contrast="high"] {
  --t-fg: #000000;
  --t-fg2: #1a1a1a;
  --t-fg3: #000000;
  --t-bd: #3d3d42;
  --t-bda: #19191c;
  --t-ac: #c81855;
  --t-ac2: #a10f43;
  --t-ac3: #a10f43;
}
:root[data-theme="dark"][data-contrast="high"] {
  --t-fg: #f6f7f3;
  --t-fg2: #f0f0f0;
  --t-fg3: #f6f7f3;
  --t-bd: #9a9aa0;
  --t-bda: #c7c7cc;
  --t-ac: #ffb3c9;
  --t-ac2: #ffd1df;
  --t-ac3: #ffd1df;
}
