/* ==========================================================================
   Редизайн «вариант Б»: живой фон, маскот из логотипа, карточки с подсветкой.
   Подключается после style.css и переопределяет часть его правил.
   Чтобы откатить оформление — убрать <link> на этот файл в partials/header.ejs.
   ========================================================================== */

:root {
  --logo-bg: #060508;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --glass-header: rgba(10, 10, 15, 0.78);
  --edge: rgba(255, 255, 255, 0.06);
  --edge-strong: rgba(255, 255, 255, 0.1);
  --soft-fill: rgba(255, 255, 255, 0.05);
  --hero-surface: rgba(10, 10, 15, 0.92);
  --hero-title: #f1eff5;
  --aurora-opacity: 0.5;
}

[data-theme="light"] {
  --glass-header: rgba(255, 255, 255, 0.84);
  --edge: rgba(20, 20, 40, 0.08);
  --edge-strong: rgba(20, 20, 40, 0.14);
  --soft-fill: rgba(20, 20, 40, 0.04);
  --hero-surface: #ffffff;
  --hero-title: #1a1a1a;
  --aurora-opacity: 0.2;
}

/* ===== Живой фон ===== */
.site-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--aurora-opacity);
}

.site-aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.site-aurora i:nth-child(1) {
  width: 620px;
  height: 420px;
  left: -120px;
  top: -160px;
  background: rgba(155, 126, 217, 0.35);
  animation: aurora-drift-a 28s ease-in-out infinite alternate;
}

.site-aurora i:nth-child(2) {
  width: 520px;
  height: 380px;
  right: -140px;
  top: 120px;
  background: rgba(92, 72, 214, 0.28);
  animation: aurora-drift-b 34s ease-in-out infinite alternate;
}

.site-aurora i:nth-child(3) {
  width: 480px;
  height: 360px;
  left: 35%;
  top: 620px;
  background: rgba(190, 110, 220, 0.14);
  animation: aurora-drift-a 40s ease-in-out infinite alternate-reverse;
}

@keyframes aurora-drift-a {
  to { transform: translate(160px, 90px) scale(1.15); }
}

@keyframes aurora-drift-b {
  to { transform: translate(-140px, 120px) scale(0.9); }
}

/* ===== Шапка ===== */
.header {
  background: var(--glass-header);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: none;
  border-bottom: 1px solid var(--edge);
}

.logo__img {
  transition: transform 0.4s var(--ease-out), box-shadow 0.3s ease;
}

.logo:hover .logo__img {
  transform: rotate(-8deg) scale(1.06);
  box-shadow: 0 0 18px rgba(155, 126, 217, 0.55);
}

.logo__name {
  background: linear-gradient(90deg, #C4A8F5 0%, #9B7ED9 35%, #7B5EB9 55%, #C4A8F5 80%, #9B7ED9 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-position 0.9s var(--ease-out);
}

.logo:hover .logo__name {
  background-position: 100% 0;
}

.header-search__input {
  border-color: rgba(155, 126, 217, 0.75);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.header-search__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(155, 126, 217, 0.18), 0 0 28px -6px rgba(155, 126, 217, 0.6);
}

.nav-link__icon {
  transition: transform 0.3s var(--ease-out), background 0.25s ease, box-shadow 0.25s ease;
}

.nav-link--feature:hover .nav-link__icon {
  transform: translateY(-2px);
  background: rgba(155, 126, 217, 0.24);
  box-shadow: 0 6px 16px -6px rgba(155, 126, 217, 0.7);
}

.nav-link--feature:hover .nav-link__title {
  color: var(--color-text);
}

.user-menu__toggle {
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--soft-fill);
  box-shadow: inset 0 0 0 1px var(--edge);
  transition: background 0.2s ease;
}

.user-menu__toggle:hover {
  background: var(--edge-strong);
}

.user-menu__dropdown {
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
}

.theme-toggle svg {
  transition: transform 0.5s var(--ease-out);
}

.theme-toggle:hover {
  color: #ffc94d;
}

.theme-toggle:hover svg {
  transform: rotate(90deg);
}

