@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/unbounded-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/unbounded-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/unbounded-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/unbounded-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/unbounded-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/unbounded-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/unbounded-800-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/unbounded-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0b0b0d;
  --text: #f5f5f7;
  --muted: #9a9aa2;
  --radius: 16px;
  --gap: 16px;
  --max: 1440px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Unbounded', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- верхняя навигация ---------- */

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 28px clamp(20px, 5vw, 64px);
  display: flex;
  justify-content: flex-end;
}

.nav {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
}

.nav__link {
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.nav__link:hover { opacity: 1; }

/* ---------- первый экран ---------- */

.hero {
  position: relative;
  min-height: 470px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 104px clamp(20px, 5vw, 64px) 18px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/hero.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0.35) 0%, rgba(11, 11, 13, 0.9) 100%);
  z-index: 1;
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: var(--max);
  width: 100%;
}

.hero__title {
  display: block;
  width: min(100%, 1200px);
  height: auto;
  margin: 0 auto;
}

.hero__subtitle {
  margin: 14px 0 0;
  font-size: clamp(14px, 1.4vw, 18px);
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- секции ---------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}

.section-title {
  margin: 38px 0 18px;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- сетка работ ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: #15151a;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: box-shadow 0.35s ease;
}

.card__still,
.card__video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1654 / 928;
  object-fit: cover;
}

.card__still {
  transition: opacity 0.35s ease, transform 0.6s ease;
}

/* видео лежит поверх и проявляется при наведении */
.card__video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card.is-playing .card__video { opacity: 1; }
.card.is-playing .card__still { opacity: 0; }

.card:hover {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.card:hover .card__still { transform: scale(1.02); }

/* ---------- анимации появления ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* заголовок мягко проявляется при загрузке */
.hero__title {
  animation: title-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__subtitle {
  animation: title-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.nav__link {
  animation: title-in 0.6s ease both;
}

.nav__link:nth-child(2) { animation-delay: 0.08s; }
.nav__link:nth-child(3) { animation-delay: 0.16s; }

@keyframes title-in {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* на тач-устройствах видео-превью не используется */
@media (hover: none), (pointer: coarse) {
  .card__video { display: none; }
  .card__title { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero__title,
  .hero__subtitle,
  .nav__link {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ---------- о себе и контакты ---------- */

.contacts__list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.contacts__link {
  display: inline-block;
  padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.contacts__link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
}

/* ---------- подвал ---------- */

.footer {
  margin-top: 80px;
  padding: 32px clamp(20px, 5vw, 64px) 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 14px;
}

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

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

@media (max-width: 640px) {
  .topbar { padding: 18px 20px; }

  .nav { gap: 18px; }

  .nav__link { font-size: 13px; }

  .hero {
    min-height: auto;
    padding: 84px 20px 24px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-title { margin: 48px 0 18px; }

  .footer { margin-top: 56px; }
}

/* Подпись проекта поверх гифки (у статичной картинки она уже вшита в изображение) */
.card__title {
  position: absolute;
  left: clamp(14px, 2vw, 24px);
  bottom: clamp(12px, 1.6vw, 22px);
  right: clamp(14px, 2vw, 24px);
  font-size: clamp(15px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.card.is-playing .card__title {
  opacity: 1;
  transform: none;
}

/* ---------- шапка страниц (проекты и категории) ---------- */

.topbar--project {
  position: relative;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(20px, 5vw, 64px);
}

.brand {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav--wide {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 8px;
}

@media (max-width: 900px) {
  .nav--wide {
    gap: 14px;
  }

  .nav--wide .nav__link {
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .topbar--project {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 20px;
  }

  .nav--wide {
    justify-content: flex-start;
    gap: 12px;
  }
}
