/* ==========================================================================
   МАКС РАДАР — дизайн-система
   Тёмно-синий + голубой акцент, светлый фон, карточки, скругления,
   плавные анимации. Один набор токенов и для сайта, и для Mini App.
   ========================================================================== */

:root {
  /* Фирменная палитра */
  --navy-900: #071228;
  --navy-800: #0b1b3a;
  --navy-700: #12264f;
  --navy-600: #1b3568;
  --navy-500: #244682;

  --accent-700: #1560c8;
  --accent-600: #1f6fe0;
  --accent-500: #2e8bff;
  --accent-400: #5aa4ff;
  --accent-200: #bcd8ff;
  --accent-100: #e6f0ff;
  --accent-50: #f3f8ff;

  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #fafbfe;

  --text: #0e1a33;
  --text-2: #3c4a66;
  --muted: #6b7a96;
  --line: #e3e9f4;

  --ok: #17a673;
  --ok-bg: #e6f7f0;
  --warn: #d68b16;
  --warn-bg: #fdf3e0;
  --danger: #d4435c;
  --danger-bg: #fdeaee;

  /* Геометрия */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Тени */
  --sh-1: 0 1px 2px rgba(11, 27, 58, .05), 0 1px 3px rgba(11, 27, 58, .04);
  --sh-2: 0 4px 14px rgba(11, 27, 58, .07), 0 1px 3px rgba(11, 27, 58, .05);
  --sh-3: 0 14px 38px rgba(11, 27, 58, .12), 0 3px 10px rgba(11, 27, 58, .06);
  --sh-accent: 0 10px 26px rgba(46, 139, 255, .28);

  /* Переходы */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-fast: .16s var(--ease);
  --t: .26s var(--ease);

  /* Сетка */
  --wrap: 1200px;
  --gap: 22px;
}

