/* Базовые настройки */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* сначала полупрозрачный градиент, потом картинка */
  background:
    radial-gradient(circle at top, rgba(31, 41, 51, 0.3) 0, rgba(5, 6, 11, 0.5) 45%, rgba(2, 3, 8, 0.6) 100%),
    url("/img/background.jpg") center center / cover no-repeat fixed;
  color: #f9fafb;
  line-height: 1.6;
}

/* Акцентные цвета */
:root {
  --accent-red: #ff305f;
  --accent-orange: #ff8c1a;
  --accent-yellow: #ffd447;
  --accent-white: #f9fafb;
}

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

/* Шапка */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 6, 11, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-white);
  position: relative;
  padding-left: 16px;
}

/* мазок за логотипом */
.logo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 56px;
  height: 22px;
  transform: translateY(-50%) skewX(-18deg);
  background: linear-gradient(120deg, var(--accent-red), var(--accent-orange), var(--accent-yellow));
  filter: blur(1px);
  opacity: 0.9;
  z-index: -1;
  border-radius: 999px;
}

/* Навигация */
.nav {
  display: flex;
  gap: 12px;
}

.nav-btn {
  border: none;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-white);
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease-out, transform 0.15s ease-out;
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 48, 95, 0.85), rgba(255, 140, 26, 0.8), rgba(255, 212, 71, 0.8));
  transform: translateX(-100%) skewX(-20deg);
  transition: transform 0.25s ease-out;
  z-index: -1;
}

.nav-btn:hover::before {
  transform: translateX(0) skewX(-20deg);
}

.nav-btn:hover {
  transform: translateY(-1px);
}

.nav-btn-active,
.nav-btn-active:hover {
  color: #05060b;
}

.nav-btn-active::before {
  transform: translateX(0) skewX(-20deg);
}

/* Основной контент */
.main {
  padding: 30px 0 40px;
}

/* Секции */
.section {
  display: none;
  padding-top: 10px;
}

.section-active {
  display: block;
}

.section h2 {
  font-size: 26px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-subtitle {
  color: #e5e7eb;
  opacity: 0.8;
  margin-bottom: 20px;
}

/* Сетка карточек */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

/* Карточка */
.card {
  position: relative;
  padding: 16px 16px 18px;
  background: radial-gradient(circle at top left,
              rgba(255, 140, 26, 0.18),
              rgba(15, 23, 42, 0.95));
  border-radius: 18px;
  border: 1px solid rgba(249, 250, 251, 0.06);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  overflow: hidden;
  backdrop-filter: blur(6px);
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, border-color 0.18s ease-out;
}

/* мазки цвета внутри карточки */
.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0 0, rgba(255, 48, 95, 0.18), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(255, 212, 71, 0.12), transparent 60%);
  opacity: 0.8;
  mix-blend-mode: screen;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 140, 26, 0.3);
  border-color: rgba(255, 212, 71, 0.4);
}

/* Общие заголовки/текст внутри */
.card h3,
.card p {
  position: relative;
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent-white);
}

.card p {
  font-size: 14px;
  color: #e5e7eb;
  opacity: 0.9;
}

/* Раскрывающиеся карточки (статьи и видео-заготовки) */
.card-expandable,
.card-video {
  /* card-video может быть или раскрывающейся, или превью */
}

/* Кнопка-«шапка» карточки */
.card-toggle {
  border: none;
  background: transparent;
  color: inherit;
  width: 100%;
  text-align: left;
  padding: 16px 16px 10px;
  cursor: pointer;
}

/* Содержимое при раскрытии */
.card-body {
  padding: 0 16px 14px;
  font-size: 14px;
  color: #e5e7eb;
  display: none;
}

/* когда карточка раскрыта */
.card-open .card-body {
  display: block;
}

/* iframe 4PDA */
.article-iframe-wrap {
  margin-top: 8px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(249, 250, 251, 0.12);
}

.article-iframe-wrap iframe {
  display: block;
  width: 100%;
  height: 260px;
  border: none;
}

