/* Design tokens. DESIGN.md is the source of truth. */

@font-face {
  font-family: "Clear Sans";
  src: url("../assets/fonts/clear-sans/ClearSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Clear Sans";
  src: url("../assets/fonts/clear-sans/ClearSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Clear Sans";
  src: url("../assets/fonts/clear-sans/ClearSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Color: light-dark(light, dark) */
  --color-primary: light-dark(#163261, #8fb0e8);
  --color-accent: #d4600a;
  --color-accent-text: light-dark(#b45209, #de640a);
  --color-accent-on-primary: light-dark(#f47a1f, #6b3105);
  --color-background: light-dark(#ffffff, #0e131f);
  --color-surface: light-dark(#f5f6f9, #171e2e);
  --color-text: light-dark(#1a1f2b, #e8eaf2);
  --color-text-muted: light-dark(#555d6e, #a9b0c2);
  --color-text-inverse: light-dark(#ffffff, #0e131f);
  --color-text-on-accent: #0e131f;
  --color-border: light-dark(#d8dbe6, #2e3750);
  --color-border-strong: light-dark(#6b7385, #7a849a);
  --color-primary-hover: light-dark(#0f2447, #b0c8f0);
  --color-focus: light-dark(#163261, #8fb0e8);
  --color-focus-inverse: light-dark(#ffffff, #0e131f);

  /* Typography */
  --font-primary: "Clear Sans", sans-serif;
  --font-secondary: "Syne", sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --type-display: 2.25rem;
  --type-h1: 2rem;
  --type-h2: 1.5rem;
  --type-h3: 1.25rem;
  --type-body-lg: 1.125rem;
  --type-body: 1rem;
  --type-small: 0.875rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Layout */
  --size-content-max: 72rem;
  --size-text-max: 65ch;
  --size-control-min: 2.75rem;

  /* Shape and depth */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
  --border-width: 1px;
  --focus-width: 2px;
  --focus-offset: 2px;
  --shadow-sm: 0 1px 2px light-dark(rgb(22 50 97 / 0.08), rgb(0 0 0 / 0.4));
  --shadow-md: 0 8px 24px light-dark(rgb(22 50 97 / 0.12), rgb(0 0 0 / 0.5));

  /* Motion */
  --motion-fast: 150ms;
  --motion-base: 250ms;
  --motion-easing: ease-out;
}

/* A visitor's choice overrides the system setting. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* breakpoint.md = 48rem. CSS variables cannot be used in media queries. */
@media (min-width: 48rem) {
  :root {
    --type-display: 3.5rem;
    --type-h1: 2.5rem;
    --type-h2: 2rem;
    --type-h3: 1.5rem;
  }
}
