/* CloudPlay design tokens (CLOUDPLAY.md §2). Every colour, size and timing the
   shell uses comes from here; components never hard-code them. */

:root {
  color-scheme: dark;

  /* Backgrounds, darkest first. */
  --bg: #0a0b0e;
  --bg-raised: #121419;
  --surface: #171a21;
  --surface-hover: #1e222b;
  --surface-active: #262b36;
  --line: #262a33; /* used sparingly */
  --bg-rgb: 10, 11, 14; /* for gradients that fade into --bg */

  /* Text. --text-3 is under 4.5:1 on --bg: icons, rules and disabled states only. */
  --text: #f3f5f9;
  --text-2: #a7adba;
  --text-3: #6d7483;
  --text-placeholder: #868d9c;

  /* The one accent. */
  --accent: #4c7dff;
  --accent-hover: #6a93ff;
  --accent-pressed: #3b67e0;
  --accent-soft: rgba(76, 125, 255, 0.16);
  --accent-text: #8fb0ff; /* accent-coloured text on dark surfaces */

  /* Status. */
  --good: #3ccf8e;
  --warn: #f2b544;
  --bad: #ff5d5d;
  --good-soft: rgba(60, 207, 142, 0.14);
  --warn-soft: rgba(242, 181, 68, 0.13);
  --bad-soft: rgba(255, 93, 93, 0.13);

  /* Controls laid over art: translucent fills, never blurred glass. */
  --over-art: rgba(255, 255, 255, 0.13);
  --over-art-hover: rgba(255, 255, 255, 0.2);
  --focus-ring: #ffffff;

  /* Type (system fonts only). */
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "SF Pro Text",
    Roboto, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system,
    "SF Pro Display", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --fs-display-1: 48px;
  --fs-display-2: 40px;
  --fs-display-3: 32px;
  --fs-title-1: 24px;
  --fs-title-2: 20px;
  --fs-body: 15px;
  --fs-caption: 13px;
  --fs-label: 12px;
  --tracking-display: -0.025em;
  --tracking-label: 0.09em;

  /* Shape and space (8 px grid). */
  --radius-card: 12px;
  --radius-panel: 16px;
  --radius-small: 8px;
  --radius-pill: 999px;
  --gutter: 32px;
  --rail-width: 240px;
  --topbar-height: 72px;
  --tabbar-height: 0px;
  --banner-height: 0px;

  /* Cards. */
  --cover-width: 176px;
  --wide-width: 392px;
  --store-width: 300px;

  /* Motion: 160-240 ms, ease-out. */
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --dur-fast: 160ms;
  --dur: 200ms;
  --dur-slow: 240ms;

  /* Elevation. */
  --shadow-lift: 0 22px 44px -18px rgba(0, 0, 0, 0.85), 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 28px 70px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(0, 0, 0, 0.4);

  /* Safe areas (iOS). */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* Tablet: the rail collapses to icons. */
@media (max-width: 1199px) {
  :root {
    --rail-width: 72px;
    --cover-width: 164px;
    --wide-width: 352px;
    --store-width: 276px;
  }
}

/* Phone: bottom tab bar, tighter gutters, smaller display type. */
@media (max-width: 719px) {
  :root {
    --rail-width: 0px;
    --gutter: 16px;
    --topbar-height: 60px;
    --tabbar-height: 64px;
    --fs-display-1: 34px;
    --fs-display-2: 30px;
    --fs-display-3: 26px;
    --fs-title-1: 21px;
    --fs-title-2: 18px;
    --cover-width: 132px;
    --wide-width: 284px;
    --store-width: 236px;
  }
}

@media (min-width: 1680px) {
  :root {
    --gutter: 48px;
    --cover-width: 192px;
    --wide-width: 432px;
    --store-width: 320px;
  }
}
