/* Aligned UI system v1. Load before style.css and refinements.css. */
@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --color-canvas: oklch(.985 0 0);
  --color-surface: #ffffff;
  --color-surface-subtle: #efefe9;
  --color-text: oklch(.2 .02 264);
  --color-text-muted: #70746d;
  --color-text-on-subtle: #62685f;
  --color-border-subtle: oklch(.9 .01 264);
  --color-border-control: #858b99;
  --color-action-primary: oklch(.55 .2 264);
  --color-action-primary-hover: #3049c1;
  --color-on-primary: #ffffff;
  --color-focus: oklch(.48 .2 264);
  --color-danger: #9f3030;
  --color-danger-surface: #fbedeb;
  --color-danger-border: #f1d0ca;
  --color-success: #344c22;
  --color-success-surface: #edf4e3;
  --color-success-border: #d6e6c1;
  --color-warning: #6b5422;
  --color-warning-surface: #faf1d8;
  --color-warning-border: #e9dba7;
  --color-info: #2c4388;
  --color-info-surface: #edf2ff;
  --color-overlay: #00000066;
  --color-shadow: #00000022;

  --space-0: 0;
  --space-25: 2px;
  --space-50: 4px;
  --space-75: 8px;
  --space-100: 12px;
  --space-200: 16px;
  --space-300: 24px;
  --space-400: 32px;
  --space-500: 40px;
  --space-600: 48px;
  --space-700: 64px;
  --space-800: 80px;
  --space-900: 96px;

  --font-ui: Manrope, ui-sans-serif, system-ui, sans-serif;
  --font-code: 'Geist Mono', ui-monospace, monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --text-xs-size: 12px; --text-xs-leading: 16px;
  --text-sm-size: 14px; --text-sm-leading: 20px;
  --text-base-size: 16px; --text-base-leading: 24px;
  --text-lg-size: 18px; --text-lg-leading: 28px;
  --text-xl-size: 20px; --text-xl-leading: 28px;
  --text-2xl-size: 24px; --text-2xl-leading: 32px;
  --text-3xl-size: 30px; --text-3xl-leading: 36px;
  --text-4xl-size: 36px; --text-4xl-leading: 40px;
  --text-5xl-size: 48px; --text-5xl-leading: 48px;
  --text-6xl-size: 60px; --text-6xl-leading: 60px;
  --type-body-size: var(--text-base-size);
  --type-body-leading: var(--text-base-leading);
  --type-heading-size: var(--text-4xl-size);
  --type-heading-leading: var(--text-4xl-leading);
  --type-section-size: var(--text-2xl-size);
  --type-section-leading: var(--text-2xl-leading);
  --type-subheading-size: var(--text-xl-size);
  --type-subheading-leading: var(--text-xl-leading);
  --type-button-size: var(--text-sm-size);
  --type-button-leading: var(--text-sm-leading);
  --type-meta-size: var(--text-xs-size);
  --type-meta-leading: var(--text-xs-leading);

  --radius-none: 0;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;
  --radius-control: var(--radius-md);
  --radius-card: var(--radius-xl);
  --radius-media: var(--radius-lg);
  --border-width: 1px;
  --focus-width: 3px;
  --focus-offset: 4px;
  --control-hit-size: 44px;
  --icon-size: 20px;

  /* CSS custom properties cannot be substituted in media conditions. */
  --breakpoint-mobile: 680px;
  --breakpoint-tablet: 900px;
  --breakpoint-rail: 1250px;
  --breakpoint-wide: 1500px;
  --layout-max: 1320px;
  --layout-max-wide: 1392px;
  --layout-sidebar: 192px;
  --layout-sidebar-wide: 210px;
  --layout-reading: 720px;
  --layout-rail: 280px;
  --layout-prose: 68ch;

  --motion-curve: cubic-bezier(.22,1,.36,1);
  --motion-feedback: 300ms;
  --motion-layout: 500ms;
  --motion-reveal: 600ms;
  --motion-stagger: 60ms;
  --layer-header: 40;
  --layer-navigation: 60;
  --layer-menu-control: 70;
  --layer-toast: 100;
  --layer-skip: 1000;

  /* Compatibility names are aliases, never a second palette. */
  --bg: var(--color-canvas);
  --surface: var(--color-surface);
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border-subtle);
  --soft: var(--color-surface-subtle);
  --accent: var(--color-action-primary);
  --accent-ink: var(--color-on-primary);
  --danger: var(--color-danger);
  --focus: var(--color-focus);
  --curve: var(--motion-curve);
}

:root[data-theme=dark] {
  color-scheme: dark;
  --color-canvas: #181818;
  --color-surface: #1f1f1f;
  --color-surface-subtle: #272727;
  --color-text: #f1f1e9;
  --color-text-muted: #b0b3a9;
  --color-text-on-subtle: #b0b3a9;
  --color-border-subtle: #313131;
  --color-border-control: #777777;
  --color-focus: #a6bcff;
  --color-danger: #ffb6b6;
  --color-danger-surface: #272727;
  --color-danger-border: #313131;
  --color-success: #d8f36a;
  --color-success-surface: #272727;
  --color-success-border: #313131;
  --color-warning: #f1d892;
  --color-warning-surface: #272727;
  --color-warning-border: #313131;
  --color-info: #b9caff;
  --color-info-surface: #272727;
  --color-overlay: #00000099;
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-feedback: 0ms; --motion-layout: 0ms; --motion-reveal: 0ms; --motion-stagger: 0ms; }
}
