/* Kvitter — "Modernist" design tokens. Flat, architectural, zero border radius. */

:root {
  --bg: #f3f2f2;
  --surface: #ffffff;
  --ink: #201e1d;
  --hairline: #dedad6;
  --input-border: #c9c5c1;
  --muted: #8c8681;
  --accent: #ec3013;
  --accent-pressed: #c2260c;
  --ai: #00bbb6;              /* secondary accent — AI actions only */
  --placeholder: #e6e3e0;
  --placeholder-dash: #b5b0ab;

  --rule-major: 2px;
  --rule-control: 1.5px;
  --rule-hairline: 1px;

  --gutter: 16px;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 0;
}

:root[data-theme="dark"],
:root:not([data-theme="light"]) {
  /* system default follows prefers-color-scheme; explicit light wins via [data-theme=light] */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171615;
    --surface: #201e1d;
    --ink: #f3f2f2;
    --hairline: #3d3936;
    --input-border: #3d3936;
    --muted: #8c8681;
    --placeholder: #2a2826;
    --placeholder-dash: #4a4642;
  }
}

:root[data-theme="dark"] {
  --bg: #171615;
  --surface: #201e1d;
  --ink: #f3f2f2;
  --hairline: #3d3936;
  --input-border: #3d3936;
  --muted: #8c8681;
  --placeholder: #2a2826;
  --placeholder-dash: #4a4642;
}

* { box-sizing: border-box; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Added only while a manual light/dark switch is in flight (see applyTheme),
   so the palette cross-fades instead of snapping. Removed right after. */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .45s ease, border-color .45s ease,
              color .45s ease, fill .45s ease, stroke .45s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  .theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
    transition: none !important;
  }
}