/* ===== Бейджи и теги ===== */
.badge {
  font-size: 0.7rem;
  font-weight: 700;
}

.badge--admin {
  background: rgba(239, 83, 80, 0.16);
  color: #ff7e7b;
  box-shadow: inset 0 0 0 1px rgba(239, 83, 80, 0.3);
}

.badge--moderator {
  background: rgba(255, 167, 38, 0.16);
  color: #ffb95c;
  box-shadow: inset 0 0 0 1px rgba(255, 167, 38, 0.3);
}

[data-theme="light"] .badge--admin {
  background: rgba(229, 57, 53, 0.1);
  color: #d32f2f;
}

[data-theme="light"] .badge--moderator {
  background: rgba(251, 140, 0, 0.12);
  color: #d46b00;
}

.tag {
  color: var(--color-secondary);
  background: rgba(155, 126, 217, 0.12);
}

[data-theme="light"] .tag {
  color: var(--color-primary);
}

.tag:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ===== Плашка новостей ===== */
.latest-news-bar {
  gap: 14px;
  padding: 10px 12px 10px 10px;
  box-shadow: inset 0 0 0 1px var(--edge);
}

.latest-news-bar__label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.latest-news-bar__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  color: var(--color-primary);
  background: rgba(155, 126, 217, 0.14);
}

.latest-news-bar__icon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7CF29A;
  animation: news-ping 2s infinite;
}

@keyframes news-ping {
  0% { box-shadow: 0 0 0 0 rgba(124, 242, 154, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(124, 242, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 242, 154, 0); }
}

.latest-news-bar__items {
  gap: 8px 10px;
}

.latest-news-bar__item {
  max-width: 300px;
}

.latest-news-bar__item:hover {
  color: var(--color-secondary);
}

.latest-news-bar__sep {
  width: 4px;
  height: 4px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-border);
}

.latest-news-bar__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.latest-news-bar__more:hover {
  color: var(--color-text);
  background: var(--soft-fill);
  text-decoration: none;
}

/* ===== Главный блок с маскотом ===== */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 24px;
  margin: 4px 0 0;
  padding: 40px 40px 34px 44px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(155, 126, 217, 0.16), transparent 55%),
    var(--hero-surface);
  box-shadow: inset 0 0 0 1px rgba(155, 126, 217, 0.16);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 90% at 0% 0%, #000, transparent 70%);
  mask-image: radial-gradient(70% 90% at 0% 0%, #000, transparent 70%);
}

[data-theme="light"] .home-hero {
  box-shadow: inset 0 0 0 1px rgba(123, 94, 185, 0.18), 0 20px 50px -30px rgba(60, 40, 120, 0.25);
}

[data-theme="light"] .home-hero::before {
  background-image: radial-gradient(rgba(30, 20, 60, 0.1) 1px, transparent 1px);
}

.home-hero__body,
.home-hero__art {
  position: relative;
  min-width: 0;
}

.home-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-secondary);
  background: rgba(155, 126, 217, 0.1);
  box-shadow: inset 0 0 0 1px rgba(155, 126, 217, 0.22);
}

[data-theme="light"] .home-hero__eyebrow {
  color: var(--color-primary);
}

.home-hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
}

.home-hero__title {
  margin: 0 0 16px;
  font-size: 2.9rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--hero-title);
}