/* ── База ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 750; letter-spacing: -.02em; line-height: 1.18; color: var(--navy-800); }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-600); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-700); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--accent-400); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.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;
}

/* ── Шапка ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 66px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy-800); font-weight: 800; letter-spacing: .04em; }
.brand:hover { color: var(--navy-800); }
.brand__mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(145deg, var(--navy-700), var(--accent-600));
  display: grid; place-items: center; color: #fff; font-size: 15px;
  box-shadow: 0 5px 14px rgba(31, 111, 224, .32);
}
.brand__text { font-size: 1.02rem; text-transform: uppercase; letter-spacing: .09em; }
.brand__text small { display: block; font-size: .62rem; letter-spacing: .22em; color: var(--muted); font-weight: 600; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 8px 13px; border-radius: var(--r-full);
  color: var(--text-2); font-size: .93rem; font-weight: 550;
  transition: background var(--t-fast), color var(--t-fast);
}
.site-nav a:hover { background: var(--accent-50); color: var(--accent-700); }
.site-nav a.is-active { background: var(--accent-100); color: var(--accent-700); }

.nav-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer;
}

/* ── Кнопки ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: var(--r-full);
  font: inherit; font-weight: 650; font-size: .94rem; line-height: 1.2;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent-600); color: #fff; box-shadow: var(--sh-accent); }
.btn--primary:hover { background: var(--accent-700); color: #fff; transform: translateY(-1px); }
.btn--navy { background: var(--navy-800); color: #fff; }
.btn--navy:hover { background: var(--navy-700); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); color: var(--navy-800); border-color: var(--accent-200); }
.btn--soft { background: var(--accent-50); color: var(--accent-700); }
.btn--soft:hover { background: var(--accent-100); color: var(--accent-700); }
.btn--sm { padding: 7px 14px; font-size: .84rem; }
.btn--lg { padding: 14px 28px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ── Карточка проекта ──────────────────────────────────────────────────── */
.grid-cards {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--accent-200); }
.card__top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.card__logo {
  width: 56px; height: 56px; flex: 0 0 56px;
  border-radius: var(--r-md); object-fit: cover;
  background: var(--accent-50); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 22px; color: var(--accent-600);
}
.card__title { font-size: 1.04rem; margin: 0 0 6px; }
.card__title a { color: var(--navy-800); }
.card__title a:hover { color: var(--accent-600); }
.card__desc { color: var(--text-2); font-size: .92rem; margin: 0 0 16px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.card__stats { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }

/* ── Бейджи ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-full);
  font-size: .76rem; font-weight: 650; letter-spacing: .01em;
  background: var(--accent-50); color: var(--accent-700);
  border: 1px solid var(--accent-100);
}
.badge--type { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.badge--muted { background: #f1f4f9; color: var(--muted); border-color: var(--line); }
.badge--ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe8d8; }
.badge--warn { background: var(--warn-bg); color: var(--warn); border-color: #f3ddb4; }
.badge--danger { background: var(--danger-bg); color: var(--danger); border-color: #f6cdd5; }

/* ── Герой (главная) ──────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 55%, #1a4a94 100%);
  color: #fff; border-radius: var(--r-xl);
  padding: clamp(30px, 5vw, 60px);
  margin: 26px 0 30px;
  box-shadow: var(--sh-3);
}
.hero::after {
  content: ""; position: absolute; inset: -40% -10% auto auto;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46,139,255,.42), transparent 68%);
  pointer-events: none;
}
.hero h1 { color: #fff; margin-bottom: 12px; max-width: 18ch; }
.hero p { color: rgba(255,255,255,.82); font-size: 1.06rem; max-width: 56ch; margin-bottom: 24px; }
.hero__eyebrow {
  display: inline-block; margin-bottom: 14px;
  font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-400);
}

/* ── Поиск ─────────────────────────────────────────────────────────────── */
.searchbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px; box-shadow: var(--sh-2);
  margin-bottom: 26px;
}
.searchbar input[type="search"], .searchbar input[type="text"], .searchbar select {
  flex: 1 1 200px; min-width: 0;
  padding: 12px 16px; font: inherit; font-size: .96rem;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.searchbar input:focus, .searchbar select:focus {
  outline: none; background: var(--surface);
  border-color: var(--accent-400);
  box-shadow: 0 0 0 4px rgba(46, 139, 255, .14);
}
.searchbar select { cursor: pointer; flex: 0 1 220px; }

/* ── Сетка страницы / секции ──────────────────────────────────────────── */
.section { margin: 44px 0; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.section__head h2 { display: flex; align-items: center; gap: 10px; }
.section__head h2::before {
  content: ""; width: 5px; height: 26px; border-radius: var(--r-full);
  background: linear-gradient(var(--accent-500), var(--accent-700));
}
.section__link { font-size: .9rem; font-weight: 650; }

/* ── Категории ─────────────────────────────────────────────────────────── */
.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cat-chip {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--text); font-weight: 600; font-size: .93rem;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.cat-chip:hover {
  transform: translateY(-2px); box-shadow: var(--sh-2);
  border-color: var(--accent-200); color: var(--accent-700);
}
.cat-chip__icon {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px;
  background: var(--accent-50); color: var(--accent-600);
}
.cat-chip__count { margin-left: auto; font-size: .78rem; color: var(--muted); font-weight: 600; }

/* ── Подборки ─────────────────────────────────────────────────────────── */
.collection {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; transition: transform var(--t), box-shadow var(--t);
}
.collection:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.collection__logos { display: flex; margin-bottom: 14px; }
.collection__logos img, .collection__logos span {
  width: 42px; height: 42px; border-radius: 12px; object-fit: cover;
  background: var(--accent-50); border: 2px solid var(--surface);
  display: grid; place-items: center; margin-left: -12px; color: var(--accent-600); font-weight: 700;
}
.collection__logos > :first-child { margin-left: 0; }

/* ── Карточка проекта (страница) ──────────────────────────────────────── */
.detail { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.detail__panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 34px); box-shadow: var(--sh-1);
}
.detail__aside {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; position: sticky; top: 86px;
}
.detail__logo {
  width: 84px; height: 84px; border-radius: var(--r-md); object-fit: cover;
  background: var(--accent-50); border: 1px solid var(--line);
}
.detail__logo--placeholder {
  display: grid; place-items: center; font-size: 34px; line-height: 1;
  color: var(--accent-600);
}
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; margin: 22px 0; }
.stat__value { font-size: 1.5rem; font-weight: 780; color: var(--navy-800); line-height: 1.1; }
.stat__label { font-size: .78rem; color: var(--muted); }

