/* Видовые: собрание ранней хроники. Только системные шрифты, без внешних запросов. */

:root {
  --paper: #f1f1ed;
  --paper-2: #e6e7e2;
  --ink: #17191b;
  --ink-2: #4b4f53;
  --ink-3: #6b6f72;
  --rule: #cdcfc9;
  --accent: #1d4ccc;
  --accent-ink: #f4f6ff;
  --screen: #101112;
  --screen-ink: #e9e8e3;
  --screen-ink-2: #a7a9aa;

  --serif: "Iowan Old Style", "Charter", "Sitka Text", "Sitka Small", Cambria, "PT Serif", "Noto Serif", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Noto Sans", "Helvetica Neue", sans-serif;
  --mono: "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1320px;
  --gut: clamp(16px, 3.2vw, 44px);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121314;
    --paper-2: #1b1d1f;
    --ink: #e8e7e2;
    --ink-2: #b0b2b2;
    --ink-3: #8c8f90;
    --rule: #2f3235;
    --accent: #8fa8ff;
    --accent-ink: #0d1330;
    --screen: #08090a;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
.fresh > *, .grid > *, .strip > *, .hero .wrap > *, .film .wrap > *, .year > * { min-width: 0; }
img { height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 8px 12px;
}
.skip:focus { left: 8px; z-index: 20; }

/* ---------- Шапка ---------- */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; min-height: 64px; padding-top: 14px; padding-bottom: 12px;
}
.brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.brand b {
  font: 700 26px/1 var(--serif);
  letter-spacing: -0.01em;
}
.brand span { font-size: 13.5px; color: var(--ink-3); }
.brand:hover b { color: var(--accent); }
.nav { display: flex; gap: 4px 22px; flex-wrap: wrap; font-size: 15px; }
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 1.5px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* ---------- Типографика ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.012em; margin: 0; }
h1 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.04; }
h2 { font-size: clamp(25px, 2.5vw, 33px); line-height: 1.15; }
h3 { font-size: 21px; line-height: 1.22; }
p { margin: 0 0 0.9em; }
.lead { font-size: clamp(18px, 1.5vw, 20px); color: var(--ink-2); max-width: 40ch; }
.prose { max-width: 66ch; }
.prose p, .prose li { font-family: var(--serif); font-size: 19px; line-height: 1.62; }
.prose h2 { margin: 1.6em 0 0.5em; }
.prose ul { padding-left: 1.1em; }
.num { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; font: 500 16px/1.2 var(--sans);
  background: var(--ink); color: var(--paper); text-decoration: none;
  border: 1px solid var(--ink);
  transition: background-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Главная ---------- */
.hero { padding: clamp(28px, 4vw, 56px) 0 clamp(40px, 5vw, 72px); }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: clamp(24px, 3.4vw, 56px); align-items: end;
}
.hero h1 { margin-bottom: 22px; max-width: 15ch; font-size: clamp(34px, 3.9vw, 54px); }
.hero .lead { margin-bottom: 28px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero figure { margin: 0; }
.hero figure > a { display: block; background: var(--screen); }
.hero figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
figcaption { font-size: 14px; color: var(--ink-3); margin-top: 10px; }
figcaption a { color: var(--ink-2); }

.band { padding: clamp(44px, 6vw, 88px) 0; border-top: 1px solid var(--rule); }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.band-head a { font-size: 15px; white-space: nowrap; }

.fresh {
  display: grid; gap: 28px clamp(18px, 2vw, 28px);
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.fresh > :first-child { grid-column: span 3; grid-row: span 2; }
.fresh > :nth-child(n + 2) { grid-column: span 3; }
@media (min-width: 1000px) {
  .fresh > :nth-child(n + 2) { grid-column: span 3; }
  .fresh { grid-template-columns: 7fr 4fr 4fr; }
  .fresh > :first-child { grid-column: 1; grid-row: 1 / span 2; }
  .fresh > :nth-child(n + 2) { grid-column: auto; }
}
.fresh > :first-child h3 { font-size: 27px; }

.card { display: block; text-decoration: none; }
.card .frame { background: var(--screen); overflow: hidden; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.6s var(--ease), opacity 0.3s; }
.card:hover img { transform: scale(1.025); }
.card:hover h3 { color: var(--accent); }
.card .meta { display: flex; gap: 12px; margin: 12px 0 6px; font-size: 14px; color: var(--ink-3); }
.card .meta .num { color: var(--ink-2); }
.card h3 { transition: color 0.2s; }
.card p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }

/* Лента кадров по годам на главной */
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 17%);
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 14px; scrollbar-width: thin;
}
.strip a { scroll-snap-align: start; text-decoration: none; }
.strip .y { font: 600 22px/1 var(--serif); display: block; margin-bottom: 8px; }
.strip img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--screen); }
.strip span.t { display: block; font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.35; }

