:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --text: #1a1d24;
  --muted: #5c6578;
  --faint: #8b93a3;
  --line: #e4e8ef;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-hover: #1d4ed8;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter", var(--font);
  --max: 1120px;
  --max-wide: 1280px;
  --sidebar: 240px;
  --hub-left: 220px;
  --hub-right: 300px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.container--wide {
  width: min(100% - 2rem, var(--max-wide));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
}

.site-nav a.is-active {
  font-weight: 600;
}

.nav-external {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent) !important;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.45);
}

.mob-overlay.is-open {
  display: block;
}

.mob-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(88vw, 320px);
  background: var(--surface);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mob-panel a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.hero {
  padding: 2.5rem 0 1.5rem;
}

.hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.hero__lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 42rem;
  margin: 0 0 1.5rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips span {
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}

.section-title {
  font-size: 1.25rem;
  margin: 2rem 0 1rem;
  letter-spacing: -0.02em;
}

.section-title a {
  color: inherit;
  text-decoration: none;
}

.section-title a:hover {
  color: var(--accent);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.guide-card:hover {
  border-color: #bfd4ff;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.08);
}

.guide-card:hover .guide-card__media img {
  transform: scale(1.03);
}

.guide-card--pinned {
  position: relative;
  order: -1;
}

.guide-card__pin {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 10px rgba(15, 23, 42, 0.18);
  color: rgba(37, 99, 235, 0.72);
  pointer-events: none;
}

.guide-card__pin svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  transform: rotate(32deg);
  transform-origin: center;
  filter: drop-shadow(0 1px 2px rgba(37, 99, 235, 0.2));
}

.guide-card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.guide-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.guide-card:not(:has(.guide-card__media)) {
  padding: 1.15rem 1.2rem;
}

.guide-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.2rem;
}

.guide-card__tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.guide-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.guide-card__excerpt {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

.guide-card__meta {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--faint);
}

.layout-article {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.5rem 0 3rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 84px;
}

.sidebar__block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.sidebar__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin: 0 0 0.65rem;
}

.sidebar nav a {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0;
}

.sidebar nav a:hover {
  color: var(--accent);
}

.sidebar nav a.is-active {
  color: var(--accent);
  font-weight: 600;
}

.article-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.breadcrumbs {
  font-size: 0.86rem;
  color: var(--faint);
  margin: 0 0 1rem;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.article-meta {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.article-meta strong {
  color: var(--text);
}

.article h1 {
  font-size: clamp(1.65rem, 3.5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.article-lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.author-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.author-line img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.article-body h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.08rem;
  margin: 1.35rem 0 0.5rem;
}

.article-body p,
.article-body li {
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.article-body li {
  margin-bottom: 0.35rem;
}

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.85rem 1rem;
  border-radius: 0 10px 10px 0;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.note--tip {
  border-color: #16a34a;
  background: #f0fdf4;
}

.note--summary {
  border-color: #7c3aed;
  background: #f5f3ff;
}

.figure {
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.figure img {
  display: block;
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.cta-box {
  margin-top: 2rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid #bfd4ff;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.cta-box h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.cta-box p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0 2.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}

@media (max-width: 900px) {
  .layout-article {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    order: 2;
  }

  .menu-toggle {
    display: inline-block;
  }

  .site-nav--desktop {
    display: none;
  }
}

@media (min-width: 901px) {
  .sidebar--mobile-only {
    display: none;
  }
}

/* —— Hub layout (главная, список статей) —— */

.page-hub .site-header--compact .site-nav--desktop {
  display: none;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  margin-left: auto;
}

.header-cta:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

.layout-hub {
  display: grid;
  grid-template-columns: var(--hub-left) minmax(0, 1fr) var(--hub-right);
  gap: 1.25rem;
  padding: 1.25rem 0 2.5rem;
  align-items: start;
}

.hub-nav {
  position: sticky;
  top: 84px;
  font-size: 0.9rem;
}

.hub-nav__main a,
.hub-nav__rubrics a,
.hub-nav__footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.hub-nav__main a:hover,
.hub-nav__rubrics a:hover,
.hub-nav__footer a:hover,
.hub-nav__main a.is-active {
  color: var(--text);
}

.hub-nav__main a.is-active {
  font-weight: 600;
}

.hub-nav__icon {
  width: 1.25rem;
  text-align: center;
  opacity: 0.65;
  font-size: 0.95rem;
}

.hub-nav__label {
  margin: 1.25rem 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.hub-nav__rubrics a {
  padding-left: 0.15rem;
  font-size: 0.86rem;
}

.hub-nav__footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.hub-nav__footer a {
  font-size: 0.82rem;
  color: var(--faint);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.panel--expert {
  padding: 1.35rem 1.5rem;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel__title {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.panel__title--sm {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.panel__link {
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}

.panel__link:hover {
  color: var(--accent);
}

.expert {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
}

.expert--compact {
  align-items: center;
}

.expert__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}

.expert--compact .expert__photo {
  width: 72px;
  height: 72px;
}

.expert__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.expert__title--sm {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.expert__bio {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.expert__stats {
  margin: 0;
  font-size: 0.82rem;
  color: var(--faint);
}

.expert__stats a {
  text-decoration: none;
}

.guide-grid--hub {
  margin-bottom: 0;
}

.hub-about-text {
  margin: 1.25rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.panel--promo {
  background: linear-gradient(160deg, #e8f0fe 0%, #f0f4ff 45%, #fafbff 100%);
  border-color: #c7d7fe;
}

.promo__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.promo__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.promo__text {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.btn--promo {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: #1e3a5f;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}

.btn--promo:hover {
  background: #152a45;
  color: #fff !important;
}

.popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: popular;
}

.popular-list__item {
  counter-increment: popular;
  border-bottom: 1px solid var(--line);
}

.popular-list__item:last-child {
  border-bottom: none;
}

.popular-list__item a {
  display: block;
  padding: 0.65rem 0 0.65rem 2rem;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.popular-list__item a::before {
  content: counter(popular);
  position: absolute;
  left: 0;
  top: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--faint);
  width: 1.25rem;
}

.popular-list__item a:hover .popular-list__name {
  color: var(--accent);
}

.popular-list__name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.popular-list__meta {
  font-size: 0.75rem;
  color: var(--faint);
}

.popular-list__meta span {
  color: var(--accent);
  font-weight: 500;
}

@media (max-width: 1100px) {
  .layout-hub {
    grid-template-columns: var(--hub-left) minmax(0, 1fr);
  }

  .hub-aside {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
  }

  .hub-aside .panel {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  .layout-hub {
    grid-template-columns: 1fr;
    padding-top: 0.75rem;
  }

  .hub-nav {
    display: none;
  }

  .page-hub .menu-toggle {
    display: inline-block;
  }

  .header-cta {
    display: none;
  }

  .expert {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .expert--compact {
    flex-direction: row;
    text-align: left;
  }
}

@media (min-width: 769px) {
  .page-hub .menu-toggle {
    display: none;
  }
}
