/* ==========================================================================
   Видеотека проекта — оформление
   Внешних зависимостей нет: ни шрифтов, ни библиотек. Страница открывается
   мгновенно даже на медленном канале.
   ========================================================================== */

/* ---------- Палитра (тёмная, единственная) -------------------------------- */
:root {
  --bg:            #0b0f11;
  --bg-alt:        #10161a;
  --surface:       #141b1f;
  --surface-2:     #192126;
  --ink:           #eef3f4;
  --ink-soft:      #a9bcc2;
  --ink-mute:      #7b8e95;
  --line:          #263136;
  --line-soft:     #1d262b;
  --accent:        #3cc0a8;
  --accent-hover:  #58d3bd;
  --accent-soft:   #12312c;
  --accent-ink:    #06231f;
  --gold:          #d5ab6a;
  --gold-soft:     #2a2317;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.3);
  --shadow-md:     0 6px 18px rgba(0,0,0,.4);
  --shadow-lg:     0 28px 80px rgba(0,0,0,.6);
  --radius:        16px;
  --radius-lg:     22px;
  --wrap:          1160px;
  color-scheme: dark;
}

/* ---------- База ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

h1, h2, h3 { margin: 0; line-height: 1.14; letter-spacing: -.022em; font-weight: 680; }
p  { margin: 0; }
img { max-width: 100%; display: block; }
svg { width: 100%; height: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { left: 16px; color: var(--accent-ink); }

/* ---------- Шапка --------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--ink); font-weight: 660; letter-spacing: -.01em;
  margin-right: auto; min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; flex: none;
  color: var(--accent);
}
.brand-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 46vw;
}

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--ink-soft); font-size: 15.5px; font-weight: 520;
  padding: 8px 14px; border-radius: 10px;
  transition: color .18s ease, background-color .18s ease;
}
.site-nav a:hover { color: var(--ink); background: var(--line-soft); }

.nav-burger {
  display: none;
  flex: none; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); cursor: pointer;
  position: relative;
}
.nav-burger span {
  position: absolute; left: 10px; right: 10px; height: 1.8px;
  background: var(--ink); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-burger span:nth-child(1) { top: 14px; }
.nav-burger span:nth-child(2) { top: 21px; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-burger { display: block; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 10px clamp(20px, 5vw, 40px) 18px;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 14px; font-size: 17px; }
}

/* ---------- Первый экран -------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(64px, 11vw, 132px) 0 clamp(56px, 8vw, 96px);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero-bg span {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .5;
}
.hero-bg span:nth-child(1) {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -18%; right: -10%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: .16;
}
.hero-bg span:nth-child(2) {
  width: 38vw; height: 38vw; max-width: 500px; max-height: 500px;
  bottom: -24%; left: -12%;
  background: radial-gradient(circle, var(--gold) 0%, transparent 68%);
  opacity: .13;
}
.hero-inner { position: relative; z-index: 1; max-width: 880px; }

.badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--gold-soft); color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
  padding: 7px 15px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; letter-spacing: .006em;
  margin-bottom: 26px;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); flex: none;
}
.badge:empty { display: none; }

.hero-title {
  font-size: clamp(36px, 6.4vw, 68px);
  letter-spacing: -.032em;
  font-weight: 700;
  margin-bottom: 22px;
  text-wrap: balance;
}
.hero-tagline {
  font-size: clamp(17px, 2.1vw, 21px);
  color: var(--ink-soft);
  max-width: 660px;
  line-height: 1.58;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 12px;
  font-size: 16px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, background-color .18s ease,
              border-color .18s ease, color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 26%, transparent);
}
.btn-primary:hover {
  background: var(--accent-hover); color: var(--accent-ink);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 32%, transparent);
}

.btn-ghost {
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-mute); transform: translateY(-2px); }

.btn-sm { padding: 9px 16px; font-size: 14.5px; border-radius: 10px; }
.btn:disabled { opacity: .38; pointer-events: none; }

/* ---------- Показатели ---------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 30px);
  margin: clamp(46px, 7vw, 76px) 0 0;
  padding-top: clamp(26px, 4vw, 38px);
  border-top: 1px solid var(--line);
  max-width: 700px;
}
.stats div { min-width: 0; }
.stats dt {
  font-size: clamp(26px, 4.2vw, 40px);
  font-weight: 700; letter-spacing: -.03em;
  color: var(--ink); line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stats dd {
  margin: 8px 0 0; font-size: 14.5px; color: var(--ink-mute);
  line-height: 1.35;
}

/* ---------- Секции -------------------------------------------------------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line-soft);
}

.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 52px); }
.eyebrow {
  display: block; font-size: 13px; font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(28px, 4.2vw, 42px);
  letter-spacing: -.028em;
  text-wrap: balance;
}
.section-sub {
  margin-top: 16px; color: var(--ink-soft); font-size: 17px;
  max-width: 620px;
}
.section-sub:empty { display: none; }

.prose { max-width: 760px; }
.prose p { color: var(--ink-soft); font-size: 17.5px; line-height: 1.72; }
.prose p + p { margin-top: 20px; }

/* ---------- Панель фильтров ----------------------------------------------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px; margin-bottom: 32px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-right: auto; }

.chip {
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); font-size: 14.5px; font-weight: 550;
  font-family: inherit; cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--ink-mute); }
.chip[aria-selected="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.chip .chip-count {
  opacity: .6; margin-left: 6px; font-variant-numeric: tabular-nums;
}

.search {
  position: relative; display: flex; align-items: center;
  min-width: 240px; flex: 0 1 300px;
}
.search svg {
  position: absolute; left: 13px; width: 17px; height: 17px;
  color: var(--ink-mute); pointer-events: none;
}
.search input {
  width: 100%; padding: 10px 14px 10px 39px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 15px; font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search input::placeholder { color: var(--ink-mute); }
.search input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.search input::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Сетка видео --------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: clamp(18px, 2.4vw, 26px);
}

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  text-align: left; padding: 0; font-family: inherit; color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .26s cubic-bezier(.22,1,.36,1),
              box-shadow .26s ease, border-color .26s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.card-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--bg-alt);
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
.card:hover .card-thumb img { transform: scale(1.045); }

/* Обложка-заглушка, когда картинка не задана */
.thumb-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,.94);
}
.thumb-fallback .fb-num {
  font-size: clamp(40px, 8vw, 60px); font-weight: 700;
  letter-spacing: -.04em; opacity: .38;
  font-variant-numeric: tabular-nums;
}
.thumb-fallback::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.14), transparent 55%);
}

