/*
 * Moonlight Web design tokens.
 * Three layers: primitive (raw values) -> semantic (purpose) -> component.
 * Derived from the Moonlight brand: logo grey #565C64, white disc,
 * moonlight-stream.org slate (#282B34, #2F333B, #484D55) and purple (#443266).
 * Shared by the login gate, the auth error page and (later) the app restyle.
 */

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Roboto Medium, subset to the Google button labels only (Google branding guidelines). */
@font-face {
  font-family: "Roboto GSI";
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url("/assets/fonts/roboto-500-gsi.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  /* ---------- Primitive ---------- */
  --slate-1000: #121419;
  --slate-950: #16181d;
  --slate-900: #1c1f26;
  --slate-850: #22252d;
  --slate-800: #282b34; /* moonlight-stream.org */
  --slate-750: #2f333b; /* moonlight-stream.org */
  --slate-700: #3a3e47;
  --slate-600: #484d55; /* moonlight-stream.org */
  --slate-500: #565c64; /* Moonlight logo ring */
  --slate-400: #8a8f99;
  --slate-300: #a0a1a7; /* moonlight-stream.org muted text */
  --slate-200: #c8cbd1;
  --slate-100: #eeeeee;
  --white: #ffffff;

  --violet-900: #251b38;
  --violet-800: #443266; /* moonlight-stream.org */
  --violet-600: #6b55a3;
  --violet-400: #9d8ae0;
  --violet-300: #bcaef2;
  --violet-200: #d9d0fa;

  --indigo-500: #3f51b5; /* Moonlight Android */

  --red-300: #f2a7a0;
  --red-900: #3b1f22;
  --green-400: #6fcf97;

  /* Google branding (dark theme button) */
  --gsi-dark-fill: #131314;
  --gsi-dark-stroke: #8e918f;
  --gsi-dark-text: #e3e3e3;

  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-gsi: "Roboto GSI", Roboto, Arial, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-moonrise: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---------- Semantic ---------- */
  --color-ground: var(--slate-900);
  --color-ground-deep: var(--slate-950);
  --color-surface: var(--slate-800);
  --color-surface-raised: var(--slate-750);
  --color-line: var(--slate-600);
  --color-line-soft: var(--slate-700);
  --color-text: var(--slate-100);
  --color-text-strong: var(--white);
  --color-text-muted: var(--slate-300);
  --color-text-faint: var(--slate-400);
  --color-brand-ring: var(--slate-500);
  /* A touch under pure white: the disc is large and the page is used in dim rooms. */
  --color-brand-disc: #eceef1;
  --color-accent: var(--violet-400);
  --color-accent-strong: var(--violet-300);
  --color-accent-deep: var(--violet-800);
  --color-focus: var(--violet-300);
  --color-danger-text: var(--red-300);
  --color-danger-surface: var(--red-900);
  --color-ok: var(--green-400);
  --color-selection: var(--violet-800);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-display: clamp(2.75rem, 1.6rem + 3.4vw, 4.5rem);

  --radius-pill: 999px;
  --radius-md: 10px;

  --duration-press: 140ms;
  --duration-ui: 220ms;
  --duration-moonrise: 1100ms;

  /* ---------- Component ---------- */
  --gsi-height: 48px;
  --gsi-bg: var(--gsi-dark-fill);
  --gsi-border: var(--gsi-dark-stroke);
  --gsi-text: var(--gsi-dark-text);
  --gsi-bg-hover: #1d1d1f;

  --seg-bg: transparent;
  --seg-border: var(--color-line-soft);
  --seg-active-bg: var(--color-surface-raised);
  --seg-active-text: var(--color-text-strong);

  --signal-line: var(--color-line-soft);
  --signal-pulse: var(--color-accent-strong);
  --signal-node: var(--color-surface-raised);
}

html {
  scrollbar-color: var(--slate-600) var(--color-ground);
}

::selection {
  background: var(--color-selection);
  color: var(--color-text-strong);
}
