/*
 * Refendr visual foundations
 *
 * One shared source for the static homepage and Astro-rendered pages.
 * Primitive values describe the palette and scale. Semantic aliases describe use.
 */

:root {
  color-scheme: dark;

  /* Primitive colour palette */
  --color-plum-950: #15101f;
  --color-plum-900: #1c1629;
  --color-plum-850: #241d34;
  --color-ivory-50: #f7f3ee;
  --color-ivory-100: #f3efea;
  --color-mauve-400: #a39ab2;
  --color-mauve-500: #81788f;
  --color-mauve-600: #6f6781;
  --color-coral-500: #ff5b43;
  --color-coral-400: #ff7a57;
  --color-mint-400: #5be3a6;

  /* Typography */
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Hanken Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: clamp(1.75rem, 3vw, 2.5rem);
  --font-size-display: clamp(3rem, 6vw, 5.75rem);

  /* Eight-point spacing system, with 4px only for optical adjustment */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --content-wide: 74rem;
  --content-standard: 60rem;
  --content-reading: 45rem;
  --content-compact: 38rem;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-block: clamp(4rem, 8vw, 6rem);

  /* Shape and elevation */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.125rem;
  --radius-pill: 999px;
  --shadow-focus: 0 0 0 3px rgba(255, 91, 67, 0.24);
  --shadow-elevated: 0 1.5rem 5rem -2rem rgba(0, 0, 0, 0.72);

  /* Semantic dark theme */
  --surface-page: var(--color-plum-950);
  --surface-subtle: var(--color-plum-900);
  --surface-elevated: var(--color-plum-850);
  --text-primary: var(--color-ivory-100);
  --text-secondary: var(--color-mauve-400);
  --text-tertiary: var(--color-mauve-600);
  --border-subtle: rgba(243, 239, 234, 0.07);
  --border-default: rgba(243, 239, 234, 0.12);
  --accent-primary: var(--color-coral-500);
  --accent-hover: var(--color-coral-400);
  --status-live: var(--color-mint-400);
  --navigation-surface: rgba(21, 16, 31, 0.86);
  --ambient-accent: rgba(255, 91, 67, 0.14);
  --ambient-live: rgba(91, 227, 166, 0.05);

  /* Compatibility aliases used by the existing components */
  --ink: var(--surface-page);
  --ink-2: var(--surface-subtle);
  --ink-3: var(--surface-elevated);
  --paper: var(--text-primary);
  --muted: var(--text-secondary);
  --muted-2: var(--text-tertiary);
  --line: var(--border-default);
  --line-2: var(--border-subtle);
  --coral: var(--accent-primary);
  --coral-2: var(--accent-hover);
  --coral-soft: rgba(255, 91, 67, 0.12);
  --live: var(--status-live);
  --nav-bg: var(--navigation-surface);
  --glow-1: var(--ambient-accent);
  --glow-2: var(--ambient-live);
  --display: var(--font-display);
  --body: var(--font-body);
  --mono: var(--font-mono);
  --maxw: var(--content-wide);
}

:root[data-theme="light"] {
  color-scheme: light;
  --surface-page: #fbf8f4;
  --surface-subtle: #ffffff;
  --surface-elevated: #f1ece3;
  --text-primary: #1b1426;
  --text-secondary: #574f66;
  --text-tertiary: #6b6379;
  --border-subtle: rgba(27, 20, 38, 0.07);
  --border-default: rgba(27, 20, 38, 0.13);
  --accent-primary: #c9361c;
  --accent-hover: #a62c13;
  --status-live: #167c55;
  --navigation-surface: rgba(251, 248, 244, 0.9);
  --ambient-accent: rgba(255, 91, 67, 0.08);
  --ambient-live: rgba(91, 227, 166, 0.05);
  --coral-soft: rgba(197, 55, 27, 0.1);
  --shadow-elevated: 0 1.5rem 5rem -2.5rem rgba(50, 33, 20, 0.2);
}

@media (max-width: 42rem) {
  :root {
    --gutter: 1.25rem;
    --section-block: 3.5rem;
  }
}
