/* =============================================================================
   tokens.css — design tokens
   Everything downstream reads from these. Change a value here and it
   propagates through every page.

   Theme contract: every token in the light and dark blocks must exist in both.
   If one is omitted, its value leaks from the other block. Fixed tokens
   (fonts, layout, pure white) live outside the theme blocks.

   Theme islands: a subtree can opt into a palette with data-theme="light" or
   data-theme="dark". This is used for fixed contexts such as the share card
   and the intentionally inverse footer/CTA sections.
   ============================================================================= */

:root {
  /* fixed neutrals */
  --white: #ffffff;
  --white-rgb: 255, 255, 255;
  --on-gold: #1a1714;

  /* theme previews — fixed so swatches don't follow the active theme */
  --theme-preview-light: #f4f1ea;
  --theme-preview-dark: #141210;

  /* type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-title: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* layout */
  --max-w: 1180px;
  --gutter: 1.25rem;
}

/* --- Light theme (default) ------------------------------------------------ */
:root,
[data-theme="light"] {
  color-scheme: light;

  /* surfaces */
  --paper: #f4f1ea;
  --paper-deep: #eae4d5;
  --ink: #1a1714;
  --ink-soft: #3a3530;
  --ink-muted: #8b8478;
  --rule: #d8d2c4;

  /* accent — --oxblood is the solid brand fill; --oxblood-text is for
     links, labels, borders, and tints; --on-oxblood sits on solid fills. */
  --oxblood: #6b2a2a;
  --oxblood-text: #6b2a2a;
  --oxblood-hi: #8b3a3a;
  --on-oxblood: #f4f1ea;
  --gold: #b8860b;
  --gold-deep: #7a5800;

  /* feedback */
  --success: #2e7d32;
  --danger: #b00020;

  /* color channels — used for translucent tints and overlays.
     Keep each channel in sync with its solid token. */
  --paper-rgb: 244, 241, 234;
  --ink-rgb: 26, 23, 20;
  --oxblood-rgb: 107, 42, 42;
  --oxblood-text-rgb: 107, 42, 42;
  --gold-rgb: 184, 134, 11;
  --success-rgb: 46, 125, 50;
  --shadow-rgb: 26, 23, 20;
  --scrim-rgb: 26, 23, 20;

  /* browser chrome */
  --theme-color: #f4f1ea;
}

/* --- Dark theme ----------------------------------------------------------- */
[data-theme="dark"] {
  color-scheme: dark;

  /* surfaces */
  --paper: #141210;
  --paper-deep: #1e1a17;
  --ink: #f2ede4;
  --ink-soft: #cfc8ba;
  --ink-muted: #9a9184;
  --rule: #302b25;

  /* accent */
  --oxblood: #6b2a2a;
  --oxblood-text: #d08585;
  --oxblood-hi: #9b4a4a;
  --on-oxblood: #f4f1ea;
  --gold: #d8ac4a;
  --gold-deep: #e6c06a;

  /* feedback */
  --success: #7ecb83;
  --danger: #ff8a9a;

  /* color channels */
  --paper-rgb: 20, 18, 16;
  --ink-rgb: 242, 237, 228;
  --oxblood-rgb: 107, 42, 42;
  --oxblood-text-rgb: 208, 133, 133;
  --gold-rgb: 216, 172, 74;
  --success-rgb: 126, 203, 131;
  --shadow-rgb: 0, 0, 0;
  --scrim-rgb: 0, 0, 0;

  /* browser chrome */
  --theme-color: #141210;
}

@media (min-width: 768px) {
  :root {
    --gutter: 2rem;
  }
}
