/* ===========================
   iТехно · Design System
   i-tehno.ru
   =========================== */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #ececee;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --text-soft: #86868b;
  --border: #d2d2d7;
  --border-soft: #e5e5ea;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff3b30;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);

  --container: 1200px;
  --container-narrow: 1100px;
  --text-col: 720px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --text: #f5f5f7;
  --text-muted: #a1a1a6;
  --text-soft: #8e8e93;
  --border: #38383a;
  --border-soft: #2c2c2e;
  --accent: #2997ff;
  --accent-hover: #4cb3ff;
  --accent-soft: rgba(41, 151, 255, 0.12);
}

/* ⚠ БЫЛО: { box-sizing: border-box; ... } — пропущен селектор * */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,251,253,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-soft);
}
[data-theme="dark"] .site-header { background: rgba(0,0,0,0.72); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; color: var(--text);
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #0071e3 0%, #5e5ce6 100%);
  display: grid; place-items: center; color: #fff;
  font-size: 18px; font-weight: 700; font-style: italic;
  box-shadow: 0 2px 8px rgba(0,113,227,0.3);
}
.nav-menu { display: flex; gap: 4px; list-style: none; }
.nav-menu a {
  color: var(--text); font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: 8px;
  transition: all .15s;
}
.nav-menu a:hover { background: var(--surface-2); color: var(--accent); }
.nav-actions { display: flex; gap: 4px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  display: grid; place-items: center; color: var(--text);
  transition: background .15s; font-size: 16px;
}
.icon-btn:hover { background: var(--surface-2); }
.burger { display: none; }

/* ===== HERO ===== */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(0,113,227,0.08), transparent 60%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 20px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, #0071e3 0%, #5e5ce6 50%, #bf5af2 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.45;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 980px;
  font-size: 15px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,113,227,0.3); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ===== SECTIONS ===== */
.section { padding: 72px 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 32px; gap: 20px; flex-wrap: wrap;
}
.section-title {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.section-sub { color: var(--text-muted); font-size: 15px; margin-top: 8px; }
.section-link { font-size: 14px; font-weight: 500; white-space: nowrap; }

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: all .2s;
  display: block;
  color: var(--text);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.product-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  opacity: 0; transition: opacity .2s;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  color: var(--text);
}
.product-card:hover::before { opacity: 1; }
.product-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 28px; margin: 0 auto 14px;
  position: relative; z-index: 1;
}
.product-card h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 4px;
  position: relative; z-index: 1;
}
.product-card p {
  font-size: 13px; color: var(--text-muted);
  position: relative; z-index: 1;
}
.product-count {
  display: inline-block; margin-top: 10px;
  font-size: 11px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  position: relative; z-index: 1;
}