/* ── Фильтры ───────────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters a {
  padding: 7px 14px; border-radius: var(--r-full); font-size: .85rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  transition: all var(--t-fast);
}
.filters a:hover { border-color: var(--accent-300, var(--accent-200)); color: var(--accent-700); }
.filters a.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* ── Пагинация ─────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 7px; justify-content: center; margin: 34px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-size: .9rem; font-weight: 600;
}
.pagination a:hover { border-color: var(--accent-200); color: var(--accent-700); }
.pagination .is-current { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.pagination .is-disabled { opacity: .4; }

/* ── Формы ─────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 32px); box-shadow: var(--sh-1);
}
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-weight: 650; font-size: .9rem; color: var(--navy-800); }
.field .help { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="url"],
.field input[type="password"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 12px 15px; font: inherit; font-size: .95rem;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; background: var(--surface);
  border-color: var(--accent-400); box-shadow: 0 0 0 4px rgba(46, 139, 255, .14);
}
.field textarea { min-height: 130px; resize: vertical; }
.field .error { color: var(--danger); font-size: .84rem; margin-top: 6px; }
.field--row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.errorlist { list-style: none; padding: 0; margin: 0 0 8px; color: var(--danger); font-size: .84rem; }

/* ── Сообщения ─────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 18px;
  border: 1px solid var(--line); background: var(--surface); font-size: .92rem;
}
.alert--ok { background: var(--ok-bg); border-color: #bfe8d8; color: #0f6f4f; }
.alert--warn { background: var(--warn-bg); border-color: #f3ddb4; color: #8a5a09; }
.alert--danger { background: var(--danger-bg); border-color: #f6cdd5; color: #9c2438; }
.alert--info { background: var(--accent-50); border-color: var(--accent-200); color: var(--accent-700); }

/* ── Пустое состояние ──────────────────────────────────────────────────── */
.empty {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-lg);
  padding: 56px 24px; text-align: center; color: var(--muted);
}
.empty__icon { font-size: 2.4rem; margin-bottom: 10px; }

/* ── Подвал ────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 60px; padding: 34px 0 40px;
  border-top: 1px solid var(--line); background: var(--surface);
}
.site-footer__inner { display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .89rem; }

/* ── Анимации появления ────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .42s var(--ease) both; }
.rise-1 { animation-delay: .05s; } .rise-2 { animation-delay: .1s; }
.rise-3 { animation-delay: .15s; } .rise-4 { animation-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ── Адаптив ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .detail__aside { position: static; }
}

@media (max-width: 760px) {
  .nav-toggle { display: grid; place-items: center; }
  .site-nav {
    position: fixed; inset: 66px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 14px 16px 20px; box-shadow: var(--sh-2);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity var(--t), transform var(--t);
  }
  .site-nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .site-nav a { padding: 12px 14px; }
  .searchbar { flex-direction: column; }
  .searchbar input[type="search"],
  .searchbar input[type="text"],
  .searchbar select,
  .searchbar .btn {
    /* В колоночном контейнере flex-basis отвечает за высоту — сбрасываем,
       иначе поле поиска вытягивается на 200px по вертикали.
       Селекторы повторяют базовые, чтобы перекрыть их по специфичности. */
    flex: 0 0 auto;
    width: 100%;
  }
  .grid-cards { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .hero { border-radius: var(--r-lg); }
}

/* ==========================================================================
   Этап 3 — публичный сайт: логотип, главная, каталог, карточка
   ========================================================================== */

