:root {
  --bg: #0e0e0f;
  --bg-2: #161618;
  --bg-3: #1f1f22;
  --line: #2a2a2e;
  --text: #ecebe7;
  --muted: #8d8c88;
  --dim: #5f5e5b;
  --accent: #d6322b;      /* «штамп» */
  --accent-soft: rgba(214, 50, 43, .14);
  --radius: 14px;
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14, 14, 15, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.header-nav { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.header-nav a:hover { color: var(--text); }

.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 2px solid var(--accent); border-radius: 6px;
  color: var(--accent);
  font: 900 18px/1 var(--font-display);
  transform: rotate(-6deg);
}
.logo-text {
  font: 900 20px/1 var(--font-display);
  letter-spacing: .02em; text-transform: uppercase;
}
.logo--small .logo-mark { width: 28px; height: 28px; font-size: 14px; }
.logo--small .logo-text { font-size: 15px; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; border-bottom: 1px solid var(--line); }
.hero-kicker {
  font: 500 12px/1 var(--font-mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
.hero h1 {
  font: 700 clamp(34px, 5.2vw, 64px)/1.05 var(--font-display);
  margin: 0 0 20px; max-width: 900px; letter-spacing: -.01em;
}
.hero p { color: var(--muted); max-width: 620px; margin: 0; font-size: 18px; }
.hero-stats { display: flex; gap: 40px; margin-top: 36px; flex-wrap: wrap; }
.stat b { display: block; font: 700 28px/1 var(--font-display); }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.section-title {
  font: 700 22px/1.2 var(--font-display); margin: 0;
}
.section-sub { color: var(--muted); font-size: 14px; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2);
  font-size: 14px; color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.tag:hover { border-color: #46464b; }
.tag .count { font: 500 12px/1 var(--font-mono); color: var(--dim); }
.tag.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag.is-active .count { color: rgba(255,255,255,.7); }
.tag--sm { padding: 5px 11px; font-size: 12px; }

/* ---------- Ghost button (неяркая) ---------- */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px dashed #3a3a3f; border-radius: 10px;
  color: var(--muted); font-size: 14px;
  transition: color .15s, border-color .15s;
}
.btn-ghost:hover { color: var(--text); border-color: #5a5a60; }
.btn-ghost svg { width: 16px; height: 16px; }

/* ---------- Person cards (как «актёры» в карточке фильма) ---------- */
.people-grid {
  display: grid; gap: 28px 22px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.person-card { display: flex; flex-direction: column; gap: 14px; }
.person-card .photo {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: var(--radius); background: var(--bg-3);
}
.person-card .photo img,
.person-card .photo svg { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.person-card:hover .photo img,
.person-card:hover .photo svg { transform: scale(1.04); }
.photo-badge {
  position: absolute; left: 12px; bottom: 12px;
  padding: 5px 10px; border-radius: 6px;
  background: rgba(14,14,15,.8); backdrop-filter: blur(6px);
  font: 500 12px/1 var(--font-mono); color: var(--text);
}
.photo-badge b { color: var(--accent); font-weight: 500; }
.person-card .surname {
  font: 700 18px/1.15 var(--font-display); text-transform: uppercase; letter-spacing: .01em;
}
.person-card .firstname { color: var(--text); font-size: 15px; margin-top: 2px; }
.person-card dl { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; }
.person-card dt { color: var(--dim); }
.person-card dd { margin: 0; color: var(--muted); }
.person-card .mini-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-tag { font-size: 11px; color: var(--muted); padding: 3px 8px; border-radius: 999px; background: var(--bg-3); }

.empty { color: var(--muted); padding: 40px 0; text-align: center; }

.suggest-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 48px; padding: 24px 28px;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.suggest-row p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Person page ---------- */
.back { display: inline-flex; gap: 6px; margin: 32px 0 0; color: var(--muted); font-size: 14px; }
.back:hover { color: var(--text); }

.profile {
  display: grid; grid-template-columns: 200px 1fr; gap: 40px;
  padding: 32px 0 48px; border-bottom: 1px solid var(--line);
}
.profile-photo { aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.profile-photo img, .profile-photo svg { width: 100%; height: 100%; object-fit: cover; }
.profile-role { font: 500 12px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.profile h1 { font: 700 clamp(30px, 4vw, 48px)/1.05 var(--font-display); margin: 14px 0 6px; text-transform: uppercase; }
.profile .fullname { color: var(--muted); font-size: 18px; }
.profile .bio { margin: 24px 0; max-width: 680px; color: #cfcdc8; }
.facts { display: flex; gap: 36px; flex-wrap: wrap; margin-bottom: 28px; }
.facts div span { display: block; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.facts div b { font-weight: 500; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.social {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 14px;
}
.social:hover { border-color: #46464b; }
.social svg { width: 18px; height: 18px; }

/* ---------- Filters ---------- */
.filters { display: grid; gap: 14px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.filter-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filter-label { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); width: 64px; }
.filter-row .tags { gap: 8px; }

.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 28px 0 8px; flex-wrap: wrap; }
.feed-head .count { color: var(--muted); font-size: 14px; }

/* ---------- Posts ---------- */
.feed { display: grid; gap: 0; padding: 8px 0 48px; }
.year-divider {
  font: 700 14px/1 var(--font-display); color: var(--dim);
  display: flex; align-items: center; gap: 14px; margin-top: 12px;
}
.year-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.post {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.video { position: relative; aspect-ratio: 16/9; background: #000; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(135deg, #141416 0 12px, #18181b 12px 24px);
  color: var(--dim); font-size: 13px;
}
.video-placeholder .play {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; border: 1px solid #3a3a3f; color: var(--muted);
}
.timecode {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  padding: 4px 8px; border-radius: 5px; background: rgba(0,0,0,.75);
  font: 500 12px/1 var(--font-mono);
}
.post-body { padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; }
.post-meta { display: flex; gap: 10px; align-items: center; font: 500 12px/1 var(--font-mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.post h3 { margin: 0; font: 600 19px/1.3 var(--font-body); }
.post .quote {
  margin: 0; padding-left: 14px; border-left: 2px solid var(--accent);
  color: #d9d7d2; font-style: italic;
}
.post .desc { margin: 0; color: var(--muted); font-size: 14px; }
.show-info { display: grid; gap: 6px; font-size: 13px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }
.show-info div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.show-info span { color: var(--dim); }
.show-info a { text-decoration: underline; text-decoration-color: #46464b; text-underline-offset: 3px; }
.show-info a:hover { text-decoration-color: var(--text); }
.post .tags { gap: 6px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.modal-dialog {
  position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 32px;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: var(--bg-3); font-size: 20px; line-height: 1;
}
.modal h2 { font: 700 20px/1.2 var(--font-display); margin: 0 0 8px; }
.modal .lead { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form input, .form textarea, .form select {
  width: 100%; padding: 11px 13px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; font-size: 15px;
}
.form textarea { min-height: 96px; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: #5a5a60; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-primary {
  margin-top: 6px; padding: 12px 18px; border: 0; border-radius: 10px;
  background: var(--text); color: var(--bg); font-weight: 600;
}
.btn-primary:hover { background: #fff; }
.form-hint { font-size: 12px; color: var(--dim); }
.thanks { text-align: center; padding: 20px 0 8px; }
.thanks .stamp {
  display: inline-block; padding: 8px 18px; margin-bottom: 18px;
  border: 3px solid var(--accent); border-radius: 6px; color: var(--accent);
  font: 900 18px/1 var(--font-display); text-transform: uppercase; transform: rotate(-5deg);
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; margin-top: 40px; }
.footer-inner { display: flex; gap: 32px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.footer-note { max-width: 560px; margin: 0; color: var(--dim); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .profile { grid-template-columns: 1fr; gap: 28px; }
  .profile-photo { max-width: 260px; }
  .post { grid-template-columns: 1fr; }
  .header-nav { display: none; }
}
@media (max-width: 520px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
  .person-card .surname { font-size: 15px; }
  .person-card dl { display: none; }
  .form .row { grid-template-columns: 1fr; }
  .filter-label { width: 100%; }
}

/* Главная: маленький заголовок → теги → личности */
.section--intro { padding: 40px 0 8px; }
.section--intro .hero-kicker { margin-bottom: 18px; }

/* Фото поменьше */
.person-card .surname { font-size: 15px; }
.person-card .firstname { font-size: 14px; }
.person-card dl { font-size: 12px; }
.profile-photo { max-width: 200px; }
@media (max-width: 860px) { .profile-photo { max-width: 160px; } }

/* ---------- Оглавление (как в книге) ---------- */
.feed .year-divider { margin: 28px 0 4px; }
.feed .year-divider:first-child { margin-top: 8px; }
.toc-item { border-bottom: 1px solid var(--line); }
.toc-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 18px 4px; cursor: pointer; list-style: none;
}
.toc-row::-webkit-details-marker { display: none; }
.toc-row:hover .toc-title b { color: #fff; }
.toc-num { font: 500 13px/1 var(--font-mono); color: var(--accent); min-width: 22px; }
.toc-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.toc-title b { font: 600 17px/1.3 var(--font-body); color: var(--text); transition: color .15s; }
.toc-title small { font-size: 13px; color: var(--dim); }
.toc-leader {
  flex: 1; min-width: 30px; align-self: flex-start; margin-top: 14px;
  border-bottom: 1px dotted #3d3d42;
}
.toc-date { font: 400 13px/1 var(--font-mono); color: var(--muted); white-space: nowrap; align-self: flex-start; margin-top: 6px; }
.toc-chevron {
  width: 9px; height: 9px; align-self: flex-start; margin-top: 7px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s;
}
.toc-item[open] .toc-chevron { transform: rotate(-135deg); margin-top: 11px; }
.toc-item[open] .toc-title b { color: #fff; }
.toc-item .post { margin: 0 0 22px 38px; }
@media (max-width: 600px) {
  .toc-leader { display: none; }
  .toc-row { flex-wrap: wrap; gap: 6px 12px; }
  .toc-title { flex: 1; }
  .toc-date { order: 5; width: 100%; padding-left: 34px; margin-top: 0; }
  .toc-item .post { margin-left: 0; }
}
@media (max-width: 520px) {
  .people-grid { grid-template-columns: repeat(3, 1fr); gap: 18px 10px; }
  .person-card { gap: 8px; }
  .person-card .surname { font-size: 12px; }
  .person-card .firstname { font-size: 12px; }
  .person-card .mini-tags { display: none; }
  .photo-badge { left: 6px; bottom: 6px; padding: 3px 6px; font-size: 10px; }
}

/* ---------- Профиль как в Instagram ---------- */
.ig-profile {
  display: flex; gap: 28px; align-items: flex-start;
  padding: 24px 0 32px; border-bottom: 1px solid var(--line);
}
.ig-avatar {
  flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  background: var(--bg-3); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px #3a3a3f;
}
.ig-avatar img, .ig-avatar svg { width: 100%; height: 100%; object-fit: cover; }
.ig-info { min-width: 0; max-width: 620px; display: grid; gap: 6px; }
.ig-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ig-nick { margin: 0; font: 600 20px/1.2 var(--font-body); }
.ig-links { display: flex; gap: 6px; }
.ig-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
}
.ig-icon:hover { color: var(--text); border-color: #46464b; }
.ig-icon svg { width: 16px; height: 16px; }
.ig-stats { display: flex; gap: 20px; flex-wrap: wrap; margin: 4px 0 6px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.ig-stats b { color: var(--text); font-weight: 600; }
.ig-name { font-weight: 600; font-size: 14px; }
.ig-name span { font-weight: 400; color: var(--muted); }
.ig-role { font-size: 14px; color: var(--muted); }
.ig-bio { margin: 2px 0 0; font-size: 14px; color: #cfcdc8; line-height: 1.5; }
@media (max-width: 520px) {
  .ig-profile { gap: 16px; }
  .ig-avatar { width: 72px; height: 72px; }
  .ig-nick { font-size: 17px; }
  .ig-stats { gap: 12px; font-size: 13px; }
}

/* Оглавление без даты в строке: год и темы — в раскрытом пункте */
.feed-head { padding: 28px 0 4px; }
.toc-leader { margin-top: 12px; }
.toc-chevron { margin-top: 6px; }
.toc-item[open] .toc-chevron { margin-top: 10px; }

.photo-credit { font-size: 11px; color: var(--dim); margin-top: 2px; }
.photo-credit:hover { color: var(--muted); }
.show-note { font-style: normal; font-size: 12px; color: var(--dim); }
.person-card .photo img { object-position: center 20%; }
.ig-avatar img { object-position: center 15%; }

/* Страница личности: без заголовка оглавления, кнопка внизу */
.feed { padding-top: 12px; padding-bottom: 20px; }
.feed-foot { display: flex; justify-content: center; padding: 8px 0 48px; }
.ig-nick { font-family: var(--font-display); font-weight: 700; font-size: 20px; }

/* Вертикальные ролики (Reels) */
.video--vertical { aspect-ratio: auto; height: 560px; }
.video--vertical iframe { width: 315px; left: 50%; transform: translateX(-50%); }

/* Обложка книги вместо видео */
.video--cover { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #222226, #0b0b0c); }
.video--cover img { position: static; height: 86%; width: auto; border-radius: 4px; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.post .quote p { margin: 0 0 .7em; }
.post .quote p:last-child { margin-bottom: 0; }

/* Не даём содержимому раздувать колонки на узких экранах */
.feed { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .post { grid-template-columns: minmax(0, 1fr); } }
.video--cover img { max-width: 90%; object-fit: contain; }
