:root {
  --bg: #0f1117;
  --surface: #161b27;
  --surface2: #1e2535;
  --surface3: #242d40;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --text: #e8eaf0;
  --muted: #6b7280;
  --muted2: #9ca3af;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --green: #22c55e;
  --orange: #f97316;
  --r: 12px;
  --r-sm: 8px;
  --r-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* HEADER */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}
.brand-logo svg { width: 18px; height: 16px; color: white; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.4px; }
.nav { display: flex; gap: 4px; flex: 1; margin-left: 16px; }
.nav-link {
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; color: var(--muted2);
  transition: all 0.15s ease;
}
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { color: var(--text); background: var(--surface2); }
.btn-login {
  padding: 9px 20px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 600;
  transition: all 0.15s ease;
}
.btn-login:hover { background: white; transform: translateY(-1px); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.messengers { display: flex; gap: 6px; }
.msg-icon {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted2); transition: all 0.15s ease;
}
.msg-icon:hover {
  background: var(--surface2); border-color: var(--border2);
  color: var(--text); transform: translateY(-1px);
}
.msg-icon svg { width: 16px; height: 16px; }

/* Burger */
.burger {
  display: none;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border);
  position: relative; flex-shrink: 0;
}
.burger span {
  position: absolute; left: 9px; right: 9px; height: 1.5px;
  background: var(--text); border-radius: 2px;
  transition: all 0.25s ease;
}
.burger span:nth-child(1) { top: 12px; }
.burger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.burger span:nth-child(3) { bottom: 12px; }
.burger.open span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none; flex-direction: column;
  padding: 12px 20px 24px; background: var(--bg);
  border-top: 1px solid var(--border); gap: 2px;
}
.mobile-menu.open { display: flex; }
.m-link {
  padding: 14px 12px; font-size: 15px; font-weight: 500;
  color: var(--text); border-radius: var(--r-sm);
  transition: background 0.15s ease;
}
.m-link:hover { background: var(--surface2); }
.m-divider { height: 1px; background: var(--border); margin: 12px 0; }
.m-login {
  margin-top: 8px; padding: 14px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 600; text-align: center;
}

