/* Шрифты семейства Vermishyan (SIL Open Font License; Тепло — лицензия И. Рудермана; см. app/fonts/licenses).
   Генерируется tools/build_fonts.py — не редактировать. */
@font-face { font-family: 'V Bambuk'; src: url('/fonts/bambuk.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Belka'; src: url('/fonts/belka.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Prostor'; src: url('/fonts/prostor.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Setka'; src: url('/fonts/setka.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Standart Wide'; src: url('/fonts/standart-wide.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Standart Narrow'; src: url('/fonts/standart-narrow.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Vagon'; src: url('/fonts/vagon.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Vagon Narrow'; src: url('/fonts/vagon-narrow.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Dom'; src: url('/fonts/dom.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Glina Narrow'; src: url('/fonts/glina-narrow.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Glina Wide'; src: url('/fonts/glina-wide.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Gora'; src: url('/fonts/gora.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Gorizont'; src: url('/fonts/gorizont.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Harvard'; src: url('/fonts/harvard.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Harvard Italic'; src: url('/fonts/harvard-italic.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Hleb Wide'; src: url('/fonts/hleb-wide.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Hleb Narrow'; src: url('/fonts/hleb-narrow.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Modul'; src: url('/fonts/modul.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Osnova'; src: url('/fonts/osnova.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Osnova Narrow'; src: url('/fonts/osnova-narrow.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Sreda'; src: url('/fonts/sreda.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Struna'; src: url('/fonts/struna.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Teplo Sans'; src: url('/fonts/teplo-sans.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Teplo Serif'; src: url('/fonts/teplo-serif.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Teplo Serif Italic'; src: url('/fonts/teplo-serif-italic.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'V Teplo Slab'; src: url('/fonts/teplo-slab.woff2') format('woff2'); font-display: swap; }

/* Вариант 4 — как вариант 3, но кнопка «Придумать» стоит рядом с полем ввода,
   а не внутри него (классическая форма поиска). */
:root {
  --page: #ebe5d8;
  --ink: #141311;
  --ink-soft: #6b6458;
  --line: #d6ccb9;
  --hero-bg: #141311;
  --hero-fg: #efe8da;
  --hero-soft: #8f877a;
  --hero-accent: #e9462c;
  --go: #e9462c;
  --go-hover: #ee6248;
  --go-ink: #1a0d05;
  --field: #f4efe4;
  --focus: #b57d10;

  --f-display: 'V Struna', 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  --f-italic: 'V Harvard Italic', 'Cormorant Garamond', Georgia, serif;
  --f-body: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(14px, 2.4vw, 28px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0e0d0b; --ink: #efe8da; --ink-soft: #9a917f; --line: #2c2822;
    --hero-bg: #ece5d6; --hero-fg: #141311; --hero-soft: #6b6458; --hero-accent: #e9462c; --field: #fbf8f1; --focus: #e9462c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0e0d0b; --ink: #efe8da; --ink-soft: #9a917f; --line: #2c2822;
  --hero-bg: #ece5d6; --hero-fg: #141311; --hero-soft: #6b6458; --hero-accent: #e9462c; --field: #fbf8f1; --focus: #e9462c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font: 500 17px/1.5 var(--f-body); padding-inline: var(--gutter); padding-block: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.page { max-width: 1440px; margin-inline: auto; }

/* ───── шапка сайта ───── */
.site-header {
  max-width: 1440px; margin-inline: auto; height: clamp(68px, 6vw, 84px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { color: var(--ink); text-decoration: none; font: 800 clamp(19px, 1.6vw, 22px)/1 var(--f-display); letter-spacing: -0.025em; display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--page); display: grid; place-items: center; font-size: 17px; }
/* ссылки — как у Иронова: крупный лёгкий гротеск, без подчёркивания, акцент линией при наведении */
.site-nav { display: flex; gap: clamp(18px, 2.4vw, 34px); font: 500 clamp(18px, 1.6vw, 22px)/1.3 var(--f-body); }
.site-nav a { color: var(--ink); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; transition: border-color .15s ease; }
.site-nav a:hover { border-bottom-color: var(--go); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ───── чёрная плашка: заголовок и форма помещаются на первом экране ───── */
.hero {
  background: var(--hero-bg); color: var(--hero-fg);
  border-radius: clamp(24px, 3vw, 40px);
  padding: clamp(30px, 4.4vw, 64px) clamp(22px, 5vw, 76px) clamp(28px, 3.6vw, 52px);
}
.hero-title {
  margin: 0;
  font: 800 clamp(38px, 5.8vw, 92px)/0.92 var(--f-display);
  letter-spacing: -0.045em; text-wrap: balance;
}
.nobr { white-space: nowrap; }
.ht-accent {
  font: 800 1.04em/1 var(--f-italic); font-style: normal; letter-spacing: -0.02em;
  color: var(--hero-accent); display: inline-block; transition: opacity .26s ease, transform .26s ease;
}
.ht-accent.out { opacity: 0; transform: translateY(0.12em); }

.search {
  margin-top: clamp(26px, 3.2vw, 44px); max-width: 1040px;
  display: flex; align-items: stretch; gap: 12px;
}
.field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px;
  background: var(--field); color: #141311; border-radius: 18px; padding: 0 8px 0 4px; height: 68px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hero-fg) 14%, transparent);
}
.field:focus-within { box-shadow: 0 0 0 2px var(--go); }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: #141311;
  font-size: clamp(18px, 1.8vw, 23px); padding: 0 16px; height: 100%; letter-spacing: -0.01em;
}
.search input::placeholder { color: #9a917f; }
.tune {
  position: relative; flex: none; width: 52px; height: 52px; border: 0; border-radius: 13px;
  background: transparent; color: #141311; display: grid; place-items: center;
}
.tune:hover, .tune[aria-expanded="true"] { background: #e6dfd0; }
.tune svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tune .dot { position: absolute; top: 11px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 2px var(--field); display: none; }
.tune.has-settings .dot { display: block; }
.go {
  flex: none; border: 0; border-radius: 18px; background: var(--go); color: var(--go-ink);
  font-weight: 800; font-size: 18px; letter-spacing: -0.01em; padding: 0 clamp(26px, 3vw, 42px); height: 68px; white-space: nowrap;
  transition: background .15s ease, transform .15s ease;
}
.go:hover { background: var(--go-hover); }
.go:active { transform: translateY(1px); }

.examples { margin-top: 20px; max-width: 1040px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; font: 500 clamp(17px, 1.45vw, 20px)/1.35 var(--f-body); color: var(--hero-soft); }
.examples button { border: 0; background: none; padding: 0 0 2px; font: inherit; color: var(--hero-fg); border-bottom: 2px solid color-mix(in srgb, var(--hero-fg) 18%, transparent); transition: border-color .15s ease; }
.examples button:hover { border-bottom-color: var(--go); }

.settings { margin-top: 18px; max-width: 1040px; border-top: 1px solid color-mix(in srgb, var(--hero-fg) 16%, transparent); padding-top: 22px; display: grid; gap: 14px; }
.set-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: baseline; }
.set-label { font: 500 16px/1.3 var(--f-body); color: var(--hero-soft); }
.set-label small { display: block; font-size: 14px; opacity: .8; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid color-mix(in srgb, var(--hero-fg) 22%, transparent); background: transparent; color: var(--hero-fg); border-radius: 999px; padding: 7px 15px; font-size: 15.5px; line-height: 1.3; }
.pill:hover { border-color: color-mix(in srgb, var(--hero-fg) 60%, transparent); }
.pill[aria-pressed="true"] { background: var(--hero-fg); color: var(--hero-bg); border-color: var(--hero-fg); }
/* сгруппированные настройки: три колонки по смыслу */
.settings.settings-grouped { margin-top: 24px; padding-top: 26px; gap: 18px; max-width: none; }
.set-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 3vw, 48px); }
.set-group { display: grid; gap: 18px; align-content: start; }
.set-group-title { margin: 0; font: 800 clamp(17px, 1.4vw, 19px)/1.1 var(--f-display); letter-spacing: -0.02em; color: var(--hero-fg); }
.set-item { display: grid; gap: 8px; }
.set-item .set-label:empty { display: none; }
.settings-grouped .set-label { font: 500 15px/1.3 var(--f-body); color: var(--hero-soft); }
.settings-grouped .set-label small { display: inline; font-size: 14px; opacity: .75; }
.settings-grouped .pills { gap: 6px; }
.settings-grouped .pill { padding: 6px 13px; font-size: 15px; }
.settings-grouped .set-foot { justify-content: flex-start; }
@media (max-width: 900px) { .set-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .set-groups { grid-template-columns: 1fr; } }
.set-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font: 500 15px/1.4 var(--f-body); color: var(--hero-soft); }
.linkish { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 4px; font: inherit; }
.settings .linkish { color: var(--hero-fg); }

/* ───── вкладки и заголовок подборки ───── */
.bar { margin-block: clamp(28px, 3.4vw, 44px) 14px; display: flex; justify-content: flex-start; scroll-margin-top: 20px; }
.tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 8%, var(--page)); }
.tab {
  border: 0; background: transparent; border-radius: 12px; padding: 11px 20px;
  font: 800 clamp(16px, 1.3vw, 18px)/1 var(--f-display); letter-spacing: -0.02em; color: var(--ink);
  transition: background .15s ease, color .15s ease;
}
.tab:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--page); }
.tab .count { margin-left: 6px; font-variant-numeric: tabular-nums; opacity: .5; font-weight: 700; }
.batch { margin-top: 8px; }
.batch + .batch { margin-top: 48px; }
.batch-head { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-block: 0 18px; }
.batch-head h2 { margin: 0; font: 800 clamp(26px, 2.8vw, 40px)/1 var(--f-display); letter-spacing: -0.035em; }
.batch-head p { margin: 0; color: var(--ink-soft); font: 500 clamp(17px, 1.45vw, 20px)/1.3 var(--f-body); }

/* ───── постеры ───── */
.posters {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(200px, 17vw, 270px); gap: clamp(10px, 1.1vw, 16px);
}
.span-wide { grid-column: span 2; }
.span-tall { grid-row: span 2; }
@media (max-width: 1020px) { .posters { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: clamp(200px, 24vw, 260px); grid-auto-flow: dense; } }
@media (max-width: 700px) { .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(180px, 42vw, 240px); grid-auto-flow: dense; } }
@media (max-width: 440px) { .posters { grid-template-columns: 1fr; grid-auto-rows: 210px; } .span-wide { grid-column: auto; } }

.poster {
  position: relative; overflow: hidden; container-type: size;
  border-radius: clamp(18px, 1.8vw, 26px);
  background: var(--bg); color: var(--fg);
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}
.posters .poster:nth-child(3n+2) { animation-delay: .04s; }
.posters .poster:nth-child(3n) { animation-delay: .08s; }
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .poster { animation: none; } .ht-accent { transition: none; } }

/* тонкое зерно — объединяет коллекцию, как печать на бумаге */
.poster::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.p-body {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
  padding: max(7cqw, 44px) 8.5cqw 7.5cqw;
}
.p-title { margin: 0; font-weight: inherit; font-size: inherit; }
.pn {
  margin: 0; font-family: var(--font); font-weight: var(--fw); font-style: var(--fst); letter-spacing: var(--ls);
  font-size: calc(var(--fs) * 1cqw); line-height: 1.02; text-wrap: balance; overflow-wrap: normal; word-break: keep-all; hyphens: none;
}
.pn-tail {
  margin: 0; font-family: var(--tail-font); font-weight: var(--tail-fw); font-style: var(--tail-fst);
  font-size: calc(var(--fs2) * 1cqw); line-height: 1.12; max-width: 86%; text-wrap: balance; opacity: .92;
}
.psub { margin: 10px 0 0; font: 500 15px/1.35 var(--f-body); opacity: .72; max-width: 92%; text-wrap: pretty; }

/* композиции */
.comp-hero .pn { line-height: .94; letter-spacing: calc(var(--ls) - 0.01em); }
.comp-low .p-body { justify-content: flex-end; }
.comp-center .p-body, .is-center .p-body { justify-content: center; align-items: center; text-align: center; padding-top: 7cqw; }
.comp-center .pn-tail, .is-center .pn-tail { margin-inline: auto; }
.comp-stack .pn { text-transform: uppercase; line-height: .9; letter-spacing: 0; display: flex; flex-direction: column; }
.comp-stack .p-body { justify-content: flex-end; }
.comp-stack.is-center .p-body { justify-content: center; }
.comp-number .p-body, .comp-split .p-body { justify-content: space-between; }
.comp-number .pn-head { line-height: .8; letter-spacing: -0.06em; }
.comp-split .pn-head { line-height: .98; }

/* фоны */
.bg-tone { background:
  radial-gradient(120% 95% at 88% 0%, color-mix(in srgb, var(--ac) 52%, var(--bg)) 0%, transparent 62%),
  radial-gradient(110% 90% at 0% 100%, color-mix(in srgb, #000 16%, var(--bg)) 0%, transparent 66%),
  var(--bg); }
.p-photo { position: absolute; inset: -3%; z-index: 0; background-size: cover; background-position: center;
  filter: grayscale(1) contrast(1.15) brightness(1.08) blur(1.2px); mix-blend-mode: multiply; opacity: .9; }
.bg-photo::after { content: ''; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, #000 30%, transparent)); }
.bg-photo .pn, .bg-photo .pn-tail { text-shadow: 0 1px 16px color-mix(in srgb, #000 35%, transparent); }
.p-circle { position: absolute; z-index: 0; width: 92cqh; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--ac) 45%, var(--bg)); right: -22cqh; bottom: -34cqh; }
.comp-low .p-circle, [data-tilt="1"] .p-circle { bottom: auto; top: -36cqh; }
[data-tilt="2"] .p-circle { right: -30cqh; }
.bg-framed::after { content: ''; position: absolute; inset: 12px; z-index: 1; border: 1.5px solid color-mix(in srgb, var(--fg) 45%, transparent); border-radius: clamp(10px, 1.2vw, 16px); pointer-events: none; }

/* действия: маленькие, в углу, вторичные */
.p-acts { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 0; opacity: .42; transition: opacity .18s ease; }
.poster:hover .p-acts, .poster:focus-within .p-acts { opacity: 1; }
@media (hover: none) { .p-acts { opacity: .6; } }
.p-act { width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--fg); display: grid; place-items: center; }
.p-act:hover { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.p-act svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.p-act.on svg { fill: currentColor; }
.p-act.spin svg { animation: spin .5s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

.more-row { display: flex; margin-block: clamp(12px, 1.1vw, 16px) 0; }
/* как у Иронова: широкая приглушённая плашка во всю сетку, при наведении — ярко-оранжевая */
.more {
  width: 100%; border: 0; border-radius: clamp(18px, 1.8vw, 26px);
  background: color-mix(in srgb, var(--ink) 8%, var(--page)); color: var(--ink);
  font: 800 clamp(22px, 2.3vw, 34px)/1 var(--f-display); letter-spacing: -0.03em;
  height: clamp(84px, 7.6vw, 112px);
  transition: background .2s ease, color .2s ease;
}
.more:hover, .more:focus-visible { background: var(--go); color: var(--go-ink); }
.more:active { background: var(--go-hover); }
.note { font: 500 clamp(17px, 1.45vw, 20px)/1.4 var(--f-body); color: var(--ink-soft); }
.empty { border-radius: 22px; padding: clamp(36px, 4vw, 56px) 24px; text-align: center; background: color-mix(in srgb, var(--ink) 5%, var(--page)); color: var(--ink-soft); font: 500 clamp(17px, 1.45vw, 20px)/1.45 var(--f-body); text-wrap: balance; }

/* история */
.hist { display: grid; gap: 0; }
.hist-item { border-top: 1px solid var(--line); padding: 22px 0; display: grid; gap: 8px; }
.hist-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.hist-top b { font: 800 clamp(22px, 2vw, 28px)/1.15 var(--f-display); letter-spacing: -0.025em; }
.hist-top time { font: 500 clamp(16px, 1.3vw, 18px)/1.3 var(--f-body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hist-names { font: 500 clamp(17px, 1.45vw, 20px)/1.45 var(--f-body); color: var(--ink-soft); text-wrap: pretty; }
.hist-actions { margin-top: 4px; }
.hist-actions .linkish, .note .linkish { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--line); padding-bottom: 1px; font: 500 clamp(17px, 1.45vw, 20px)/1.3 var(--f-body); transition: border-color .15s ease; }
.hist-actions .linkish:hover, .note .linkish:hover { border-bottom-color: var(--go); }

/* подвал: только автор, сайт и год */
.site-footer {
  max-width: 1440px; margin: clamp(56px, 7vw, 96px) auto 0; padding-block: 22px 28px;
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font: 500 clamp(17px, 1.45vw, 20px)/1.4 var(--f-body); color: var(--ink-soft);
}
.site-footer a { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--line); padding-bottom: 1px; transition: border-color .15s ease; }
.site-footer a:hover { border-bottom-color: var(--go); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 10px 18px; border-radius: 12px; font: 500 16px/1.3 var(--f-body); z-index: 10; }

@media (max-width: 640px) {
  .search { flex-direction: column; gap: 10px; }
  .go { width: 100%; }
  .set-row { grid-template-columns: 1fr; gap: 6px; }
  .site-nav { gap: 16px; font-size: 17px; }
  .bar { justify-content: flex-start; }
  .nobr { white-space: normal; }
}