.home-hero__accent {
  background: linear-gradient(90deg, #C4A8F5, #9B7ED9 60%, #7e60cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-hero__text {
  max-width: 470px;
  margin: 0 0 26px;
  font-size: 1.02rem;
  color: var(--color-text-secondary);
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.home-hero__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 20px;
  overflow: hidden;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, background 0.25s ease, color 0.2s ease;
}

.home-hero__btn--primary,
.home-hero__btn--primary:hover {
  color: #fff;
}

.home-hero__btn--primary {
  background: linear-gradient(135deg, #a88be3, #7B5EB9);
  box-shadow: 0 10px 30px -10px rgba(155, 126, 217, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.home-hero__btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: left 0.7s var(--ease-out);
}

.home-hero__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -12px rgba(155, 126, 217, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.home-hero__btn--primary:hover::after {
  left: 130%;
}

.home-hero__btn--ghost {
  color: var(--color-text);
  background: var(--soft-fill);
  box-shadow: inset 0 0 0 1px var(--edge-strong);
}

.home-hero__btn--ghost:hover {
  color: var(--color-text);
  background: var(--edge-strong);
  transform: translateY(-2px);
}

.home-hero__dice {
  transition: transform 0.6s var(--ease-out);
}

.home-hero__btn--ghost:hover .home-hero__dice {
  transform: rotate(200deg);
}

.home-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.home-hero__stat b {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  color: var(--hero-title);
}

.home-hero__stat span {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.home-hero__art {
  justify-self: center;
  width: 100%;
  max-width: 470px;
}

.home-hero__glow {
  position: absolute;
  inset: 6% 4%;
  border-radius: 40px;
  background: conic-gradient(from 0deg, #9B7ED9, #4f3fc9, #C4A8F5, #7B5EB9, #9B7ED9);
  filter: blur(46px);
  opacity: 0.42;
  animation: hero-glow-spin 16s linear infinite;
}

[data-theme="light"] .home-hero__glow {
  opacity: 0.3;
}

@keyframes hero-glow-spin {
  to { transform: rotate(360deg); }
}

.home-hero__frame {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  font: inherit;
  cursor: pointer;
  background: var(--logo-bg);
  box-shadow: 0 0 0 1px rgba(177, 159, 230, 0.25), 0 30px 70px -25px rgba(0, 0, 0, 0.9);
  -webkit-tap-highlight-color: transparent;
}

[data-theme="light"] .home-hero__frame {
  box-shadow: 0 0 0 1px rgba(123, 94, 185, 0.25), 0 30px 60px -28px rgba(40, 20, 90, 0.55);
}

.home-hero__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(177, 159, 230, 0.1), transparent 40%);
}

.home-hero__frame:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 4px;
}

.home-hero__frame .mascot-svg {
  display: block;
  width: 100%;
  height: auto;
}

.home-hero__frame.is-boing {
  animation: mascot-boing 0.6s var(--ease-out);
}

@keyframes mascot-boing {
  0% { transform: scale(1); }
  25% { transform: scale(0.94, 1.06) translateY(-6px); }
  50% { transform: scale(1.04, 0.96); }
  75% { transform: scale(0.99, 1.01) translateY(-2px); }
  100% { transform: scale(1); }
}

.home-hero__bubble {
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 3;
  padding: 8px 14px;
  border-radius: 14px;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a1328;
  background: #efe9fb;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -100%) scale(0.6);
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
}

.home-hero__bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #efe9fb;
  transform: translateX(-50%) rotate(45deg);
}

.home-hero__bubble.is-on {
  opacity: 1;
  transform: translate(-50%, -110%) scale(1);
}

.home-hero__hint {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  opacity: 0.75;
}

@media (hover: none) {
  .home-hero__hint {
    display: none;
  }
}

/* ===== Маскот: глаза ===== */
.mascot-eye__cover {
  fill: var(--logo-bg);
}

.mascot-eye__white {
  fill: #ebe7eb;
}

.mascot-eye__pupil {
  fill: var(--logo-bg);
}

.mascot-eye__ball {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.08s ease-in;
}

.mascot.is-blink .mascot-eye__ball {
  transform: scaleY(0.08);
}

/* ===== Тулбар ленты и теги-фильтры ===== */
.home-hero + .catalog-toolbar {
  margin-top: 36px;
}

/* Заголовок и кнопки — первая строка, теги — вторая. На телефоне теги встают рядом с кнопками */
.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "start controls"
    "chips chips";
  align-items: center;
  gap: 14px 16px;
  margin-bottom: 22px;
}

.catalog-toolbar__start {
  grid-area: start;
}

.catalog-toolbar__controls {
  grid-area: controls;
}

.sort-dropdown__icon {
  display: none;
  flex-shrink: 0;
}

.catalog-toolbar__title--feed {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.catalog-toolbar__title--feed svg {
  flex-shrink: 0;
  color: var(--color-primary);
}

.catalog-toolbar__count {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color-text-secondary);
  background: var(--soft-fill);
  box-shadow: inset 0 0 0 1px var(--edge);
}

.view-toggle__btn--active {
  color: var(--color-text);
  background: rgba(155, 126, 217, 0.2);
  box-shadow: none;
}

.tag-chips {
  grid-area: chips;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  box-shadow: inset 0 0 0 1px var(--edge-strong);
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.tag-chip small {
  font-size: 0.72rem;
  opacity: 0.7;
}

.tag-chip:hover {
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px rgba(155, 126, 217, 0.55);
  transform: translateY(-1px);
}

.tag-chip--active,
.tag-chip--active:hover {
  color: #fff;
  background: linear-gradient(135deg, #9B7ED9, #7B5EB9);
  box-shadow: 0 6px 18px -8px rgba(155, 126, 217, 0.9);
}

.tag-chip--active small {
  opacity: 0.85;
}

/* ===== Карточки ===== */
.utility-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px var(--edge);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

/* рамка, подсвеченная там, где курсор */
.utility-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(206, 184, 255, 0.9), rgba(155, 126, 217, 0.35) 45%, transparent 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* мягкий свет внутри карточки */
.utility-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(155, 126, 217, 0.09), transparent 65%);
}

.utility-card:hover {
  box-shadow: inset 0 0 0 1px var(--edge), 0 24px 50px -24px rgba(155, 126, 217, 0.45), 0 10px 24px -12px rgba(0, 0, 0, 0.8);
}

.utilities-grid:not(.utilities-grid--list) .utility-card:hover {
  transform: translateY(-5px);
}

[data-theme="light"] .utility-card:hover {
  box-shadow: inset 0 0 0 1px var(--edge), 0 24px 50px -24px rgba(123, 94, 185, 0.35), 0 10px 24px -12px rgba(0, 0, 0, 0.12);
}

.utility-card:hover::before,
.utility-card:hover::after {
  opacity: 1;
}

@media (hover: none) {
  .utility-card::before,
  .utility-card::after {
    display: none;
  }
}

.utility-card__image {
  position: relative;
}

.utility-card__image img {
  transition: transform 0.6s var(--ease-out);
}

.utility-card:hover .utility-card__image img {
  transform: scale(1.06);
}

.utilities-grid:not(.utilities-grid--list) .utility-card__image:not(.utility-card__image--mascot)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.7), transparent);
}

