:root {
  --bg: #000;
  --surface: #141414;
  --text: #fff;
  --muted: #8c8c8c;
  --line: #2a2a2a;
  --accent: #fa1821;
  --radius: 14px;
  --gutter: 32px;
  --header-padding: 20px;
  --logo-height: 60px;
  --anchor-clearance: calc(var(--logo-height) + 2 * var(--header-padding) + 16px);
  --section-padding: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Open Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

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

.red {
  color: var(--accent);
}

.dot {
  display: inline-block;
  width: 0.22em;
  height: 0.22em;
  margin-left: 0.06em;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2.4s steps(1) infinite;
}

@keyframes blink {
  0%, 85% { opacity: 1; }
  90% { opacity: 0; }
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 16px 32px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}

.button:hover {
  opacity: 0.85;
}

/* Шапка */
.header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: var(--header-padding) var(--gutter);
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.logo img {
  height: var(--logo-height);
  display: block;
}

.menu {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.pill {
  border: 1px solid var(--text);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}

.pill:hover {
  background: var(--text);
  color: var(--bg);
}

.pill-icon {
  display: block;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  -webkit-mask: var(--icon) center / 60% no-repeat;
  mask: var(--icon) center / 60% no-repeat;
}

.messenger-telegram {
  --icon: url(img/telegram.svg);
  background: #2aabee;
}

.messenger-whatsapp {
  --icon: url(img/whatsapp.svg);
  background: #25d366;
}

.pill-icon:hover {
  background: var(--text);
}

/* Первый экран: манифест */
.hero {
  min-height: min(calc(100vh - 100px), 980px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 24px var(--gutter) 40px;
}

.manifesto {
  font-size: clamp(40px, 7.6vw, 132px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.reel {
  display: inline-block;
  position: relative;
  width: 3.2em;
  height: 0.9em;
  vertical-align: -0.08em;
  z-index: 1;
}

.reel-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0.3em;
  background: #141414;
  transition: height 0.5s ease, width 0.5s ease;
}

@media (hover: hover) {
  .reel:hover .reel-box,
  .reel:focus-visible .reel-box {
    width: 5.08em;
    height: 2.86em;
  }
}

@media (hover: none) {
  .reel.open {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0.1em 0;
  }
}

.reel video,
.reel .touch-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-works {
  display: none;
}

.reel-play {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgb(0 0 0 / 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.reel-play::before {
  content: "";
  margin-left: 2px;
  border: solid transparent;
  border-width: 5px 0 5px 8px;
  border-left-color: #fff;
}

.reel.open .reel-play,
.reel:focus-visible .reel-play {
  display: none;
}

@media (hover: hover) {
  .reel:hover .reel-play {
    display: none;
  }
}

.reel-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 42%);
  color: #fff;
  font: inherit;
  font-size: 0.3em;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

@media (hover: hover) {
  .reel:hover .reel-label {
    opacity: 1;
  }
}

.reel.open .reel-label,
.reel:focus-visible .reel-label {
  opacity: 1;
}

.reel:focus-visible .reel-box {
  outline: 2px solid #fff;
  outline-offset: 3px;
}


.about {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 48px;
  font-size: clamp(18px, 2.2vw, 30px);
  line-height: 1.4;
}

.about h2 {
  font-size: clamp(20px, 2.6vw, 36px);
  font-weight: 700;
  margin-bottom: 8px;
}

.about p {
  color: var(--muted);
}

/* Награды */
.awards-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
  align-items: end;
}

.award {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.award img {
  height: clamp(96px, 10vw, 140px);
  width: auto;
  object-fit: contain;
}

.award figcaption {
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.4;
  color: var(--muted);
}

.award figcaption b {
  display: block;
  color: var(--text);
  font-weight: 700;
}

/* Общие блоки */
.section {
  padding: var(--section-padding) var(--gutter);
  border-top: 1px solid var(--line);
}

#about {
  scroll-margin-top: var(--anchor-clearance);
}

#cases,
#contacts {
  scroll-margin-top: max(0px, calc(var(--anchor-clearance) - var(--section-padding)));
}

.section-title {
  font-size: clamp(36px, 6vw, 96px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

/* Работы */
.cases {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 16px;
}

.case-preview {
  display: block;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: transform 0.3s;
}

.case[data-kinescope]:hover .case-preview {
  transform: scale(0.98);
}

.case:not([data-kinescope]) {
  cursor: default;
}

.case h3 {
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.case p {
  font-size: clamp(18px, 1.8vw, 26px);
  color: var(--muted);
  line-height: 1.2;
  margin-top: 4px;
}

/* Плеер поверх страницы */
.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(0, 0, 0, 0.92);
}

.player[hidden] {
  display: none;
}

.player-frame {
  width: min(100%, 1400px, calc((100vh - 120px) * 16 / 9));
  aspect-ratio: 16 / 9;
}

.player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
}

.player-close {
  position: absolute;
  top: 16px;
  right: var(--gutter);
  width: 44px;
  height: 44px;
  border: 1px solid var(--text);
  border-radius: 50%;
  background: none;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.player-close:hover {
  background: var(--text);
  color: var(--bg);
}

/* Заявка */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.contact-body > p {
  color: var(--muted);
  margin-bottom: 24px;
}

.form {
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.form input,
.form textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font: inherit;
}

.form .button {
  justify-self: start;
}

/* Подвал */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  color: var(--text);
}

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

/* Планшет и узкое окно */
@media (max-width: 1100px) {
  .about {
    grid-template-columns: repeat(2, 1fr);
  }

  .about > div:last-child {
    grid-column: 1 / -1;
  }
}

/* Телефон */
@media (max-width: 760px) {
  :root {
    --gutter: 16px;
    --header-padding: 12px;
    --logo-height: 36px;
  }

  .menu .pill:not(.pill-icon):not([href="#contacts"]) {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-works {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 24px;
  }

  .about,
  .awards-list,
  .cases,
  .contact {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

.touch-preview {
  display: none;
}

@media (hover: none) {
  .case {
    position: relative;
  }

  .reel video:not(.preview-playing),
  video.case-preview:not(.preview-playing) {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
  }

  video:not(.preview-playing) + .touch-preview {
    display: block;
  }
}
