/* ============================================================
   BTF Media — сайт-визитка (вертикальный слайдер)
   Стиль: «полуночный кинозал» — тёмный космический фон,
   один синий акцент #6199f6, крупная спокойная типографика.
   ============================================================ */

:root {
  --vellum:   #fcfcfc;
  --obsidian: #0a0a13;
  --void:     #040407;
  --graphite: #08080c;
  --smoke:    #757580;
  --ash:      #a3a3b3;
  --charcoal: #2a2a32;
  --iris:     #6199f6;
  --twilight: #4f4f80;

  --font-main: 'Manrope', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Unbounded', 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --max-w: 1280px;
  --nav-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .slider { scroll-behavior: auto !important; }
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0.16px;
  color: var(--vellum);
  background-color: var(--obsidian);
  background-image:
    radial-gradient(1100px 600px at 85% -5%, rgba(12, 29, 50, 0.9), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(10, 0, 30, 0.8), transparent 55%),
    radial-gradient(1000px 800px at 50% 110%, rgba(0, 11, 53, 0.55), transparent 60%),
    linear-gradient(195deg, #0a0010 0%, #02000a 45%, #0c1d32 130%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;                 /* прокручивается только слайдер */
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(97, 153, 246, 0.35); color: var(--vellum); }

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

/* ---------- Типографика ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 0.9;
  letter-spacing: 0.72px;
  text-transform: uppercase;
  color: var(--iris);
  margin-bottom: 16px;
}

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 4.2vw, 54px);
  line-height: 1.12;
  letter-spacing: 0;
  max-width: 960px;
}

.heading-lg {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 2.8vw, 36px);
  line-height: 1.14;
  letter-spacing: 0;
}

.sub {
  font-size: 18px;
  line-height: 1.3;
  color: var(--smoke);
  max-width: 560px;
}

.slide-hero .sub { color: var(--ash); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-block;
  border-radius: 100px;
  padding: 14px 28px;
  font-size: 14px;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.btn-fill { background: var(--vellum); color: var(--obsidian); font-weight: 500; }
.btn-fill:hover { opacity: 0.85; }

.btn-ghost {
  background: rgba(10, 10, 19, 0.25);
  border: 1px solid var(--vellum);
  color: var(--vellum);
  font-weight: 400;
}
.btn-ghost:hover { background: var(--vellum); color: var(--obsidian); }

/* ---------- Навигация ---------- */

.nav-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
}

.nav { display: flex; align-items: center; gap: 40px; height: var(--nav-h); }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.nav-logo img { display: block; height: 26px; width: auto; }

.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { font-size: 14px; }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.nav-cta { padding: 12px 20px; }

/* ---------- Пагинация слайдов ---------- */

.dots {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dot-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 100px;
  background: transparent;
  border: 1px solid var(--smoke);
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  flex: none;
}

.dot-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.72px;
  text-transform: uppercase;
  color: var(--ash);
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.dot-link:hover .dot-label { opacity: 1; transform: translateX(0); }

.dot-link.active .dot {
  background: var(--iris);
  border-color: var(--iris);
  transform: scale(1.35);
}
.dot-link.active .dot-label { color: var(--iris); }

/* ---------- Слайдер ---------- */

.slider {
  height: 100svh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.slider::-webkit-scrollbar { display: none; }

.slide {
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
}

.slide-inner {
  padding-top: calc(var(--nav-h) + 24px);
  padding-bottom: 40px;
}

/* ---------- Слайд 1: герой с видео ---------- */

.slide-hero { overflow: hidden; }

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: transparent;   /* до/без видео сквозь него виден живой градиент .slide-hero::before */
}

/* Живой фон героя, когда видео ещё нет или грузится — медленный «северный» дрейф */
.slide-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(55% 55% at 18% 22%, rgba(97, 153, 246, 0.28), transparent 62%),
    radial-gradient(50% 60% at 84% 78%, rgba(79, 79, 128, 0.30), transparent 60%),
    radial-gradient(45% 45% at 62% 30%, rgba(28, 63, 143, 0.32), transparent 60%),
    var(--graphite);
  background-size: 180% 180%;
  animation: aurora 26s ease-in-out infinite alternate;
}

@keyframes aurora {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 25% 100%; }
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(4, 4, 7, 0.38), rgba(4, 4, 7, 0.38)),   /* ровный тёмный слой поверх всего видео */
    linear-gradient(90deg, rgba(4, 4, 7, 0.85) 0%, rgba(4, 4, 7, 0.6) 55%, rgba(4, 4, 7, 0.3) 100%),
    linear-gradient(180deg, rgba(4, 4, 7, 0.6) 0%, transparent 30%, transparent 65%, rgba(10, 10, 19, 0.92) 100%);
}

.hero-inner { position: relative; z-index: 2; }

.hero-inner .sub { margin-top: 24px; }

