/* Веб-каталог образов. Направление: тихая «фотобумага» — цвет несут сами фото, интерфейс спокойный.
   Тёплая нейтральная шкала, один акцент (тёмная сиена) только для ссылок и фокуса, заголовки с засечками, мелкие цифры как номера кадров.
   Выкладка: немного крупных осмысленных групп (П. Браун, «Эстетический интеллект»); все карточки тем одного размера и на одной линии. */
:root {
  --bg: #f7f4ee; --card: #fdfbf7; --raised: #efe9df;
  --ink: #1f1b16; --ink-2: #5e554a; --muted: #6f665a;
  --line: rgba(31, 27, 22, .1); --accent: #8a4b1f;
  --r-ctl: 10px; --r-card: 16px; --r-panel: 20px; --maxw: 1200px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --serif: 'Source Serif 4', 'Georgia', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* шапка */
.top { position: sticky; top: 0; z-index: 20; background: rgba(247, 244, 238, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { text-decoration: none; font-weight: 600; font-size: 18px; display: flex; align-items: baseline; gap: 12px; }
.brand span { font-weight: 400; font-size: 14px; color: var(--muted); }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); border-radius: var(--r-ctl); padding: 0 20px; height: 40px; font: 500 14px/1 var(--sans); text-decoration: none; cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease); }
.btn:active { transform: scale(.98); }
.btn-dark { background: var(--ink); color: var(--card); }
.btn-dark:hover { background: #3a332b; border-color: #3a332b; }
.btn-ghost { border-color: var(--line); background: var(--card); }
.btn-ghost:hover { background: var(--raised); }
.btn-lg { height: 48px; font-size: 15px; width: 100%; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* заголовки */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
.hero { padding-top: 72px; padding-bottom: 24px; }
h1 { margin-bottom: 20px; font-size: clamp(36px, 5.6vw, 64px); line-height: 1.06; letter-spacing: -.025em; font-weight: 400; }
.lead { margin: 0; max-width: 36rem; font-size: 18px; line-height: 28px; color: var(--ink-2); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 48px 0 24px; }
h2 { margin-bottom: 8px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; letter-spacing: -.02em; }
.sub { margin: 0; color: var(--ink-2); }
.all-link { font-size: 14px; font-weight: 500; color: var(--accent); text-decoration: none; white-space: nowrap; }
.all-link::after { content: ' →'; }
.all-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* карточки тем: одна обложка одного размера, заголовки на одной линии */
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 32px 24px; align-items: start; }
.coll { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 0; width: 100%; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.cover { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-card); overflow: hidden; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font: 400 22px/1.2 var(--serif); color: var(--muted); }
.coll-t { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; font-size: 18px; font-weight: 500; line-height: 24px; }
.coll-n { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.coll:hover .coll-n { text-decoration-line: underline; }
.count { font: 400 12px/16px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.coll-d { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--ink-2); }

/* панель поиска и тем */
.bar { position: sticky; top: 64px; z-index: 10; display: flex; gap: 12px; align-items: center; padding: 16px 0; margin-top: 56px; background: linear-gradient(var(--bg) 88%, rgba(247, 244, 238, 0)); }
.search { position: relative; flex: 0 0 min(320px, 100%); color: var(--muted); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
.search input { width: 100%; height: 40px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--card); padding: 0 14px 0 42px; font: inherit; font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--card); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; transition: background-color .15s var(--ease), color .15s var(--ease); }
.chip:hover { background: var(--raised); }
.chip small { font: 400 12px var(--mono); color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
.chip[aria-selected="true"] small { color: #cfc8bd; }
.sort select { height: 40px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--card); padding: 0 12px; font: 500 14px var(--sans); }

/* полки по темам */
.shelf { margin: 40px 0 8px; }
.shelf-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.shelf-h h3 { font-size: 28px; line-height: 1.15; letter-spacing: -.015em; }
.shelf-h p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.shelf-h button { border: 0; background: none; font: 500 14px var(--sans); color: var(--accent); cursor: pointer; white-space: nowrap; }
.shelf-h button:hover { text-decoration: underline; text-underline-offset: 3px; }
.shelf-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.shelf-row .card { flex: 0 0 200px; scroll-snap-align: start; }
.more-tile { flex: 0 0 200px; aspect-ratio: 3/4; border-radius: var(--r-card); border: 1px dashed rgba(31, 27, 22, .24); display: grid; place-items: center; text-align: center; padding: 16px; font: 500 14px/1.4 var(--sans); color: var(--accent); background: transparent; cursor: pointer; transition: background-color .15s var(--ease); }
.more-tile:hover { background: var(--raised); }

/* карточки образов: все 3:4 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 24px 16px; }
.card { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.thumb { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-card); overflow: hidden; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; font: 400 18px/1.25 var(--serif); color: var(--muted); }
.thumb .go { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 10px 12px; border-radius: var(--r-ctl); background: rgba(253, 251, 247, .96); text-align: center; font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(6px); transition: opacity .18s var(--ease), transform .18s var(--ease); }
.card:hover .go, .card:focus-visible .go { opacity: 1; transform: none; }
.card-t { margin: 10px 2px 0; font-weight: 500; font-size: 14px; line-height: 20px; }
.grid-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 32px 0 24px; }
.grid-head h3 { font-size: 32px; line-height: 1.15; letter-spacing: -.015em; }
.grid-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.more { display: flex; margin: 40px auto 0; }
.more-coll { display: flex; margin: 32px auto 0; }
.state { text-align: center; padding: 72px 0; color: var(--ink-2); }
.state b { display: block; color: var(--ink); font: 400 24px/1.2 var(--serif); margin-bottom: 8px; }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 80px; padding-top: 32px; padding-bottom: 64px; border-top: 1px solid var(--line); color: var(--ink-2); }
.foot p { margin: 0; max-width: 36rem; font-size: 14px; line-height: 20px; }

/* просмотр образа */
.viewer[hidden] { display: none; }
.viewer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.v-back { position: absolute; inset: 0; background: rgba(31, 27, 22, .6); backdrop-filter: blur(4px); }
.v-card { position: relative; width: min(980px, 100%); max-height: 92vh; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); border-radius: var(--r-panel); box-shadow: 0 8px 24px rgba(0, 0, 0, .12), 0 32px 80px rgba(0, 0, 0, .28); }
.v-img { background: var(--raised); min-height: 420px; display: grid; place-items: center; }
.v-img img { width: 100%; height: 100%; max-height: 92vh; object-fit: contain; }
.v-info { padding: 32px 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.v-info h3 { font-size: 32px; line-height: 1.12; letter-spacing: -.015em; }
.pill { align-self: flex-start; font-size: 13px; font-weight: 500; color: var(--accent); }
.steps { margin: 0 0 4px; padding-left: 20px; color: var(--ink-2); display: grid; gap: 4px; font-size: 14px; line-height: 20px; }
.v-x, .v-nav { position: absolute; z-index: 3; border: 0; border-radius: 50%; background: rgba(253, 251, 247, .94); cursor: pointer; line-height: 1; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); transition: background-color .15s var(--ease); }
.v-x:hover, .v-nav:hover { background: #fff; }
.v-x { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 24px; }
.v-nav { top: 50%; width: 40px; height: 40px; font-size: 26px; transform: translateY(-50%); }
.v-prev { left: 12px; } .v-next { left: calc(50% - 52px); }
.similar { margin-top: 8px; }
.similar h4 { margin: 0 0 12px; font: 500 13px/16px var(--sans); color: var(--muted); }
.similar-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.similar-row button { flex: 0 0 80px; border: 0; padding: 0; background: none; cursor: pointer; }
.similar-row img, .similar-row .ph { width: 80px; height: 104px; object-fit: cover; border-radius: 8px; background: var(--raised); }
.similar-row .ph { display: grid; place-items: center; font-size: 11px; font-weight: 500; color: var(--muted); padding: 4px; text-align: center; }
body.lock { overflow: hidden; }

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .brand span { display: none; }
  .hero { padding-top: 40px; }
  .coll-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .coll-t { font-size: 16px; margin-top: 10px; }
  .bar { flex-wrap: wrap; top: 64px; margin-top: 40px; }
  .search { flex: 1 1 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .shelf-row .card, .more-tile { flex-basis: 156px; }
  .v-card { grid-template-columns: 1fr; max-height: 94vh; }
  .v-img { min-height: 0; max-height: 52vh; }
  .v-img img { max-height: 52vh; }
  .v-next { left: auto; right: 12px; }
  .v-info { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
