/*
 * The design system's tokens (Figma, page 529:19902 «kaplia-pro-new»), shared by the
 * administration and the site: the palette, the typefaces, the scale, and the
 * semantic colours in three modes. A component names a semantic token (--ui-…) and
 * so works on a light, a dark and a brand ground: put .mode-dark or .mode-brand on
 * the block it stands in, or .ui-hot on what turns brand under the pointer.
 */

:root {
  /* The palette. */
  --ink-0: #101517; --ink-1: #1d2327; --ink-2: #2c3338; --ink-4: #50575e; --ink-faint: #646970; --ink-5: #8c8f94;
  --stone-3: #c3c4c7; --stone-1: #dcdcde; --stone-2: #f6f7f7; --white: #ffffff; --alpha-white-15: #ffffff26;
  --blue-dark: #0a4b78; --blue-deep: #135e96; --blue-1: #2271b1; --blue-soft: #4f94d4; --blue-2: #72aee6; --blue-3: #c5d9ed; --blue-4: #f0f6fc;
  --lemon-1: #f0c33c; --lemon-3: #fcf9e8; --red-1: #b32d2e;
  /* Only the administration has these: its states and its hovers. */
  --ink-3: #3c434a; --lemon-deep: #dba617; --red-dark: #8a2424; --red-3: #fcf0f1; --green-1: #00a32a; --green-3: #edfaef;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 2px; --radius-4: 4px; --radius-full: 999px;
  --ring: 0 0 0 2px var(--blue-1);
  --elevation: 0 8px 24px rgb(0 0 0 / 8%), 0 1px 2px rgb(0 0 0 / 6%);
  --elevation-popup: 0 12px 40px rgb(0 0 0 / 18%);
  --elevation-bar: 0 8px 24px rgb(0 0 0 / 14%);
  /* What the header of the site casts on the menu that slides out from under it. */
  --elevation-header: 0 2px 10px rgb(0 0 0 / 10%);
  --elevation-cookie: 0 -8px 32px rgb(0 0 0 / 12%);
  --scrim: rgb(29 35 39 / 60%);

  /* The scale: spacing; the large steps shrink on a phone. */
  --space-4: 4px; --space-8: 8px; --space-12: 12px; --space-16: 16px; --space-20: 20px; --space-24: 24px; --space-30: 30px; --space-40: 40px;
  --space-48: 48px; --space-60: 60px; --space-80: 80px; --space-100: 100px;

  /* Type: size/line height of the styles that change with the screen. */
  --type-giant: 400px/360px; --type-figure: 160px/160px; --type-poster: 120px/116px; --type-statement: 70px/77px; --type-stack: 36px/40px;
  --type-h1: 70px/74px; --type-h2: 50px/60px; --type-h3: 36px/46px; --type-h4: 30px/40px; --type-h5: 26px/34px; --type-h6: 22px/29px;
  --type-pullquote: 32px/42px; --type-lead: 20px/34px; --type-title: 24px/32px;
}

@media (max-width: 640px) {
  :root {
    --space-48: 32px; --space-60: 40px; --space-80: 40px; --space-100: 56px;
    --type-giant: 150px/140px; --type-figure: 120px/120px; --type-poster: 56px/58px; --type-statement: 44px/50px; --type-stack: 20px/24px;
    --type-h1: 44px/50px; --type-h2: 34px/42px; --type-h3: 28px/36px; --type-h4: 24px/32px; --type-h5: 22px/30px; --type-h6: 20px/28px;
    --type-pullquote: 24px/34px; --type-lead: 18px/30px; --type-title: 20px/28px;
  }
}

:root, .mode-light {
  --ui-bg: var(--white); --ui-bg-subtle: var(--stone-2); --ui-bg-brand: var(--blue-4); --ui-card: var(--white); --ui-media: var(--blue-4); --ui-ghost: var(--blue-3);
  --ui-text: var(--ink-1); --ui-text-2: var(--ink-4); --ui-text-3: var(--ink-faint); --ui-brand: var(--blue-1); --ui-statement: var(--blue-soft);
  --ui-line: var(--stone-1); --ui-line-strong: var(--ink-5); --ui-focus: var(--blue-1);
  --ui-primary-bg: var(--blue-1); --ui-primary-hover: var(--blue-deep); --ui-primary-text: var(--white);
  --ui-tonal-bg: var(--blue-4); --ui-tonal-hover: var(--blue-3); --ui-tonal-text: var(--blue-1); --ui-tonal-text-hover: var(--blue-dark);
  --ui-outline: var(--blue-1); --ui-outline-hover: var(--blue-deep); --ui-outline-text-hover: var(--white);
  --ui-ghost-text: var(--ink-1); --ui-ghost-hover: var(--stone-2);
  --ui-disabled-bg: var(--stone-2); --ui-disabled-text: var(--ink-5); --ui-disabled-line: var(--stone-1);
  --ui-tag-bg: var(--stone-2); --ui-tag-text: var(--ink-1);
  --ui-field-bg: var(--white); --ui-field-line: var(--ink-5); --ui-field-text: var(--ink-1); --ui-placeholder: var(--ink-5); --ui-search: var(--stone-2);
  --ui-warning: var(--lemon-1); --ui-warning-bg: var(--lemon-3); --ui-danger: var(--red-1); --ui-success: var(--green-1); --ui-success-bg: var(--green-3);
}

.mode-dark {
  --ui-bg: var(--ink-1); --ui-bg-subtle: var(--ink-2); --ui-card: var(--ink-2); --ui-media: var(--ink-2); --ui-ghost: var(--ink-2);
  --ui-text: var(--white); --ui-text-2: var(--stone-3); --ui-text-3: var(--ink-5); --ui-brand: var(--blue-2);
  --ui-line: var(--alpha-white-15); --ui-line-strong: var(--ink-4); --ui-focus: var(--blue-2);
  --ui-outline: var(--white); --ui-outline-hover: var(--white); --ui-outline-text-hover: var(--ink-1);
  --ui-ghost-text: var(--white); --ui-ghost-hover: var(--ink-2);
}

.mode-brand, .ui-hot:is(:hover, :focus-visible, .is-hover) {
  --ui-bg: var(--blue-1); --ui-bg-subtle: var(--blue-deep); --ui-card: var(--blue-1); --ui-media: var(--blue-deep); --ui-ghost: var(--blue-deep);
  --ui-text: var(--white); --ui-text-2: var(--blue-4); --ui-text-3: var(--blue-3); --ui-brand: var(--white);
  --ui-line: var(--alpha-white-15); --ui-focus: var(--white);
  --ui-primary-bg: var(--white); --ui-primary-hover: var(--blue-4); --ui-primary-text: var(--blue-1);
  --ui-outline: var(--white); --ui-outline-hover: var(--white); --ui-outline-text-hover: var(--blue-1);
  --ui-ghost-text: var(--white); --ui-ghost-hover: var(--blue-deep);
}

:is(.mode-light, .mode-dark, .mode-brand), .ui-hot:is(:hover, :focus-visible, .is-hover) { background: var(--ui-bg); color: var(--ui-text); }
