/* Базовые переменные и общие правила. */

:root {
  color-scheme: light dark;

  --bg: #f5f4ef;
  --surface: #fffefb;
  --surface-2: #efeee8;
  --text: #20211e;
  --muted: #66685f;
  --border: #dcdad0;
  --accent: #2f6f5e;
  --accent-strong: #225445;
  --accent-soft: #e2efe9;
  --on-accent: #ffffff;
  --danger: #a23b32;
  --danger-soft: #f8e7e4;
  --on-danger: #ffffff;
  --warning: #8a5a12;
  --warning-soft: #fbf0d8;
  --on-warning: #ffffff;
  --ok: #2f6f5e;
  --focus: #2f6f5e;

  --color-red: #b34a3f;
  --color-orange: #c4762f;
  --color-yellow: #b39120;
  --color-green: #4c7d4a;
  --color-blue: #3f6f9e;
  --color-purple: #7a5a9e;
  --color-gray: #777a70;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30, 30, 20, 0.04), 0 10px 30px rgba(30, 30, 20, 0.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513;
    --surface: #1d1f1c;
    --surface-2: #242723;
    --text: #ecebe6;
    --muted: #a3a49d;
    --border: #343830;
    --accent: #7fc7ae;
    --accent-strong: #a5ddc9;
    --accent-soft: #1f3a31;
    --on-accent: #10221c;
    --danger: #ef9a92;
    --danger-soft: #3a2320;
    --on-danger: #2a0f0c;
    --warning: #e8c27a;
    --warning-soft: #3a3020;
    --on-warning: #2a1d07;
    --ok: #7fc7ae;
    --focus: #9bd8c2;
    --color-red: #e08a80;
    --color-orange: #e0a36a;
    --color-yellow: #ddc06a;
    --color-green: #8fbf87;
    --color-blue: #8ab4dc;
    --color-purple: #b79bd8;
    --color-gray: #a8aaa0;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.2);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 34%);
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-strong);
}

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

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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