.hero-cta { display: flex; gap: 16px; margin-top: 40px; flex-wrap: wrap; }

/* Кнопки управления видео */

.video-controls {
  position: absolute;
  left: 24px;
  bottom: 28px;
  z-index: 3;
  display: flex;
  gap: 10px;
}

.vc-btn {
  width: 40px; height: 40px;
  border-radius: 100px;
  border: 1px solid rgba(252, 252, 252, 0.45);
  background: rgba(4, 4, 7, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--vellum);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.vc-btn:hover { background: rgba(252, 252, 252, 0.15); border-color: var(--vellum); }

/* переключение иконок по состоянию */
.vc-btn .ic-play,  .vc-btn .ic-sound  { display: none; }
.vc-btn.is-paused .ic-pause { display: none; }
.vc-btn.is-paused .ic-play  { display: block; }
.vc-btn.is-sound  .ic-muted { display: none; }
.vc-btn.is-sound  .ic-sound { display: block; }

.scroll-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 28px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.72px;
  text-transform: uppercase;
  color: var(--ash);
  animation: hint 2.4s ease-in-out infinite;
}

@keyframes hint {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
  50% { transform: translate(-50%, 6px); opacity: 1; }
}

/* ---------- Проекты ---------- */

.projects { margin-top: 40px; border-top: 1px solid var(--charcoal); }

.project {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--charcoal);
}

.p-logo {
  width: 80px; height: 80px;
  border-radius: 10px;
  border: 1px solid var(--twilight);
  background: rgba(24, 24, 38, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.p-logo span { font-family: var(--font-mono); font-size: 18px; color: var(--twilight); }
.p-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* логотипы не обрезаем */
  padding: 14px;
}

.p-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(16px, 1.8vw, 23px);
  line-height: 1.2;
  letter-spacing: 0;
}

.p-desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ash);
  max-width: 560px;
}

.p-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

.p-index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.72px;
  color: var(--smoke);
}

.p-link { font-size: 14px; color: var(--iris); }
.p-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Резиденты ---------- */

.section-sub { margin-top: 20px; }

/* Горизонтальная лента со снапом: колесо/свайп/стрелки */
.residents {
  margin-top: 28px;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 2px 18px;          /* место под тень карточки при ховере */
  scrollbar-width: none;
}
.residents::-webkit-scrollbar { display: none; }

.resident {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 190px;
  scroll-snap-align: start;
}