.card-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(to top, rgba(6,14,16,.5), rgba(6,14,16,.06) 55%, transparent);
  opacity: 0; transition: opacity .26s ease;
}
.card:hover .card-play, .card:focus-visible .card-play { opacity: 1; }
.card-play span {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.94);
  display: grid; place-items: center;
  color: #0e6b5e;
  transform: scale(.82);
  transition: transform .26s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.card:hover .card-play span { transform: scale(1); }
.card-play svg { width: 22px; height: 22px; margin-left: 3px; }

.card-duration {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(8,16,18,.78); color: #fff;
  backdrop-filter: blur(6px);
  padding: 3.5px 9px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-tag {
  font-size: 12px; font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--accent);
}
.card-title {
  font-size: 18px; font-weight: 640; letter-spacing: -.014em;
  line-height: 1.34; color: var(--ink);
}
.card-desc {
  font-size: 14.8px; color: var(--ink-mute); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-warn {
  margin-top: auto; padding-top: 4px;
  font-size: 13px; font-weight: 600; color: var(--gold);
}

.empty {
  text-align: center; color: var(--ink-mute);
  padding: 60px 20px; font-size: 16.5px;
}

/* ---------- Контакты ------------------------------------------------------ */
.contact-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(26px, 4vw, 40px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(20px, 3vw, 34px);
  box-shadow: var(--shadow-sm);
}
.contact-item .contact-label {
  font-size: 12.5px; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-mute); margin-bottom: 7px;
}
.contact-item .contact-value {
  font-size: 17.5px; font-weight: 560; color: var(--ink);
  word-break: break-word;
}
.contact-item a.contact-value { color: var(--accent); }
.contact-item a.contact-value:hover { text-decoration: underline; }

