/*
 * THE GONG LOGIC DESIGN TOKENS — one set for every site (redesign phase C, 2026-11-16).
 *
 * Until now there were three visual systems: Outfit on beige with a translucent 76px header
 * (gonglogic.com, shop, studio, audio), Newsreader on cream with a white header (the Library), and
 * Source Serif on manuscript paper under a navy band (music). A visitor crossing from one to another
 * met a different company. Now there is one paper, one ink, one type pair, one scale, and each site
 * keeps its personality through ONE colour: its --accent.
 *
 * Every site's own sheet reads these names. A site sheet may DERIVE a token of its own from them
 * (music's --brand is its accent ink), never set a colour of its own for paper, ink or rule.
 *
 * ── LIGHT, DARK, AUTO
 * data-theme on <html> is the visitor's choice (light, dark, auto); data-scheme is what it resolves
 * to, set before any paint by the inline script in Page.ss (and live when the device changes, under
 * auto). Every dark value keys on `:root[data-scheme="dark"]`, never on the media query alone, so the
 * switch overrides the device. The script is inline and has no dependencies, so it always runs
 * before the first paint (as it has on every site since 2026-10-25).
 *
 * ── CONTRAST (checked 2026-11-16, WCAG relative luminance; site checks read-hover, music-hover,
 *    audio-hover enforce it on the live pages)
 *   light: ink 16.4:1 on paper, --ink-2 8.9, --muted 6.0 (5.5 on paper-2); every --accent-ink is
 *          at least 5.4 on paper, surface and surface-2, and --on-accent at least 6.0 on its --accent.
 *   dark:  ink 15.6, --ink-2 10.4, --muted 7.1 (5.8 on surface-2); accent inks at least 7.1,
 *          --on-accent at least 7.7.
 *   games (2026-11-16): light ink 6.3 on paper, 6.9 surface, 6.0 surface-2, white on it 6.9 (8.2 on
 *          hover); dark ink 9.1 / 8.2 / 7.4, --on-accent 7.8 (9.0 on hover).
 *   studio (2026-11-16): --accent-ink-on-band, its text on the always-dark hero, 7.1 at worst.
 *   --accent itself is a FILL (a button, a rule, a mark). Gold is 2.5:1 on paper, so text in an
 *   accent colour is always --accent-ink.
 */

:root {
  /* ── colour: the page */
  --paper: #f7f5f0;          /* the page */
  --paper-2: #efebe3;        /* a band, one step down */
  --surface: #ffffff;        /* anything ON the page: a card, a form, the score */
  --surface-2: #f3f0ea;      /* a fill inside a surface */
  --ink: #18171c;
  --ink-2: #45434b;          /* secondary text */
  --muted: #5f5c66;          /* the floor for text: 6.0:1 on paper */
  --line: rgba(24, 23, 28, 0.12);
  --line-2: rgba(24, 23, 28, 0.22);
  --brand-gold: #c8962f;     /* the logo's gold: marks and focus rings, never small text */
  --brand-gold-ink: #835a0c; /* gold that has to be read: 5.6:1 on paper */
  --ok: #2d7444;
  --ok-wash: rgba(45, 116, 68, 0.12);
  --bad: #ad2b22;
  --bad-wash: rgba(173, 43, 34, 0.1);
  --shadow-1: 0 1px 2px rgba(24, 23, 28, 0.06);
  --shadow-2: 0 1px 2px rgba(24, 23, 28, 0.05), 0 10px 28px -14px rgba(24, 23, 28, 0.28);
  --shadow-3: 0 2px 4px rgba(24, 23, 28, 0.06), 0 22px 48px -18px rgba(24, 23, 28, 0.4);

  /* ── colour: the site's one accent. gonglogic.com's is ink and gold, as it was: its buttons
     ink, its links the logo's gold; each other site sets its own below, on body[data-site]. */
  --accent: #18171c;         /* a fill */
  --accent-ink: #835a0c;     /* the accent as text: the brand gold, 5.6:1 on paper */
  --on-accent: #ffffff;      /* text on a fill */
  --accent-hover: #34323a;   /* the fill under a pointer: 84% accent, 16% ink, as a plain colour */
  --accent-wash: rgba(24, 23, 28, 0.06);

  /* ── type: Inter for the interface, Source Serif 4 for content (titles, reading). Outfit is the
     logo's alone, and the logo is drawn, so no page downloads it. */
  --font-ui: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'PingFang SC', 'Hiragino Sans', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  --font-text: 'Source Serif 4', 'Source Serif Fallback', Georgia, 'Times New Roman', serif;
  --font-logo: 'Outfit', var(--font-ui);
  /* the scale, 14 / 16 / 18 / 22 / 28 / 36 / 48 */
  --fs-1: 0.875rem;
  --fs-2: 1rem;
  --fs-3: 1.125rem;
  --fs-4: 1.375rem;
  --fs-5: 1.75rem;
  --fs-6: 2.25rem;
  --fs-7: 3rem;

  /* ── space: a 4px base */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;

  /* ── shape */
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-pill: 999px;

  /* ── the shared header */
  --head-h: 56px;
  --wrap: 76rem;
  --gutter: 1rem;

  color-scheme: light;
}
@media (min-width: 48rem) {
  :root { --head-h: 64px; --gutter: 2rem; }
}

