:root {
    color-scheme: dark;

    /* Core palette */
    --color-ink: #161826;
    --color-surface: #232532;
    --color-surface-raised: #292b3a;
    --color-paper: #e9e9ed;
    --color-accent: #9184d9;
    --color-accent-secondary: #a7a1db;

    /* Neutral ramp */
    --color-neutral-100: #f3f5fe;
    --color-neutral-200: #e4e7f5;
    --color-neutral-300: #cfd3e5;
    --color-neutral-400: #b2b6ca;
    --color-neutral-500: #9397ab;
    --color-neutral-600: #75798c;
    --color-neutral-700: #595d6c;
    --color-neutral-800: #3f424d;
    --color-neutral-900: #292b31;

    /* Accent ramp */
    --color-accent-100: #f5f4ff;
    --color-accent-200: #e7e5fe;
    --color-accent-300: #d2cefd;
    --color-accent-400: #b5abfc;
    --color-accent-500: #968ae0;
    --color-accent-600: #796cbf;
    --color-accent-700: #5d5294;
    --color-accent-800: #423a6a;
    --color-accent-900: #2b2741;

    /* Saturated section treatment */
    --color-section: #262a60;
    --color-section-glow: #353b80;
    --color-section-ghost: #4c5397;

    /* Semantic color roles */
    --color-background: var(--color-ink);
    --color-background-elevated: var(--color-surface);
    --color-text: var(--color-paper);
    --color-text-subtle: var(--color-neutral-400);
    --color-text-muted: var(--color-neutral-500);
    --color-text-faint: var(--color-neutral-600);
    --color-link: var(--color-accent-300);
    --color-link-hover: var(--color-accent-100);
    --color-border: color-mix(in srgb, var(--color-paper) 16%, transparent);
    --color-border-strong: color-mix(in srgb, var(--color-paper) 34%, transparent);
    --color-focus: var(--color-accent-400);
    --color-danger: #ff8585;
    --color-success: #7bd7a6;

    /* Backward-compatible aliases used by the initial shell */
    --color-bg: var(--color-background);
    --color-muted: var(--color-text-subtle);
    --color-divider: var(--color-border);
    --color-accent-light: var(--color-accent-300);

    /* Type */
    --font-sans: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system,
        BlinkMacSystemFont, sans-serif;
    --font-heading: var(--font-sans);
    --font-body: var(--font-sans);
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: clamp(1.5rem, 2.6vw, 2rem);
    --font-size-3xl: clamp(2rem, 4vw, 3.5rem);
    --font-size-display: clamp(2.75rem, 6.4vw, 5rem);
    --line-height-tight: 1.08;
    --line-height-heading: 1.18;
    --line-height-body: 1.65;
    --letter-spacing-heading: -0.025em;
    --letter-spacing-label: 0.12em;

    /* Spacing */
    --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(3.5rem, 8vw, 6rem);
    --space-page-inline: clamp(1.25rem, 5vw, 4rem);

    /* Layout */
    --content-width-cozy: 72.5rem;
    --content-width-default: 82.5rem;
    --content-width-wide: 105rem;
    --content-width: var(--content-width-default);
    --text-width: 64ch;
    --text-width-narrow: 52ch;

    /* Shape and elevation */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.875rem;
    --radius-pill: 999px;
    --shadow-sm: 0 0 0 1px var(--color-neutral-800);
    --shadow-md: 0 0 0 1px var(--color-neutral-700), 0 0.375rem 1.125rem rgb(0 0 0 / 55%);
    --shadow-lg: 0 0 0 1px var(--color-neutral-500), 0 1rem 2.5rem rgb(0 0 0 / 65%);

    /* Motion */
    --duration-fast: 120ms;
    --duration-normal: 220ms;
    --duration-slow: 600ms;
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);

    /* Layering */
    --layer-base: 0;
    --layer-sticky: 20;
    --layer-overlay: 40;
    --layer-toast: 60;

    /* Breakpoint reference (CSS custom properties cannot drive media queries). */
    --breakpoint-small: 40rem;
    --breakpoint-navigation: 55rem;
    --breakpoint-wide: 80rem;
}
