/* ---------- «О компании»: 15-секундная световая заставка (about.js) ---------- */

.about-film {
  --af-gold: #ffe294;
  --af-cream: #fff3cf;
  --af-blue: #3f9cff;

  position: fixed;
  inset: 0;
  z-index: 400;               /* выше праздничного экрана (300), ниже курсора (9999) */
  overflow: hidden;
  background: #06182b;
  color: #fff;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.about-film[hidden] {
  display: none;
}

.about-film.is-open {
  opacity: 1;
}

.about-film__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.about-film__stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* каждая сцена — слой на весь экран, текст по центру */
.af-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 18px);
  padding: 0 20px;
  text-align: center;
  text-shadow: 0 2px 22px rgba(3, 12, 24, 0.5);
}

.af-scene > *,
.af-name__l,
.af-word,
.af-pill {
  margin: 0;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform, filter;
}

.af-eyebrow {
  color: rgba(255, 236, 190, 0.92);
  font-size: clamp(12px, 1.4vw, 14px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

/* сцена 1 — «Всё начинается с рассвета» */
.af-line {
  font-size: clamp(24px, 4.4vw, 52px);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.af-line b {
  color: var(--af-gold);
  font-weight: 500;
}

.af-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-left: 0.15em;
  padding: 0.1em 0.7em 0.16em 0.24em;
  border: 1px solid rgba(255, 226, 148, 0.65);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 226, 148, 0.1), rgba(255, 226, 148, 0.36));
  box-shadow:
    0 0 28px rgba(255, 206, 110, 0.35),
    inset 0 0 14px rgba(255, 240, 200, 0.22);
  color: var(--af-cream);
  font-size: 0.86em;
  vertical-align: 0.04em;
}

/* хвост кометы, пока капсула влетает */
.af-pill::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% - 6px);
  width: 4.5em;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 226, 148, 0.9), rgba(255, 226, 148, 0));
  transform: translateY(-50%);
  opacity: var(--trail, 0);
}

.af-pill__sun {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: var(--af-gold);
  filter: drop-shadow(0 0 6px rgba(255, 220, 130, 0.9));
}

/* сцена 2 — название */
.af-name {
  display: flex;
  font-size: clamp(46px, 11vw, 136px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.af-name__l {
  display: inline-block;
}

.af-name__l--plan {
  font-weight: 200;
}

.af-sub {
  color: rgba(255, 243, 207, 0.88);
  font-size: clamp(12px, 1.6vw, 16px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

/* сцена 3 — «легко / быстро / точно», текст чуть выше солнца */
.af-s3 {
  padding-bottom: 22vh;
}

.af-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.1em 0.7em;
  font-size: clamp(34px, 7vw, 84px);
  line-height: 1.15;
}

.af-word {
  display: inline-block;
}

/* сцена 4 — технология и мастера, над световым мастерпланом */
.af-s4 {
  padding-bottom: 30vh;
}

.af-tech {
  font-size: clamp(24px, 4.6vw, 54px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.af-masters {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(16px, 2.4vw, 26px);
  line-height: 1.4;
}

.af-masters em {
  color: var(--af-gold);
  font-style: normal;
  white-space: nowrap;
}

/* сцена 5 — финал */
.af-logo {
  width: clamp(56px, 7vw, 76px);
  height: auto;
  color: #0f3a5c;
  filter: drop-shadow(0 0 22px rgba(255, 214, 120, 0.7));
}

.af-final-name {
  font-size: clamp(38px, 7.4vw, 88px);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
}

.af-final-name span {
  font-weight: 200;
}

.af-final-sub {
  color: rgba(255, 243, 207, 0.92);
  font-size: clamp(14px, 1.8vw, 18px);
  letter-spacing: 0.14em;
}

/* ---------- управление ---------- */

.about-film__close {
  appearance: none;
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.about-film__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.about-film__close svg,
.about-film__replay svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* финальные кнопки: «Смотреть ещё раз» и «Подробнее о сервисе» */
.about-film__end {
  position: absolute;
  right: 16px;
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.6s ease,
    visibility 0.6s,
    transform 0.6s cubic-bezier(.2, .8, .2, 1);
}

.about-film.is-ended .about-film__end {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.about-film__replay,
.about-film__more {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 11px 26px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.about-film__more[hidden] {
  display: none;
}

/* главный шаг после фильма — тёплая сплошная кнопка */
.about-film__more {
  border-color: #ffe294;
  background: #ffe294;
  color: #1a2f44;
}

.about-film__more svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1);
}

.about-film__more:hover svg {
  transform: translateX(3px);
}

.about-film__replay:hover {
  background: rgba(255, 255, 255, 0.18);
}

.about-film__more:hover {
  background: #fff0c4;
}

.about-film__close:focus-visible,
.about-film__replay:focus-visible,
.about-film__more:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.about-film__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: opacity 0.6s ease;
}

.about-film__progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 226, 148, 0.15), var(--af-gold));
  transform: scaleX(0);
  transform-origin: left center;
}

.about-film.is-ended .about-film__progress {
  opacity: 0;
}

.about-film__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .about-film,
  .about-film__end {
    transition: none;
  }
}