.about-home { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.about-home h2 { margin: 0 0 18px; }
.facts { margin: 0; display: grid; gap: 18px; align-content: start; }
.facts div { border-top: 1px solid var(--rule); padding-top: 10px; }
.facts dt { font-size: 14px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font: 600 30px/1.1 var(--serif); }
.facts dd small { font: 400 15px/1.4 var(--sans); color: var(--ink-2); display: block; margin-top: 4px; }

/* ---------- Каталог ---------- */
.page-head { padding: clamp(28px, 4vw, 52px) 0 24px; }
.page-head p { margin-top: 14px; }

.filters {
  display: grid; gap: 12px 16px; align-items: end;
  grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)) auto;
  padding: 18px 0 20px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.filters label { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.filters input, .filters select {
  font: 16px/1.3 var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink-3); border-radius: 0; padding: 9px 10px; min-height: 42px; width: 100%;
}
.filters input::placeholder { color: var(--ink-3); }
.filters input:focus, .filters select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.filters button {
  font: 500 15px/1 var(--sans); background: none; border: 0; color: var(--accent);
  padding: 12px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em;
}
.count { font-size: 14px; color: var(--ink-3); margin: 14px 0 26px; min-height: 1.4em; }
.grid {
  display: grid; gap: 40px clamp(18px, 2vw, 30px);
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  padding-bottom: 80px;
}
.empty { padding: 40px 0 90px; max-width: 46ch; }
.empty h2 { margin-bottom: 10px; }
.js-only { display: none; }
.js .js-only { display: block; }

/* ---------- Страница фильма ---------- */
.screen { background: var(--screen); color: var(--screen-ink); padding: 26px 0 22px; }
.screen .wrap { max-width: 1180px; }
.screen video { width: 100%; height: auto; background: #000; aspect-ratio: var(--ar, 4 / 3); max-height: 78vh; margin: 0 auto; }
.player-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px;
  margin-top: 14px; font-size: 14.5px; color: var(--screen-ink-2);
}
.quality { display: flex; align-items: center; gap: 8px; }
.quality button {
  font: 500 14px/1 var(--mono); padding: 8px 11px; cursor: pointer;
  color: var(--screen-ink); background: transparent; border: 1px solid #3a3d40;
  transition: border-color 0.2s;
}
.quality button:hover { border-color: var(--screen-ink-2); }
.quality button[aria-pressed="true"] { background: var(--screen-ink); color: var(--screen); border-color: var(--screen-ink); }
.dl-main { color: var(--screen-ink); }
.dl-main:hover { color: #fff; }

.film { padding: clamp(30px, 4vw, 56px) 0 70px; }
.film .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 84px); }
.film h1 { font-size: clamp(32px, 3.8vw, 50px); }
.film .orig { font: italic 19px/1.4 var(--serif); color: var(--ink-2); margin: 10px 0 26px; }
.film .note p { font: 19px/1.62 var(--serif); }
.crumbs { font-size: 14px; color: var(--ink-3); margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); }

.card-data { margin: 0; font-size: 15.5px; }
.card-data div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); }
.card-data div:last-child { border-bottom: 1px solid var(--rule); }
.card-data dt { color: var(--ink-3); }
.card-data dd { margin: 0; overflow-wrap: anywhere; }

.files { margin: 28px 0 0; font-size: 15px; }
.files ul { margin: 0; padding: 0; list-style: none; }
.files h2 { font: 600 15px/1.3 var(--sans); margin-bottom: 8px; letter-spacing: 0; }
.files li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.files li + li { border-top: 1px dashed var(--rule); }

.frames { margin-top: 44px; }
.frames h2 { font: 600 15px/1.3 var(--sans); letter-spacing: 0; margin-bottom: 14px; color: var(--ink-2); }
.frames ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.frames ul.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.frames a { display: block; background: var(--screen); text-decoration: none; position: relative; }
.frames img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: opacity 0.2s; }
.frames a:hover img { opacity: 0.85; }
.frames .tc { display: block; font: 13px/1.2 var(--mono); color: var(--ink-3); margin-top: 6px; }

