/* ==========================================================================
   AIHUB — DLE 21 template
   Современный каталог промтов для нейросетей.
   Стек: чистый CSS (без фреймворков), light/dark, адаптив 360–1920.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "AvertaCY";
  src: url("../fonts/AvertaCY-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AvertaCY";
  src: url("../fonts/AvertaCY-Semibold.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AvertaCY";
  src: url("../fonts/AvertaCY-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;
  --font: "AvertaCY", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1320px;
  --header-h: 72px;

  --bg: #f7f7fb;
  --bg-soft: #f1f1f8;
  --surface: #ffffff;
  --surface-2: #f4f4fa;
  --surface-3: #ebebf4;

  --text: #0b0b12;
  --text-2: #42425a;
  --muted: #71718a;
  --faint: #9a9ab0;

  --border: rgba(11, 11, 18, 0.08);
  --border-strong: rgba(11, 11, 18, 0.14);

  --accent: #6c4dff;
  --accent-hover: #5a3bf0;
  --accent-2: #ff3d7f;
  --accent-3: #00c8ff;
  --accent-soft: rgba(108, 77, 255, 0.1);
  --accent-soft-2: rgba(255, 61, 127, 0.1);

  --grad: linear-gradient(115deg, #7b5cff 0%, #b44dff 46%, #ff4d8d 100%);
  --grad-soft: linear-gradient(135deg, rgba(123, 92, 255, 0.14), rgba(255, 77, 141, 0.12));

  --shadow-xs: 0 1px 2px rgba(11, 11, 18, 0.05);
  --shadow-sm: 0 6px 18px -8px rgba(11, 11, 18, 0.18);
  --shadow-md: 0 20px 44px -20px rgba(11, 11, 18, 0.28);
  --shadow-lg: 0 44px 90px -34px rgba(30, 15, 80, 0.38);
  --ring: 0 0 0 4px rgba(108, 77, 255, 0.18);

  --header-bg: rgba(255, 255, 255, 0.78);
  --overlay: rgba(8, 8, 13, 0.55);

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Совместимость с lazydev/dle_filter и старыми сниппетами */
  --bg2: var(--surface);
  --bg3: #0b0b12;
  --text1: #ffffff;
  --text2: var(--text-2);
  --radius: var(--r-md);
  --light: rgba(255, 255, 255, 0.15);
  --light2: rgba(255, 255, 255, 0.3);
  --dark: rgba(0, 0, 0, 0.1);
  --color1: var(--accent);
  --color2: var(--accent-hover);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --speed: 0.28s;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08080d;
  --bg-soft: #0d0d14;
  --surface: #111118;
  --surface-2: #171720;
  --surface-3: #1f1f2b;

  --text: #f5f5fa;
  --text-2: #c3c3d4;
  --muted: #9a9ab2;
  --faint: #6f6f88;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --accent: #8b6fff;
  --accent-hover: #9d85ff;
  --accent-2: #ff5c93;
  --accent-3: #35d7ff;
  --accent-soft: rgba(139, 111, 255, 0.14);
  --accent-soft-2: rgba(255, 92, 147, 0.14);

  --grad: linear-gradient(115deg, #8b6fff 0%, #c56bff 46%, #ff5c93 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 111, 255, 0.18), rgba(255, 92, 147, 0.14));

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 8px 22px -10px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 24px 50px -24px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 50px 100px -40px rgba(0, 0, 0, 0.9);
  --ring: 0 0 0 4px rgba(139, 111, 255, 0.25);

  --header-bg: rgba(10, 10, 16, 0.76);
  --overlay: rgba(0, 0, 0, 0.68);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

img[src=""] {
  visibility: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure {
  margin: 0;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: 56px;
}

.section--tight {
  padding-block: 32px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: clamp(28px, 3vw, 40px);
}

.section-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.muted {
  color: var(--muted);
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transition: top var(--speed) var(--ease);
}

.skip-link:focus {
  top: 16px;
}

.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i--sm {
  width: 16px;
  height: 16px;
}

.i--lg {
  width: 24px;
  height: 24px;
}

.i--fill {
  fill: currentColor;
  stroke: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--speed) var(--ease), background-color var(--speed) var(--ease),
    border-color var(--speed) var(--ease), color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(123, 92, 255, 0.7);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -12px rgba(123, 92, 255, 0.8);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn--soft {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn--soft:hover {
  background: var(--accent);
  color: #fff;
}

.btn--dark {
  background: var(--text);
  color: var(--bg);
}

.btn--dark:hover {
  transform: translateY(-2px);
}

.btn--white {
  background: #fff;
  color: #0b0b12;
}

.btn--sm {
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 14px;
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px -20px rgba(11, 11, 18, 0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  border-radius: 12px;
}

.logo img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.logo__text {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.logo__text span {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.nav__link:hover,
.nav__item:hover > .nav__link,
.nav__item.is-open > .nav__link {
  background: var(--surface-2);
  color: var(--text);
}

.nav__link .i {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  min-width: 228px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}

.search-trigger:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.search-trigger span {
  flex: 1;
  text-align: left;
}

.search-trigger kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--faint);
  font-family: var(--font);
  font-size: 11px;
  line-height: 1;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn--bordered {
  border-color: var(--border);
}

.theme-toggle .moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .moon {
  display: block;
}

.header-cta {
  height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
}

.burger {
  display: none;
}

/* --- Mega menu --- */
.mega {
  position: absolute;
  top: calc(100% + 12px);
  left: -160px;
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.95fr;
  gap: 8px;
  width: min(820px, calc(100vw - 48px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease),
    visibility var(--speed) var(--ease);
}

.nav__item:hover > .mega,
.nav__item:focus-within > .mega,
.nav__item.is-open > .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega__col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
}

.mega__title {
  margin-bottom: 8px;
  padding: 0 10px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mega__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  transition: background-color 0.2s, color 0.2s;
}

.mega__link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.mega__link .i {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.mega__promo {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
}

.mega__promo b {
  font-size: 17px;
  line-height: 1.2;
}

.mega__promo span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* --- Login / user --- */
.user-menu {
  position: relative;
}

.user-menu > a,
.user-menu > .user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.user-menu > a:hover {
  background: var(--surface-2);
}

.user-menu img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.user-menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.2s;
  z-index: 5;
}

.user-menu:hover .user-menu__panel,
.user-menu:focus-within .user-menu__panel,
.user-menu.is-open .user-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.user-menu__panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.user-menu__panel a:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 54px 0 26px;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 82% 4%, rgba(123, 92, 255, 0.18), transparent 64%),
    radial-gradient(680px 480px at 4% 0%, rgba(0, 200, 255, 0.1), transparent 62%),
    radial-gradient(640px 420px at 56% 104%, rgba(255, 77, 141, 0.1), transparent 70%);
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 40px;
  align-items: center;
  min-height: 540px;
}

.hero__copy {
  padding: 20px 0;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.hero__badge b {
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero__title {
  margin: 20px 0 20px;
  font-size: clamp(44px, 5.4vw, 82px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.hero__title em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 560px;
  color: var(--text-2);
  font-size: clamp(16px, 1.35vw, 18px);
  line-height: 1.6;
}

.hero__lead b {
  color: var(--text);
  font-weight: 600;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 620px;
  margin-top: 28px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.hero-search .i {
  margin-left: 10px;
  color: var(--muted);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  padding: 0 6px;
  font-size: 16px;
  outline: none;
}

.hero-search input::placeholder {
  color: var(--faint);
}

.hero-search button {
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: filter 0.2s, transform 0.2s;
}

.hero-search button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.hero-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-tags > span {
  color: var(--faint);
  font-size: 12px;
  margin-right: 2px;
}

.hero-tags a {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  transition: 0.2s;
}

.hero-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin-top: 34px;
}

.hero-stat b {
  display: block;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero-stat span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

/* --- Hero visual --- */
.hero__visual {
  position: relative;
  min-height: 540px;
  perspective: 1200px;
}

.hero-card {
  position: absolute;
  width: 236px;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: transform 0.5s var(--ease);
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, transparent 34%, transparent 58%, rgba(0, 0, 0, 0.62) 100%);
}

.hero-card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-pill);
  background: rgba(10, 10, 16, 0.38);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-card__label {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 12px;
  z-index: 2;
  color: #fff;
}

.hero-card__label b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hero-card__label span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.hero-card__label span:empty {
  display: none;
}

.hero-card--1 {
  top: 13%;
  left: 2%;
  transform: rotate(-7deg);
}

.hero-card--2 {
  top: 2%;
  left: 31%;
  z-index: 3;
  transform: rotate(1.5deg) translateY(-4px);
}

/* ---------- Login popover ---------- */
.login-popover {
  position: relative;
}

.login-popover > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.login-popover > summary::-webkit-details-marker {
  display: none;
}

.login-popover > summary:hover {
  background: var(--surface-2);
}

.login-popover[open] > summary {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.login-form {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: 300px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.login-form h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.login-form > p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.login-form .btn {
  width: 100%;
  margin-top: 6px;
}

.login-form__links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.login-form__links a {
  color: var(--accent);
}

.login-form .modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
}

/* ---------- Category menu contexts ---------- */
.mega .catmenu {
  flex-direction: column;
  gap: 1px;
  max-height: 360px;
  overflow: auto;
  scrollbar-width: thin;
}

.mega .catmenu__item {
  display: block;
}

.mega .catmenu__link {
  width: 100%;
  height: auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  justify-content: space-between;
  font-size: 13.5px;
}

.mega .catmenu__link:hover {
  background: var(--surface-2);
}

.mega .catmenu__sub {
  padding: 0 0 0 12px;
}

.mega .catmenu__sub .catmenu__link {
  height: auto;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.chips .catmenu__sub {
  display: none;
}

.filters .catmenu {
  flex-direction: column;
  gap: 2px;
}

.filters .catmenu__item {
  display: block;
}

.filters .catmenu__link {
  width: 100%;
  height: auto;
  padding: 8px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  justify-content: space-between;
  font-size: 13.5px;
}

.filters .catmenu__link:hover {
  background: var(--surface-2);
}

.filters .catmenu__link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.filters .catmenu__sub {
  width: 100%;
  padding: 0 0 0 12px;
}

.filters .catmenu__sub .catmenu__link {
  height: auto;
  padding: 6px 9px;
  font-size: 12.5px;
}

/* ---------- Search page ---------- */
.search-page {
  padding: 36px 0 60px;
}

.search-page h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 46px);
}

.search-page > p {
  max-width: 720px;
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.search-page-form input[type="text"],
.search-page-form input[type="search"],
.search-page-form input:not([type]) {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.search-page-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 760px;
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.search-page-form .field {
  flex: 1 1 240px;
  margin: 0;
}

.search-page-form select,
.search-page-form input[type="text"],
.search-page-form input[type="search"] {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.search-page-form .field--wide {
  flex-basis: 100%;
}

.search-page-form .btn {
  align-self: flex-end;
}

.dle-search {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.cards > .search-page,
.cards > .dle-search,
#dle-content > .search-page,
#dle-content > .dle-search,
.cards > *:has(> .search-page),
.cards > *:has(> .dle-search),
#dle-content > *:has(.search-page),
#dle-content > *:has(.dle-search) {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
}

.search-page .search-page-form,
.dle-search .search-page-form {
  max-width: 100% !important;
}

.dle-search h1 {
  margin-bottom: 16px;
  font-size: 34px;
}

/* ---------- Blog cards ---------- */
.tpl-card--blog .tpl-card__media {
  aspect-ratio: 16 / 10;
}

.tpl-card--blog .tpl-card__body {
  padding: 16px;
}

.tpl-card--blog .tpl-card__title {
  font-size: 18px;
}

/* ---------- Profile / stats ---------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.profile-card__avatar {
  width: 84px;
  height: 84px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-2);
}

.profile-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card__info h2 {
  font-size: 24px;
}

.profile-card__info p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0;
}

.stat-tile {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.stat-tile b {
  display: block;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.stat-tile span {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Polls / attachments ---------- */
.dle-vote {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.dle-vote > h3 {
  margin-bottom: 14px;
  font-size: 15px;
}

.dle-vote_title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.dle-vote_title h3 {
  font-size: 15px;
}

.dle-vote_list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dle-vote_grade {
  margin-top: 12px;
  color: var(--faint);
  font-size: 12px;
}

.dle-vote_btn {
  margin-top: 12px;
}

.dle-atta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.dle-atta_title {
  flex: 1;
}

.dle-atta_title h4 {
  font-size: 14px;
}

.dle-atta_title span {
  color: var(--faint);
  font-size: 11.5px;
}

.dle-atta_link {
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}

.dle-atta_no {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Page shell ---------- */
.page-shell {
  padding: 32px 0 64px;
}

.page-shell > h1 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 46px);
}

/* ---------- Offline page ---------- */
.offline {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(800px 500px at 70% 0%, rgba(123, 92, 255, 0.22), transparent 65%),
    radial-gradient(700px 500px at 10% 100%, rgba(255, 77, 141, 0.16), transparent 60%),
    #08080d;
}

.offline__card {
  width: 100%;
  max-width: 560px;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: #111118;
  color: #f5f5fa;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  text-align: center;
}

.offline__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.offline__logo img {
  width: 42px;
  height: 42px;
}

.offline__card h1 {
  margin-bottom: 12px;
  font-size: 32px;
}

.offline__card p {
  color: #a6a6bd;
  font-size: 14.5px;
  line-height: 1.7;
}

.offline__card .btn {
  margin-top: 24px;
}

.hero__visual .hero-card:nth-of-type(1) {
  top: 13%;
  left: 2%;
  transform: rotate(-7deg);
}

.hero__visual .hero-card:nth-of-type(2) {
  top: 2%;
  left: 31%;
  z-index: 3;
  transform: rotate(1.5deg) translateY(-4px);
}

.hero__visual .hero-card:nth-of-type(3) {
  top: 17%;
  right: 0;
  transform: rotate(7deg);
}

.hero__visual .hero-card:hover {
  z-index: 5;
  transform: rotate(0) translateY(-8px) scale(1.02);
}

.hero-card:hover {
  z-index: 5;
  transform: rotate(0) translateY(-8px) scale(1.02);
}

.hero__glow {
  position: absolute;
  top: 20%;
  left: 26%;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.22;
  filter: blur(80px);
  pointer-events: none;
}

.hero__spark {
  position: absolute;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-md);
}

.hero__spark--1 {
  top: 5%;
  right: 4%;
  transform: rotate(8deg);
}

.hero__spark--2 {
  bottom: 9%;
  left: 14%;
  transform: rotate(-10deg);
  color: var(--accent-2);
}

.hero__note {
  position: absolute;
  right: 10%;
  bottom: 1%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.hero__note-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.hero__note b {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.hero__note span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}

/* ---------- Models rail ---------- */
.models {
  padding: 26px 0 6px;
}

.models__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.models__head h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.models__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.models__nav > a {
  margin-right: 4px;
  color: var(--muted);
  font-size: 13px;
}

.models__nav > a:hover {
  color: var(--accent);
}

.models__nav .models-arrow {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
}

.models__nav .models-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.models-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 196px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.models-rail::-webkit-scrollbar {
  display: none;
}

.model-pill {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 11px;
  row-gap: 3px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  scroll-snap-align: start;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}

.model-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(108, 77, 255, 0.4);
  box-shadow: var(--shadow-sm);
}

.model-pill__logo {
  display: grid;
  grid-row: 1;
  grid-column: 1;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.model-pill__logo--alt {
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
}

.model-pill__logo--warm {
  background: linear-gradient(135deg, #f97316, #f43f5e);
}

.model-pill__logo--green {
  background: linear-gradient(135deg, #10b981, #84cc16);
}

.model-pill__logo--dark {
  background: #15151f;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.model-pill > span:last-child {
  display: contents;
}

.model-pill__name {
  display: flex;
  grid-row: 1;
  grid-column: 2;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.model-pill__name .badge-new {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--accent-soft-2);
  color: var(--accent-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.model-pill__meta {
  grid-row: 2;
  grid-column: 1 / -1;
  margin-top: 0;
  overflow: hidden;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.35;
  white-space: normal;
}

/* ---------- Chips / catmenu ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 12px;
}

.chips > .catmenu {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.2s;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip.is-active,
.chip[aria-current="page"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.chip .count {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
}

.chip.is-active .count {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] .chip.is-active .count {
  background: rgba(0, 0, 0, 0.25);
}

.catmenu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catmenu__item {
  display: contents;
}

.catmenu__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.2s;
}

.catmenu__link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.catmenu__link.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.catmenu__count {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
}

.catmenu__link.is-active .catmenu__count {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.72);
}

.catmenu__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 2px 0 0 14px;
}

.catmenu__sub .catmenu__link {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* ---------- Catalog ---------- */
.catalog {
  padding-top: 30px;
}

.catalog__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.catalog__head h2 {
  font-size: clamp(28px, 3vw, 40px);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.catalog-toolbar__count {
  color: var(--muted);
  font-size: 13.5px;
}

.catalog-toolbar__count b {
  color: var(--text);
  font-weight: 600;
}

.catalog-toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sort select {
  height: 40px;
  padding: 0 36px 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.sort .i {
  position: absolute;
  right: 11px;
  width: 14px;
  height: 14px;
  pointer-events: none;
  color: var(--muted);
}

.sort__details {
  position: relative;
}

.sort__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.sort__toggle::-webkit-details-marker {
  display: none;
}

.sort__toggle:hover {
  border-color: var(--border-strong);
}

.sort__details[open] .sort__toggle {
  border-color: var(--accent);
  color: var(--accent);
}

.sort__toggle .i {
  position: static;
  width: 14px;
  height: 14px;
  transform: none;
  transition: transform 0.2s;
}

.sort__details[open] .sort__toggle .i {
  transform: rotate(180deg);
}

.sort__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.sort__menu a,
.sort__menu span,
.sort__menu b,
.sort__menu strong {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.sort__menu a:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.sort__menu .selected,
.sort__menu b,
.sort__menu strong {
  background: var(--accent-soft);
  color: var(--accent);
}

.sort__menu select {
  width: 100%;
}

.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.view-toggle button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.view-toggle button.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.catalog-layout--full {
  grid-template-columns: minmax(0, 1fr);
}

.catalog-layout--full .catalog-main {
  width: 100%;
  min-width: 0;
}

/* --- Filters --- */
.filters {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.filters__head h2 {
  font-size: 16px;
  font-weight: 600;
}

.filters__reset {
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  cursor: pointer;
}

.filters__reset:hover {
  color: var(--accent-2);
}

.filter-block {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.filter-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.filter-block h3 {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  transition: 0.18s;
}

.filter-list a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.filter-list a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.filter-list .count {
  color: var(--faint);
  font-size: 11px;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 4px;
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
}

.filter-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.filter-price {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-price input {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
}

.filters .btn {
  margin-top: 4px;
}

.filter-note {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--grad-soft);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.filter-note b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13px;
}

.filter-form select {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371718a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.filter-form__actions {
  display: flex;
  gap: 8px;
}

.filters__close {
  display: none;
}

.cards > .attention {
  grid-column: 1 / -1;
}

.footer .catmenu__count {
  display: none;
}

@media (max-width: 1024px) {
  .filters__close {
    display: grid;
  }
}

/* --- Cards --- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 5px;
  min-width: 0;
}

.cards > * {
  min-width: 0;
}

.cards--rail {
  grid-auto-flow: column;
  grid-template-columns: none;
  grid-auto-columns: 240px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.cards--rail::-webkit-scrollbar {
  display: none;
}

.cards--rail .tpl-card {
  scroll-snap-align: start;
}

.tpl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}

.tpl-card:hover {
  transform: translateY(-4px);
  border-color: rgba(108, 77, 255, 0.34);
  box-shadow: var(--shadow-md);
}

.tpl-card__media {
  position: relative;
  display: block;
  aspect-ratio: 2.5 / 4;
  overflow: hidden;
  background: var(--surface-2);
}

.tpl-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease);
}

.tpl-card:hover .tpl-card__media img {
  transform: scale(1.045);
}

.tpl-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.tpl-card.is-playing .tpl-card__video {
  opacity: 1;
}

.tpl-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.26) 0%, transparent 30%, transparent 60%, rgba(0, 0, 0, 0.55) 100%);
}

.tpl-card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tpl-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  background: rgba(10, 10, 16, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tpl-card__badge:empty {
  display: none;
}

.tpl-card__badge--new {
  border-color: transparent;
  background: var(--grad);
  text-transform: uppercase;
}

.tpl-card__badge--hit {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.92);
  color: #0b0b12;
}

.tpl-card__fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
}

.tpl-card__fav a,
.tpl-card__fav button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(10, 10, 16, 0.34);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  transition: 0.2s;
}

.tpl-card__fav a:hover,
.tpl-card__fav button:hover {
  background: rgba(255, 255, 255, 0.94);
  color: #ff3d7f;
}

.tpl-card__fav .i {
  width: 17px;
  height: 17px;
}

.tpl-card__fav .i--fill {
  color: #ff3d7f;
}

.tpl-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #0b0b12;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
  transition: 0.3s var(--ease);
}

.tpl-card__play .i {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.tpl-card:hover .tpl-card__play,
.tpl-card:focus-within .tpl-card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tpl-card.is-playing .tpl-card__play {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
}

.tpl-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  min-height: 116px;
  padding: 12px 13px 13px;
}

/* Card content over the poster */
.tpl-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 54px 14px 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, transparent 34%, rgba(0, 0, 0, 0.78) 100%);
  pointer-events: none;
}

.tpl-card__overlay .tpl-card__model {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10.5px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.tpl-card__overlay .tpl-card__title {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 5px;
  color: #fff;
  font-size: 16px;
  line-height: 1.28;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tpl-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
}

.tpl-card__overlay .tpl-card__meta {
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.tpl-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #0b0b12;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), background 0.2s;
}

.tpl-card__cta .i {
  width: 12px;
  height: 12px;
}

.tpl-card__cta-short {
  display: none;
}

.tpl-card:hover .tpl-card__cta,
.tpl-card:focus-within .tpl-card__cta {
  opacity: 1;
  transform: translateY(0);
}

.tpl-card:hover .tpl-card__cta {
  background: #fff;
}

@media (hover: none) {
  .tpl-card__cta {
    display: inline-flex;
    opacity: 1;
    transform: none;
  }

  .tpl-card__cta-full {
    display: none;
  }

  .tpl-card__cta-short {
    display: inline;
  }
}

.tpl-card__model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tpl-card__model::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad);
}

.tpl-card__model:empty {
  display: none;
}

.tpl-card__title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: -0.015em;
}

.tpl-card__title a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tpl-card__title a:hover {
  color: var(--accent);
}

.tpl-card__desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tpl-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  color: var(--faint);
  font-size: 11.5px;
}

.tpl-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tpl-card__meta .i {
  width: 13px;
  height: 13px;
}

.tpl-card__more {
  display: none;
}

.cards--list {
  grid-template-columns: 1fr;
}

.cards--list .tpl-card {
  flex-direction: row;
  align-items: stretch;
}

.cards--list .tpl-card__media {
  width: 186px;
  flex: none;
  aspect-ratio: 3 / 4;
}

.cards--list .tpl-card__body {
  justify-content: center;
  gap: 9px;
  padding: 18px 20px;
}

.cards--list .tpl-card__title {
  font-size: 19px;
}

.cards--list .tpl-card__desc {
  -webkit-line-clamp: 3;
  font-size: 13.5px;
}

.cards--list .tpl-card__meta {
  margin-top: 4px;
}

/* Skeleton (while AJAX filters swap content) */
.tpl-card--skeleton {
  pointer-events: none;
}

.tpl-card--skeleton .tpl-card__media,
.tpl-card--skeleton .tpl-card__body > * {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  color: transparent;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Tags / badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  transition: 0.2s;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--new {
  background: var(--grad);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.features--3 {
  grid-template-columns: repeat(3, 1fr);
}

.feature {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}

.feature:hover {
  transform: translateY(-3px);
  border-color: rgba(108, 77, 255, 0.3);
}

.feature__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 13px;
  background: var(--grad-soft);
  color: var(--accent);
}

.feature h3 {
  margin-bottom: 7px;
  font-size: 16px;
  font-weight: 600;
}

.feature p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 26px 24px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: 14px;
  right: 18px;
  color: var(--border-strong);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.step__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(123, 92, 255, 0.8);
}

.step h3 {
  position: relative;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
}

.step p {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- FAQ ---------- */
.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
  align-items: start;
}

.faq__intro h2 {
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 14px;
}

.faq__intro p {
  color: var(--muted);
  line-height: 1.65;
  max-width: 360px;
}

.faq__intro .btn {
  margin-top: 22px;
}

.faq__list {
  border-top: 1px solid var(--border);
}

.faq__item {
  border-bottom: 1px solid var(--border);
}

.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 2px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  transition: 0.25s;
}

.faq__item[open] summary::after {
  content: "−";
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
  transform: rotate(180deg);
}

.faq__item p {
  padding: 0 44px 20px 2px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}

.faq__item p + p {
  margin-top: -8px;
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 28px;
  align-items: center;
  overflow: hidden;
  padding: 46px;
  border-radius: var(--r-xl);
  background: #0b0b12;
  color: #fff;
}

.cta::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.45;
  filter: blur(90px);
}

.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.cta__copy,
.cta__action {
  position: relative;
  z-index: 2;
}

.cta h2 {
  max-width: 620px;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.05;
}

.cta p {
  max-width: 520px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  line-height: 1.6;
}

.cta__action {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.cta__note {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  text-align: center;
}

/* ---------- SEO text ---------- */
.seo-block {
  padding: 48px 0 12px;
  border-top: 1px solid var(--border);
}

.seo-block h2 {
  margin-bottom: 16px;
  font-size: 26px;
}

.seo-block h3 {
  margin: 22px 0 8px;
  font-size: 17px;
}

.seo-block p {
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.75;
}

.seo-block a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.seo-block .seo-cols {
  columns: 2;
  column-gap: 56px;
}

.seo-block .seo-cols > * {
  break-inside: avoid;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  margin-top: 72px;
  overflow: hidden;
  padding: 56px 0 22px;
  background: #08080d;
  color: #a6a6bd;
}

.footer::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 20%;
  width: 520px;
  height: 360px;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.14;
  filter: blur(90px);
  pointer-events: none;
}

.footer__top {
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
}

.footer .logo__text {
  color: #fff;
}

.footer__about {
  max-width: 320px;
  margin: 16px 0 20px;
  color: #8e8ea6;
  font-size: 13.5px;
  line-height: 1.65;
}

.footer__title {
  margin-bottom: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.footer__col a,
.footer__col .catmenu__link {
  display: block;
  padding: 5px 0;
  height: auto;
  border: 0;
  background: transparent;
  color: #9a9ab2;
  font-size: 13.5px;
  white-space: normal;
}

.footer__col a:hover,
.footer__col .catmenu__link:hover {
  color: #fff;
}

.footer .catmenu {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer .catmenu__item {
  display: block;
}

.footer .catmenu__link {
  display: block;
}

.footer .catmenu__sub {
  display: none;
}

.footer__bottom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #75758c;
  font-size: 12.5px;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer__legal a:hover {
  color: #fff;
}

.socials {
  display: flex;
  gap: 8px;
}

.socials a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #cfcfe0;
  transition: 0.2s;
}

.socials a:hover {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  transform: translateY(-2px);
}

.socials .i {
  width: 17px;
  height: 17px;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--faint);
  font-size: 12.5px;
}

.breadcrumbs__list a {
  color: var(--muted);
}

.breadcrumbs__list a:hover {
  color: var(--accent);
}

.breadcrumbs__list .sep {
  opacity: 0.6;
}

.breadcrumbs__list [aria-current="page"] {
  color: var(--text-2);
}

.breadcrumbs__list .speedbar {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: inherit;
  color: inherit;
}

.breadcrumbs__list .speedbar a {
  color: var(--muted);
}

.speedbar {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--muted);
}

.speedbar a {
  color: var(--muted);
}

.speedbar a:hover {
  color: var(--accent);
}

/* ---------- Catalog page head ---------- */
.page-head {
  padding: 36px 0 22px;
}

.page-head h1 {
  max-width: 900px;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.02;
}

.page-head__desc {
  max-width: 820px;
  margin-top: 14px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.65;
}

.page-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- Article ---------- */
.article-hero {
  padding: 34px 0 18px;
}

.article-hero__kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.article-hero h1 {
  max-width: 980px;
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.article-hero__lead {
  max-width: 800px;
  margin-top: 16px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.65;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.article-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.article-meta__item .i {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.article-meta__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-weight: 500;
}

.article-meta__author img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f59e0b;
  font-size: 12px;
}

.rating__stars {
  letter-spacing: 1px;
}

.rating b {
  color: var(--text);
  font-size: 12.5px;
}

.article-section {
  margin-top: 38px;
}

.article-section > h2 {
  margin-bottom: 14px;
  font-size: 26px;
}

.related-block {
  margin-top: 46px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.related-block__head h2 {
  font-size: 24px;
}

.related-block .cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.side-promo {
  padding: 18px;
  border-radius: var(--r-md);
  background: #0b0b12;
  color: #fff;
}

.side-promo b {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}

.side-promo p {
  margin: 8px 0 14px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12.5px;
  line-height: 1.5;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 36px;
  align-items: start;
  padding: 24px 0 72px;
}

.article-main {
  min-width: 0;
}

.article-side {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* AI summary */
.ai-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin: 22px 0 24px;
  padding: 18px 20px;
  border: 1px solid rgba(108, 77, 255, 0.18);
  border-radius: var(--r-md);
  background: var(--grad-soft);
}

.ai-summary__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
}

.ai-summary h2 {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ai-summary ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.ai-summary li {
  position: relative;
  padding-left: 14px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.ai-summary li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.ai-summary b {
  color: var(--text);
  font-weight: 600;
}

/* Media */
.media-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  background: #000;
}

.media-frame__bg {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(46px) saturate(1.2);
  opacity: 0.55;
}

.media-frame--photo {
  aspect-ratio: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-frame--photo .media-frame__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 820px);
  max-height: 80vh;
  object-fit: contain;
}

.media-frame__img,
.media-frame video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-frame__play {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #0b0b12;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s;
}

.media-frame__play:hover {
  transform: scale(1.06);
}

.media-frame__play .i {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}

.media-frame--player {
  aspect-ratio: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 320px;
  background: #000;
}

.video-shell__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 17px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #0b0b12;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 0.25s var(--ease), visibility 0.25s, transform 0.25s var(--ease);
}

.video-shell__play .i {
  width: 19px;
  height: 19px;
  margin-left: 1px;
}

.video-shell__play:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.video-shell.is-playing .video-shell__play {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
}

.media-frame--player video {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  object-fit: contain !important;
  background: #000;
}

.media-frame--player iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  object-fit: contain;
  background: #000;
}

.media-frame video {
  object-fit: contain !important;
}

.media-frame__player {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
}

.media-frame__player video,
.media-frame__player iframe {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 80vh;
  border: 0;
  object-fit: contain !important;
  background: #000;
}

.media-frame--player .video-player,
.media-frame--player .video-js {
  width: 100%;
  height: 100%;
}

.story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.story-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.media-caption {
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

/* Prompt box */
.prompt-card {
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.prompt-card__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.prompt-card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.prompt-card__title .i {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.prompt-card__hint {
  margin-left: 2px;
  color: var(--faint);
  font-size: 11.5px;
}

.prompt-card pre,
.prompt-card__text {
  margin: 0;
  padding: 18px;
  max-height: 460px;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-card pre code {
  font: inherit;
}

.prompt-negative {
  margin: -12px 0 28px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.prompt-negative b {
  display: block;
  margin-bottom: 4px;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.prompt-negative p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: 0.2s;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn.is-copied {
  border-color: transparent;
  background: #10b981;
  color: #fff;
}

.copy-btn .i {
  width: 15px;
  height: 15px;
}

/* Specs */
.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--border);
}

.specs__row {
  padding: 13px 15px;
  background: var(--surface);
}

.specs dt {
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.specs dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

/* Prose */
.prose {
  max-width: 800px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 14px;
}

.prose h2 {
  margin-top: 34px;
  color: var(--text);
  font-size: 26px;
  line-height: 1.2;
}

.prose h3 {
  margin-top: 26px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.3;
}

.prose p {
  margin: 0;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 6px;
}

.prose li::marker {
  color: var(--accent);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose code,
.article-main code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9em;
}

.prompt-card pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: inherit;
}

.prose blockquote {
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
  color: var(--text-2);
}

.prose img {
  border-radius: var(--r-sm);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.gallery figure {
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.gallery figure:hover img {
  transform: scale(1.04);
}

.gallery figcaption {
  padding: 8px 10px;
  color: var(--faint);
  font-size: 11px;
}

/* Если DLE не отдал изображения — не показываем пустые подписи и секцию */
.gallery figure:not(:has(img)) {
  display: none;
}

.gallery:not(:has(img)) {
  display: none;
}

.article-section:has(.gallery:not(:has(img))) {
  display: none;
}

/* Tags / share */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 28px 0 0;
}

.article-tags a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  transition: 0.2s;
}

.article-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.article-share > span {
  color: var(--faint);
  font-size: 12px;
}

.share-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  transition: 0.2s;
}

.share-btn:hover {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
}

/* Author */
.author-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.author-box img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.author-box b {
  display: block;
  font-size: 14px;
}

.author-box span {
  color: var(--muted);
  font-size: 12.5px;
}

/* Sidebar cards */
.side-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.side-card h3 {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.side-card--grad {
  background: var(--grad-soft);
  border-color: rgba(108, 77, 255, 0.2);
}

.model-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.model-card__logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.model-card__head b {
  display: block;
  font-size: 15px;
}

.model-card__head span {
  color: var(--muted);
  font-size: 12px;
}

.model-card__desc {
  margin: 12px 0 14px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.side-card .btn {
  width: 100%;
}

.related-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.related-mini a {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px;
  margin: 0 -7px;
  border-radius: 11px;
  transition: background-color 0.2s;
}

.related-mini a:hover {
  background: var(--surface-2);
}

.related-mini img {
  width: 56px;
  height: 70px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-2);
}

.related-mini b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.related-mini span {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10.5px;
}

.side-card .catmenu {
  flex-direction: column;
  gap: 1px;
}

.side-card .catmenu__item {
  display: block;
}

.side-card .catmenu__link {
  width: 100%;
  height: auto;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  justify-content: space-between;
  font-size: 12.5px;
}

.side-card .catmenu__link:hover {
  background: var(--surface-2);
}

.side-card .catmenu__sub {
  padding: 0 0 0 10px;
}

.side-card .catmenu__sub .catmenu__link {
  height: auto;
  padding: 5px 8px;
  font-size: 11.5px;
  color: var(--muted);
}

/* Comments */
.comments {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.comments > h2 {
  margin-bottom: 18px;
  font-size: 24px;
}

.comments-form {
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.comments-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  resize: vertical;
}

.comments-form .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.comments-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.comment {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.comment__avatar {
  overflow: hidden;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
}

.comment__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.comment__head b {
  font-size: 13.5px;
}

.comment__head span {
  color: var(--faint);
  font-size: 11.5px;
}

.comment__text {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

.comment__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.comment__actions a,
.comment__actions button {
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 11.5px;
  cursor: pointer;
}

.comment__actions a:hover {
  color: var(--accent);
}

/* ---------- Pagination ---------- */
.navigation {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 34px;
}

.navigation a,
.navigation span,
.pagination a,
.pagination span {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
}

.navigation a:hover,
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.navigation .current,
.navigation span.current,
.pagination .current {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

/* ---------- Forms and auth pages ---------- */
.auth {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h) - 200px);
  padding: 40px 0;
}

.auth-card,
.form-card {
  width: 100%;
  max-width: 520px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-card--wide {
  max-width: 680px;
}

.auth-card h1,
.form-card h1 {
  margin-bottom: 8px;
  font-size: 28px;
}

.auth-card > p,
.form-card > p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field > label {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}

.input,
.select,
.textarea,
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea,
.field textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 13px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}

.checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.form-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.form-links a {
  color: var(--accent);
}

.auth-card .btn,
.form-card .btn {
  width: 100%;
  margin-top: 8px;
}

.notice,
.attention {
  padding: 13px 15px;
  margin: 14px 0;
  border: 1px solid #ffd8a8;
  border-radius: 12px;
  background: #fff6e8;
  color: #8a5a12;
  font-size: 13.5px;
  line-height: 1.5;
}

.attention strong {
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}

html[data-theme="dark"] .notice,
html[data-theme="dark"] .attention {
  border-color: rgba(255, 190, 92, 0.24);
  background: rgba(255, 190, 92, 0.1);
  color: #ffce8a;
}

/* DLE service forms */
.dle-form {
  width: 100%;
  max-width: 620px;
  margin: 28px auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.dle-form h1,
.dle-form h2 {
  margin-bottom: 16px;
  font-size: 26px;
}

.dle-form_flex,
.dle-form_flexno {
  margin-bottom: 12px;
}

.dle-form_flex > label,
.dle-form_flexno > label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Search modal ---------- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}

.search-modal.is-open {
  display: block;
}

.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.search-modal__panel {
  position: relative;
  width: min(680px, calc(100vw - 32px));
  margin: 10vh auto 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.search-modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.search-modal__head .i {
  color: var(--muted);
}

.search-modal__head input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 17px;
  outline: none;
}

.search-modal__head button {
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 11px;
}

.search-modal__body {
  padding: 18px;
  max-height: 56vh;
  overflow: auto;
}

.search-modal__body h3 {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.search-result-mini {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px;
  border-radius: 10px;
}

.search-result-mini:hover {
  background: var(--surface-2);
}

.search-result-mini img {
  width: 38px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.search-result-mini b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.search-result-mini span {
  color: var(--faint);
  font-size: 11px;
}

.search-modal__popular {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

/* ---------- Drawer / mobile nav ---------- */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 110;
  display: flex;
  flex-direction: column;
  width: min(380px, 92vw);
  padding: 18px;
  background: var(--surface);
  transform: translateX(102%);
  transition: transform 0.35s var(--ease);
  overflow-y: auto;
}

.drawer.is-open {
  transform: none;
}

.drawer__backdrop {
  position: fixed;
  inset: 0;
  z-index: 109;
  background: var(--overlay);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.drawer__backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer__nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 11px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.drawer__nav a:hover {
  background: var(--surface-2);
}

.drawer__label {
  margin: 18px 12px 8px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.drawer .catmenu {
  flex-direction: column;
  gap: 0;
}

.drawer .catmenu__link {
  justify-content: space-between;
  width: 100%;
  height: auto;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
}

.drawer .catmenu__link:hover {
  background: var(--surface-2);
}

.drawer .catmenu__sub {
  display: none;
}

.drawer__foot {
  margin-top: auto;
  padding-top: 18px;
}

.mobile-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  display: none;
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}

.mobile-bar a,
.mobile-bar button {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}

.mobile-bar .i {
  width: 21px;
  height: 21px;
}

.mobile-bar .is-active {
  color: var(--accent);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: 0.3s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .i {
  width: 17px;
  height: 17px;
  color: #4ade80;
}

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }

  html.js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  html.js .reveal[data-delay="1"] {
    transition-delay: 0.08s;
  }

  html.js .reveal[data-delay="2"] {
    transition-delay: 0.16s;
  }

  html.js .reveal[data-delay="3"] {
    transition-delay: 0.24s;
  }
}

/* ---------- Sticky filter drawer for mobile ---------- */
.filters-toggle {
  display: none;
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .site-footer,
  .footer,
  .mobile-bar,
  .search-modal,
  .drawer,
  .article-side,
  .article-share,
  .cta {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .article-layout {
    display: block;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
  .hero__grid {
    gap: 24px;
  }

  .hero-card {
    width: 206px;
  }

  .hero__visual {
    min-height: 480px;
  }

  .header-actions .search-trigger {
    min-width: 190px;
  }

  .nav__link {
    padding: 0 10px;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__top {
    grid-template-columns: 1.35fr 1fr 1fr;
  }

  .footer__col:last-child {
    grid-column: 2 / -1;
  }
}

@media (max-width: 1024px) {
  .hero__grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero__visual {
    display: none;
  }

  .hero__copy {
    max-width: 760px;
    padding-bottom: 0;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .filters {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 115;
    width: min(360px, 92vw);
    padding: 20px;
    background: var(--surface);
    overflow-y: auto;
    transform: translateX(102%);
    transition: transform 0.35s var(--ease);
    box-shadow: var(--shadow-lg);
  }

  .filters.is-open {
    transform: none;
  }

  .filters-toggle {
    display: inline-flex;
  }

  .filters__head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 12px;
    background: var(--surface);
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-side {
    position: static;
  }

  .faq {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .faq__intro p {
    max-width: 640px;
  }

  .cta {
    grid-template-columns: 1fr;
    padding: 36px;
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .footer__col:last-child {
    grid-column: auto;
  }
}

@media (max-width: 1100px) {
  .header-cta {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 64px;
  }

  .container {
    padding-inline: 18px;
  }

  .section {
    padding-block: 40px;
  }

  .nav,
  .search-trigger,
  .header-cta,
  .header-actions .theme-toggle {
    display: none;
  }

  .burger {
    display: inline-grid;
  }

  .header-inner {
    gap: 10px;
  }

  .logo__text {
    font-size: 21px;
  }

  .logo img {
    width: 34px;
    height: 34px;
  }

  .hero {
    padding-top: 34px;
  }

  .hero__title {
    font-size: clamp(38px, 10vw, 58px);
  }

  .hero-search {
    flex-wrap: nowrap;
  }

  .hero-search button {
    display: inline-flex;
    width: auto;
    padding: 0 16px;
  }

  .hero-search button span {
    display: inline;
  }

  .hero-search button .i {
    display: none;
    margin: 0;
  }

  .hero-stats {
    gap: 24px;
  }

  .catalog__head,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .catalog-toolbar {
    flex-wrap: wrap;
  }

  .catalog-toolbar__right {
    flex-wrap: wrap;
  }

  .catalog-toolbar__right .sort {
    flex: 1;
  }

  .catalog-toolbar__right .sort select {
    width: 100%;
  }

  .catalog-toolbar__right .sort__toggle {
    width: 100%;
    justify-content: space-between;
  }

  .catalog-toolbar__right .sort__menu {
    right: auto;
    left: 0;
    width: 100%;
  }

  .catalog-toolbar__right {
    width: 100%;
    justify-content: space-between;
  }

  .related-block .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards:not(.cards--rail) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .tpl-card {
    border-radius: 16px;
  }

  .tpl-card__body {
    padding: 10px 11px 12px;
  }

  .tpl-card__title {
    font-size: 13.5px;
  }

  .tpl-card__desc {
    display: none;
  }

  .tpl-card__media {
    aspect-ratio: 3 / 4;
  }

  .tpl-card__badge {
    font-size: 9px;
    padding: 3px 6px;
  }

  .cards--list {
    grid-template-columns: 1fr;
  }

  .cards--list .tpl-card {
    flex-direction: row;
  }

  .cards--list .tpl-card__media {
    width: 132px;
  }

  .cards--list .tpl-card__title {
    font-size: 16px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .footer {
    margin-top: 48px;
    padding-top: 40px;
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 26px;
  }

  .mobile-bar {
    display: flex;
  }

  body {
    padding-bottom: 68px;
  }

  .toast {
    bottom: 80px;
  }

  .article-hero {
    padding-top: 24px;
  }

  .article-hero h1 {
    font-size: clamp(28px, 7vw, 42px);
  }

  .article-layout {
    padding-bottom: 48px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .specs {
    grid-template-columns: 1fr;
  }

  .seo-block .seo-cols {
    columns: 1;
  }

  .cta {
    padding: 26px;
    border-radius: var(--r-lg);
  }

  .cta h2 {
    font-size: 28px;
  }

  .feature {
    padding: 18px;
  }

  .auth-card,
  .form-card {
    padding: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .article-side {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cards--rail {
    grid-auto-columns: 214px;
  }

  .container {
    padding-inline: 14px;
  }

  .hero__badge {
    font-size: 12px;
  }

  .hero__lead {
    font-size: 15px;
  }

  .hero-search input {
    font-size: 15px;
  }

  .hero-tags a:nth-child(n + 5) {
    display: none;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .hero-stat b {
    font-size: 22px;
  }

  .hero-stat span {
    font-size: 11px;
  }

  .models-rail {
    grid-auto-columns: 176px;
  }

  .models__nav > a {
    display: none;
  }

  .model-pill {
    padding: 9px 10px;
  }

  .model-pill__logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 15px;
  }

  .section-head h2,
  .catalog__head h2 {
    font-size: 26px;
  }

  .cards {
    gap: 10px;
  }

  .tpl-card__title {
    font-size: 13px;
  }

  .tpl-card__meta {
    font-size: 10.5px;
  }

  .tpl-card__model {
    font-size: 9.5px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .footer__top {
    grid-template-columns: 1fr;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-meta {
    gap: 8px 14px;
  }

  .ai-summary {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .ai-summary__icon {
    width: 34px;
    height: 34px;
  }

  .prompt-card__hint {
    display: none;
  }

  .prompt-card pre {
    padding: 14px;
    font-size: 12.5px;
  }

  .faq__item summary {
    font-size: 14.5px;
    gap: 12px;
  }

  .faq__item p {
    padding-right: 8px;
  }

  .media-frame {
    aspect-ratio: 4 / 5;
    border-radius: var(--r-md);
  }

  .article-tags {
    gap: 6px;
  }

  .tag {
    font-size: 11.5px;
    padding: 5px 9px;
  }

  .auth {
    padding: 24px 0;
  }

  .auth-card,
  .form-card {
    padding: 20px;
    border-radius: var(--r-md);
  }

  .dle-form {
    padding: 20px;
    margin: 16px auto;
  }

  .search-modal__panel {
    margin-top: 6vh;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Мобильный каталог: две компактные карточки */
@media (max-width: 480px) {
  .cards:not(.cards--rail),
  .related-block .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .tpl-card {
    border-radius: 14px;
  }

  .tpl-card__media {
    aspect-ratio: 2.5 / 4;
  }

  .tpl-card__overlay {
    padding: 40px 8px 8px;
  }

  .tpl-card__overlay .tpl-card__model {
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .tpl-card__overlay .tpl-card__title {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.22;
    -webkit-line-clamp: 2;
  }

  .tpl-card__bottom {
    gap: 4px;
    margin-top: 6px;
  }

  .tpl-card__overlay .tpl-card__meta {
    gap: 5px;
    font-size: 9px;
  }

  .tpl-card__badge {
    padding: 3px 5px;
    font-size: 8px;
  }

  .tpl-card__fav a,
  .tpl-card__fav button {
    width: 28px;
    height: 28px;
  }

  .tpl-card__cta {
    margin-left: auto;
    padding: 5px 7px;
    font-size: 9px;
    opacity: 1;
    transform: none;
  }

  .tpl-card__cta-full {
    display: none;
  }

  .tpl-card__cta-short {
    display: inline;
  }

  .tpl-card__cta .i {
    width: 9px;
    height: 9px;
  }
}

/* Горизонтальные ленты не должны превращаться в сетку */
.cards.cards--rail {
  grid-template-columns: none;
}