/* DARK. The same names, turned over: every rule that reads a token follows. */
:root[data-scheme="dark"] {
  --paper: #121317;
  --paper-2: #18191e;
  --surface: #1c1d23;
  --surface-2: #24262d;
  --ink: #ecebe8;
  --ink-2: #c4c2bd;
  --muted: #a29fa8;
  --line: rgba(236, 235, 232, 0.12);
  --line-2: rgba(236, 235, 232, 0.22);
  --brand-gold: #d6a646;
  --brand-gold-ink: #e4b95e;
  --ok: #74c38c;
  --ok-wash: rgba(116, 195, 140, 0.14);
  --bad: #f0877c;
  --bad-wash: rgba(240, 135, 124, 0.13);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.7);
  --shadow-3: 0 2px 4px rgba(0, 0, 0, 0.35), 0 24px 50px -18px rgba(0, 0, 0, 0.8);
  --accent: #ecebe8;
  --accent-ink: #e4b95e;
  --on-accent: #121317;
  --accent-hover: #ffffff;
  --accent-wash: rgba(236, 235, 232, 0.08);
  color-scheme: dark;
}

/* ── EACH SITE'S ACCENT. On <body>, because the site is known there (data-site, Page.ss): the main
   host also serves library and music pages before their redirects, and those take their own area's
   colour. Values chosen for contrast first; see the table at the top. */
body[data-site="library"] {   /* the brand amber: a book's warm lamp */
  --accent: #c8962f;
  --accent-ink: #835a0c;
  --on-accent: #18171c;
  --accent-hover: #ac822c;
  --accent-wash: rgba(200, 150, 47, 0.13);
}
body[data-site="music"] {     /* the score-cover blue */
  --accent: #24467f;
  --accent-ink: #24467f;
  --on-accent: #ffffff;
  --accent-hover: #223e6f;
  --accent-wash: rgba(36, 70, 127, 0.09);
}
body[data-site="audio"] {     /* dusk violet, from the packs' pixel skies */
  --accent: #5b3fa8;
  --accent-ink: #5b3fa8;
  --on-accent: #ffffff;
  --accent-hover: #503992;
  --accent-wash: rgba(91, 63, 168, 0.1);
}
body[data-site="games"] {     /* arcade raspberry, a coin-op button (2026-11-16) */
  --accent: #a8235c;
  --accent-ink: #a8235c;
  --on-accent: #ffffff;
  --accent-hover: #93204f;
  --accent-wash: rgba(168, 35, 92, 0.1);
}
body[data-site="shop"] {      /* a ledger green */
  --accent: #1d6b58;
  --accent-ink: #1a6553;
  --on-accent: #ffffff;
  --accent-hover: #1c5e4e;
  --accent-wash: rgba(29, 107, 88, 0.1);
}
body[data-site="studio"] {    /* terracotta */
  --accent: #a8441d;
  --accent-ink: #a3411b;
  --on-accent: #ffffff;
  --accent-hover: #913d1d;
  --accent-wash: rgba(168, 68, 29, 0.1);
  /* the accent as text on the hero's dark band, which is dark in BOTH schemes: terracotta was
     2.5:1 there (site-basics, the home eyebrow, 2026-11-16); this is 7.1 at the band's lightest
     (#2a2622) and 8.6 at its darkest */
  --accent-ink-on-band: #f39d7c;
}
:root[data-scheme="dark"] body[data-site="library"] {
  --accent: #d6a646;
  --accent-ink: #e4b95e;
  --on-accent: #17150f;
  --accent-hover: #dab160;
  --accent-wash: rgba(214, 166, 70, 0.15);
}
:root[data-scheme="dark"] body[data-site="music"] {
  --accent: #9db9ee;
  --accent-ink: #a9c2f2;
  --on-accent: #101522;
  --accent-hover: #aac1ed;
  --accent-wash: rgba(157, 185, 238, 0.12);
}
:root[data-scheme="dark"] body[data-site="audio"] {
  --accent: #b7a2f2;
  --accent-ink: #c2b0f5;
  --on-accent: #17122a;
  --accent-hover: #bfaef0;
  --accent-wash: rgba(183, 162, 242, 0.13);
}
:root[data-scheme="dark"] body[data-site="games"] {
  --accent: #f08cb4;
  --accent-ink: #f49bbf;
  --on-accent: #2a0d19;
  --accent-hover: #f2a0c1;
  --accent-wash: rgba(240, 140, 180, 0.13);
}
:root[data-scheme="dark"] body[data-site="shop"] {
  --accent: #63c7a9;
  --accent-ink: #74d0b4;
  --on-accent: #0d1f1a;
  --accent-hover: #79cdb3;
  --accent-wash: rgba(99, 199, 169, 0.13);
}
:root[data-scheme="dark"] body[data-site="studio"] {
  --accent: #f0906c;
  --accent-ink: #f39d7c;
  --on-accent: #24110a;
  --accent-hover: #ef9f80;
  --accent-wash: rgba(240, 144, 108, 0.13);
}

/* ── FALLBACK FACES, sized to the web fonts, so a late font does not move the page (font-display:
   swap). Measured from the font files against Arial and Georgia (redesign phase C). */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans');
  size-adjust: 107%;
  ascent-override: 90.6%;
  descent-override: 22.6%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Source Serif Fallback';
  src: local('Georgia'), local('Times New Roman'), local('Liberation Serif');
  size-adjust: 101.8%;
  ascent-override: 101.8%;
  descent-override: 32.9%;
  line-gap-override: 0%;
}