/* время чтения — плашкой на обложке */
.utility-card__rt {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  color: #eee;
  background: rgba(10, 10, 15, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.utilities-grid:not(.utilities-grid--list) .utility-card__meta-info .stat--reading-time,
.utilities-grid--list .utility-card__rt {
  display: none;
}

/* обложка-заглушка: маскот выглядывает снизу */
.utility-card__image.utility-card__image--mascot,
.utility-card__image.utility-card__image--mascot:hover {
  opacity: 1;
  color: inherit;
}

.utility-card__image.utility-card__image--mascot {
  overflow: hidden;
  background:
    radial-gradient(90% 75% at var(--peek-x, 50%) -15%, rgba(155, 126, 217, 0.34), transparent 62%),
    radial-gradient(60% 50% at calc(100% - var(--peek-x, 50%)) 0%, rgba(92, 72, 214, 0.18), transparent 70%),
    var(--logo-bg);
}

.utility-card__image--mascot .utility-card__rt {
  top: 12px;
  bottom: auto;
}

.utility-card__peek {
  position: absolute;
  bottom: 0;
  left: var(--peek-x, 50%);
  width: 84%;
  transform: translateX(-50%) translateY(4%);
  transition: transform 0.5s var(--ease-out);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%), linear-gradient(to right, transparent 0, #000 11%, #000 89%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%), linear-gradient(to right, transparent 0, #000 11%, #000 89%, transparent 100%);
  mask-composite: intersect;
}

.utility-card__peek .mascot-svg {
  display: block;
  width: 100%;
  height: auto;
}

.utility-card:hover .utility-card__peek {
  transform: translateX(-50%) translateY(-3%);
}

.utilities-grid:not(.utilities-grid--list) .utility-card__content {
  padding: 18px 20px 16px;
}

.utility-card__title {
  line-height: 1.35;
}

.utilities-grid:not(.utilities-grid--list) .utility-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.utility-card__title a {
  transition: color 0.2s ease;
}

.utility-card:hover .utility-card__title a {
  color: #fff;
}

[data-theme="light"] .utility-card:hover .utility-card__title a {
  color: var(--color-primary-dark);
}

.utilities-grid:not(.utilities-grid--list) .utility-card__description {
  flex: none;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.utility-card__avatar {
  box-shadow: 0 0 0 2px rgba(155, 126, 217, 0.25);
}

.utilities-grid:not(.utilities-grid--list) .utility-card__meta-extra {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-top: 12px;
  border-top-color: var(--edge);
}

.utilities-grid:not(.utilities-grid--list) .utility-card__stats {
  gap: 10px;
}

.reactions--small .reaction-btn {
  padding: 4px 8px;
}

/* ===== Реакции ===== */
.reaction-btn {
  position: relative;
  transition: background 0.2s ease, color 0.2s ease;
}

.reaction-btn svg {
  transition: transform 0.35s var(--ease-out);
}

.reaction-btn:hover {
  color: var(--color-text);
  background: rgba(155, 126, 217, 0.14);
}

.reaction-btn--active {
  color: #d9c9ff;
  background: rgba(155, 126, 217, 0.22);
}

.reaction-btn--active svg {
  fill: rgba(155, 126, 217, 0.55);
}

.reaction-btn--active.reaction-btn--dislike {
  color: #ff9c9c;
  background: rgba(255, 107, 107, 0.16);
}

.reaction-btn--active.reaction-btn--dislike svg {
  fill: rgba(255, 107, 107, 0.45);
}

[data-theme="light"] .reaction-btn--active {
  color: var(--color-primary-dark);
}

[data-theme="light"] .reaction-btn--active.reaction-btn--dislike {
  color: #d32f2f;
}

.reaction-btn.is-pop svg {
  animation: reaction-pop 0.45s var(--ease-out);
}

@keyframes reaction-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45) rotate(-12deg); }
  100% { transform: scale(1); }
}

