/*
 * Design tokens and element defaults.
 *
 * `stylesheet_link_tag :app` in the layout bundles every file in this
 * directory, so new styles go in their own file here (BEM-named, one block
 * per file) rather than growing this one.
 *
 * Tokens are declared on `:root` and overridden wholesale in the dark-scheme
 * block below -- never hard-code a colour in a component file.
 */

:root {
  color-scheme: light dark;

  /* Surfaces and text */
  --color-bg: #eef1f6;
  --color-bg-accent: #dfe5f2;
  --color-surface: #ffffff;
  --color-surface-muted: #f6f7fa;
  --color-text: #14171f;
  --color-text-muted: #5b6376;
  --color-text-subtle: #858c9c;
  --color-border: #dde1e9;
  --color-border-strong: #c3c9d6;

  /* Brand */
  --color-brand: #3a5bd9;
  --color-brand-hover: #2f4bbb;
  --color-brand-active: #27409e;
  --color-brand-contrast: #ffffff;
  --color-brand-soft: #eaefff;

  /* Feedback */
  --color-notice: #0b6b3a;
  --color-notice-bg: #e6f4ec;
  --color-notice-border: #b8e0cb;
  --color-alert: #8a1c1c;
  --color-alert-bg: #fbeaea;
  --color-alert-border: #f0c3c3;

  /* Focus */
  --color-focus: #3a5bd9;

  /* Spacing scale */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.12);

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0d0f14;
    --color-bg-accent: #161a24;
    --color-surface: #171a21;
    --color-surface-muted: #1e222b;
    --color-text: #e9ebf0;
    --color-text-muted: #9aa2b1;
    --color-text-subtle: #767e8d;
    --color-border: #2b303b;
    --color-border-strong: #3b4250;

    --color-brand: #7d9bff;
    --color-brand-hover: #93abff;
    --color-brand-active: #a9beff;
    --color-brand-contrast: #0d0f14;
    --color-brand-soft: #1c2438;

    --color-notice: #6ee7a8;
    --color-notice-bg: #10261b;
    --color-notice-border: #1f4a34;
    --color-alert: #ff9d9d;
    --color-alert-bg: #2a1416;
    --color-alert-border: #4d2226;

    --color-focus: #7d9bff;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: var(--space-md);
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--color-brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-brand-hover);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