/* ===== FEATURED ===== */
.featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-soft);
}
.featured-img {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1d1d1f 0%, #3a3a3c 100%);
  display: grid; place-items: center;
  color: #fff; font-size: 80px;
}
.featured-body {
  padding: 40px; display: flex; flex-direction: column; justify-content: center;
}
.featured-cat {
  display: inline-block;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent); margin-bottom: 12px;
}
.featured h2 {
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.featured h2 a { color: var(--text); }
.featured h2 a:hover { color: var(--accent); }
.featured p { color: var(--text-muted); font-size: 15px; margin-bottom: 20px; line-height: 1.5; }

/* ===== ARTICLES GRID ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .2s;
  display: flex; flex-direction: column;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.article-card-img {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #e5e5ea, #d1d1d6);
  display: grid; place-items: center;
  font-size: 50px; color: #8e8e93;
}
[data-theme="dark"] .article-card-img {
  background: linear-gradient(135deg, #2c2c2e, #1c1c1e);
  color: #636366;
}
.article-card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.article-card-cat {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 10px;
}
.article-card h3 {
  font-size: 17px; font-weight: 600; line-height: 1.35;
  letter-spacing: -0.01em; margin-bottom: 10px;
}
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--accent); }
.article-card p {
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 16px; flex: 1; line-height: 1.5;
}

/* ===== META ===== */
.meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.meta-item { display: flex; align-items: center; gap: 5px; }

/* ===== CATEGORY PAGE ===== */
.breadcrumbs {
  padding: 20px 0; font-size: 13px; color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 8px; opacity: 0.5; }

.cat-header { padding: 10px 0 40px; border-bottom: 1px solid var(--border-soft); margin-bottom: 40px; }
.cat-header h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700; letter-spacing: -0.025em;
  margin-bottom: 12px; line-height: 1.1;
}
.cat-header p { font-size: 17px; color: var(--text-muted); max-width: 720px; line-height: 1.5; }
.cat-stats { display: flex; gap: 24px; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.cat-stats strong { color: var(--text); font-weight: 600; }

.cat-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
.article-list { display: flex; flex-direction: column; gap: 20px; }
.list-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .2s;
}
.list-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: transparent; }
.list-item-img {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #e5e5ea, #d1d1d6);
  display: grid; place-items: center;
  font-size: 40px; color: #8e8e93;
}
[data-theme="dark"] .list-item-img {
  background: linear-gradient(135deg, #2c2c2e, #1c1c1e); color: #636366;
}
.list-item-body { padding: 20px 20px 20px 0; display: flex; flex-direction: column; }
.list-item-cat {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 8px;
}
.list-item h2 {
  font-size: 19px; font-weight: 600; line-height: 1.3;
  letter-spacing: -0.01em; margin-bottom: 8px;
}
.list-item h2 a { color: var(--text); }
.list-item h2 a:hover { color: var(--accent); }
.list-item p { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; flex: 1; line-height: 1.5; }

.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }
.sidebar-block {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 20px;
}
.sidebar-block h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 16px; font-weight: 600;
}
.popular-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.popular-list li { display: flex; gap: 12px; align-items: flex-start; }
.popular-num {
  font-size: 18px; font-weight: 700; color: var(--accent);
  min-width: 24px; font-variant-numeric: tabular-nums;
}
.popular-list a { font-size: 14px; color: var(--text); line-height: 1.4; font-weight: 500; }
.popular-list a:hover { color: var(--accent); }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 6px 12px; border-radius: 980px;
  background: var(--surface-2); font-size: 12px; color: var(--text);
  transition: all .15s;
}
.tag:hover { background: var(--accent); color: #fff; }

.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 48px;
}
.pagination a, .pagination span {
  min-width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text);
  background: var(--surface);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== ARTICLE PAGE ===== */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), #5e5ce6);
  z-index: 100; transition: width .1s;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 48px;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding-bottom: 80px;
  align-items: start;
}
.article-main {
  min-width: 0;
  max-width: var(--text-col);
  width: 100%;
  margin: 0 auto;
}

.article-cat {
  display: inline-block; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 16px;
}
.article h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700; letter-spacing: -0.028em;
  line-height: 1.12; margin-bottom: 20px;
}
.article-lead {
  font-size: 19px; color: var(--text-muted);
  line-height: 1.5; margin-bottom: 28px;
}
.article-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 20px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
  margin-bottom: 36px; font-size: 14px; color: var(--text-muted);
  align-items: center;
}
.author { display: flex; align-items: center; gap: 12px; }
.author-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #0071e3, #5e5ce6);
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px;
  flex-shrink: 0;
}
.author-name { color: var(--text); font-weight: 500; font-size: 14px; }
.author-role { font-size: 12px; color: var(--text-muted); }

.article-hero {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1d1d1f, #3a3a3c);
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  color: #fff; font-size: 90px;
  margin-bottom: 40px;
  overflow: hidden;
}

