/* ==========================================================================
   Главная: титульный кадр, кинозал, список фильмов, текст архива
   ========================================================================== */

/* --- Титульный кадр ------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 3.4vw, 64px);
  min-height: min(92svh, 940px);
  max-width: var(--page-max);
  margin-inline: auto;
  padding: clamp(96px, 15vh, 170px) var(--gutter) clamp(30px, 6vh, 70px);
  background: var(--ink);
}

.hero__figure {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}

.hero__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: clip;
  background: #000;
  isolation: isolate;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 45%;
  filter: saturate(0.92) contrast(1.02);
  animation: heroDrift 34s var(--ease) both;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--ink) 0%, rgba(11, 11, 12, 0.35) 7%, rgba(11, 11, 12, 0) 22%),
    linear-gradient(180deg, rgba(11, 11, 12, 0.3) 0%, rgba(11, 11, 12, 0) 30%);
}

.hero__caption {
  margin-top: 0.75rem;
  color: var(--ash);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
}

.hero__caption a {
  color: var(--bone-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-line);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.hero__caption a:hover {
  color: var(--bone);
  border-bottom-color: var(--signal);
}

.hero__inner {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1.1rem, 2.6vh, 1.9rem);
  max-width: 34rem;
}

.hero__title {
  font-size: clamp(1.9rem, 3.3vw, 3.35rem);
  font-weight: 200;
  line-height: 1.03;
  letter-spacing: -0.022em;
  text-wrap: balance;
  max-width: 12ch;
  animation: rise 1s var(--ease) 0.15s both;
}

.hero__lead {
  max-width: 31ch;
  color: var(--bone-dim);
  font-size: clamp(0.9375rem, 1.02vw, 1.0625rem);
  line-height: 1.55;
  animation: rise 1s var(--ease) 0.32s both;
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2.5rem;
  width: 100%;
  max-width: 26rem;
  margin-top: clamp(0.6rem, 2vh, 1.6rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  animation: rise 1s var(--ease) 0.5s both;
}

.hero__jump {
  font-size: var(--step-0);
  letter-spacing: 0.01em;
  text-decoration: none;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--signal);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.hero__jump:hover {
  color: var(--signal);
}

.hero__years {
  color: var(--ash);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  margin-left: auto;
}

/* --- Кинозал -------------------------------------------------------------- */

.screening {
  padding-top: clamp(46px, 8vh, 104px);
}

.screening__head {
  margin-bottom: clamp(0.9rem, 1.6vw, 1.3rem);
  font-size: var(--step--1);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--ash);
}

.screening__screen {
  position: relative;
  background: #000;
  box-shadow: 0 0 0 1px rgba(239, 235, 227, 0.09);
  aspect-ratio: var(--film-ar, 16 / 9);
  overflow: hidden;
  transition: aspect-ratio 0.4s var(--ease);
}

.player {
  width: 100%;
  height: 100%;
  background: #000;
  /* Экран подстраивается под формат фильма, а вшитые в файл полосы срезаются. */
  object-fit: cover;
}

/* Кадр другого фильма: показывается, пока фильм не включили. */
.screen__preview {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.screening__screen[data-preview="true"] .screen__preview {
  opacity: 1;
}

.screen__preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.screen__preview img[data-active] {
  opacity: 1;
}

/* Кнопка запуска: тонкое кольцо поверх кадра, пока фильм не включён. */
.player__start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: auto;
  width: clamp(58px, 7vw, 84px);
  height: clamp(58px, 7vw, 84px);
  border: 1px solid rgba(239, 235, 227, 0.72);
  border-radius: 50%;
  background: rgba(11, 11, 12, 0.28);
  backdrop-filter: blur(1px);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.player__start-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--bone);
  transition: border-left-color 0.3s var(--ease);
}

.player__start:hover {
  border-color: var(--signal);
  background: rgba(11, 11, 12, 0.45);
  transform: scale(1.04);
}

.player__start:hover .player__start-icon {
  border-left-color: var(--signal);
}

.screening__screen[data-started="true"] .player__start {
  display: none;
}

/* Пока идёт смена фильма, кадр притухает — это ответ на действие, а не декор. */
.screening__screen[data-switching="true"] .player {
  opacity: 0.35;
}

/* --- Список фильмов ------------------------------------------------------- */

.index {
  list-style: none;
  margin: clamp(26px, 3.4vw, 44px) 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.film {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) 4.5rem 3.9rem;
  align-items: baseline;
  gap: clamp(8px, 1.4vw, 22px);
  padding: clamp(12px, 1.4vw, 19px) clamp(6px, 0.8vw, 12px);
  margin-inline: calc(-1 * clamp(6px, 0.8vw, 12px));
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ash);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.film__num {
  font-size: var(--step--1);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  transition: color 0.25s var(--ease);
}

.film__title {
  font-size: clamp(1.0625rem, 1.45vw, 1.3rem);
  font-weight: 300;
  letter-spacing: -0.012em;
  line-height: 1.25;
  color: var(--bone-dim);
  transition: color 0.25s var(--ease);
}

.film__year,
.film__dur {
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  text-align: right;
  transition: color 0.25s var(--ease);
}

.film:hover,
.film:focus-visible {
  background-color: rgba(239, 235, 227, 0.035);
}

.film:hover .film__title,
.film:focus-visible .film__title {
  color: var(--bone);
}

/* Текущий фильм: красная черта по левому краю и более светлая строка. */
.film[aria-current="true"] {
  background-color: rgba(239, 235, 227, 0.055);
  box-shadow: inset 2px 0 0 var(--signal);
}

.film[aria-current="true"] .film__num {
  color: var(--signal);
}

.film[aria-current="true"] .film__title {
  color: var(--bone);
}

.film[aria-current="true"] .film__year,
.film[aria-current="true"] .film__dur {
  color: var(--bone-dim);
}

/* --- Текст архива --------------------------------------------------------- */

.note {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 60px);
  margin-top: clamp(52px, 8vw, 112px);
}

.note__title {
  font-size: var(--step-1);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--bone);
}

.note__body {
  display: grid;
  gap: 1.05em;
  max-width: var(--measure);
  color: var(--bone-dim);
  font-size: 1.0625rem;
  line-height: 1.68;
}

.note__body p:first-child {
  color: var(--bone);
}

/* --- Анимации ------------------------------------------------------------- */

@keyframes heroDrift {
  from {
    transform: scale(1.07);
  }
  to {
    transform: scale(1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: clamp(84px, 13vh, 120px);
    padding-bottom: clamp(30px, 5vh, 46px);
  }

  .hero__figure {
    grid-column: 1;
    grid-row: 1;
  }

  .hero__media {
    aspect-ratio: 16 / 10;
    max-height: 54svh;
  }

  .hero__shade {
    background: linear-gradient(180deg, rgba(11, 11, 12, 0.35) 0%, rgba(11, 11, 12, 0) 30%, rgba(11, 11, 12, 0.55) 100%);
  }

  .hero__inner {
    grid-column: 1;
    grid-row: 2;
    gap: 1.1rem;
    max-width: none;
  }

  .hero__title {
    max-width: 18ch;
  }

  .film {
    grid-template-columns: 2.2rem minmax(0, 1fr) 3.4rem 3.2rem;
    gap: 0.5rem 0.7rem;
  }

  .film__title {
    font-size: 1.0625rem;
  }

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

@media (max-width: 560px) {
  .masthead__logo,
  .masthead__logo img {
    height: 17px;
  }

  .screening__head {
    letter-spacing: 0.06em;
  }
}