/* ── Логотип ───────────────────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo__mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px; color: #fff;
  background: linear-gradient(145deg, var(--navy-700), var(--accent-600));
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(31, 111, 224, .30);
  overflow: hidden;
}
.logo__mark svg { width: 26px; height: 26px; }
.logo--lg .logo__mark { width: 58px; height: 58px; flex: 0 0 58px; border-radius: 18px; }
.logo--lg .logo__mark svg { width: 40px; height: 40px; }
.logo__text { display: flex; flex-direction: column; line-height: 1.05; }
.logo__name {
  font-size: 1.06rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--navy-800);
}
.logo--lg .logo__name { font-size: 1.35rem; letter-spacing: .1em; }
.logo__tagline {
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-top: 3px;
}
.brand:hover .logo__name { color: var(--accent-700); }
.brand--footer .logo__name { color: var(--navy-800); }

/* ── Главная: герой ────────────────────────────────────────────────────── */
.hero--home { padding: clamp(26px, 4vw, 52px); }
.hero__inner {
  position: relative; z-index: 1;
  display: grid; gap: 34px; grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr);
  align-items: center;
}
.hero__glow {
  position: absolute; inset: -60% -20% auto auto;
  width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 139, 255, .40), transparent 66%);
  pointer-events: none;
}
.hero__lead h1 { max-width: 16ch; }
.hero__search {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 18px;
}
.hero__search input {
  flex: 1 1 320px; min-width: 0;
  padding: 16px 22px; font: inherit; font-size: 1.02rem;
  border-radius: var(--r-full); border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .10); color: #fff;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.hero__search input::placeholder { color: rgba(255, 255, 255, .58); }
.hero__search input:focus {
  outline: none; background: rgba(255, 255, 255, .16);
  border-color: var(--accent-400);
  box-shadow: 0 0 0 4px rgba(46, 139, 255, .26);
}
.hero__hints { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; }
.hero__hints-label { color: rgba(255, 255, 255, .58); }
.hero__hints a {
  padding: 5px 13px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .09); color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.hero__hints a:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.hero__side {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--r-lg); padding: 24px;
  backdrop-filter: blur(6px);
}
.hero__stats { display: grid; gap: 18px; }
.hero__stat { display: flex; flex-direction: column; }
.hero__stat-value { font-size: 2.1rem; font-weight: 800; color: #fff; line-height: 1; }
.hero__stat-label { font-size: .82rem; color: rgba(255, 255, 255, .64); margin-top: 5px; }
.hero__note { margin: 18px 0 0; font-size: .78rem; color: rgba(255, 255, 255, .5); }

/* ── Категории: расширенная плитка ─────────────────────────────────────── */
.cat-grid--rich { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cat-chip__body { display: flex; flex-direction: column; min-width: 0; }
.cat-chip__name { font-weight: 650; color: var(--text); }
.cat-chip__count { margin-left: 0; font-size: .76rem; color: var(--muted); font-weight: 500; }

/* ── Типы проектов ─────────────────────────────────────────────────────── */
.type-row { display: flex; flex-wrap: wrap; gap: 10px; }
.type-pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2); font-size: .9rem; font-weight: 600;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.type-pill:hover {
  transform: translateY(-2px); box-shadow: var(--sh-2);
  border-color: var(--accent-200); color: var(--accent-700);
}
.type-pill__icon { font-size: 1rem; }
.type-pill__count {
  font-size: .74rem; color: var(--muted); background: var(--accent-50);
  padding: 2px 8px; border-radius: var(--r-full);
}

/* ── Карточка проекта: доработки ───────────────────────────────────────── */
.card { position: relative; }
.card__ribbon {
  position: absolute; top: 14px; right: -32px; z-index: 2;
  transform: rotate(38deg);
  background: var(--accent-600); color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  padding: 4px 38px; box-shadow: var(--sh-2);
}
.card__head { min-width: 0; }
.card__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.card__rating { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; font-size: .84rem; }
.card__stars { color: #f0a92a; letter-spacing: 1px; font-size: .9rem; }
.card__rating-value { font-weight: 750; color: var(--navy-800); }
.card__rating-count { color: var(--muted); font-size: .8rem; }
.card__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; font-size: .95rem; line-height: 1;
  display: inline-grid; place-items: center;
  transition: all var(--t-fast);
}
.icon-btn:hover { border-color: var(--accent-200); color: var(--accent-600); background: var(--accent-50); }
.icon-btn.is-active { background: var(--accent-600); border-color: var(--accent-600); color: #fff; }

/* ── Подборки ──────────────────────────────────────────────────────────── */
.collection { display: block; color: inherit; }
.collection:hover { color: inherit; }
.collection__title { font-size: 1.05rem; margin: 0 0 8px; }
.collection__desc { color: var(--text-2); font-size: .92rem; margin: 0 0 14px; }
.collection__more { font-size: .87rem; font-weight: 650; color: var(--accent-600); }

/* ── Рекламные места ───────────────────────────────────────────────────── */
.ad-slot { margin: 28px 0; }
.ad-slot__label {
  display: inline-block; margin-bottom: 9px;
  font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); background: var(--surface);
  border: 1px dashed var(--line); border-radius: var(--r-full);
  padding: 3px 12px;
}
.ad-card {
  display: flex; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 22px;
  color: inherit;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.ad-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--accent-200); color: inherit; }