.reaction-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
}

/* появление карточек при прокрутке (классы ставит redesign.js) */
.utility-card.is-reveal {
  opacity: 0;
  transform: translateY(18px);
}

.utility-card.is-reveal.is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease-out) var(--reveal-delay, 0s), transform 0.6s var(--ease-out) var(--reveal-delay, 0s);
}

/* ===== Пустая выдача ===== */
.empty-state__mascot {
  width: 240px;
  max-width: 70%;
  margin: 0 auto 18px;
  padding-top: 18px;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(90% 70% at 50% -20%, rgba(155, 126, 217, 0.3), transparent 65%),
    var(--logo-bg);
  box-shadow: 0 0 0 1px rgba(177, 159, 230, 0.2);
}

.empty-state__mascot .mascot-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== Пагинация ===== */
.pagination {
  justify-content: center;
  gap: 10px;
  padding-top: 0;
  border-top: 0;
}

.pagination__pages {
  gap: 8px;
}

.pagination__nav,
.pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  box-shadow: inset 0 0 0 1px var(--edge-strong);
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

a.pagination__nav:hover,
a.pagination__page:hover {
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px rgba(155, 126, 217, 0.6);
  transform: translateY(-1px);
}

.pagination__nav--active {
  color: var(--color-text);
}

.pagination__page--current {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #9B7ED9, #7B5EB9);
  box-shadow: 0 8px 20px -8px rgba(155, 126, 217, 0.9);
}

.pagination__nav--disabled {
  opacity: 0.45;
}

/* ===== Футер ===== */
.footer {
  position: relative;
  margin-top: 48px;
  border-top-color: var(--edge);
}

