/*
 * Design tokens: the only place colours, type sizes, spacing and radii are defined.
 * Components use these names and never a raw value.
 *
 * The unset theme is the dark studio (:root). Light is an explicit alternate.
 * Lime is reserved for primary actions (--action). It is not a text, card or border colour.
 */
:root {
  color-scheme: dark;

  --font-sans:
    Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-display: clamp(2.6rem, 4.8vw, 4.25rem);
  --leading-tight: 1.2;
  --leading-display: 0.96;
  --leading-body: 1.5;
  --tracking-display: -0.048em;
  --tracking-label: 0.14em;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 999px;

  --control-height: 2.5rem;
  --sidebar-width: 15rem;
  --content-width: 60rem;
  --motion-fast: 120ms;

  --surface-page: #0e1012;
  --surface-raised: #17191c;
  --surface-sunken: #101214;
  --surface-hover: #1c1e20;
  --border: #2a2d31;
  --border-strong: #3d4147;
  --text: #f3f4f1;
  --text-muted: #9b9f98;
  --accent: #d7dbd4;
  --accent-strong: #f3f4f1;
  --accent-soft: #23262a;
  --on-accent: #14160a;
  --action: #d1fe17;
  --action-hover: #c3f000;
  --on-action: #14160a;
  --positive: #8fd18a;
  --positive-soft: #1a2a1c;
  --warning: #f0c060;
  --warning-soft: #3a2e12;
  --danger: #ff8a80;
  --danger-soft: #40201d;
  --focus: #f3f4f1;
  --shadow-raised: 0 1px 0 rgb(255 255 255 / 4%), 0 16px 40px rgb(0 0 0 / 36%);
  --glow-action: 0 0 0 1px rgb(209 254 23 / 6%), 0 24px 80px -24px rgb(209 254 23 / 22%);
  /* The Jaduvid brand: the lime tile with dark ink, and the lime used for "vid". */
  --brand: #d1fe17;
  --on-brand: #0e1012;
  --brand-text: #d1fe17;
  /* The chosen item of a set: a solid fill with text and a tick that read on it. */
  --selected: #f3f4f1;
  --on-selected: #14160a;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314160a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");

  /*
   * Fixed colours: the same in both themes because they picture something else. The theme
   * swatches show each theme's own page, line and accent; a video plays on black; the page
   * behind a dialog is dimmed.
   */
  --swatch-light-page: #f4f5f2;
  --swatch-light-line: #d4d5d0;
  --swatch-light-accent: #d1fe17;
  --swatch-dark-page: #0e1012;
  --swatch-dark-line: #2a2d31;
  --swatch-dark-accent: #d1fe17;
  --swatch-system-line: #9a9da3;
  --swatch-system-accent: #d1fe17;
  --video-backdrop: #000000;
  /* Words laid over a picture are light on a dark fade in both themes. */
  --text-on-media: #ffffff;
  --text-on-media-muted: rgb(255 255 255 / 78%);
  --media-fade: linear-gradient(
    180deg,
    rgb(0 0 0 / 0%) 30%,
    rgb(0 0 0 / 72%) 58%,
    rgb(0 0 0 / 94%) 100%
  );
  --media-chip: rgb(0 0 0 / 62%);
  --on-media-positive: #8fd18a;
  --on-media-warning: #f0c060;
  --on-media-danger: #ff8a80;
  /* Voice avatars: a steady colour per voice, the same in both themes, with white letters. */
  --tone-1: linear-gradient(135deg, #ff7a59, #c2185b);
  --tone-2: linear-gradient(135deg, #5b8cff, #3949ab);
  --tone-3: linear-gradient(135deg, #2ec4b6, #00796b);
  --tone-4: linear-gradient(135deg, #b388ff, #6a1b9a);
  --tone-5: linear-gradient(135deg, #ffb74d, #e65100);
  --tone-6: linear-gradient(135deg, #f06292, #7b1fa2);
  --scrim: rgb(8 9 10 / 72%);
}

:root[data-theme='light'] {
  color-scheme: light;

  --surface-page: #f4f5f2;
  --surface-raised: #ffffff;
  --surface-sunken: #e7e8e4;
  --surface-hover: #dedfd9;
  --border: #d4d5d0;
  --border-strong: #b4b6b0;
  --text: #14160f;
  --text-muted: #5a5e56;
  --accent: #1c1f18;
  --accent-strong: #14160f;
  --accent-soft: #e4e6dc;
  --on-accent: #14160a;
  --action: #d1fe17;
  --action-hover: #c3f000;
  --on-action: #14160a;
  --positive: #16703f;
  --positive-soft: #dff3e7;
  --warning: #8a5a00;
  --warning-soft: #fbefd3;
  --danger: #b3261e;
  --danger-soft: #fbe4e2;
  --focus: #14160f;
  --shadow-raised: 0 1px 2px rgb(20 22 16 / 6%), 0 16px 36px rgb(20 22 16 / 8%);
  --glow-action: 0 0 0 0 transparent;
  --selected: #14160f;
  --brand-text: #4d6300;
  --on-selected: #ffffff;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