.ad-card__image { width: 76px; height: 76px; object-fit: cover; border-radius: var(--r-md); flex: 0 0 76px; }
.ad-card__title { font-size: 1rem; margin: 0 0 4px; color: var(--navy-800); }
.ad-card__text { color: var(--text-2); font-size: .9rem; margin: 0 0 6px; }
.ad-card__cta { font-size: .84rem; font-weight: 650; color: var(--accent-600); }
.ad-slot--project_sidebar .ad-card { flex-direction: column; align-items: flex-start; }

/* ── Преимущества ──────────────────────────────────────────────────────── */
.advantages {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(26px, 3.4vw, 44px);
}
.advantages__head { text-align: center; margin-bottom: 30px; }
.advantages__head h2 { margin-bottom: 8px; }
.advantages__grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.adv {
  padding: 22px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.adv:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--accent-200); }
.adv__icon {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--r-sm); background: var(--accent-50);
  font-size: 1.25rem; margin-bottom: 14px;
}
.adv h3 { font-size: 1rem; margin-bottom: 7px; }
.adv p { color: var(--text-2); font-size: .9rem; margin: 0; }

/* ── Призыв к действию ─────────────────────────────────────────────────── */
.cta {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700) 60%, #1a4a94);
  border-radius: var(--r-xl); padding: clamp(28px, 4vw, 56px);
  text-align: center; color: #fff;
}
.cta__glow {
  position: absolute; inset: auto -10% -60% auto;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 139, 255, .40), transparent 68%);
}
.cta__body { position: relative; z-index: 1; }
.cta h2 { color: #fff; margin-bottom: 12px; }
.cta p { color: rgba(255, 255, 255, .8); max-width: 56ch; margin: 0 auto 24px; }
.cta__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta .btn--ghost { border-color: rgba(255, 255, 255, .3); color: #fff; }
.cta .btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .5); }