/* Стрелки ленты */
.res-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.res-btn {
  width: 40px; height: 40px;
  border-radius: 100px;
  border: 1px solid var(--charcoal);
  background: rgba(24, 24, 38, 0.5);
  color: var(--ash);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.res-btn:hover { border-color: var(--iris); color: var(--iris); }

.r-photo {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  border: 1px solid var(--charcoal);
  background:
    radial-gradient(140% 100% at 50% 0%, rgba(79, 79, 128, 0.25), transparent 70%),
    var(--graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.r-photo img { width: 100%; height: 100%; object-fit: cover; }
.r-initials { font-family: var(--font-mono); font-size: 18px; color: var(--twilight); }
.r-name { font-size: 15px; font-weight: 500; }
.r-role { font-size: 12px; color: var(--smoke); }

/* ---------- О центре ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ash);
  max-width: 560px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--charcoal);
}

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-n { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; letter-spacing: 0; font-weight: 600; }
.stat-l { font-size: 14px; color: var(--smoke); }

/* ---------- Контакты ---------- */

.footer-inner { display: flex; flex-direction: column; justify-content: center; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
}

.footer-title { margin-bottom: 24px; }

.footer-contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.footer-mail {
  font-size: clamp(18px, 2.4vw, 24px);
  letter-spacing: -0.02em;
  color: var(--iris);
}
.footer-mail:hover { text-decoration: underline; text-underline-offset: 5px; }

.footer-wa {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--vellum);
  transition: color 0.2s ease;
}
.footer-wa svg { color: #25D366; flex: none; }   /* фирменный зелёный WhatsApp */
.footer-wa:hover { color: #25D366; }

.footer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 14px; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-note { font-size: 13px; color: var(--smoke); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--charcoal);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.72px;
  color: var(--smoke);
}

/* ---------- Адаптив ---------- */

@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
  .dots { right: 12px; }
  .dot-label { display: none; }
}

@media (max-width: 720px) {
  /* на мобильных снап мягче: длинные слайды можно скроллить свободно */
  .slider { scroll-snap-type: y proximity; }
  .slide { min-height: auto; padding: 0; }
  .slide-hero { min-height: 100svh; }
  .slide-inner { padding-top: calc(var(--nav-h) + 32px); padding-bottom: 56px; }

  .nav { gap: 20px; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }

  .project { grid-template-columns: 56px 1fr; gap: 16px; }
  .p-logo { width: 56px; height: 56px; }
  .p-logo span { font-size: 13px; }
  .p-meta {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .resident { flex-basis: 150px; }
  .res-nav { display: none; }     /* на тачах листается свайпом */

  .footer-grid { grid-template-columns: 1fr; align-items: start; }
  .footer-meta { align-items: flex-start; }

  .scroll-hint { display: none; }
  .video-controls { left: 16px; bottom: 16px; }
}

/* ============================================================
   ПОЛИРОВКА — появление на скролле, ховеры, фактура
   (прогрессивное улучшение: без JS контент виден,
    класс .js вешает скрипт на <html>)
   ============================================================ */

/* ---------- Появление контента при входе слайда ---------- */

.js .slide-inner > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.8s cubic-bezier(0.16, 0.84, 0.34, 1);
}

.js .slide.in-view .slide-inner > * { opacity: 1; transform: none; }

.js .slide.in-view .slide-inner > *:nth-child(1) { transition-delay: 0.04s; }
.js .slide.in-view .slide-inner > *:nth-child(2) { transition-delay: 0.12s; }
.js .slide.in-view .slide-inner > *:nth-child(3) { transition-delay: 0.20s; }
.js .slide.in-view .slide-inner > *:nth-child(4) { transition-delay: 0.28s; }
.js .slide.in-view .slide-inner > *:nth-child(5) { transition-delay: 0.36s; }

/* Строки проектов и карточки резидентов появляются каскадом внутри своих блоков */
.js .slide.in-view .project,
.js .slide.in-view .resident {
  animation: rise 0.7s cubic-bezier(0.16, 0.84, 0.34, 1) both;
}
.js .slide .project,
.js .slide .resident { animation: none; }

.js .slide.in-view .project:nth-child(1) { animation-delay: 0.24s; }
.js .slide.in-view .project:nth-child(2) { animation-delay: 0.34s; }
.js .slide.in-view .project:nth-child(3) { animation-delay: 0.44s; }
.js .slide.in-view .project:nth-child(4) { animation-delay: 0.54s; }

.js .slide.in-view .resident:nth-child(1)  { animation-delay: 0.18s; }
.js .slide.in-view .resident:nth-child(2)  { animation-delay: 0.24s; }
.js .slide.in-view .resident:nth-child(3)  { animation-delay: 0.30s; }
.js .slide.in-view .resident:nth-child(4)  { animation-delay: 0.36s; }
.js .slide.in-view .resident:nth-child(5)  { animation-delay: 0.42s; }
.js .slide.in-view .resident:nth-child(6)  { animation-delay: 0.48s; }
.js .slide.in-view .resident:nth-child(7)  { animation-delay: 0.54s; }
.js .slide.in-view .resident:nth-child(8)  { animation-delay: 0.60s; }
.js .slide.in-view .resident:nth-child(9)  { animation-delay: 0.66s; }
.js .slide.in-view .resident:nth-child(10) { animation-delay: 0.72s; }
.js .slide.in-view .resident:nth-child(11) { animation-delay: 0.78s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Ховер строк проектов ---------- */

.project { position: relative; z-index: 0; transition: border-color 0.25s ease; }

.project::before {
  content: "";
  position: absolute;
  inset: 0 -24px;
  z-index: -1;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(97, 153, 246, 0.08), rgba(97, 153, 246, 0.02) 70%, transparent);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.project:hover::before { opacity: 1; }
.project:hover { border-bottom-color: var(--twilight); }

.p-logo { transition: border-color 0.28s ease, transform 0.28s ease; }
.project:hover .p-logo { border-color: var(--iris); transform: translateY(-2px); }
.project:hover .p-logo span { color: var(--iris); }
.project:hover .p-index { color: var(--iris); }

.p-link { display: inline-flex; align-items: center; gap: 4px; transition: gap 0.22s ease; }
.project:hover .p-link { gap: 9px; }

/* ---------- Ховер карточек резидентов ---------- */

.r-photo { transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
.resident:hover .r-photo {
  transform: translateY(-5px);
  border-color: var(--twilight);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.7);
}
.resident:hover .r-initials { color: var(--iris); }
.r-role { transition: color 0.25s ease; }
.resident:hover .r-role { color: var(--iris); }

/* ---------- Ховер плиток статистики ---------- */

.stat-n { transition: color 0.25s ease; }
.stat:hover .stat-n { color: var(--iris); }

/* ---------- Плёнка зерна (фактура) ---------- */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Уважение к prefers-reduced-motion: показываем контент сразу, без сдвигов */
@media (prefers-reduced-motion: reduce) {
  .js .slide-inner > * { opacity: 1 !important; transform: none !important; }
  .js .slide .project,
  .js .slide .resident { animation: none !important; opacity: 1 !important; }
  .slide-hero::before { animation: none !important; }
}