/* ARTICLE TYPOGRAPHY */
.article-body { font-size: 17px; line-height: 1.7; color: var(--text); }
.article-body h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  margin: 48px 0 16px; line-height: 1.2;
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
  margin: 32px 0 12px; line-height: 1.3;
  scroll-margin-top: 80px;
}
.article-body h4 { font-size: 17px; font-weight: 600; margin: 24px 0 10px; }
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { font-weight: 600; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px; margin: 24px 0;
  font-style: italic; color: var(--text-muted);
  font-size: 18px; line-height: 1.5;
}
.article-body figure { margin: 32px 0; }
.article-body figcaption {
  text-align: center; font-size: 13px;
  color: var(--text-muted); margin-top: 10px;
}
.article-body table {
  width: 100%; border-collapse: collapse;
  margin: 24px 0; font-size: 15px;
  background: var(--surface); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
}
.article-body th, .article-body td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.article-body th { background: var(--surface-2); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.article-body tr:last-child td { border-bottom: none; }

.article-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 40px 0; padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}
.article-tags a {
  padding: 6px 14px; border-radius: 980px;
  background: var(--surface-2); font-size: 13px; color: var(--text);
}
.article-tags a:hover { background: var(--accent); color: #fff; }

.author-box-extended {
  display: flex; gap: 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 28px;
  margin: 40px 0;
}
.author-box-extended .author-avatar { width: 80px; height: 80px; font-size: 28px; flex-shrink: 0; }
.author-box-extended-info h4 { font-size: 18px; margin-bottom: 4px; }
.author-box-extended-info .role { color: var(--accent); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.author-box-extended-info p { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.5; }

.share-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 16px 0; margin: 24px 0;
  border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
}
.share-bar span { font-size: 13px; color: var(--text-muted); margin-right: 8px; }
.share-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); display: grid; place-items: center;
  font-size: 16px; transition: all .15s; color: var(--text);
  border: none; cursor: pointer;
}
.share-btn:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

.feedback {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 28px;
  margin: 40px 0;
  text-align: center;
}
.feedback h4 { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.feedback-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.feedback-btn {
  padding: 10px 20px; border-radius: 980px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.feedback-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.feedback-btn.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.feedback-thanks { display: none; color: var(--text-muted); font-size: 14px; margin-top: 12px; }
.feedback-thanks.show { display: block; }

.toc-aside {
  position: sticky; top: 80px;
  font-size: 13px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc-aside h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); margin-bottom: 14px; font-weight: 600;
}
.toc-aside ol {
  list-style: none; counter-reset: toc;
  border-left: 2px solid var(--border-soft);
  padding-left: 16px;
}
.toc-aside li {
  counter-increment: toc;
  margin-bottom: 10px;
  position: relative;
}
.toc-aside li::before {
  content: counter(toc);
  position: absolute; left: -23px; top: 0;
  font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.toc-aside a {
  color: var(--text-muted); line-height: 1.4;
  transition: color .15s; display: block;
}
.toc-aside a:hover, .toc-aside a.active { color: var(--accent); font-weight: 500; }

.related {
  margin-top: 64px; padding-top: 40px;
  border-top: 1px solid var(--border-soft);
}
.related h2 { font-size: 24px; margin-bottom: 24px; letter-spacing: -0.02em; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.related-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden; transition: all .2s;
}
.related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.related-card-img {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #e5e5ea, #d1d1d6);
  display: grid; place-items: center; font-size: 40px; color: #8e8e93;
}
[data-theme="dark"] .related-card-img {
  background: linear-gradient(135deg, #2c2c2e, #1c1c1e); color: #636366;
}
.related-card-body { padding: 16px; }
.related-card h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.related-card h3 a { color: var(--text); }
.related-card h3 a:hover { color: var(--accent); }

/* ===== NEWSLETTER ===== */
.newsletter {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
}
.newsletter h2 { font-size: 28px; margin-bottom: 10px; letter-spacing: -0.02em; }
.newsletter p { color: var(--text-muted); margin-bottom: 24px; }
.newsletter-form {
  display: flex; gap: 8px; max-width: 480px; margin: 0 auto;
}
.newsletter-form input {
  flex: 1; padding: 12px 18px;
  border: 1px solid var(--border); border-radius: 980px;
  background: var(--bg); color: var(--text);
  font-size: 15px; outline: none;
  font-family: inherit;
}
.newsletter-form input:focus { border-color: var(--accent); }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--surface-2);
  padding: 60px 0 30px;
  margin-top: 80px;
  border-top: 1px solid var(--border-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 16px; font-weight: 600;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text); font-size: 14px; }
.footer-col a:hover { color: var(--accent); }
.footer-about p { font-size: 14px; color: var(--text-muted); margin-top: 12px; max-width: 320px; line-height: 1.5; }
.footer-bottom {
  padding-top: 24px; border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--text-muted);
}

