/*
 * Design tokens: colour, type, space, shape and motion.
 * Components only reference these variables, never raw values for colour.
 */

/* Registered so the rim highlight can animate smoothly as the light moves. */
@property --light-angle {
  syntax: "<angle>";
  inherits: true;
  initial-value: -40deg;
}

:root {
  /* Palette: an iridescent oil slick on deep plum or pearl */
  --violet: #5b2ee0;
  --teal: #12b5ac;
  --orchid: #e0369b;
  --gilt: #f2b84b;
  --night: #140b2e;
  --pearl: #eef0fa;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.375rem;
  --text-xl: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem);
  --text-display: clamp(3rem, 2rem + 4.5vw, 4.75rem);
  --text-countdown: clamp(4.75rem, 21vw, 11rem);

  /* Space */
  --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;
  --space-8: 4.5rem;

  /* Shape: the lens is the softest shape, controls are pills or circles */
  --radius-lens: 2.75rem;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
}

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

  --page: var(--pearl);
  --text: var(--night);
  --text-muted: rgb(20 11 46 / 0.64);
  --hairline: rgb(20 11 46 / 0.14);

  --glass-tint: rgb(255 255 255 / 0.26);
  --glass-tint-strong: rgb(255 255 255 / 0.5);
  --glass-shadow:
    0 1.5rem 3.5rem -1.25rem rgb(46 22 120 / 0.38),
    0 0.25rem 0.75rem rgb(46 22 120 / 0.08),
    inset 0 0 1.5rem rgb(255 255 255 / 0.25);
  --rim-bright: rgb(255 255 255 / 0.95);
  --rim-soft: rgb(255 255 255 / 0.4);
  --rim-faint: rgb(255 255 255 / 0.1);
  --sheen: rgb(255 255 255 / 0.38);

  --solid: var(--night);
  --on-solid: var(--pearl);
  --focus-ring: var(--violet);
  --hold-fill: rgb(224 54 155 / 0.42);
}

[data-theme="dark"] {
  color-scheme: dark;

  --page: var(--night);
  --text: var(--pearl);
  --text-muted: rgb(238 240 250 / 0.68);
  --hairline: rgb(238 240 250 / 0.16);

  --glass-tint: rgb(255 255 255 / 0.06);
  --glass-tint-strong: rgb(255 255 255 / 0.14);
  --glass-shadow:
    0 2rem 4rem -1rem rgb(6 2 18 / 0.65),
    0 0.25rem 1rem rgb(6 2 18 / 0.25),
    inset 0 0 1.5rem rgb(255 255 255 / 0.05);
  --rim-bright: rgb(255 255 255 / 0.75);
  --rim-soft: rgb(255 255 255 / 0.22);
  --rim-faint: rgb(255 255 255 / 0.05);
  --sheen: rgb(255 255 255 / 0.12);

  --solid: var(--pearl);
  --on-solid: var(--night);
  --focus-ring: var(--gilt);
  --hold-fill: rgb(224 54 155 / 0.5);
}
