/*
 * The design tokens of the game: its fonts, colors, radii, shadows, board geometry and motion,
 * from the screens of docs/design/. Every rule of style.css builds on them: no color, font or
 * radius is written out in a rule. Loaded before style.css.
 */

/*
 * The fonts, served from public/fonts/ since the Content-Security-Policy allows the site alone:
 * the Latin subsets of Fontsource 5.3.0, under the SIL Open Font License (the OFL-*.txt files).
 */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/inter-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/inter-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/inter-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
}

:root {
  /* Surfaces, from the page to the most raised */
  --color-bg: #0A0E1A;
  --color-surface: #111729;          /* cards, chips, inputs */
  --color-surface-inset: #0E1426;    /* cards inside a dialog or a panel */
  --color-surface-raised: #141B2F;   /* the card of the player to play */
  --color-surface-control: #141B30;  /* secondary buttons, kbd */
  --color-surface-dialog: #121931;   /* dialogs and bottom sheets */
  --color-board: #161E36;
  --color-hole: #070A14;             /* an empty cell */

  /* Lines */
  --color-border: #1F2742;
  --color-border-strong: #2A3456;    /* controls */
  --color-border-board: #27315A;
  --color-handle: #2F3A60;           /* bottom sheet handle, inactive pagination */
  /*
   * The graphics of the board that WCAG 1.4.11 asks to show at 3:1: the dashed circles of the
   * column strip, 3.7:1 on --color-bg and at least 3.3:1 on the surfaces, and the rim of the
   * holes, 3.1:1 on --color-board.
   */
  --color-board-line: #5E6A99;

  /* Text, with its contrast on --color-bg */
  --color-text: #E8ECF7;             /* 16.3:1 */
  --color-text-secondary: #B4BBD3;   /* 10.1:1 */
  --color-text-muted: #8A93B0;       /* 6.3:1, and 5.6:1 on --color-surface-control */

  /* Players */
  --color-red: #FF4D6D;
  --color-yellow: #FFD23F;
  --glow-red: rgba(255, 77, 109, 0.5);
  --glow-yellow: rgba(255, 210, 63, 0.42);
  --token-marker: rgba(0, 0, 0, 0.55); /* the dot of red, 3.3:1 on --color-red */
  --token-marker-ring: rgba(0, 0, 0, 0.55); /* the ring of yellow, 4.3:1 on --color-yellow */

  /* States */
  --color-online: #3DDC97;
  --color-warning: #FFA94D;
  --color-danger: #FF7A85;
  --color-danger-text: #FF9AA3;
  --color-info: #7AA2FF;
  --color-scrim: rgba(5, 7, 14, 0.74); /* behind a dialog, with backdrop-filter: blur(6px) */

  /* The board: the light that marks an aimed column, the shading of holes and tokens, the win */
  --color-column-band: rgba(255, 255, 255, 0.05);
  --color-win-ring: #FFFFFF;
  --hole-shade: rgba(0, 0, 0, 0.75);
  --token-shade: rgba(0, 0, 0, 0.18);
  --token-highlight: rgba(255, 255, 255, 0.3);

  /* Type */
  --font-display: 'Space Grotesk', Inter, system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --radius-xs: 6px;    /* kbd */
  --radius-sm: 10px;   /* buttons inside a banner */
  --radius-md: 12px;   /* buttons, icon buttons */
  --radius-lg: 14px;   /* inputs, banners, chips, primary buttons */
  --radius-xl: 20px;   /* cards */
  --radius-2xl: 24px;  /* panels */
  --radius-3xl: 28px;  /* dialogs, bottom sheets */
  --radius-pill: 999px;

  /* Shadows */
  --shadow-board: 0 30px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-card-active: 0 0 0 4px rgba(255, 210, 63, 0.08), 0 20px 40px rgba(0, 0, 0, 0.35);
  --shadow-card-lift: 0 20px 40px rgba(0, 0, 0, 0.35); /* the lift of --shadow-card-active, for a ring of any color */
  --shadow-dialog: 0 40px 80px rgba(0, 0, 0, 0.6);
  --shadow-sheet: 0 -20px 60px rgba(0, 0, 0, 0.5); /* a bottom sheet, which rises from below */

  /*
   * The board at its full size, in pixels of the screens: a cell of 64, 78 from one cell to the
   * next, 25 from the outer edge of the frame to the first cell (a border of 1, a padding of 20
   * and the 4 of the column band), so 582 wide and 504 tall. The column strip above it is 72
   * tall, 10 above the frame. style.css scales every length by the width the board gets.
   */
  --board-full-width: 582;
  --board-full-height: 504;
  --cell-full-size: 64;
  --cell-full-pitch: 78;
  --board-full-inset: 25;
  --column-band-full-margin: 4;
  --strip-full-height: 72;
  --strip-full-gap: 10;
  --board-min-width: 288px;

  /* The content of the header and of the main area, 1200 wide, plus their padding of 32 */
  --page-max-width: 1264px;

  /* Motion, all stopped under prefers-reduced-motion */
  --motion-drop-base: 200ms;
  --motion-drop-per-row: 35ms;
  --motion-settle: 120ms;
  --ease-drop: cubic-bezier(0.5, 0, 0.75, 0);
  --motion-win-ring: 300ms;
  --motion-win-stagger: 60ms;
  --motion-fast: 150ms;
  --motion-dialog: 180ms; /* a dialog fades in and grows from 0.96 */
  --motion-sheet: 240ms; /* a bottom sheet slides up */
}
