/*
 * GamesWeb design tokens. The only file that defines colour, type, spacing, radius, shadow and motion.
 * The site and the SDK widgets (feedback, ads slot, sign-in) both load this file, so they match.
 * No hex value lives anywhere else (site.css, render.mjs, placeholder-art.mjs all use these variables), so a
 * change of palette is a change to the two blocks below and nothing else.
 *
 * Theme: dark by default, always. The system's light setting is ignored on purpose. Light is a manual choice
 * (data-theme="light" on <html>, set by the toggle and remembered in localStorage under "hub-theme").
 * site/check-contrast.mjs fails the build if a text pair in either theme drops below WCAG AA.
 *
 * Palette A2: warm graphite (dark) and warm paper (light), with no purple and no blue tint, so the game covers carry
 * the colour. One primary, teal, used for Play and for anything you press (dark ink on the bright dark-theme teal,
 * white on the deeper light-theme teal). One link colour, a lighter teal. A calm coral chip for the small "New"
 * badge: it is deliberately not a solid coral, which would sit at the hue of the red-orange category tags.
 * Per game: a page or tile sets --accent, --accent-contrast and --card-bg from game.json. The game accent is used
 * for the category tag and a soft glow, never for the Play button and never as text colour.
 *
 * Where each colour is used:
 *   --hub-bg, --hub-surface, --hub-surface-2, --hub-surface-3   page, cards and panels, inputs and chips, hover and pressed fills
 *   --hub-ink, --hub-ink-soft, --hub-line                        text, secondary text, borders
 *   --hub-primary, -ink, -edge                                   Play buttons, active chips, brand mark, list markers, heading bars
 *   --hub-secondary                                              links and highlighted words (text), brand node dot
 *   --hub-highlight, -ink                                        the "Just launched" badge
 *   --hub-focus                                                  keyboard focus ring
 *   --hub-art, --hub-art-tint                                    blog illustrations and the placeholder art
 *   --hub-scrim, --hub-on-image                                  text laid over cover art
 *
 * Illustrations (blog figures) use one accent of their own: --hub-art, and --hub-art-tint for soft fills. Both are
 * graphics colours: 3:1 on the page and surface, never text. See site/lib/figures.mjs.
 */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --hub-bg: #141210;
  --hub-surface: #1b1916;
  --hub-surface-2: #23201c;
  --hub-surface-3: #2d2924;
  --hub-ink: #f4efe8;
  --hub-ink-soft: #b8b0a5;
  --hub-line: #3b362f;
  --hub-focus: #5fd9cc;
  --hub-primary: #2ec4b6;
  --hub-primary-ink: #04211d;
  --hub-primary-edge: #1a8f84;
  --hub-secondary: #5fd9cc;
  --hub-highlight: #3a1a13;
  --hub-highlight-ink: #ff9d88;
  --hub-scrim: #0c0b0a;
  --hub-on-image: #ffffff;
  --hub-shadow-color: #000000;
  --hub-art: #2ec4b6;
  --hub-art-tint: #123a36;
  --hub-shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 6px 14px -8px rgba(0, 0, 0, 0.7);
  --hub-shadow-2: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 16px 32px -16px rgba(0, 0, 0, 0.8);
  --hub-glow: 0 0 0 1px rgba(46, 196, 182, 0.4), 0 10px 28px -14px rgba(46, 196, 182, 0.35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --hub-bg: #f6f2ec;
  --hub-surface: #ffffff;
  --hub-surface-2: #efe9e0;
  --hub-surface-3: #e5ddd1;
  --hub-ink: #1d1915;
  --hub-ink-soft: #5a534a;
  --hub-line: #d8cfc1;
  --hub-focus: #0b6a62;
  --hub-primary: #0e7c73;
  --hub-primary-ink: #ffffff;
  --hub-primary-edge: #0a5e57;
  --hub-secondary: #0b6a62;
  --hub-highlight: #ffe3dc;
  --hub-highlight-ink: #9a2a12;
  --hub-scrim: #0c0b0a;
  --hub-on-image: #ffffff;
  --hub-shadow-color: #1d1915;
  --hub-art: #0e7c73;
  --hub-art-tint: #d6efec;
  --hub-shadow-1: 0 1px 2px rgba(29, 25, 21, 0.06), 0 6px 16px -10px rgba(29, 25, 21, 0.22);
  --hub-shadow-2: 0 2px 4px rgba(29, 25, 21, 0.06), 0 16px 32px -16px rgba(29, 25, 21, 0.3);
  --hub-glow: 0 0 0 1px rgba(14, 124, 115, 0.45), 0 10px 26px -14px rgba(14, 124, 115, 0.35);
}

:root {
  /* the AR tag (camera games): night navy with the lime of the AR games, the same in both themes */
  --hub-ar-bg: #0b1630;
  --hub-ar-ink: #c8f560;
  --hub-ar-line: #8fd11c;
  /* Accent for widgets and pages that have no game accent: the hub primary. */
  --accent: var(--hub-primary);
  --accent-contrast: var(--hub-primary-ink);
  --card-bg: var(--hub-surface-2);

  /* Type. The display face is for headings, buttons and tags. The text face is for everything else. */
  --hub-font-display: "Hub Display", "Hub Display Fallback", "Arial Rounded MT Bold", "Arial Black", system-ui, sans-serif;
  --hub-font-text: "Hub Text", "Hub Text Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hub-fs-xs: 0.8125rem;
  --hub-fs-sm: 0.9375rem;
  --hub-fs-md: 1.0625rem;
  --hub-fs-lg: 1.25rem;
  --hub-fs-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  --hub-fs-2xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  --hub-fs-3xl: clamp(2.25rem, 1.5rem + 3.4vw, 4rem);
  --hub-lh-tight: 1.1;
  --hub-lh-body: 1.55;

  /* Spacing, on a 4px base. */
  --hub-sp-1: 0.25rem;
  --hub-sp-2: 0.5rem;
  --hub-sp-3: 0.75rem;
  --hub-sp-4: 1rem;
  --hub-sp-5: 1.5rem;
  --hub-sp-6: 2rem;
  --hub-sp-7: 3rem;
  --hub-sp-8: 4.5rem;
  --hub-measure: 68ch;
  --hub-page-max: 76rem;
  --hub-head-h: 3.5rem;

  /* Shape. Rounded cards and chunky pills. */
  --hub-radius-1: 10px;
  --hub-radius-2: 16px;
  --hub-radius-3: 24px;
  --hub-radius-pill: 999px;
  --hub-border: 1px solid var(--hub-line);

  /* Motion. */
  --hub-dur-1: 140ms;
  --hub-dur-2: 280ms;
  --hub-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --hub-dur-1: 0.01ms;
    --hub-dur-2: 0.01ms;
  }
}
