/* algieba.com — design tokens
   Primitive values first, then semantic tokens per theme.
   Components and pages should only use the semantic tokens. */

:root {
  /* ---- Colour primitives ---------------------------------------------- */
  /* Ink: the night sky around Leo. Cool, slightly blue blacks. */
  --ink-950: #0d0f15;
  --ink-900: #14161f;
  --ink-800: #1e2130;
  --ink-700: #2b2f40;
  --ink-600: #444a5e;
  --ink-500: #5f6579;
  --ink-400: #8a8fa0;
  --ink-300: #b6b9c4;
  --ink-200: #d6d8de;

  /* Paper: warm off-whites for light surfaces. */
  --paper-50: #fbf9f4;
  --paper-100: #f7f3ea;
  --paper-200: #eee8db;
  --paper-300: #e0d8c7;
  --paper-400: #c9bfaa;

  /* Gold: Algieba (γ Leonis), a golden-orange giant star. */
  --gold-100: #fbebcb;
  --gold-200: #f6d697;
  --gold-300: #f0c26b;
  --gold-400: #e9ae4c;
  --gold-500: #d89530;
  --gold-600: #b87516;
  --gold-700: #8f5810;
  --gold-800: #6a410e;

  /* Feedback */
  --green-600: #2f7d57;
  --green-300: #7fd1a6;
  --red-600: #b4443a;
  --red-300: #f19a90;
  --blue-600: #3c6fb0;
  --blue-300: #9cc0ef;

  /* ---- Typography ------------------------------------------------------ */
  --font-display: "Urbanist", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-text: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.07rem + 0.3vw, 1.25rem);
  --text-xl: clamp(1.35rem, 1.2rem + 0.6vw, 1.6rem);
  --text-2xl: clamp(1.6rem, 1.35rem + 1.1vw, 2.1rem);
  --text-3xl: clamp(2rem, 1.6rem + 1.8vw, 2.9rem);
  --text-4xl: clamp(2.5rem, 1.8rem + 3vw, 4.2rem);
  --text-display: clamp(3rem, 2rem + 5vw, 6rem);

  --leading-tight: 1.05;
  --leading-snug: 1.2;
  --leading-normal: 1.6;

  --tracking-display: -0.02em;
  --tracking-heading: -0.01em;
  --tracking-eyebrow: 0.14em;

  /* ---- Space (4 px base) ---------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-section: clamp(4rem, 3rem + 5vw, 8rem);

  /* ---- Layout ---------------------------------------------------------- */
  --container: 72rem;
  --container-wide: 84rem;
  --measure: 66ch;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-height: 4.5rem;

  /* ---- Shape: round, like the symbol's terminals ----------------------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --border-width: 1px;

  /* ---- Motion ---------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 360ms;

  /* ---- Layers ---------------------------------------------------------- */
  --z-header: 100;
  --z-overlay: 200;
  --z-toast: 300;
}

/* ---- Semantic tokens: light (default) ----------------------------------- */
:root,
[data-theme="light"] {
  color-scheme: light;
  --color-bg: var(--paper-100);
  --color-surface: var(--paper-50);
  --color-surface-raised: #ffffff;
  --color-surface-inverse: var(--ink-900);
  --color-text: var(--ink-900);
  --color-text-muted: var(--ink-500);
  --color-text-inverse: var(--paper-100);
  --color-border: var(--paper-300);
  --color-border-strong: var(--paper-400);

  --color-brand: var(--gold-600);          /* symbol, large accents, non-text */
  --color-link: var(--gold-700);           /* text links (AA on paper) */
  --color-link-hover: var(--gold-800);
  --color-highlight: var(--gold-100);      /* text selection, marks */

  --color-button-bg: var(--ink-900);
  --color-button-text: var(--paper-100);
  --color-button-bg-hover: var(--ink-700);
  --color-accent-button-bg: var(--gold-400);
  --color-accent-button-text: var(--ink-900);
  --color-accent-button-bg-hover: var(--gold-300);

  --color-focus: var(--gold-600);
  --color-success: var(--green-600);
  --color-danger: var(--red-600);
  --color-info: var(--blue-600);

  --shadow-sm: 0 1px 2px rgb(20 22 31 / 0.06), 0 1px 1px rgb(20 22 31 / 0.04);
  --shadow-md: 0 6px 18px -6px rgb(20 22 31 / 0.14), 0 2px 4px rgb(20 22 31 / 0.05);
  --shadow-lg: 0 24px 48px -16px rgb(20 22 31 / 0.22);
}

/* ---- Semantic tokens: dark ---------------------------------------------- */
[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: var(--ink-900);
  --color-surface: var(--ink-800);
  --color-surface-raised: var(--ink-700);
  --color-surface-inverse: var(--paper-100);
  --color-text: var(--paper-100);
  --color-text-muted: var(--ink-400);
  --color-text-inverse: var(--ink-900);
  --color-border: var(--ink-700);
  --color-border-strong: var(--ink-600);

  --color-brand: var(--gold-400);
  --color-link: var(--gold-300);
  --color-link-hover: var(--gold-200);
  --color-highlight: rgb(233 174 76 / 0.25);

  --color-button-bg: var(--paper-100);
  --color-button-text: var(--ink-900);
  --color-button-bg-hover: var(--paper-300);
  --color-accent-button-bg: var(--gold-400);
  --color-accent-button-text: var(--ink-900);
  --color-accent-button-bg-hover: var(--gold-300);

  --color-focus: var(--gold-300);
  --color-success: var(--green-300);
  --color-danger: var(--red-300);
  --color-info: var(--blue-300);

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 8px 20px -8px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 28px 56px -18px rgb(0 0 0 / 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: var(--ink-900);
    --color-surface: var(--ink-800);
    --color-surface-raised: var(--ink-700);
    --color-surface-inverse: var(--paper-100);
    --color-text: var(--paper-100);
    --color-text-muted: var(--ink-400);
    --color-text-inverse: var(--ink-900);
    --color-border: var(--ink-700);
    --color-border-strong: var(--ink-600);
    --color-brand: var(--gold-400);
    --color-link: var(--gold-300);
    --color-link-hover: var(--gold-200);
    --color-highlight: rgb(233 174 76 / 0.25);
    --color-button-bg: var(--paper-100);
    --color-button-text: var(--ink-900);
    --color-button-bg-hover: var(--paper-300);
    --color-accent-button-bg: var(--gold-400);
    --color-accent-button-text: var(--ink-900);
    --color-accent-button-bg-hover: var(--gold-300);
    --color-focus: var(--gold-300);
    --color-success: var(--green-300);
    --color-danger: var(--red-300);
    --color-info: var(--blue-300);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 8px 20px -8px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 28px 56px -18px rgb(0 0 0 / 0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}