/* тёмный фон картинки растворяется в фоне страницы — остаются контур и глаза */
.footer__peek {
  position: absolute;
  top: 0;
  right: 12%;
  width: 170px;
  pointer-events: none;
  transform: translateY(-80%);
  mix-blend-mode: lighten;
}

.footer__peek .mascot-svg {
  display: block;
  width: 100%;
  height: auto;
}

[data-theme="light"] .footer__peek {
  display: none;
}

@media (min-width: 769px) {
  .footer::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(155, 126, 217, 0.6), transparent);
  }

  .footer__inner {
    justify-content: flex-start;
    gap: 12px 28px;
  }

  .footer__brand {
    display: flex;
    order: 0;
  }

  .footer__links {
    order: 1;
  }

  .footer__copy {
    order: 2;
    margin-left: auto;
  }

  .footer__links .footer__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 10px;
  }

  .footer__links .footer__link:hover {
    background: var(--soft-fill);
  }

  .footer__link-icon {
    display: inline-flex;
    color: var(--color-primary);
  }
}

/* ===== Адаптив ===== */
@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 24px;
  }

  .home-hero__art {
    order: -1;
    max-width: 380px;
  }

  .home-hero__title {
    font-size: 2.3rem;
  }
}

@media (max-width: 768px) {
  .footer__peek {
    right: 8%;
    width: 120px;
  }

  .catalog-toolbar {
    grid-template-areas:
      "start start"
      "chips controls";
    gap: 12px 10px;
  }

  .catalog-toolbar:not(:has(.tag-chips)) {
    grid-template-areas: "start controls";
  }

  .catalog-toolbar__controls {
    width: auto;
    gap: 6px;
  }

  .catalog-toolbar__title--feed {
    gap: 8px;
    font-size: 1.2rem;
  }

  .catalog-toolbar__title--feed svg {
    width: 20px;
    height: 20px;
  }

  /* теги листаются вбок и затухают у края, чтобы было видно, что их больше */
  .tag-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: -20px;
    padding: 2px 14px 2px 20px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 28px), transparent);
  }

  .tag-chips::-webkit-scrollbar {
    display: none;
  }

  .latest-news-bar__more,
  .latest-news-bar__sep {
    display: none;
  }
}

@media (max-width: 600px) {
  .home-hero {
    padding: 20px 16px 22px;
    border-radius: 18px;
  }

  .home-hero__art {
    max-width: 260px;
  }

  .home-hero__bubble {
    top: 10px;
    transform: translate(-50%, 0) scale(0.6);
  }

  .home-hero__bubble::after {
    display: none;
  }

  .home-hero__bubble.is-on {
    transform: translate(-50%, 0) scale(1);
  }

  .home-hero__eyebrow {
    margin-bottom: 12px;
  }

  .home-hero__title {
    font-size: 1.9rem;
    letter-spacing: -1px;
  }

  .home-hero__text {
    display: none;
  }

  .home-hero__actions {
    margin-bottom: 20px;
  }

  .home-hero__btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .home-hero__stats {
    gap: 20px;
  }

  .home-hero__stat b {
    font-size: 1.3rem;
  }

  /* сортировка — иконкой: текущий порядок и так виден в заголовке ленты */
  .sort-dropdown__toggle {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
  }

  .sort-dropdown__toggle::after {
    content: none;
  }

  .sort-dropdown__icon {
    display: block;
  }

  .sort-dropdown__label {
    display: none;
  }
}

@media (max-width: 480px) {
  .tag-chips {
    margin-left: -16px;
    padding-left: 16px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 28px), transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-aurora i,
  .home-hero__glow,
  .latest-news-bar__icon::after,
  .home-hero__frame.is-boing,
  .reaction-btn.is-pop svg {
    animation: none;
  }

  .utility-card,
  .utility-card__image img,
  .utility-card__peek,
  .logo__img,
  .home-hero__btn {
    transition: none;
  }

  .utility-card.is-reveal {
    opacity: 1;
    transform: none;
  }
}
