/* Единая таблица стилей сайта. Светлая тема по умолчанию, тёмная — через prefers-color-scheme. */

:root {
  --bg: #f7f5f2;
  --bg-alt: #ffffff;
  --text: #23201c;
  --muted: #6b6459;
  --border: #ddd6cc;
  --accent: #d9711c;
  --accent-text: #ffffff;
  --accent-soft: #f6e2d0;
  --code-bg: #efeae2;
  --table-head-bg: #eee7db;
  --shadow: rgba(35, 32, 28, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1815;
    --bg-alt: #24201b;
    --text: #ece7de;
    --muted: #a69c8d;
    --border: #3a342c;
    --accent: #e6873a;
    --accent-text: #1b1815;
    --accent-soft: #3a2a1a;
    --code-bg: #2a251e;
    --table-head-bg: #2c261e;
    --shadow: rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  font-size: 16px;
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

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

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

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

/* Каркас */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  flex-wrap: wrap;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.brand:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--text);
}

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

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.foot {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Крупные блоки */

.hero {
  padding: 2rem 0 2.5rem;
}

.hero h1 {
  font-size: 2rem;
  max-width: 22ch;
}

.hero p {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.05rem;
}

.hero .btn {
  margin-top: 0.5rem;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  background: var(--bg-alt);
  margin: 1.5rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--bg-alt);
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.9rem 1.1rem;
  border-radius: 0 6px 6px 0;
  margin: 1.5rem 0;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 1.5rem 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  margin-bottom: 1rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Содержимое */

.tbl-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.tbl th,
.tbl td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tbl th {
  background: var(--table-head-bg);
  font-weight: 700;
}

.tbl tr:last-child td {
  border-bottom: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Утилиты */

.muted {
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--accent);
}

.btn:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.ghost:hover {
  background: var(--accent);
  color: var(--accent-text);
}