/* Видео-заглушки (2..12) */
.video-placeholder {
  position: relative;
  margin-top: 8px;
  border-radius: 14px;
  background: conic-gradient(
    from 210deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 140, 26, 0.35),
    rgba(255, 48, 95, 0.35),
    rgba(255, 212, 71, 0.3),
    rgba(255, 255, 255, 0.05)
  );
  padding: 2px;
  overflow: hidden;
}

.video-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0, rgba(0, 0, 0, 0.4), transparent 60%);
  pointer-events: none;
}

.video-placeholder span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  background: radial-gradient(circle at top, #05060b, #030712);
  color: #e5e7eb;
  font-size: 13px;
  text-align: center;
  padding: 0 10px;
}

/* Плитка-предпросмотр для первого видео */
.card-video-preview {
  border: none;
  background: transparent;
  color: inherit;
  width: 100%;
  text-align: left;
  padding: 10px 10px 12px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
}

.video-thumb {
  position: relative;
  width: 140px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #111827;
}

.video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55));
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 48, 95, 0.9);
  color: #f9fafb;
  font-size: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
}

.video-text h3 {
  margin-bottom: 4px;
}

.video-text p {
  font-size: 13px;
  opacity: 0.9;
}

/* Модальное окно с видео */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
}

.video-modal-open {
  display: flex;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.video-modal-content {
  position: relative;
  max-width: 1100px;
  width: 100%;
  margin: 0 12px;
  z-index: 51;
}

.video-modal-frame {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-modal-close {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 52;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.95);
  color: #f9fafb;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
  font-size: 16px;
}

/* Подвал */
.footer {
  border-top: 1px solid rgba(249, 250, 251, 0.05);
  padding: 16px 0 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(229, 231, 235, 0.75);
}

/* Модальное окно с ридером статей — копия видео */
.article-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
}

.article-modal-open {
  display: flex;
}

.article-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.article-modal-content {
  position: relative;
  max-width: 1100px;
  width: 90%;
  max-height: 90vh;
  margin: 0 12px;
  z-index: 51;
}

.article-modal-frame {
  position: relative;
  height: 80vh;
  border-radius: 16px;
  overflow: hidden;
  /* оставь */
  display: flex;
  /* ← ДОБАВЬ */
  flex-direction: column;
  /* ← ДОБАВЬ */
}

.article-reader {
  flex: 1;
  /* ← ДОБАВЬ: растянется и проскроллится */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  overflow-y: auto;
  /* ← основной скролл */
  overflow-x: hidden;
  /* горизонтальный не нужен */
  max-height: 80vh;
  font-size: 16px;
  line-height: 1.7;
  color: var(--accent-white);
  scrollbar-width: thin;
  /* тонкая полоса в Firefox */
  scrollbar-color: rgba(255, 140, 26, 0.5) rgba(15, 23, 42, 0.8);
}

.article-reader::-webkit-scrollbar {
  width: 6px;
}

.article-reader::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 3px;
}

.article-reader::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 26, 0.6);
  border-radius: 3px;
}

.article-reader h1,
.article-reader h2 {
  color: var(--accent-white);
  margin-top: 1.5em;
  margin-bottom: 0.8em;
}

.article-reader p {
  margin-bottom: 1.2em;
}

.article-modal-close {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 52;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.95);
  color: #f9fafb;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
  font-size: 16px;
}

/* Превью-стиль для карточек статей (как у видео) */
.card-article-preview {
  border: none;
  background: transparent;
  color: inherit;
  width: 100%;
  text-align: left;
  padding: 16px 16px 10px;
  cursor: pointer;
}

/* Адаптивность */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    gap: 8px;
    height: auto;
    padding: 10px 0;
  }

  .logo {
    font-size: 18px;
  }

  .cards {
    gap: 14px;
  }

  .card-body {
    padding-bottom: 12px;
  }

  .video-thumb {
    width: 120px;
  }

  .card-video-preview {
    flex-direction: row;
    align-items: flex-start;
  }

  .video-modal-content {
    margin: 0 6px;
  }

  .video-modal-frame {
    padding-top: 62%;
  }

  .video-modal-close {
    top: -6px;
    right: -6px;
  }

  .article-iframe-wrap iframe {
    height: 220px;
  }
}