/* ===== SEARCH MODAL ===== */
.search-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px;
}
.search-modal.open { display: flex; }
.search-box {
  width: 100%; max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: searchSlideIn 0.2s ease-out;
}
@keyframes searchSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.search-input-wrap {
  display: flex; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  gap: 12px;
}
.search-input {
  flex: 1; border: none; outline: none;
  background: transparent;
  font-size: 17px; color: var(--text);
  font-family: inherit;
}
.search-input::placeholder { color: var(--text-soft); }
.search-kbd {
  padding: 2px 8px; border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono);
}
.search-results { max-height: 400px; overflow-y: auto; padding: 8px; }
.search-result {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 10px;
  cursor: pointer; transition: background 0.1s;
  color: var(--text);
}
.search-result:hover, .search-result.active { background: var(--surface-2); color: var(--text); }
.search-result-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 18px; flex-shrink: 0;
}
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 14px; font-weight: 500; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-meta { font-size: 12px; color: var(--text-muted); }
.search-empty {
  padding: 40px 20px; text-align: center;
  color: var(--text-muted); font-size: 14px;
}
.search-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-soft);
  display: flex; gap: 16px;
  font-size: 12px; color: var(--text-muted);
}
.search-footer kbd {
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px; margin: 0 2px;
}

/* ===== SCROLL TOP ===== */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  display: grid; place-items: center;
  font-size: 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(20px);
  transition: all 0.3s; z-index: 40;
}
.scroll-top.visible { opacity: 1; transform: translateY(0); }
.scroll-top:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ===== FONT SIZE CONTROLS ===== */
.font-size-controls { display: flex; gap: 4px; align-items: center; }
.font-size-controls button {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 12px; font-weight: 600;
  transition: all 0.15s;
}
.font-size-controls button:hover { background: var(--surface-2); border-color: var(--accent); }