/* ══════════ HEADER С ФИЛЬТРАМИ В ОДНОМ БЛОКЕ ══════════ */
.blog-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 28px 32px;
  position: relative;
}
.blog-top::after {
  content: '';
  position: absolute;
  top: 80px; right: 28px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.blog-top-flex {
  display: flex; justify-content: space-between; align-items: end;
  gap: 32px;
  flex-wrap: wrap;
}
.blog-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.blog-title {
  font-size: clamp(40px, 5.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -1.8px;
  font-weight: 600;
}
.blog-title-em {
  color: var(--accent-2);
}
.blog-stats {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
  display: flex; gap: 16px; align-items: center;
  margin-bottom: 8px;
}
.blog-stat-num {
  color: var(--text); font-weight: 500;
  margin-right: 4px;
}

/* FILTERS */
.filters-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 32px;
}
.filters {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  width: fit-content;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.filters::-webkit-scrollbar { display: none; }
.filter-pill {
  padding: 8px 16px;
  border-radius: 100px;
  background: transparent;
  color: var(--muted2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.18s ease;
  display: flex; align-items: center; gap: 7px;
}
.filter-pill:hover { color: var(--text); }
.filter-pill.active {
  background: var(--accent);
  color: white;
}
.filter-count {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  opacity: 0.7;
}

/* ══════════ BENTO GRID ══════════ */
.bento {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 96px;
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 16px;
}

/* Карточка */
.bento-card {
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.bento-card > article {
  display: flex; flex-direction: column;
  flex: 1;
  width: 100%;
}
.bento-card:hover {
  background: var(--surface2);
  border-color: var(--border2);
  transform: translateY(-3px);
}
.bento-card-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.bento-cat {
  padding: 3px 9px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.bento-cat-ai { background: rgba(99,102,241,0.15); color: var(--accent); }
.bento-cat-ops { background: rgba(34,197,94,0.15); color: var(--green); }
.bento-cat-cases { background: rgba(249,115,22,0.15); color: var(--orange); }
.bento-cat-howto { background: rgba(139,92,246,0.15); color: var(--accent-2); }
.bento-cat-base { background: rgba(56,189,248,0.15); color: #38bdf8; }
.bento-meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.bento-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 12px;
}
.bento-excerpt {
  font-size: 13.5px;
  color: var(--muted2);
  line-height: 1.55;
  flex: 1;
}
.bento-arrow {
  position: absolute;
  bottom: 24px; right: 24px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted2);
  transition: all 0.2s ease;
  font-size: 16px;
}
.bento-card:hover .bento-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* РАЗМЕРЫ */
/* Featured — 4 колонки × 2 ряда */
.bento-card.size-featured {
  grid-column: span 4;
  grid-row: span 2;
  padding: 48px;
  background:
    radial-gradient(circle at 80% 20%, rgba(99,102,241,0.18) 0%, transparent 50%),
    linear-gradient(180deg, var(--surface) 0%, rgba(22,27,39,0.7) 100%);
}
.bento-card.size-featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: 0.6;
}
.bento-card.size-featured .bento-title {
  font-size: 34px;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 16px;
}
.bento-card.size-featured .bento-excerpt {
  font-size: 15px;
  max-width: 560px;
}

/* Side — 2 колонки × 1 ряд (рядом с featured) */
.bento-card.size-side { grid-column: span 2; }

/* Wide — 3 колонки × 1 ряд */
.bento-card.size-wide { grid-column: span 3; }

/* Square — 2 колонки × 1 ряд */
.bento-card.size-square { grid-column: span 2; }

/* Special quote card */
.bento-card.size-quote {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--surface) 100%);
  border-color: rgba(99,102,241,0.2);
  justify-content: center;
}
.bento-quote-mark {
  font-family: 'DM Mono', monospace;
  font-size: 48px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0.6;
}
.bento-quote-text {
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.3px;
  font-weight: 500;
}

/* FOOTER */
.footer {
  position: relative;
  padding: 36px 28px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  flex: 1;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.footer-brand-logo {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.footer-brand-logo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 50%);
}
.footer-brand-logo svg {
  width: 14px; height: 14px;
  color: white;
  position: relative;
  z-index: 1;
}
.footer-brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: -0.05px;
  line-height: 1.5;
}
.footer-meta a {
  color: var(--muted2);
  transition: color 0.15s ease;
}
.footer-meta a:hover { color: var(--text); }
.footer-meta-sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.5;
  flex-shrink: 0;
}
.footer-meta-soon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted2);
}
.footer-meta-soon::after {
  content: 'скоро';
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted2);
}
.footer-socials {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.footer-social {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  transition: all 0.2s ease;
}
.footer-social:hover {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
  transform: translateY(-2px);
}
.footer-social svg { width: 16px; height: 16px; }
.footer-meta-mobile { display: none; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .bento-grid { grid-template-columns: repeat(4, 1fr); }
  .bento-card.size-featured { grid-column: span 4; grid-row: span 1; }
  .bento-card.size-side { grid-column: span 2; }
  .bento-card.size-wide { grid-column: span 2; }
  .bento-card.size-square { grid-column: span 2; }
  .bento-card.size-quote { grid-column: span 2; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .messengers { display: flex; }
  .btn-login { display: none; }
  .burger { display: block; }
  .header-inner { gap: 10px; padding: 12px 16px; }
  .header-actions { gap: 8px; margin-left: auto; }
  .blog-top { padding: 40px 20px 24px; }
  .blog-title { font-size: 36px; letter-spacing: -1.2px; }
  .filters-wrap { padding: 0 20px 24px; }
  .filters { padding: 4px; }
  .filter-pill { padding: 7px 14px; font-size: 12.5px; }
  .bento { padding: 0 20px 64px; }
  .bento-grid { grid-template-columns: 1fr; gap: 12px; }
  .bento-card,
  .bento-card.size-featured,
  .bento-card.size-side,
  .bento-card.size-wide,
  .bento-card.size-square,
  .bento-card.size-quote { grid-column: span 1; grid-row: auto; padding: 24px; }
  .bento-card.size-featured .bento-title { font-size: 22px; }

  .footer { padding: 32px 20px 24px; }
  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }
  .footer-left { display: contents; }
  .footer-brand { order: 1; }
  .footer-socials {
    order: 2;
    align-self: center;
    gap: 10px;
  }
  .footer-social { width: 40px; height: 40px; }
  .footer-social svg { width: 18px; height: 18px; }

  .footer-meta { display: none; }

  .footer-meta-mobile {
    order: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  .fm-m-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted2);
  }
  .fm-m-links a {
    color: var(--muted2);
    transition: color 0.15s ease;
  }
  .fm-m-links a:hover { color: var(--text); }
  .fm-m-dot {
    color: var(--muted);
    opacity: 0.5;
  }
  .fm-m-divider {
    width: 64px;
    height: 1px;
    background: var(--border);
    margin: 2px 0;
  }
  .fm-m-legal,
  .fm-m-inn {
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
    line-height: 1.45;
  }
  .fm-m-inn { opacity: 0.75; }
}