/* ---------- Материалы ------------------------------------------------------ */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  gap: clamp(18px, 2.4vw, 26px);
}
.material-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  color: inherit; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .26s cubic-bezier(.22,1,.36,1),
              box-shadow .26s ease, border-color .26s ease;
}
.material-card:hover, .material-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.material-cover {
  aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg-alt);
}
.material-cover img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
.material-card:hover .material-cover img { transform: scale(1.045); }
.material-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.material-title {
  font-size: 18px; font-weight: 640; letter-spacing: -.014em;
  line-height: 1.34; color: var(--ink);
}
.material-desc { font-size: 14.8px; color: var(--ink-mute); line-height: 1.55; }
.material-hint {
  margin-top: auto; padding-top: 4px;
  font-size: 13.5px; font-weight: 650; color: var(--accent);
}

/* ---------- Подвал -------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 8px 26px;
  justify-content: space-between; align-items: center;
  color: var(--ink-mute); font-size: 14.5px;
}
#footerOrg { font-weight: 560; color: var(--ink-soft); }

/* Подпись автора — намеренно негромкая */
.credit {
  font-size: 12.5px;
  color: var(--ink-mute);
  opacity: .68;
  letter-spacing: .004em;
}
.credit:empty { display: none; }
.credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, currentColor 32%, transparent);
  transition: color .18s ease, border-color .18s ease;
}
.credit a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Плеер --------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: clamp(12px, 3vw, 32px);
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6,12,14,.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } }

.modal-dialog {
  position: relative; z-index: 1;
  width: min(1080px, 100%);
  max-height: calc(100dvh - clamp(24px, 6vw, 64px));
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop .32s cubic-bezier(.22,1,.36,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.985); } }

/* На невысоких экранах сужаем окно, чтобы плеер и подпись помещались целиком
   и модальное окно не приходилось прокручивать. */
@media (min-width: 561px) and (min-height: 520px) {
  .modal-dialog { width: min(1080px, 100%, calc((100dvh - 215px) * 16 / 9)); }
}
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-dialog { animation: none; }
}

.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 38px; height: 38px; padding: 9px;
  border: none; border-radius: 50%;
  background: rgba(10,18,20,.6); color: #fff;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: background-color .18s ease, transform .18s ease;
}
.modal-close:hover { background: rgba(10,18,20,.85); transform: rotate(90deg); }

.player {
  position: relative; aspect-ratio: 16 / 9;
  background: #05090a;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}
.player iframe { width: 100%; height: 100%; border: 0; display: block; }

.player-missing {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 28px;
  color: #cfe0e3;
}
.player-missing strong { font-size: 17px; color: #fff; font-weight: 620; }
.player-missing span { font-size: 14.5px; max-width: 440px; line-height: 1.55; opacity: .8; }

.modal-meta {
  display: flex; flex-wrap: wrap; gap: 18px 24px;
  align-items: flex-start; justify-content: space-between;
  padding: 22px clamp(20px, 3vw, 28px) 26px;
}
.modal-meta-text { min-width: 0; flex: 1 1 320px; }
.modal-tag {
  display: inline-block; font-size: 12px; font-weight: 650;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 9px;
}
#modalTitle { font-size: clamp(19px, 2.6vw, 24px); letter-spacing: -.02em; }
#modalDesc { margin-top: 10px; color: var(--ink-soft); font-size: 15.8px; line-height: 1.6; }
#modalDesc:empty { display: none; }
.modal-nav { display: flex; gap: 8px; flex: none; }

body.modal-open { overflow: hidden; }

/* ---------- Появление при прокрутке --------------------------------------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .member, .btn { transition: none; }
}

/* ---------- Мелкие экраны ------------------------------------------------- */
@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .stats { grid-template-columns: 1fr; gap: 20px; }
  .stats div { display: flex; align-items: baseline; gap: 12px; }
  .stats dd { margin-top: 0; }
  .grid { grid-template-columns: 1fr; }
  .search { flex: 1 1 100%; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .modal { padding: 0; }
  .modal-dialog {
    width: 100%; max-height: 100dvh; border-radius: 0; border: none;
  }
  .player { border-radius: 0; }
  .modal-meta { padding-bottom: 30px; }
  .modal-nav { width: 100%; }
  .modal-nav .btn { flex: 1; }
}

/* ---------- Печать -------------------------------------------------------- */
@media print {
  .site-header, .hero-bg, .toolbar, .modal, .card-play { display: none !important; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
}