/* ===== ANIMATIONS ===== */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc-aside { display: none; }
  .cat-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; }
  .featured-body { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-menu { display: none; }
  .burger { display: grid; }
  .nav-menu.open {
    display: flex; flex-direction: column;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px; gap: 4px; box-shadow: var(--shadow-md);
  }
  .nav-menu.open a { padding: 12px 16px; }
}
@media (max-width: 640px) {
  .list-item { grid-template-columns: 1fr; }
  .list-item-body { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .newsletter { padding: 32px 20px; }
  .newsletter-form { flex-direction: column; }
  .section { padding: 48px 0; }
  .hero { padding: 48px 0 32px; }
  .article h1 { font-size: 26px; }
  .article-lead { font-size: 16px; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 18px; }
  .author-box-extended { flex-direction: column; text-align: center; }
}

.info-banner { background: #e7f3ff; border-left: 4px solid #2196f3; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.profile-card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 2px solid transparent; }
.profile-card.active { border-color: #30d158; }
.profile-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.profile-card h3 { font-size: 18px; margin-bottom: 4px; }
.profile-card .desc { color: #6e6e73; font-size: 13px; }
.profile-models { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.model-chip { padding: 6px 12px; border-radius: 980px; background: #f5f5f7; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.model-chip.judge { background: #fff3cd; color: #856404; }
.model-chip.gen { background: #d4edda; color: #155724; }
.badge-active { background: #30d158; color: #fff; padding: 3px 10px; border-radius: 980px; font-size: 11px; font-weight: 600; text-transform: uppercase; }

/* Модалка */
.form-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; padding: 40px; align-items: center; justify-content: center; }
.form-modal.open { display: flex; }
.form-modal-content { background: #fff; border-radius: 16px; width: 90%; max-width: 600px; max-height: 85vh; overflow-y: auto; }
.form-modal-header { padding: 16px 20px; border-bottom: 1px solid #e5e5ea; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; z-index: 1; }
.form-modal-body { padding: 20px; }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #e5e5ea; border-radius: 8px; cursor: pointer; transition: all .15s; }
.checkbox-item:hover { background: #f5f5f7; }
.checkbox-item input { width: 18px; height: 18px; cursor: pointer; }
.checkbox-item label { flex: 1; cursor: pointer; font-size: 14px; }
.checkbox-item .code { font-family: monospace; font-size: 12px; color: #6e6e73; }

/* ===== FAQ БЛОК ===== */
.faq-section {
    margin: 48px 0;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.faq-section h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 24px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-section h2::before {
    content: '❓';
    font-size: 28px;
}

.faq-item {
    border-bottom: 1px solid var(--border-soft);
    padding: 0;
    margin: 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    padding: 20px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: color 0.2s;
    font-family: inherit;
    line-height: 1.4;
}

.faq-question:hover {
    color: var(--accent);
}

.faq-question:focus {
    outline: none;
    color: var(--accent);
}

.faq-question::after {
    content: '+';
    font-size: 24px;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.3s ease, color 0.2s;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
    color: var(--accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    max-height: 2000px;
    padding: 0 0 20px 0;
}

.faq-answer p {
    margin: 0 0 12px 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    margin: 8px 0 12px 24px;
}

.faq-answer li {
    margin-bottom: 6px;
}

.faq-answer strong {
    color: var(--text);
    font-weight: 600;
}

.faq-answer code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--font-mono);
}

/* Счётчик вопросов */
.faq-counter {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

/* Адаптив */
@media (max-width: 640px) {
    .faq-section {
        padding: 20px;
        margin: 32px 0;
    }
    
    .faq-section h2 {
        font-size: 20px;
    }
    
    .faq-question {
        font-size: 15px;
        padding: 16px 0;
    }
    
    .faq-answer {
        font-size: 14px;
    }
}

/* ===== FAQ БЛОК ===== */
.faq-section {
    margin: 48px 0;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.faq-section h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 24px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-section h2::before {
    content: '❓';
    font-size: 28px;
}

.faq-item {
    border-bottom: 1px solid var(--border-soft);
    padding: 0;
    margin: 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    padding: 20px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: color 0.2s;
    font-family: inherit;
    line-height: 1.4;
}

.faq-question:hover {
    color: var(--accent);
}

.faq-question:focus {
    outline: none;
    color: var(--accent);
}

.faq-question::after {
    content: '+';
    font-size: 24px;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.3s ease, color 0.2s;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
    color: var(--accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 0 0 20px 0;
}

.faq-answer p {
    margin: 0 0 12px 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    margin: 8px 0 12px 24px;
}

.faq-answer li {
    margin-bottom: 6px;
}

.faq-answer strong {
    color: var(--text);
    font-weight: 600;
}

.faq-answer code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--font-mono);
}

/* Счётчик вопросов */
.faq-counter {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

/* Адаптив */
@media (max-width: 640px) {
    .faq-section {
        padding: 20px;
        margin: 32px 0;
    }
    
    .faq-section h2 {
        font-size: 20px;
    }
    
    .faq-question {
        font-size: 15px;
        padding: 16px 0;
    }
    
    .faq-answer {
        font-size: 14px;
    }
}