/* ============================================================
   Школа Актива 239 ФМЛ — дизайн v3
   Тёмный минимализм, анимации скролла, без неона
   ============================================================ */

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

:root {
  --bg-deep: #0b0d12;
  --bg: #0f1218;
  --bg-soft: #14181f;
  --card: #171c25;
  --card-hover: #1c222d;
  --border: #232a36;
  --border-hover: #2f3846;
  --text: #e9edf4;
  --text-muted: #8b94a7;
  --text-dim: #586174;
  --accent: #5b8def;
  --accent-hover: #7aa5f5;
  --accent-soft: rgba(91, 141, 239, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}

/* ---------- Фон: благородный градиент + тонкая текстура ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(91, 141, 239, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(91, 141, 239, 0.04), transparent 70%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

/* ---------- Индикатор прогресса скролла ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(91, 141, 239, 0.5);
}

/* ---------- Контейнер ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Хедер ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 0;
  background: rgba(11, 13, 18, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(35, 42, 54, 0.6);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.header.scrolled {
  background: rgba(11, 13, 18, 0.92);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.brand:hover { opacity: 0.85; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: transform 0.3s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav {
  display: flex;
  gap: 2px;
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.nav-link.active {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
  padding: 28px 0 0;
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover { color: var(--accent); }

.breadcrumbs span {
  margin: 0 8px;
  color: var(--text-dim);
}

/* ---------- Герой ---------- */
.hero {
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--border);
}

.hero-label {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 600;
  opacity: 0.9;
}

.hero-title {
  font-size: clamp(30px, 5.5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.2px;
  margin-bottom: 24px;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 620px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

.hero-meta-item::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* ---------- Секции ---------- */
.section {
  padding: 70px 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 36px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 640px;
  line-height: 1.7;
}

/* ---------- Сетка годов ---------- */
.years-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.year-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.year-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.year-card:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
  transform: translateY(-3px);
}

.year-card:hover::before {
  opacity: 0.6;
}

.year-card-number {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.year-card-label {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.year-card-status {
  display: inline-block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 5px 11px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.year-card-status.soon {
  background: rgba(139, 148, 167, 0.08);
  color: var(--text-dim);
}

.year-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Сетка видео ---------- */
.video-list {
  display: grid;
  gap: 14px;
}

.video-card {
  display: flex;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
  align-items: center;
}

.video-card:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
  transform: translateY(-2px);
}

.video-thumb {
  flex-shrink: 0;
  width: 180px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, #1c2230 0%, #111620 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.video-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.8;
}

.video-thumb-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(91, 141, 239, 0.15);
  border: 1px solid rgba(91, 141, 239, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.video-card:hover .video-thumb-icon {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

.video-thumb-icon svg {
  width: 15px;
  height: 15px;
  fill: var(--accent);
  margin-left: 2px;
  transition: fill 0.3s ease;
}

.video-card:hover .video-thumb-icon svg {
  fill: white;
}

.video-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.video-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  letter-spacing: -0.2px;
}

.video-meta {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.1px;
}

/* ---------- О проекте ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.about-item {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.about-item:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
}

.about-item h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.1px;
}

.about-item p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ---------- Футер ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
  color: var(--text-dim);
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Модалка плеера ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  width: 100%;
  max-width: 880px;
  position: relative;
  transform: translateY(12px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 5;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  background: var(--card);
  color: var(--text);
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-right: 40px;
  letter-spacing: -0.2px;
}

/* ---------- Плеер ---------- */
.player-wrap {
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.custom-player {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #0a0d12;
  border-top: 1px solid var(--border);
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
  opacity: 0.85;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  opacity: 1;
}

.ctrl-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.seek-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: #262c3a;
  outline: none;
  cursor: pointer;
  min-width: 60px;
}

.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.seek-bar::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.seek-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.time-display {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 82px;
  text-align: center;
  letter-spacing: 0.3px;
}

.volume-bar {
  width: 70px;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: #262c3a;
  outline: none;
  cursor: pointer;
}

.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.volume-bar::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.modal-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.2px;
  min-height: 18px;
}

/* ---------- Кнопка назад ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease, gap 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
  gap: 10px;
}

/* ---------- Анимации при скролле ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* Появление заголовка героя */
.hero-title,
.hero-sub,
.hero-label,
.hero-meta {
  opacity: 0;
  transform: translateY(16px);
  animation: heroIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hero-label { animation-delay: 0.05s; }
.hero-title { animation-delay: 0.15s; }
.hero-sub { animation-delay: 0.3s; }
.hero-meta { animation-delay: 0.45s; }

@keyframes heroIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Адаптив ---------- */
@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .video-card {
    flex-direction: column;
    align-items: stretch;
  }
  .video-thumb {
    width: 100%;
  }
  .volume-bar {
    display: none;
  }
  .hero {
    padding: 56px 0 48px;
  }
  .hero-title {
    letter-spacing: -0.8px;
  }
  .section {
    padding: 50px 0;
  }
  .container {
    padding: 0 20px;
  }
}

/* Уважение к prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Полноэкранный режим */
.player-wrap:fullscreen,
.player-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  border: none;
}

.player-wrap:fullscreen .custom-player,
.player-wrap:-webkit-full-screen .custom-player {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  object-fit: contain;
}

.player-wrap:fullscreen .player-controls,
.player-wrap:-webkit-full-screen .player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}
