/* И что теперь? — design tokens + mobile-first */

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --text: #171717;
  --muted: #6C6C6C;
  --border: #E6E1D8;
  --accent: #2B6E55;
  --accent-soft: #E8F1ED;
  --warning: #A65B28;
  --danger: #9C3D32;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(23, 23, 23, 0.06);
  --container: 1180px;
  --article: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #1f5542; }

.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}
.container.narrow { width: min(100% - 2rem, var(--article)); }

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.1rem; }

.lead { color: var(--muted); font-size: 1.05rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: #245c47; color: #fff; }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.icon-btn {
  border: 0;
  background: transparent;
  padding: 0.35rem;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.logo-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}
.logo-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
}
.nav { display: none; gap: 1rem; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--accent); }
.header-cta { display: none; }
.menu-toggle { margin-left: auto; }
.mobile-nav {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.mobile-nav[hidden] {
  display: none !important;
}
.mobile-nav a { color: var(--text); text-decoration: none; font-weight: 500; }

.hero { padding: 1.25rem 0 0.5rem; }
.hero-grid {
  display: grid;
  gap: 1rem;
  align-items: center;
}
.hero-sub {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.hero-lead { color: var(--muted); margin: 0 0 0.9rem; font-size: 0.98rem; }
.hero-art { justify-self: center; max-width: 340px; }
.hero-art img { width: 100%; height: auto; }

.search-form { margin-bottom: 0.75rem; }
.search-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.search-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}
.search-row input {
  border: 0;
  outline: none;
  font: inherit;
  font-size: 1.02rem;
  width: 100%;
  background: transparent;
  min-width: 0;
  min-height: 2.5rem;
}
.search-row .btn { grid-column: 1 / -1; }
.search-icon { opacity: 0.55; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}
.chip:hover { outline: 1px solid var(--accent); }

.section { padding: 2rem 0; }
.category-grid,
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
.category-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.category-card:hover,
.card:hover {
  border-color: #cfc7b8;
  box-shadow: 0 10px 28px rgba(23, 23, 23, 0.08);
  transform: translateY(-1px);
}
.category-card:focus-visible,
.card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.category-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.85rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.category-card img { grid-row: span 2; }
.category-name { font-weight: 650; }
.category-count { color: var(--muted); font-size: 0.9rem; }

.card-link { color: inherit; text-decoration: none; display: grid; gap: 0.35rem; }
.card-meta { margin: 0; color: var(--muted); font-size: 0.85rem; }
.card-title { margin: 0; }
.card-excerpt { margin: 0; color: var(--muted); }

.brand-cta-inner {
  display: grid;
  gap: 1rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
}
.footer-inner {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}
.footer-brand {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.footer-logo-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}
.footer-logo-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}
.footer-tagline {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 28rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy { margin: 0; font-size: 0.9rem; }

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--border);
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

.category-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.short-answer {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
}
.short-answer-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.article-excerpt {
  margin: 0.35rem 0 0.75rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

.diagnostic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
}
.diagnostic-q {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 650;
  margin: 0 0 0.75rem;
}
.diagnostic-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.diag-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  cursor: pointer;
}
.diag-btn:hover,
.diag-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.diagnostic-panel {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--accent-soft);
  margin-bottom: 0.5rem;
}
.diagnostic-panel[hidden] { display: none !important; }
.diagnostic-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.diag-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.diag-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: var(--surface);
}
.diag-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.callout {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
}
.callout--info { background: var(--accent-soft); }
.callout--warn {
  background: #fff6ef;
  border-color: #efd2bc;
}
.callout p { margin: 0; }

.related { margin-top: 2rem; }
.faq { margin-top: 1.75rem; }

.prose :where(p, ul, ol) { margin: 0 0 1rem; }
.prose :where(h2, h3) { margin-top: 1.6rem; }
.prose :where(ul, ol) { padding-left: 1.2rem; }

.article-dates {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.eyebrow { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.9rem; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}
.faq summary { cursor: pointer; font-weight: 600; }

.empty { color: var(--muted); }
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}
.empty-state-title {
  margin: 0 0 0.5rem;
  font-weight: 650;
}
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}
.error-page { text-align: center; }
.error-page img { margin: 0 auto 1rem; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .search-row {
    grid-template-columns: auto 1fr auto;
  }
  .search-row .btn { grid-column: auto; }
  .category-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .logo-mark {
    width: 44px;
    height: 44px;
  }
  .logo-title {
    font-size: 1.2rem;
  }
  .footer-logo-mark {
    width: 44px;
    height: 44px;
  }
  .footer-logo-title {
    font-size: 1.2rem;
  }
  .nav { display: flex; }
  .header-cta { display: inline-flex; margin-left: 0.5rem; }
  .menu-toggle { display: none; }
  .mobile-nav { display: none !important; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 2rem; }
  .category-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand-cta-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
