/*
  Onepage Template
  Структура:
  - Header: логотип + подпись + десктопное меню / мобильный бургер
  - Main: адаптивное видео 16:9 во всю ширину + mute-кнопка
  - Cards: сетка карточек 4 в ряд на десктопе, адаптивная перестройка на мобильных
  - Footer: ссылки, предупреждения, копирайт с автогодом
*/

:root {
  --color-page: #0f1115;
  --color-surface: #171a21;
  --color-surface-strong: #20242d;
  --color-text: #f4f4f5;
  --color-muted: #a9adb8;
  --color-border: rgba(255, 255, 255, 0.12);
  --color-overlay: rgba(0, 0, 0, 0.58);
  --color-overlay-soft: rgba(0, 0, 0, 0.38);
  --color-active: #1f9d55;
  --color-active-hover: #28b866;
  --color-inactive: rgba(255, 255, 255, 0.24);
  --header-height: 76px;
  --container-width: 1440px;
  --gap: 18px;
  --radius-card: 0;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--color-page);
  color: var(--color-text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

img,
video {
  display: block;
  max-width: 100%;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* =========================
   Header
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  background: rgba(15, 17, 21, 0.92);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(100%, var(--container-width));
  min-height: var(--header-height);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: var(--color-surface-strong);
  background-image: url(../img/logo.jpg);
  background-position: center;
  background-size: contain;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  padding: 10px 13px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--transition), background var(--transition);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface-strong);
  cursor: pointer;
}

.nav-toggle-line {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

/* =========================
   Main / Video
   ========================= */

.site-main {
  background: var(--color-page);
}

.hero-video-section {
  width: 100%;
  background: #000;
}

.video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000 url('../img/video-poster.png') center / cover no-repeat;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.mute-button {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 3;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 116px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(0, 0, 0, 0.54);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.mute-button:hover,
.mute-button:focus-visible {
  background: rgba(0, 0, 0, 0.74);
  border-color: rgba(255, 255, 255, 0.62);
  transform: translateX(-50%) translateY(-1px);
  outline: none;
}

/* =========================
   Cards section
   ========================= */

.cards-section {
  padding: 34px 0 54px;
  background: var(--color-page);
}

.section-inner {
  width: min(100%, var(--container-width));
  margin: 0 auto;
  padding: 0 28px;
}

.section-title {
  margin: 0 0 20px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.article-card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.22)),
    var(--card-image);
  background-position: center;
  background-size: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  isolation: isolate;
}

.article-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-overlay-soft);
  opacity: 0;
  transition: opacity var(--transition);
}

.article-card:hover::before {
  opacity: 1;
}

.card-lang-links {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.lang-link {
  min-width: 38px;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.lang-link.is-active {
  background: var(--color-active);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.lang-link.is-active:hover,
.lang-link.is-active:focus-visible {
  background: var(--color-active-hover);
  transform: translateY(-1px);
  outline: none;
}

.lang-link.is-inactive {
  background: var(--color-inactive);
  color: rgba(255, 255, 255, 0.62);
  cursor: default;
  pointer-events: none;
}

.card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: block;
  padding: 18px;
  background: var(--color-overlay);
  transition: background var(--transition), padding-bottom var(--transition);
}

.card-content:hover,
.card-content:focus-visible {
  background: rgba(0, 0, 0, 0.72);
  padding-bottom: 22px;
  outline: none;
}

.card-content h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(16px, 1.5vw, 22px);
  line-height: 1.22;
  font-weight: 800;
  text-wrap: balance;
}

.article {
  padding: 30px;
}
/* =========================
   Footer
   ========================= */

.site-footer {
  background: #0a0c10;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  width: min(100%, var(--container-width));
  margin: 0 auto;
  padding: 24px 28px;
  display: grid;
  gap: 16px;
}

.footer-nav {
  display: flex;
  justify-items: center;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.footer-nav a {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--color-muted);
  outline: none;
}

.footer-warnings {
  display: grid;
  gap: 6px;
  color: var(--color-muted);
  font-size: 13px;
}

.footer-warnings p,
.copyright {
  margin: 0;
}

.copyright {
  color: rgba(255, 255, 255, 0.56);
  font-size: 13px;
}

/* =========================
   Tablet
   ========================= */

@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .brand-title,
  .brand-subtitle {
    max-width: 320px;
  }
}

/* =========================
   Mobile header + cards
   ========================= */

@media (max-width: 760px) {
  :root {
    --header-height: 66px;
    --gap: 14px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
    font-size: 11px;
  }

  .brand-title {
    max-width: 210px;
    font-size: 15px;
  }

  .brand-subtitle {
    max-width: 210px;
    font-size: 10px;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(15, 17, 21, 0.98);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
  }

  .site-header.is-menu-open .main-nav {
    display: flex;
  }

  .main-nav a {
    padding: 15px 18px;
    border-top: 1px solid var(--color-border);
  }

  .site-header.is-menu-open .nav-toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.is-menu-open .nav-toggle-line:nth-child(2) {
    opacity: 0;
  }

  .site-header.is-menu-open .nav-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .video-shell {
    aspect-ratio: 16 / 9;
  }

  .mute-button {
    bottom: 14px;
    min-width: 98px;
    height: 38px;
    padding: 0 14px;
    font-size: 12px;
  }

  .cards-section {
    padding: 24px 0 38px;
  }

  .section-inner {
    padding: 0 14px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .article-card {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .card-content {
    padding: 14px;
  }

  .card-content h2 {
    font-size: 18px;
  }

  .footer-inner {
    padding: 22px 16px;
  }
}

@media (max-width: 420px) {
  .brand-title,
  .brand-subtitle {
    max-width: 168px;
  }

  .article-card {
    aspect-ratio: 4 / 3;
  }

  .lang-link {
    min-width: 34px;
    height: 30px;
    font-size: 11px;
  }
}
