/* ===== Шрифты ===== */
@font-face { font-family: "Tonduk"; src: url("../fonts/tonduk.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Vinque Antique"; src: url("../fonts/vinque-antique.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Lombardia"; src: url("../fonts/Lombardia.ttf") format("truetype"); font-display: swap; }
/* тот же шрифт с «сжатой» рабочей областью для крупных заголовков: курсор и выделение не выше самих букв */
@font-face { font-family: "Lombardia Tight"; src: url("../fonts/Lombardia.ttf") format("truetype"); font-display: swap; ascent-override: 66%; descent-override: 18%; line-gap-override: 0%; }

/* ===== Переменные ===== */
:root {
  --red: #CC1A1A;
  --red-soft: #D95B5B;
  --heading: #D9484F;
  --pink-pill: #F2B5B0;
  --bg: #FAF0EC;
  --bg-section: #F5E8E4;
  --line: #E8D8D4;
  --text: #D48080;
  --text-gray: #6A5050;
  --text-muted: #8A7373;
  --ink: #2A1A1A;
  --footer: #7C0000;

  --f-logo: "Tonduk", serif;
  --f-main: "Vinque Antique", serif;
  --f-names: "Lombardia", serif;

  --gutter: 64px;
  --gap: 24px;
  --anim: 800ms; /* скорость всех анимаций на сайте */
}

/* ===== База ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-main);
  font-size: 24px;
  line-height: 1.35;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }

/* иконки (спрайт в html) */
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* круглая кнопка со стрелкой */
.round-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid #EDB4B0; color: var(--red); font-size: 18px;
  transition: background var(--anim), color var(--anim);
}
.round-btn:hover { background: var(--red); color: var(--bg); }

/* заглушки вместо картинок */
.ph { background: var(--c1, #ccc); background-image: linear-gradient(135deg, var(--c1, #ccc), var(--c2, var(--c1, #ccc))); }

/* ===== Шапка ===== */
.site-header { position: relative; padding-top: 72px; text-align: center; max-width: 1440px; margin-inline: auto; }
.logo { display: inline-block; color: var(--red); }
.logo__word { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--f-logo); font-size: 96px; line-height: 1.15; }
.logo__star { width: 32px; height: 32px; stroke-width: 2.6; margin-top: 22px; }
.logo__tag { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.header-tools { position: absolute; right: 116px; top: 130px; display: flex; gap: 18px; align-items: center; font-size: 14px; }
.lang { color: var(--text-muted); }
.social { color: var(--red); display: inline-flex; gap: 6px; align-items: center; }
.header-line { border: 0; border-top: 1px solid var(--line); margin: 40px var(--gutter) 0; }

/* ===== Герой ===== */
.hero { position: relative; text-align: center; padding: 24px var(--gutter) 36px; max-width: 1440px; margin-inline: auto; }
.hero h1 { font-family: var(--f-logo); font-weight: normal; font-size: 48px; line-height: 1.2; color: var(--red); }
.nav { display: flex; justify-content: center; gap: 36px; margin-top: 14px; font-size: 14px; }
.nav a { color: var(--text-muted); position: relative; }
.nav a:hover { color: var(--red-soft); }
.nav a.is-active { color: var(--red); }
.nav a.is-active::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 12px; vertical-align: middle; position: relative; top: -1px; }
.hero__text { margin-top: 32px; font-size: 16px; color: var(--red-soft); }
.hero__rose { position: absolute; top: 105px; font-size: 56px; line-height: 1; }
.hero__rose--l { left: 100px; }
.hero__rose--r { right: 100px; }
/* кнопка «Рыскать по вселенным» → поисковая строка */
.search-wrap { position: relative; display: inline-block; margin-top: 24px; }
.search { position: relative; display: flex; align-items: center; width: 276px; height: 43px; border-radius: 3px; background: var(--red); color: var(--bg); overflow: hidden; transition: width var(--anim) ease, height var(--anim) ease, background var(--anim); vertical-align: top; }
.search__open { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; justify-content: center; width: 100%; padding: 0 14px 5px; height: 100%; white-space: nowrap; cursor: pointer; font-family: var(--f-names); font-size: 32px; transition: opacity var(--anim); }
.search__open:hover { background: #A31414; }
.search__open .ico { font-size: 28px; stroke-width: 2.6; position: relative; top: 2.5px; }
.search__input { position: absolute; inset: 0 52px 0 0; width: calc(100% - 52px); padding: 0 22px 8px; border: 0; outline: 0; background: transparent; color: var(--red); font-family: var(--f-main); font-size: 24px; opacity: 0; pointer-events: none; transition: opacity var(--anim); }
.search__input::placeholder { font-family: var(--f-names); font-size: 32px; color: var(--red); opacity: 1; }
.search__go { all: unset; position: absolute; right: 0; top: 0; width: 52px; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--red); opacity: 0; pointer-events: none; transition: opacity var(--anim); }
.search__go .ico { font-size: 24px; stroke-width: 2.6; }
.search.is-open { background: #FCD5D4; }
.search.is-open .search__open { opacity: 0; pointer-events: none; }
.search.is-open .search__input, .search.is-open .search__go { opacity: 1; pointer-events: auto; }

/* ===== Секции ===== */
.section { padding-block: 72px; }
.section--tinted { background: var(--bg-section); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 40px; }
.eyebrow { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--red); margin-bottom: 14px; }
.sec-head h2 { font-weight: normal; font-size: 48px; line-height: 1.1; text-transform: uppercase; color: var(--heading); }
.sec-head p { max-width: 340px; text-align: right; font-size: 14px; line-height: 1.5; color: var(--text); }

.more { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 36px; font-size: 24px; color: var(--red); }
.more .round-btn { width: 48px; height: 48px; font-size: 22px; }
.sec-line { border: 0; border-top: 1px solid var(--line); margin-top: 48px; }

/* сетка из трёх */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

/* ===== Карточка галереи ===== */
.art { display: block; }
.art__img { position: relative; aspect-ratio: 562 / 400; border-radius: 6px; overflow: hidden; }
.art__go { position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.art__title { margin-top: 18px; font-family: var(--f-names); font-weight: normal; font-size: 40px; line-height: 1.1; color: var(--red); }
.art__meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; font-size: 14px; color: var(--text-muted); }

/* ===== Карточка вселенной ===== */
.uni__img { position: relative; aspect-ratio: 562 / 640; border-radius: 6px; overflow: hidden; }
.uni__num { position: absolute; left: 14px; top: 14px; background: var(--bg); color: var(--red); font-size: 14px; padding: 4px 10px; border-radius: 3px; }
.uni__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; }
.uni__genre { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-top: 22px; }
.uni__title { font-family: var(--f-names); font-weight: normal; font-size: 40px; line-height: 1.1; color: var(--red); }
.uni__text { margin-top: 18px; font-size: 16px; line-height: 1.4; color: var(--text-gray); }
.uni .uni__row { margin-top: 6px; }

/* ===== Список персонажей ===== */
.chars { border-top: 1px solid var(--line); }
.char { display: grid; grid-template-columns: 24px 158px 1fr auto; align-items: start; gap: 0 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.char__num { align-self: center; font-size: 11px; color: var(--red); }
.char__ava { width: 158px; height: 183px; border-radius: 79px; overflow: hidden; }
.char__name { font-family: var(--f-names); font-weight: normal; font-size: 40px; line-height: 1.1; color: var(--red); }
.abbr { font-family: var(--f-main); font-size: .6em; letter-spacing: .02em; } /* 24px рядом с названием 40px; в заголовках другого размера масштабируется */
.char__sub { margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.char__side { align-self: center; display: flex; align-items: center; gap: 14px; }
.pill { background: var(--pink-pill); color: var(--red); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 4px 16px; border-radius: 20px; }
.chars-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; font-size: 14px; color: var(--text); }
.chars-foot .more { margin: 0; font-size: 24px; }

/* ===== Подвал ===== */
.site-footer { background: var(--footer); color: #F3D9D5; padding-top: 56px; }
.footer__top { display: grid; grid-template-columns: 1fr minmax(0, 400px) 1fr; gap: 40px; align-items: start; padding-bottom: 56px; }
.footer__logo { display: flex; align-items: center; gap: 10px; font-family: var(--f-logo); font-size: 28px; color: var(--bg); line-height: 1; }
.footer__logo .ico { font-size: 22px; stroke-width: 2.6; }
.footer__about { font-size: 16px; line-height: 1.5; text-align: center; }
.footer__links { justify-self: end; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; font-size: 14px; }
.footer__links a { display: inline-flex; gap: 6px; align-items: center; color: var(--bg); }
.footer__links a:last-child { color: #E8BDB8; }
.footer__bottom { border-top: 1px solid rgba(250,240,236,.14); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding-block: 24px; font-size: 11px; color: #E8BDB8; }
.footer__bottom > :last-child { justify-self: end; }
.footer__bottom > :nth-child(2) { text-align: center; }
.footer__bottom a { color: var(--bg); display: inline-flex; gap: 6px; align-items: center; }

/* ===== Адаптив ===== */
@media (max-width: 1400px) {
  :root { --gutter: 40px; }
  .logo__word { font-size: 72px; }
  .header-tools { right: 40px; top: 70px; }
  .hero__rose { font-size: 40px; left: 24px; }
  .art__title, .uni__title, .char__name { font-size: 32px; }
}
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  body { font-size: 20px; }
  .logo__word { font-size: 52px; }
  .logo__star { width: 28px; height: 28px; margin-top: 10px; }
  .header-tools { position: static; justify-content: center; margin-top: 16px; font-size: 16px; }
  .header-line { margin-top: 24px; }
  .hero h1 { font-size: 30px; }
  .nav { flex-wrap: wrap; gap: 14px 28px; font-size: 16px; }
  .hero__rose { display: none; }
  .sec-head { flex-direction: column; align-items: flex-start; }
  .sec-head h2 { font-size: 34px; }
  .sec-head p { text-align: left; max-width: none; }
  .grid3 { grid-template-columns: 1fr; }
  .char { grid-template-columns: 36px 100px 1fr; gap: 0 14px; }
  .char__ava { width: 100px; height: 120px; border-radius: 50px; }
  .char__side { grid-column: 3; margin-top: 8px; }
  .char__name { font-size: 26px; }
  .chars-foot { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer__top { grid-template-columns: 1fr; }
  .footer__links { justify-self: start; }
  .footer__bottom { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer__bottom > :last-child { justify-self: center; }
}

/* результаты поиска */
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; background: #FCD5D4; border-radius: 3px; padding: 8px; max-height: 420px; overflow-y: auto; text-align: left; animation: fade-in var(--anim) ease; }
.search-result { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 16px; border-radius: 3px; color: var(--red); transition: background var(--anim); }
.search-result:hover, .search-result:focus-visible { background: rgba(250,240,236,.85); outline: 0; }
.search-result__title { font-family: var(--f-names); font-size: 28px; line-height: 1.1; }
.search-result__type { grid-column: 2; grid-row: 1; align-self: center; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.search-result__meta { grid-column: 1 / 3; font-size: 11px; color: var(--text); }
.search-empty { padding: 14px 16px; font-size: 14px; color: var(--text-gray); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ===== Страница «Галерея» ===== */
.sec-head__right { display: flex; align-items: center; gap: 24px; }
.grid3--gallery { row-gap: 64px; }
.gallery-empty { margin-top: 24px; font-size: 16px; color: var(--text); text-align: center; }
.art__author { text-transform: lowercase; }

/* кнопка «Фильтры» → строка тегов → список тегов */
.filter-slot { position: relative; width: 171px; height: 43px; flex: none; }
.filter { position: absolute; right: 0; top: 0; width: 100%; z-index: 30; background: var(--red); color: var(--bg); border-radius: 6px; overflow: hidden; transition: width var(--anim) ease, background var(--anim); }
.filter__head { position: relative; height: 43px; transition: height var(--anim) ease; }
.filter__open { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; padding-bottom: 6px; cursor: pointer; font-family: var(--f-names); font-size: 28px; white-space: nowrap; transition: opacity var(--anim); }
.filter__open:hover { background: #A31414; }
.filter__open .ico { font-size: 22px; stroke-width: 2.2; position: relative; top: 3px; }
.filter__count { font-family: var(--f-main); font-size: 14px; background: var(--bg); color: var(--red); border-radius: 10px; padding: 1px 8px; }
.filter__bar { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; pointer-events: none; transition: opacity var(--anim); }
.filter__input { flex: 1; min-width: 0; height: 100%; padding: 0 22px 12px; border: 0; outline: 0; background: transparent; color: var(--red); font-family: var(--f-main); font-size: 24px; }
.filter__input::placeholder { font-family: var(--f-names); font-size: 32px; color: var(--red); opacity: 1; }
.filter__icon { width: 24px; height: 24px; margin-right: 20px; color: var(--red); stroke-width: 2.4; flex: none; }

.filter.is-bar { background: #FCD5D4; }
/* высота при открытии не меняется: 43px */
.filter.is-bar .filter__open { opacity: 0; pointer-events: none; }
.filter.is-bar .filter__bar { opacity: 1; pointer-events: auto; }

/* список тегов выезжает из-под строки; фон общий, поэтому шва нет */
.filter__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--anim) ease; color: var(--red); }
.filter.is-list .filter__panel { grid-template-rows: 1fr; }
.filter__tags { min-height: 0; overflow: hidden; }
.filter.is-list .filter__tags { overflow-y: auto; max-height: 70vh; }
.tag-group { border-top: 1px solid var(--red-soft); padding: 16px 20px 18px; }
.tag-group__title { display: inline-block; margin-bottom: 14px; padding: 6px 16px; border-radius: 3px; background: #FBEBE8; color: var(--red-soft); font-size: 20px; }
.tag-group__list { display: flex; flex-wrap: wrap; gap: 12px; }
.tag { all: unset; box-sizing: border-box; cursor: pointer; padding: 6px 14px; border-radius: 3px; background: #FBEBE8; color: var(--red); font-family: var(--f-names); font-size: 32px; line-height: 1.2; transition: background var(--anim), color var(--anim); }
.tag:hover { background: #FDF5F1; }
.tag.is-active { background: var(--red); color: var(--bg); }
.tag-more { all: unset; box-sizing: border-box; cursor: pointer; display: block; margin: 14px 0 0 auto; padding: 5px 18px; border-radius: 3px; background: var(--red); color: var(--bg); font-family: var(--f-names); font-size: 32px; transition: background var(--anim); }
.tag-more:hover { background: #A31414; }
.tag-none { padding: 18px 20px; font-size: 14px; }

/* «Страница 2 из 10» */
.pager-wrap { display: flex; justify-content: center; margin-top: 56px; }
.pager { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 16px; font-size: 24px; color: var(--red); }
.pager .round-btn { width: 48px; height: 48px; font-size: 22px; }
.pager:hover .round-btn { background: var(--red); color: var(--bg); }

@media (max-width: 900px) {
  .sec-head__right { flex-direction: column; align-items: flex-start; }
  .filter-slot { align-self: flex-end; }
  .grid3--gallery { row-gap: 40px; }
}


/* ===== Страница результатов поиска ===== */
.res-group { margin-top: 48px; }
.res-group:first-child { margin-top: 0; }
.res-group__title { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 6px 16px; border-radius: 3px; background: #FBEBE8; color: var(--red-soft); font-weight: normal; font-size: 24px; }
.res-group__count { font-size: 14px; color: var(--red); }
.res-list { border-top: 1px solid var(--line); }
.res-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.res-row__title { font-family: var(--f-names); font-weight: normal; font-size: 40px; line-height: 1.1; color: var(--red); }
.res-row__meta { margin-top: 6px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text); }
.res-row__text { margin-top: 12px; max-width: 900px; font-size: 16px; line-height: 1.5; color: var(--red-soft); }
.res-row mark { background: #FCD5D4; color: var(--red); padding: 0 2px; border-radius: 2px; }
.res-empty { font-size: 24px; color: var(--text-gray); }
@media (max-width: 900px) { .res-row__title { font-size: 28px; } }

.pager.is-done { cursor: default; }

/* ===== Страница «Персонажи»: список в две колонки ===== */
.chars--2col { display: grid; grid-template-columns: 1fr 1fr; }
.chars--2col .char { grid-template-columns: 24px 158px 1fr; padding: 22px 24px 22px 0; }
.chars--2col .char:nth-child(even) { border-left: 1px solid var(--line); padding: 22px 0 22px 24px; }
.chars--2col .char__info { grid-column: 3; grid-row: 1; }
.chars--2col .char__side { grid-column: 3; grid-row: 1; align-self: end; justify-self: end; }
.chars-note { margin-top: 40px; font-size: 14px; color: var(--text); }
@media (max-width: 900px) {
  .chars--2col { grid-template-columns: 1fr; }
  .chars--2col .char, .chars--2col .char:nth-child(even) { grid-template-columns: 36px 100px 1fr; padding: 22px 0; border-left: 0; }
}

/* ===== Страница персонажа ===== */
.char-hero { padding-bottom: 0; }
.char-hero .eyebrow { margin-bottom: 4px; }
.char-hero__name { font-family: var(--f-names); font-weight: normal; font-size: 96px; line-height: 1.05; color: var(--heading); }
.char-hero__tag { margin-top: 24px; font-size: 20px; color: var(--red-soft); }
.char-oval { width: min(650px, 100%); aspect-ratio: 650 / 880; margin: 40px auto 0; border-radius: 999px; overflow: hidden; }

/* блок «Статьи» */
#char-articles { margin-top: 64px; padding-block: 48px 56px; }
.articles-title { font-weight: normal; font-size: 36px; line-height: 1.1; color: var(--text); margin-bottom: 24px; }
.articles { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.article-card { display: block; background: var(--bg); border-radius: 4px; padding: 22px 26px 26px; transition: background var(--anim); }
.article-card:hover { background: #FDF5F1; }
.article-card__title { font-family: var(--f-names); font-weight: normal; font-size: 69px; line-height: 1.05; color: var(--red); }
.article-card__text { margin-top: 14px; font-size: 20px; line-height: 1.45; color: var(--red-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* содержание и текст — одинаковые размеры на страницах персонажа, вселенной и статьи */
.char-contents h2 { font-family: var(--f-names); font-weight: normal; font-size: 64px; line-height: 1.1; color: var(--red); margin-bottom: 20px; }
.toc { list-style: none; }
.char-contents > .toc { margin-left: 32px; }   /* содержимое «Содержания» сдвинуто вправо — читается как вложенное */
.toc__item { font-size: 20px; line-height: 1.55; color: #B06565; }
.toc > .toc__item { margin-bottom: 6px; }
.toc--sub { margin: 4px 0 0 28px; }
.toc__num { display: inline-block; min-width: 40px; }
.toc--sub .toc__num { min-width: 48px; }
.toc a { color: inherit; transition: color var(--anim); }
.toc a:hover { color: var(--red); }

.char-section { margin-top: 56px; scroll-margin-top: 24px; }
.char-h2 { font-family: var(--f-names); font-weight: normal; font-size: 64px; line-height: 1.1; color: var(--red); margin-bottom: 16px; }
.char-subsection { margin-top: 32px; scroll-margin-top: 24px; }
.char-h3 { font-family: var(--f-names); font-weight: normal; font-size: 48px; line-height: 1.1; color: var(--heading); margin-bottom: 14px; }
.char-sub { margin: 20px 0 8px 18px; font-size: 16px; color: var(--text); }
.char-p { font-size: 20px; line-height: 1.55; color: #B06565; }
.char-p + .char-p { margin-top: 0; }
.char-p a { text-decoration: underline; text-underline-offset: 3px; color: #B06565; transition: color var(--anim); }
.char-p a:hover { color: var(--red); }
.char-author { margin-top: 56px; text-align: right; display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; }
.char-author span { font-size: 20px; color: var(--text-muted); }
.char-author b { font-family: var(--f-names); font-weight: normal; font-size: 64px; color: var(--red); }

/* галерея персонажа — розовый блок */
.char-gallery { padding-top: 0; }
.gallery-box { background: var(--bg-section); border-radius: 6px; padding: 64px; }
.gallery-box .grid3--gallery { row-gap: 40px; }

/* ===== Страница изображения ===== */
.img-view { width: min(913px, 100%); aspect-ratio: 913 / 806; margin: 8px auto 0; border-radius: 4px; overflow: hidden; }
.img-info { margin-top: 36px; display: grid; gap: 24px; justify-items: center; text-align: center; }
.img-info__row { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 8px 22px; }
.img-info__label { font-size: 24px; color: #B87777; }
.img-info__value { font-family: var(--f-names); font-size: 96px; line-height: 1.05; color: var(--red); }
.img-info__link { transition: color var(--anim); }
.img-info__link:hover { color: var(--heading); }

@media (max-width: 1400px) {
  .char-hero__name, .img-info__value { font-size: 72px; }
  .article-card__title { font-size: 48px; }
}
@media (max-width: 900px) {
  .char-hero__name, .img-info__value { font-size: 44px; }
  .articles { grid-template-columns: 1fr; gap: 24px; }
  .article-card__title { font-size: 32px; }
  .char-contents h2, .char-h2 { font-size: 36px; }
  .char-h3 { font-size: 28px; }
  .char-author b { font-size: 40px; }
  .gallery-box { padding: 24px; }
}

.chars--2col .char--empty { min-height: 1px; padding: 0; }
.chars--2col .char--empty > * { display: none; }
.chars--2col .char--empty:nth-child(even) { padding-left: 24px; }

/* ===== Страница статьи ===== */
.article-text { margin-top: 40px; }
.more--left { justify-content: flex-start; margin-top: 56px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.article-tags .tag { font-size: 32px; cursor: default; }
.article-tags a.tag { cursor: pointer; }
.article-tags .tag:hover { background: #FDF5F1; }


/* ===== Страница вселенной ===== */
.uni-banner { width: 100%; aspect-ratio: 1312 / 420; margin-top: 32px; border-radius: 4px; overflow: hidden; }
.uni-chars { padding-top: 24px; }
@media (max-width: 900px) { .uni-banner { aspect-ratio: 16 / 9; } }

/* ===== Страница персонажа: имя между двумя линиями, форма картинки ===== */
#character .char-hero { padding-top: 0; }
.char-head { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0 14px; }
.char-head .eyebrow { color: #8A7070; margin-bottom: 4px; }
#character .char-hero__name { color: var(--red); }
#character .char-hero__tag { margin-top: 20px; }
#character .char-oval { margin-top: 56px; }
/* горизонтальная картинка: прямоугольник с небольшим скруглением; пропорции задаёт js/character.js */
.char-oval--rect { width: min(913px, 100%); aspect-ratio: 4 / 3; border-radius: 4px; }


/* ===== Единая шапка страниц: подпись и название между двумя линиями ===== */
#universe .char-hero, #article .char-hero { padding-top: 0; }
#universe .char-hero__name, #article .char-hero__name { color: var(--red); }
#universe .char-hero__tag { margin-top: 20px; }
#universe .uni-banner { margin-top: 40px; }
#article .article-tags { margin-top: 24px; }
#article .article-text { margin-top: 32px; }
/* страницы со списками (галерея, персонажи, поиск, изображение): те же линии вокруг заголовка секции */
.section--page { padding-top: 36px; }
.sec-head--page { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0 18px; }
.sec-head--page .eyebrow { color: #8A7070; margin-bottom: 4px; }

/* ===== Страница «Об авторе» ===== */
.about-intro { display: grid; grid-template-columns: 420px 1fr; gap: 64px; margin-top: 48px; align-items: start; }
.about-portrait { width: 100%; aspect-ratio: 3 / 4; border-radius: 999px; overflow: hidden; }
.about-portrait--rect { border-radius: 4px; aspect-ratio: 4 / 5; }
.about-lead { font-size: 24px; line-height: 1.4; color: var(--red-soft); margin-bottom: 20px; }
.about-text .char-p + .char-p { margin-top: 14px; }
.about-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.btn-link { display: inline-flex; align-items: center; gap: 8px; height: 43px; padding: 0 22px 5px; border-radius: 3px; background: var(--red); color: var(--bg); font-family: var(--f-names); font-size: 28px; transition: background var(--anim); }
.btn-link .ico { font-size: 22px; stroke-width: 2.4; position: relative; top: 2.5px; }
.btn-link:hover { background: #A31414; }

.about-stats-section { margin-top: 72px; padding-block: 56px; }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat__n { font-family: var(--f-names); font-size: 96px; line-height: 1; color: var(--red); }
.stat__label { margin-top: 8px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text); }

.coauthors { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.coauthor { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coauthor__name { font-family: var(--f-names); font-weight: normal; font-size: 40px; line-height: 1.1; color: var(--red); }
.coauthor__role { margin-top: 6px; font-size: 14px; color: var(--text); }
.coauthor:hover .round-btn { background: var(--red); color: var(--bg); }

@media (max-width: 900px) {
  .about-intro { grid-template-columns: 1fr; gap: 32px; }
  .about-portrait { max-width: 320px; margin-inline: auto; }
  .about-stats { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .stat__n { font-size: 56px; }
  .coauthors { grid-template-columns: 1fr; }
}

/* ===== Одинаковая шапка на всех страницах: рамка из двух линий одной высоты ===== */
.char-head, .sec-head--page { box-sizing: border-box; min-height: 160px; padding: 22px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.char-head { display: flex; flex-direction: column; justify-content: center; }
.sec-head--page { align-items: center; margin-bottom: 40px; }
/* подпись и название — один столбец шириной в название: подпись не может выйти за его текст (длинная обрезается «…») */
.char-head, .sec-head--page > div:first-child { display: grid; grid-template-columns: fit-content(100%); justify-content: start; align-content: center; }
.sec-head--page > div:first-child { display: grid; }
.char-head .eyebrow, .sec-head--page .eyebrow { contain: inline-size; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }

/* страница изображения: название — Lombardia, цвет акцента */
#image-title { font-family: var(--f-names); text-transform: none; font-size: 96px; line-height: 1.05; color: var(--red); }
@media (max-width: 1400px) { #image-title { font-size: 72px; } }
@media (max-width: 900px) { #image-title { font-size: 44px; } }

/* блок «Инструменты» на странице «Об авторе» */
.tools { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
.tool { display: grid; grid-template-columns: 56px 1fr; align-items: baseline; gap: 0 12px; padding: 22px 24px 22px 0; border-bottom: 1px solid var(--line); }
.tool:nth-child(even) { border-left: 1px solid var(--line); padding-left: 24px; }
.tool__num { font-size: 11px; color: var(--red); }
.tool__name { font-family: var(--f-names); font-weight: normal; font-size: 40px; line-height: 1.1; color: var(--red); }
.tool__use { margin-top: 6px; font-size: 14px; color: var(--text); }
@media (max-width: 900px) { .tools { grid-template-columns: 1fr; } .tool:nth-child(even) { border-left: 0; padding-left: 0; } }

/* ===== Страница «Соцсети» ===== */
.soc-author { padding: 40px 0 8px; }
.soc-author + .soc-author { border-top: 1px solid var(--line); margin-top: 32px; }
.soc-author__head { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.soc-author__name { font-family: var(--f-names); font-weight: normal; font-size: 64px; line-height: 1.05; color: var(--red); }
.soc-author__role { font-size: 14px; color: var(--text); }
.soc-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 var(--gap); align-items: start; }
.soc-col .tag-group__title { margin-bottom: 8px; }
.soc-list { list-style: none; border-top: 1px solid var(--line); }
.soc-item { border-bottom: 1px solid var(--line); }
.soc-item__link { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; }
.soc-item__platform { font-family: var(--f-names); font-size: 32px; line-height: 1.1; color: var(--red); }
.soc-item__handle { margin-top: 4px; font-size: 14px; color: var(--text); }
.soc-item__link:hover .round-btn { background: var(--red); color: var(--bg); }
@media (max-width: 900px) { .soc-cols { grid-template-columns: 1fr; gap: 24px; } .soc-author__name { font-size: 40px; } }

/* ===== Компактная шапка (размеры сняты с макета) и подпись шире названия ===== */
.char-head, .sec-head--page { min-height: 136px; padding: 14px 0 20px; }
.char-hero__name { line-height: 1; margin-top: -14px; }
.char-head .eyebrow, .sec-head--page .eyebrow { contain: none; overflow: visible; text-overflow: clip; white-space: normal; margin-bottom: 0; }
.sec-head--page h2 { line-height: 1; }
#image-title { line-height: 1; margin-top: -14px; }
@media (max-width: 900px) { .char-head, .sec-head--page { min-height: 0; } }

/* ===== Единый вид подписи (рубрики) над названием — как «об авторе» ===== */
.eyebrow { color: #8A7070; margin-bottom: 0; }
.sec-head h2 { line-height: 1; margin-top: 2px; }
.sec-head { margin-bottom: 52px; }
.char-head, .sec-head--page { min-height: 144px; padding: 17px 0 22px; }
.sec-head--page { margin-bottom: 52px; }
.sec-head--page h2 { margin-top: 2px; }
#image-title { margin-top: -14px; }

/* крупные заголовки — «сжатая» версия Lombardia, курсор у текста не рисуется */
:root { --f-names-tight: "Lombardia Tight", "Lombardia", serif; }
.char-hero__name, #image-title, .char-h2, .char-h3, .article-card__title, .soc-author__name, .char-author b, .stat__n, .img-info__value { font-family: var(--f-names-tight); }
html { caret-color: transparent; }
input, textarea { caret-color: var(--red); }

/* высота рамки шапки одна на всех страницах: содержимое по центру */
.char-head, .sec-head--page { min-height: 0; padding: 15px 0 14px; }

/* ===== Ссылки в подписях (рубриках) ===== */
.eyebrow a { color: inherit; transition: color var(--anim); }
.eyebrow a:hover { color: var(--red); }

/* ===== Главная: отступы между блоками, линия между «Вселенными» и «Персонажами» ===== */
#gallery { padding-block: 56px; }
#universes { padding-top: 56px; padding-bottom: 0; }
#universes .sec-line { margin-top: 56px; }
#characters { padding-top: 56px; padding-bottom: 56px; }
#home-articles { padding-block: 56px; }
#home-articles .more { margin-top: 36px; }

/* ===== Появление страницы при переходе (800 мс) ===== */
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
body { animation: page-in var(--anim) ease both; }


/* ===== Страница «Статьи» ===== */
#articles-page .articles { margin-top: 0; }
@media (max-width: 900px) { #home-articles .articles { grid-template-columns: 1fr; } }
.soc-author { scroll-margin-top: 24px; }

/* названия-ссылки */
.sec-head h2 a, .articles-title a { color: inherit; transition: color var(--anim); }
.sec-head h2 a:hover, .articles-title a:hover { color: var(--red); }

/* звёздочка в логотипе — по центру строчных букв ника (центр x-высоты); потом здесь будет логотип */
.logo__star { position: relative; top: -29px; }
.footer__logo .ico { position: relative; top: -6px; }

/* ===== Блоки текста: списки, цитаты, картинки, жирный и курсив ===== */
.char-p b, .char-list b, .char-quote b { font-weight: normal; text-shadow: 0 0 0 currentColor; letter-spacing: .01em; }
.char-p i, .char-list i, .char-quote i { font-style: italic; }
.char-list { margin: 12px 0 12px 8px; padding-left: 28px; font-size: 20px; line-height: 1.55; color: #B06565; }
.char-list li { margin: 2px 0; padding-left: 4px; }
.char-list li::marker { color: var(--red-soft); }
.char-list a, .char-quote a { text-decoration: underline; text-underline-offset: 3px; color: inherit; }
.char-quote { margin: 20px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--red-soft); font-size: 24px; line-height: 1.45; color: var(--red-soft); }
.char-figure { margin: 24px 0; }
.char-figure img { display: block; max-width: 100%; border-radius: 4px; }
.char-figure figcaption { margin-top: 8px; font-size: 14px; color: var(--text); }
.char-list { list-style: disc outside; }
ol.char-list { list-style: decimal outside; }


/* ===== «Персонажи»: список карточками на тёмно-кремовой подложке ===== */
.sec-head--noline { border-bottom: 0; }
.chars.chars--2col { border-top: 0; gap: 16px; }
.chars--2col .char, .chars--2col .char:nth-child(even) { padding: 22px 24px; border: 0; border-radius: 10px; background: var(--bg-section); }
.chars--2col .char--empty { display: none; }
@media (max-width: 900px) { .chars--2col .char, .chars--2col .char:nth-child(even) { padding: 16px; } }

/* ===== «Галерея» и «Статьи»: большой кремовый фрейм без линий, как на главной ===== */
.section--frame { padding-block: 56px; }
/* страницы с линией шапки: отступ от кнопки поиска до линии — как до края кремового фрейма на главной (36px) */
.section--page { padding-top: 0; }
.section--tinted.section--page { padding-top: 0; }

/* подпись и название на страницах с линией шапки — на том же уровне от кнопки поиска, что и на главной (линия остаётся выше) */
.section--page:not(.section--tinted):not(.section--head-tight) .sec-head--page { padding-top: 55px; }

/* ===== Линии шапки и разделители идут от края до края экрана ===== */
html { overflow-x: hidden; }
body { overflow-x: clip; }   /* линии шире экрана обрезаются — горизонтальной прокрутки нет */
.header-line, .sec-line { width: 100vw; max-width: none; position: relative; left: 50%; margin-left: -50vw; margin-right: 0; }
.char-head, .sec-head--page { position: relative; border-top: 0; border-bottom: 0; }
.char-head::before, .char-head::after, .sec-head--page::before, .sec-head--page::after { content: ""; position: absolute; left: 50%; width: 100vw; height: 1px; margin-left: -50vw; background: var(--line); }
.char-head::before, .sec-head--page::before { top: 0; }
.char-head::after, .sec-head--page::after { bottom: 0; }
.sec-head--noline::after { display: none; }
.footer__bottom { position: relative; border-top: 0; }
.footer__bottom::before { content: ""; position: absolute; top: 0; left: 50%; width: 100vw; margin-left: -50vw; height: 1px; background: rgba(250,240,236,.14); }
#about .char-hero { padding-top: 0; }

/* ===== Страница изображения: тёмно-кремовая подложка только вокруг картинки ===== */
.img-card { width: min(961px, 100%); margin: 8px auto 0; padding: 24px; background: var(--bg-section); border-radius: 10px; }
.img-card .img-view { width: 100%; margin: 0; }
@media (max-width: 900px) { .img-card { padding: 12px; } }

/* ===== Страница изображения: листание зонами у краёв экрана ===== */
/* зоны нажатия — полосы у левого и правого края экрана (на высоте картинки), могут лечь поверх широкой картинки;
   стрелка в кружке появляется только при наведении на зону */
.img-stage { position: relative; width: min(961px, 100%); margin: 8px auto 0; }
.img-stage .img-card { width: 100%; margin: 0; }
.img-nav { position: absolute; top: 0; bottom: 0; width: clamp(80px, 12vw, 200px); z-index: 5; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.img-nav[hidden] { display: none; }
.img-nav--prev { left: calc(50% - 50vw); }
.img-nav--next { right: calc(50% - 50vw); }
.img-nav .round-btn { width: 56px; height: 56px; background: var(--bg); font-size: 24px; opacity: 0; transition: opacity var(--anim), background var(--anim), color var(--anim); pointer-events: none; }
.img-nav:hover .round-btn, .img-nav:focus-visible .round-btn { opacity: 1; }
.img-nav:hover .round-btn { background: var(--red); color: var(--bg); }
.img-nav--prev .ico { transform: scaleX(-1); }
/* сенсорные экраны: наведения нет — кнопки видны чуть приглушённо, нажимать можно и по краю экрана */
@media (hover: none) { .img-nav .round-btn { opacity: .8; width: 44px; height: 44px; font-size: 20px; } }

/* ===== Карточки вселенных и персонажей кликабельны целиком («растянутая» ссылка) ===== */
.uni, .char { position: relative; }
.uni > a:first-child::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.char .round-btn::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.uni:hover .round-btn { background: var(--red); color: var(--bg); }

/* ===== Список персонажей (главная, страница вселенной): широкие карточки на тёмно-кремовой подложке вместо линий ===== */
.chars:not(.chars--2col) { border-top: 0; display: grid; gap: 16px; }
.chars:not(.chars--2col) .char { padding: 22px 24px; border: 0; border-radius: 10px; background: var(--bg-section); }
@media (max-width: 900px) { .chars:not(.chars--2col) .char { padding: 16px; } }

/* список персонажей на главной и странице вселенной — карточки-контуры (без заливки) */
.chars:not(.chars--2col) .char { background: transparent; border: 1px solid var(--line); transition: border-color var(--anim); }
.chars:not(.chars--2col) .char:hover { border-color: var(--red-soft); }

/* страница «Персонажи» (две колонки): карточки-контуры, как на главной */
.chars--2col .char, .chars--2col .char:nth-child(even) { background: transparent; border: 1px solid var(--line); transition: border-color var(--anim); }
.chars--2col .char:hover { border-color: var(--red-soft); }

/* ссылка на оригинал изображения */
.img-original-wrap { text-align: center; margin: 28px 0 8px; }
.img-original { display: inline-block; font-family: var(--f-names); font-size: 28px; line-height: 1; padding: 10px 24px; border: 1px solid var(--red-soft); border-radius: 999px; color: var(--red); background: transparent; transition: background var(--anim), border-color var(--anim), color var(--anim); }
.img-original:hover { background: #FDF5F1; border-color: var(--red); }

/* сортировка списков (js/sort.js) */
.sort { position: relative; flex: none; height: 43px; z-index: 20; }
.sort__btn { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 10px; height: 43px; padding: 0 20px 6px; cursor: pointer; white-space: nowrap; font-family: var(--f-names); font-size: 28px; color: var(--red); border: 1px solid var(--red-soft); border-radius: 6px; transition: background var(--anim), border-color var(--anim), color var(--anim); }
.sort__btn:hover, .sort.is-open .sort__btn { background: #FDF5F1; border-color: var(--red); }
.sort.is-changed .sort__btn { border-color: var(--red); }
.sort__btn .ico { font-size: 18px; stroke-width: 2.2; position: relative; top: 3px; transition: transform var(--anim); }
.sort.is-open .sort__btn .ico { transform: rotate(180deg); }
.sort__menu { position: absolute; right: 0; top: 50px; min-width: 100%; margin: 0; padding: 6px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden; transition: opacity var(--anim), transform var(--anim), visibility 0s linear var(--anim); }
.sort.is-open .sort__menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.sort__menu button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 9px 14px; border-radius: 6px; cursor: pointer; white-space: nowrap; font-family: var(--f-main); font-size: 16px; color: var(--text-gray); transition: background var(--anim), color var(--anim); }
.sort__menu button:hover { background: var(--bg-section); }
.sort__menu button.is-on { color: var(--red); }
@media (max-width: 900px) { .sort { align-self: flex-start; } }
