/* ==============================================================================
   TENANT TOKENS — the Waveloom theme (variant AvavaStation) distilled for the
   pages a tourist sees under /{tenant}/ (ADR-037). Linked only from
   templates/tenant/partials/head.html, after tokens.css, so the public site,
   the portal and the admin never read it.

   Mode B of the waveloom-theme skill: not one byte of the vendor. What is
   taken is its vocabulary, written again here: paper and ink per mode, a grey
   scale made of the ink at an opacity (Station's --i10 … --i84), radii that
   are almost square, system stacks in the roles of its five Google families
   (Archivo and Bricolage → system-ui, DM Mono → ui-monospace, Instrument
   Serif italic → ui-serif italic) and one accent with its own ink on top.

   The accent and its shades are the client's: /{tenant}/theme.css
   (internal/palette) writes --band, --accent, --accent-ink, --accent-text,
   --accent-edge, --accent-wash, --link and --focus-ring for both modes,
   every one measured for AA against the surfaces below. The values of those
   names in this file are the site's own brand (palette.Derive of #0066cc and
   #27ae60), for the 404 of an address that names no client and has no
   theme.css. internal/palette's TestTokensMatchTheSurfaces keeps the
   surfaces and these defaults equal to what the Go side measures.

   Two blocks and no [data-theme] one: these pages have no theme selector
   (design §12), so prefers-color-scheme decides. The dark block uses the
   selector of tokens.css's, so loaded after it, it wins.
   ============================================================================== */

:root {
  color-scheme: light;

  /* Surfaces: Station's light paper without its texture. The sheet is
     the quieter panel (the route, the cue, the code to copy); it is the
     cream of Station's hero and of Curioseety's brand. */
  --paper: #ffffff;
  --sheet: #f4f2ec;
  --ink: #141110;

  /* Secondary text is solid, not an opacity, so its ratio is the same on
     every surface: 7.08:1 on the paper, 6.32:1 on the sheet. Station's
     own --i45 is 3.36:1 and would fail. */
  --muted: #5c5850;

  /* The grey scale of Station: the ink at an opacity. Only rules and
     rails use it; text never does. --i55 is the boundary of a control
     (a 4.2:1 line on the paper), where 1.4.11 asks for 3:1. */
  --i10: rgba(20, 17, 16, 0.1);
  --i14: rgba(20, 17, 16, 0.14);
  --i20: rgba(20, 17, 16, 0.2);
  --i28: rgba(20, 17, 16, 0.28);
  --i55: rgba(20, 17, 16, 0.55);

  /* The site's brand, for a page without theme.css. */
  --band: #0066cc;
  --band-ink: #ffffff;
  --band-accent: #c4f2d7;
  --accent: #27ae60;
  --accent-ink: #141110;
  --accent-text: #1c7e46;
  --accent-edge: #249f58;
  --accent-wash: #eef9f2;
  --link: #0066cc;

  /* Station's type roles on system stacks: zero bytes downloaded. */
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --font-title: var(--font-text);

  /* Station is almost square: 2px on boxes, 50% on the round buttons. */
  --radius: 2px;

  /* The page column: Station's 1240px measure with a fluid gutter. */
  --measure: 77.5rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* The names tokens.css gives these roles, which main.css and
     _buttons.css read (the body, the skip link, a plain link). */
  --page-bg: var(--paper);
  --paper-bg: var(--paper);
  --paper-secondary-bg: var(--sheet);
  --text-primary: var(--ink);
  --text-secondary: var(--ink);
  --text-muted: var(--muted);
  --border-light: var(--i14);
  --border-color: var(--i28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    /* Station's dark paper and the cream as ink: 16.43:1. */
    --paper: #141416;
    --sheet: #0c0c0d;
    --ink: #f4f2ec;

    /* 7.23:1 on the paper, 7.68:1 on the sheet. */
    --muted: #a6a299;

    --i10: rgba(244, 242, 236, 0.1);
    --i14: rgba(244, 242, 236, 0.14);
    --i20: rgba(244, 242, 236, 0.2);
    --i28: rgba(244, 242, 236, 0.28);
    --i55: rgba(244, 242, 236, 0.55);

    --band: #0066cc;
    --band-ink: #ffffff;
    --band-accent: #c4f2d7;
    --accent: #27ae60;
    --accent-ink: #141110;
    --accent-text: #27ae60;
    --accent-edge: #27ae60;
    --accent-wash: #16231d;
    --link: #0d86ff;

    --page-bg: var(--paper);
    --paper-bg: var(--paper);
    --paper-secondary-bg: var(--sheet);
    --text-primary: var(--ink);
    --text-secondary: var(--ink);
    --text-muted: var(--muted);
    --border-light: var(--i14);
    --border-color: var(--i28);
  }
}