/* ── Каталог: шапка, табы, хлебные крошки ───────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 22px 0 6px; font-size: .84rem; color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-600); }
.breadcrumb__current { color: var(--text); font-weight: 600; }

.catalog__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin: 12px 0 22px;
}
.catalog__title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 6px; }
.catalog__head .muted { margin: 0; max-width: 62ch; }
.catalog__count { text-align: right; }
.catalog__count-value { display: block; font-size: 2rem; font-weight: 800; color: var(--navy-800); line-height: 1; }
.catalog__count-label { font-size: .8rem; color: var(--muted); }

.cat-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
  margin-bottom: 18px; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cat-tabs__item {
  flex: 0 0 auto; white-space: nowrap;
  padding: 9px 16px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2); font-size: .88rem; font-weight: 600;
  transition: all var(--t-fast);
}
.cat-tabs__item:hover { border-color: var(--accent-200); color: var(--accent-700); }
.cat-tabs__item.is-active {
  background: var(--navy-800); border-color: var(--navy-800); color: #fff;
}

.filters__reset { font-size: .82rem; color: var(--accent-600); font-weight: 600; }
.filters .badge { text-decoration: none; }

/* ── Карточка проекта: страница ────────────────────────────────────────── */
.detail__main { display: grid; gap: 22px; min-width: 0; }
.detail__head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.detail__head-body { min-width: 0; flex: 1 1 260px; }
.detail__title { font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin-bottom: 10px; }
.detail__badges { display: flex; gap: 8px; flex-wrap: wrap; }
.detail__badges a.badge { text-decoration: none; }
.detail__badges a.badge:hover { border-color: var(--accent-400); }
.detail__text { color: var(--text-2); font-size: 1.02rem; margin-bottom: 18px; }
.detail__keywords { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.detail__keywords a.badge { text-decoration: none; }
.detail__rating { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; }
.detail__stars { color: #f0a92a; letter-spacing: 2px; font-size: 1.05rem; }
.detail__rating-value { font-size: 1.3rem; font-weight: 780; color: var(--navy-800); }
.detail__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
.detail__fav-count { margin-left: -4px; }
.detail__panel--flat { padding: 22px 24px; }
.stat-row--tight { margin: 0 0 12px; gap: 30px; }

/* ── Отзывы ─────────────────────────────────────────────────────────────── */
.reviews { display: grid; gap: 14px; margin-bottom: 20px; }
.review {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px;
}
.review__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.review__author { font-weight: 700; color: var(--navy-800); font-size: .94rem; }
.review__stars { color: #f0a92a; font-size: .84rem; font-weight: 700; }
.review__date { margin-left: auto; }
.review__text { margin: 0; color: var(--text-2); font-size: .93rem; }

.review-form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.field__label { display: block; margin-bottom: 8px; font-weight: 650; font-size: .9rem; color: var(--navy-800); }
.rating-input { display: flex; gap: 8px; flex-wrap: wrap; }
.rating-input__item { position: relative; }
.rating-input__item input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating-input__item span {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 700;
  color: var(--muted); transition: all var(--t-fast);
}
.rating-input__item:hover span { border-color: var(--accent-400); color: var(--accent-700); }
.rating-input__item input:checked + span {
  background: var(--accent-600); border-color: var(--accent-600); color: #fff;
}
.rating-input__item input:focus-visible + span { outline: 3px solid var(--accent-400); outline-offset: 2px; }

/* ── Сайдбар карточки ───────────────────────────────────────────────────── */
.aside-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; margin-bottom: 18px;
}
.aside-card--soft { background: var(--accent-50); border-color: var(--accent-100); }
.aside-card__title { font-size: .98rem; margin-bottom: 14px; }
.aside-list { margin: 0; display: grid; gap: 10px; font-size: .9rem; }
.aside-list > div { display: flex; justify-content: space-between; gap: 12px; }
.aside-list dt { color: var(--muted); margin: 0; }
.aside-list dd { margin: 0; font-weight: 600; color: var(--text); text-align: right; }

/* ── Футер ─────────────────────────────────────────────────────────────── */
.site-footer { margin-top: 70px; padding: 44px 0 30px; }
.site-footer__top {
  display: grid; gap: 32px; grid-template-columns: 1.6fr repeat(3, 1fr);
  padding-bottom: 28px; border-bottom: 1px solid var(--line);
}
.site-footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.site-footer__col { display: flex; flex-direction: column; gap: 9px; }
.site-footer__col h4 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--navy-800); margin-bottom: 4px;
}
.site-footer__col a { color: var(--muted); font-size: .9rem; }
.site-footer__col a:hover { color: var(--accent-600); }
.site-footer__bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 20px;
}