.source { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--ink); font-size: 15.5px; }
.source h2 { font: 600 15px/1.3 var(--sans); letter-spacing: 0; margin-bottom: 8px; }
.source p { margin-bottom: 0.6em; }

.nextprev { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; border-top: 1px solid var(--rule); padding: 22px 0 0; margin-top: 48px; font-size: 15px; }
.nextprev a { text-decoration: none; }
.nextprev a span { display: block; color: var(--ink-3); font-size: 13.5px; }
.nextprev a b { font: 600 18px/1.3 var(--serif); }
.nextprev a:last-child { text-align: right; }

/* ---------- Лента по годам ---------- */
.years { padding-bottom: 90px; }
.year { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 9fr); gap: clamp(18px, 3vw, 48px); padding: 28px 0; border-top: 1px solid var(--rule); }
.year h2 { font: 600 clamp(40px, 5vw, 68px)/0.95 var(--serif); letter-spacing: -0.03em; position: sticky; top: 16px; align-self: start; }
.year h2 small { display: block; font: 400 14px/1.4 var(--sans); letter-spacing: 0; color: var(--ink-3); margin-top: 10px; }
.year ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.year li a { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; text-decoration: none; align-items: start; }
.year li img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--screen); }
.year li b { font: 600 21px/1.25 var(--serif); display: block; }
.year li a:hover b { color: var(--accent); }
.year li span { display: block; font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.gap { padding: 10px 0 10px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 14.5px; }

/* ---------- Права ---------- */
.rights-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 10px 0 80px; }
.rights-table th, .rights-table td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); }
.rights-table th { font-weight: 600; font-size: 13.5px; color: var(--ink-3); border-bottom-color: var(--ink); }
.rights-table td:first-child { font-family: var(--serif); font-size: 17px; }
.table-scroll { overflow-x: auto; }

/* ---------- 404 ---------- */
.lost { padding: clamp(40px, 7vw, 110px) 0; }
.lost .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center; }
.lost h1 { margin-bottom: 18px; }
.lost img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: grayscale(1); }

/* ---------- Подвал ---------- */
.foot { border-top: 1px solid var(--rule); padding: 34px 0 44px; font-size: 14.5px; color: var(--ink-3); }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); gap: 28px; }
.foot b { color: var(--ink); font: 600 18px/1.2 var(--serif); display: block; margin-bottom: 6px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.foot a { color: var(--ink-2); }

/* ---------- Появление ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .rise { opacity: 0; transform: translateY(14px); animation: rise 0.8s var(--ease) forwards; }
  .js .rise:nth-child(2) { animation-delay: 0.08s; }
  .js .rise:nth-child(3) { animation-delay: 0.16s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Узкие экраны ---------- */
@media (max-width: 900px) {
  .hero .wrap, .about-home, .film .wrap, .lost .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero figure { order: -1; }
  .hero h1 { max-width: 16ch; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  .foot .wrap { grid-template-columns: 1fr 1fr; }
  .foot .wrap > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .top .wrap { flex-direction: column; gap: 8px; align-items: flex-start; }
  .brand span { display: none; }
  .nav { gap: 4px 18px; }
  .fresh { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px 14px; }
  .fresh > :first-child { grid-column: 1 / -1; grid-row: auto; }
  .fresh > :nth-child(n + 2) { grid-column: auto; }
  .fresh > :nth-child(n + 2) h3 { font-size: 17px; }
  .fresh > :nth-child(n + 2) .meta span:nth-child(3) { display: none; }
  .strip { grid-auto-columns: 62%; }
  .year { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .year h2 { position: static; }
  .year li a { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  .year li b { font-size: 18px; }
  .frames ul { grid-template-columns: 1fr 1fr; }
  .card-data div { grid-template-columns: 7.5em minmax(0, 1fr); }
  .prose p, .prose li, .film .note p { font-size: 17.5px; }
  .screen { padding: 0 0 16px; }
  .screen .wrap { padding: 0; }
  .player-bar { padding: 0 16px; }
  .rights-table { font-size: 14px; }
  .nextprev { grid-template-columns: 1fr; }
  .nextprev a:last-child { text-align: left; }
}
