/* Статьи — статический раздел /articles. Фирменная тёмная палитра сайта,
   самодостаточный CSS без внешних шрифтов (CWV: без блокирующего CDN). */
:root {
  --graphite-950: #07090c;
  --graphite-900: #0d1117;
  --graphite-850: #121821;
  --steel-100: #e7edf5;
  --steel-200: #c8d2e0;
  --steel-300: #9fb0c4;
  --steel-400: #6f8098;
  --steel-500: #4d5b6f;
  --electric-400: #4fc3ff;
  --electric-500: #2fb6ff;
  --line: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--graphite-950);
  color: var(--steel-200);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--electric-400); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Картинка-герой статьи */
article .hero {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin: 22px 0 6px;
  display: block;
  background: var(--graphite-900);
}

/* Шапка */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 12, 0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; max-width: 1100px;
}
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand b { font-size: 15px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--steel-100); }
.brand span { font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel-400); margin-top: 3px; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--steel-300); font-size: 14px; }
.nav a:hover { color: var(--steel-100); text-decoration: none; }

/* Хлебные крошки */
.crumbs { font-size: 13px; color: var(--steel-400); margin: 22px 0 8px; }
.crumbs a { color: var(--steel-400); }
.crumbs a:hover { color: var(--electric-400); }
.crumbs span { color: var(--steel-500); }

/* Статья */
article { padding-bottom: 40px; }
.eyebrow { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--electric-400); font-weight: 700; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.12; color: var(--steel-100); margin: 10px 0 6px; letter-spacing: -0.01em; }
.meta { font-size: 13px; color: var(--steel-400); margin-bottom: 26px; }
article h2 { font-size: clamp(21px, 3.4vw, 26px); color: var(--steel-100); margin: 38px 0 12px; letter-spacing: -0.01em; }
article h3 { font-size: 19px; color: var(--steel-100); margin: 26px 0 10px; }
article p { margin: 0 0 18px; }
article ul, article ol { margin: 0 0 18px; padding-left: 22px; }
article li { margin-bottom: 8px; }
article strong { color: var(--steel-100); }
article img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }

/* Фото-иллюстрация в теле статьи (не hero) */
.a-figure { margin: 22px 0; text-align: center; }
.a-figure img { max-width: 400px; width: 100%; border-radius: 14px; border: 1px solid var(--line); background: var(--graphite-900); }
.a-figure figcaption { margin-top: 8px; font-size: 13px; color: var(--steel-400); }
article code { background: var(--graphite-850); padding: 2px 6px; border-radius: 6px; font-size: 0.92em; }

/* Определение */
.definition {
  border: 1px solid rgba(47, 182, 255, 0.22);
  background: rgba(47, 182, 255, 0.05);
  border-radius: 14px; padding: 16px 18px; margin: 24px 0;
}
.definition b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--electric-400); margin-bottom: 6px; }
.definition p { margin: 0; color: var(--steel-200); }

/* FAQ */
.faq { margin: 40px 0 8px; }
.faq h2 { margin-bottom: 14px; }
.faq details {
  border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; margin-bottom: 10px;
  background: var(--graphite-900);
}
.faq summary { cursor: pointer; font-weight: 600; color: var(--steel-100); padding: 12px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--electric-400); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; color: var(--steel-300); }

/* HowTo */
.howto { margin: 34px 0; padding-left: 0; list-style: none; counter-reset: step; }
.howto li { position: relative; padding-left: 44px; margin-bottom: 16px; }
.howto li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(47, 182, 255, 0.12); color: var(--electric-400);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.howto b { color: var(--steel-100); }

/* Автор-блок */
.author {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 40px 0;
  background: var(--graphite-900);
}
.author .avatar {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(47,182,255,0.25), rgba(47,182,255,0.05));
  border: 1px solid rgba(47,182,255,0.3);
  display: grid; place-items: center; color: var(--electric-400); font-weight: 800;
}
.author .who b { color: var(--steel-100); display: block; }
.author .who span { color: var(--steel-400); font-size: 14px; }

/* Читать по теме */
.related { margin: 40px 0; }
.related h2 { font-size: 18px; }
.related-grid { display: grid; gap: 12px; }
@media (min-width: 560px) { .related-grid { grid-template-columns: 1fr 1fr; } }
.related-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--graphite-900);
  display: block; transition: border-color .15s, background .15s;
}
.related-card:hover { border-color: rgba(47,182,255,0.3); background: var(--graphite-850); text-decoration: none; }
.related-card b { color: var(--steel-100); display: block; margin-bottom: 4px; }
.related-card span { color: var(--steel-400); font-size: 14px; }

/* Лента /articles */
.feed-head { padding: 40px 0 6px; }
.feed-head h1 { margin-bottom: 8px; }
.feed-head p { color: var(--steel-300); max-width: 60ch; }

.feed-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 6px; }
.feed-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font-size: 14px; color: var(--steel-300); background: var(--graphite-900);
}
.feed-nav a:hover { border-color: rgba(47,182,255,0.35); color: var(--steel-100); text-decoration: none; }
.feed-nav a span { font-size: 12px; color: var(--electric-400); font-variant-numeric: tabular-nums; }

.feed-cluster { padding: 22px 0 6px; scroll-margin-top: 76px; }
.feed-cluster > h2 { font-size: 20px; color: var(--steel-100); margin: 6px 0 14px; }

.feed { display: grid; gap: 16px; padding: 0 0 12px; }
@media (min-width: 640px) { .feed { grid-template-columns: 1fr 1fr; } }
.feed-card {
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--graphite-900);
  display: flex; flex-direction: column; transition: border-color .15s, transform .15s;
}
.feed-card:hover { border-color: rgba(47,182,255,0.3); transform: translateY(-2px); text-decoration: none; }
.feed-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--graphite-850); border-bottom: 1px solid var(--line); }
.feed-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.feed-card:hover .thumb img { transform: scale(1.04); }
.feed-card .body { padding: 16px 18px; display: flex; flex-direction: column; flex: 1; }
.feed-card .tag { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--electric-400); }
.feed-card h3 { font-size: 18px; color: var(--steel-100); margin: 8px 0 8px; line-height: 1.25; }
.feed-card p { color: var(--steel-400); font-size: 14px; margin: 0 0 14px; }
.feed-card .card-meta { margin-top: auto; font-size: 12px; color: var(--steel-500); }
.feed-empty { color: var(--steel-400); padding: 30px 0 60px; }

/* Подвал */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--steel-500); font-size: 13px; }
.site-footer a { color: var(--steel-400); }
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--electric-500); color: var(--graphite-950); font-weight: 700;
  padding: 12px 22px; border-radius: 12px; margin: 8px 0 40px;
}
.cta:hover { background: var(--electric-400); text-decoration: none; }
