/* 2/4 CONTEXT — meaning: which primitive plays which role (text, surface, action …). */

:root {
  --text-font-family: var(--font-family-sans);
  --text-display-family: var(--font-family-display);
  --text-body-size: var(--font-size-2);
  --text-title-color: var(--ink-900);
  --text-body-color: var(--ink-900);
  --text-muted-color: var(--ink-900-64);
  --text-title-size: var(--font-size-fluid-title);
  --text-lede-size: var(--font-size-fluid-lede);
  --text-caption-size: var(--font-size-1);

  --surface-glass-bg: var(--white-55);
  --surface-glass-bg-hover: var(--white-80);
  --surface-glass-border: var(--ink-900-10);
  --surface-glass-blur: var(--blur-1);
  --surface-radius: var(--radius-3);
  --surface-padding: var(--size-4);
  --surface-gap: var(--size-3);

  /* the main button is solid: dark ink body, live segment color as offset shadow and chip */
  --action-primary-bg: var(--ink-900);
  --action-primary-text: var(--white);
  --action-primary-accent: var(--seg-1);
  --action-primary-chip: var(--seg-2);
  --action-primary-size: var(--font-size-3);
  --action-height: 4.4rem;
  --action-gap: var(--size-4);

  /* solid and soft surfaces: what used to be written as "white" in the components */
  --surface-solid: var(--white);
  --surface-field-bg: var(--white-80);
  --surface-field-bg-hover: var(--white);
  --surface-tint-base: var(--white); /* mixed with a segment color for cards, menus and file chips */
  --surface-glow: color-mix(in srgb, var(--white) 92%, transparent);
  --surface-media-bg: var(--ink-900-10);
  --surface-veil: rgb(255 255 255 / 0.72); /* the frosted panes of a gate */
  --surface-veil-edge: rgb(255 255 255 / 0.9);
  --status-error-color: var(--red-1);
  --title-accent-from: var(--seg-4);
  --title-accent-to: var(--seg-3);
  --aurora-opacity: 1;
  --gem-facet-a: 55%; /* how strongly a card's two cut corners catch the light */
  --gem-facet-b: 22%;
  --halo-ink-a: var(--seg-1);
  --halo-ink-b: var(--seg-4);

  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--seg-1) 70%, transparent);
  --page-gutter: clamp(1.1rem, 4vw, 3rem);
  --page-max-width: 1240px;
}

/* night: only meaning changes here, no component is touched. Ink on colored chips (--ink-900) stays dark on purpose. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --text-title-color: var(--night-ink);
  --text-body-color: var(--night-ink);
  --text-muted-color: var(--night-ink-72);

  --surface-glass-bg: var(--night-glass);
  --surface-glass-bg-hover: var(--night-glass-hi);
  --surface-glass-border: var(--night-line);

  --surface-solid: var(--night-paper);
  --surface-field-bg: var(--night-field);
  --surface-field-bg-hover: var(--night-field-hi);
  --surface-tint-base: var(--night-paper);
  --surface-glow: rgb(255 255 255 / 0.07);
  --surface-media-bg: rgb(255 255 255 / 0.08);
  --surface-veil: rgb(18 14 44 / 0.7);
  --surface-veil-edge: rgb(255 255 255 / 0.16);
  --status-error-color: var(--red-2);
  --title-accent-from: var(--seg-3);
  --title-accent-to: var(--seg-2);
  --aurora-opacity: 0.3;
  --gem-facet-a: 20%;
  --gem-facet-b: 14%;
  --halo-ink-b: var(--seg-3); /* the deep tone would vanish on a dark sticker */

  /* the solid button flips: a light body with dark ink, still lifted by the live segment color */
  --action-primary-bg: var(--night-ink);
  --action-primary-text: var(--ink-900);
}