/* ── Раздел модерации ──────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--sh-1);
}
.mod-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mod-table th {
  text-align: left; padding: 13px 14px; white-space: nowrap;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.mod-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mod-table tr:last-child td { border-bottom: 0; }
.mod-table tbody tr:hover { background: var(--accent-50); }
.mod-table__check { width: 38px; text-align: center; }
.mod-table__check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent-600); }
.mod-table__title { font-weight: 650; color: var(--navy-800); display: block; margin-bottom: 4px; }
.mod-table__title:hover { color: var(--accent-600); }
.mod-table__url { max-width: 220px; word-break: break-all; font-size: .84rem; }

.mod-bulk {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.mod-bulk input[type="text"] {
  flex: 1 1 240px; padding: 10px 14px; font: inherit; font-size: .92rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
}
.mod-form .field { margin-bottom: 14px; }
.mod-form textarea { width: 100%; }
.review--unread { border-left: 3px solid var(--accent-500); background: var(--accent-50); }

/* ── Панель управления ─────────────────────────────────────────────────── */
.panel-nav {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin: 20px 0 22px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.panel-nav a {
  flex: 0 0 auto; white-space: nowrap;
  padding: 9px 16px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2); font-size: .88rem; font-weight: 600;
  transition: all var(--t-fast);
}
.panel-nav a:hover { border-color: var(--accent-200); color: var(--accent-700); }
.panel-nav a.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

.stat-cards {
  display: grid; gap: 14px; margin-bottom: 26px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.stat-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; color: inherit;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--accent-200); color: inherit; }
.stat-card__value { font-size: 1.85rem; font-weight: 800; color: var(--navy-800); line-height: 1; }
.stat-card__label { font-size: .8rem; color: var(--muted); }
.stat-card--warn { border-color: var(--accent-200); background: var(--accent-50); }
.stat-card--warn .stat-card__value { color: var(--accent-700); }

.panel-columns { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }

.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.checkbox-row {
  display: inline-flex; align-items: center; gap: 9px; margin: 0 18px 10px 0;
  font-size: .92rem; color: var(--text-2); cursor: pointer;
}
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--accent-600); cursor: pointer; }

/* ── Адаптив: 900px ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__side { order: -1; }
  .hero__stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .hero__stat-value { font-size: 1.55rem; }
  .site-footer__top { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
  .panel-columns { grid-template-columns: 1fr; }
}

/* ── Адаптив: 760px ─────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .catalog__head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .catalog__count { text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .catalog__count-value { font-size: 1.5rem; }
  .detail__actions .btn { flex: 1 1 auto; }
  .adv { padding: 18px; }
  .site-footer__top { grid-template-columns: 1fr; gap: 24px; }
}

/* ── Адаптив: 360px ─────────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .wrap { width: calc(100% - 24px); }
  .logo__name { font-size: .95rem; letter-spacing: .07em; }
  .hero--home { padding: 22px 18px; border-radius: var(--r-lg); }
  .hero__search { flex-direction: column; }
  .hero__search input,
  .hero__search .btn {
    flex: 0 0 auto;
    width: 100%;
  }
  .hero__stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero__stat-value { font-size: 1.3rem; }
  .hero__stat-label { font-size: .72rem; }
  .cat-grid--rich { grid-template-columns: 1fr 1fr; }
  .cat-chip { padding: 12px; gap: 9px; }
  .cat-chip__icon { width: 30px; height: 30px; flex: 0 0 30px; }
  .grid-cards { gap: 16px; }
  .card { padding: 18px; }
  .card__logo { width: 48px; height: 48px; flex: 0 0 48px; border-radius: var(--r-sm); }
  .cta { padding: 26px 18px; border-radius: var(--r-lg); }
  .cta__actions { flex-direction: column; }
  .cta__actions .btn { width: 100%; }
  .detail__panel { padding: 18px; border-radius: var(--r-md); }
  .detail__head { gap: 14px; }
  .detail__logo { width: 62px; height: 62px; }
  .rating-input__item span { width: 38px; height: 38px; }
  .site-footer__bottom { flex-direction: column; gap: 8px; }
}
