/* =========================================================================
   RUSTAM BULATOV — styles
   Тёмная минималистичная сетка: крупный заголовок, таблица работ,
   моно-подписи. Правки контента — в content.js.
   ========================================================================= */

:root {
  --bg:        #080d13;
  --bg-2:      #060a0f;
  --bg-3:      #0a1017;
  --ink:       #e9eef2;
  --ink-2:     #aebac4;
  --muted:     #61717e;
  --line:      rgba(233, 238, 242, .10);
  --line-soft: rgba(233, 238, 242, .06);

  --font-display: "Poppins", "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --pad: clamp(20px, 4vw, 56px);
  --maxw: 1320px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
dl, dd, ul, ol, figure, h1, h2, h3, h4, p { margin: 0; padding: 0; }
ul, ol { list-style: none; }

::selection { background: rgba(233, 238, 242, .18); }

:focus-visible {
  outline: 1px solid rgba(233, 238, 242, .55);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ atoms */

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

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

.grain {
  position: fixed;
  inset: -50%;
  z-index: 900;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  animation: grain 6s steps(6) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -2%); }
  80%  { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* -------------------------------------------------------------------- nav */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 2.4vw, 34px);
  padding: 22px var(--pad);
  transition: background-color .4s var(--ease), backdrop-filter .4s var(--ease), padding .4s var(--ease);
}

.nav.is-stuck {
  padding-block: 14px;
  background: rgba(8, 13, 19, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.nav__brand { color: var(--ink); }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  margin-left: auto;
}

/* Язык и бургер — всегда в шапке, поверх выпадающего меню. */
.nav__actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
}

.nav__links a {
  color: var(--ink-2);
  transition: color .3s var(--ease);
}
.nav__links a:hover { color: var(--ink); }

.lang { display: flex; align-items: center; gap: 6px; }
.lang__btn { color: var(--muted); transition: color .3s var(--ease); }
.lang__btn:hover { color: var(--ink-2); }
.lang__btn.is-active { color: var(--ink); }
.lang__sep { color: var(--muted); }

.nav__burger {
  display: none;
  width: 28px;
  height: 18px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.nav__burger i {
  display: block;
  height: 1px;
  background: var(--ink);
  transition: transform .35s var(--ease), opacity .3s var(--ease);
}

/* ------------------------------------------------------------------- hero */

.hero {
  padding: clamp(110px, 15vh, 170px) var(--pad) clamp(40px, 6vh, 66px);
  max-width: var(--maxw);
  margin-inline: auto;
}

.hero__title {
  font-weight: 300;
  font-size: clamp(34px, 6.2vw, 78px);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin-bottom: clamp(40px, 7vh, 84px);
}

.hero__title .line {
  display: block;
  overflow: hidden;
}

.hero__title .line > span {
  display: block;
  transform: translateY(105%);
  animation: rise 1.1s var(--ease) forwards;
}
.hero__title .line:nth-child(2) > span { animation-delay: .12s; }

@keyframes rise { to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hero__title .line > span { transform: none; animation: none; }
}

/* ------------------------------------------------------------------- reel */

.reel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
}

/* Пропорции задаёт content.js (SITE.reel.ratio): --reel-ar для рамки,
   --reel-arn тем же числом — оно не даёт блоку вырасти выше экрана. */
.reel {
  width: min(100%, calc(72vh * var(--reel-arn, 2.4)));
}

.reel__stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--reel-ar, 12 / 5);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
}

.reel__media,
.reel__media img,
.reel__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel__media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Прозрачная кнопка поверх шоурила: он играет сам, клик открывает со звуком. */
.reel__open {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.reel__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 15, .35), rgba(6, 10, 15, .55));
}

.reel__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 15, 0);
  transition: background .5s var(--ease);
}
.reel__stage:hover::after { background: rgba(6, 10, 15, .12); }

.reel__btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.reel__btn svg {
  width: 54px;
  height: 54px;
  opacity: .85;
  transition: transform .5s var(--ease), opacity .4s var(--ease);
}
.reel__stage:hover .reel__btn svg { transform: scale(1.08); opacity: 1; }

.reel__bar {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 14px clamp(14px, 2vw, 22px);
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- section */

.section {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(56px, 9vh, 104px) var(--pad);
}

.section + .section,
.hero + .section { border-top: 1px solid var(--line-soft); }

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.sort {
  transition: color .3s var(--ease);
  white-space: nowrap;
}
.sort:hover { color: var(--ink-2); }
.sort i { font-style: normal; }

/* ------------------------------------------------------------------ table */

.table__head,
.row__line {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(0, 300px) 64px;
  align-items: center;
  gap: 16px;
}

.table__head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.table__head > span:last-child { text-align: right; }

.row { border-bottom: 1px solid var(--line-soft); }

.row__line {
  width: 100%;
  padding: 18px 0;
  text-align: left;
  transition: opacity .35s var(--ease);
}

.row__n {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
  align-self: start;
  padding-top: 6px;
}

.row__title {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 300;
  letter-spacing: -.01em;
  color: var(--ink);
  transition: opacity .35s var(--ease), transform .5s var(--ease);
}

.row__format {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.row__year {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
  text-align: right;
}

.row:hover .row__title { transform: translateX(6px); }
.row.is-open .row__title { color: #fff; }

/* раскрытая карточка */
.row__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .55s var(--ease), opacity .45s var(--ease);
  opacity: 0;
}
.row.is-open .row__panel { grid-template-rows: 1fr; opacity: 1; }

.row__panel > div { overflow: hidden; }

.row__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 16px;
  padding: 0 0 30px;
}

.row__still {
  position: relative;
  aspect-ratio: 12 / 5;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
}
.row__still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.row:hover .row__still img { transform: scale(1.02); }

/* вертикальная обложка 4:5 — целиком, на размытом фоне из неё же */
.row__still--cover { aspect-ratio: 16 / 9; }
.row__still--cover .row__still-img {
  position: relative;
  z-index: 1;
  object-fit: contain;
}
.row__still-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: blur(28px) saturate(.8);
  transform: scale(1.15);
  opacity: .5;
}
.row:hover .row__still-bg { transform: scale(1.15); }

.row__side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 2px;
}

.row__credits {
  display: grid;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.row__credits div { display: flex; gap: 10px; }
.row__credits dt { color: var(--muted); min-width: 74px; }
.row__credits dd { color: var(--ink-2); }

.row__desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 46ch;
}

.watch {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: gap .35s var(--ease), border-color .35s var(--ease);
}
.watch:hover { gap: 14px; border-color: rgba(233, 238, 242, .45); }

/* ------------------------------------------------------------------ about */

.section--about { background: transparent; }

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: clamp(28px, 6vw, 90px);
  align-items: start;
  margin-top: 26px;
}

.about__text p {
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.5;
  font-weight: 300;
  letter-spacing: -.01em;
  max-width: 30ch;
  color: var(--ink);
}
.about__text p + p { margin-top: 1em; max-width: 40ch; }

/* правая колонка: маленький портрет + мета-строки */
.about__side {
  display: grid;
  gap: clamp(22px, 3vw, 34px);
  justify-items: start;
}

.about__photo { width: 132px; }

.about__photo img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  filter: grayscale(1);
  opacity: .88;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.about__photo:hover img { opacity: 1; transform: translateY(-2px); }

.about__photo figcaption { margin-top: 10px; }

.about__meta { display: grid; width: 100%; }

.about__meta .row-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.about__meta .row-meta:first-child { border-top: 1px solid var(--line-soft); }
.about__meta dt { color: var(--muted); }
.about__meta dd { color: var(--ink-2); }

/* ---------------------------------------------------------------- contact */

.contact {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.contact__email {
  font-size: clamp(22px, 3.4vw, 42px);
  font-weight: 300;
  letter-spacing: -.02em;
  color: var(--ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  transition: border-color .4s var(--ease), opacity .4s var(--ease);
  word-break: break-word;
}
.contact__email:hover { border-color: rgba(233, 238, 242, .5); }

.socials {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  padding-bottom: 12px;
}
.socials a { transition: color .3s var(--ease); }
.socials a:hover { color: var(--ink); }

/* ----------------------------------------------------------------- footer */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 22px var(--pad) 30px;
  border-top: 1px solid var(--line-soft);
}

/* ------------------------------------------------------------------ modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(4, 7, 10, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: default;
}

.modal__panel {
  position: relative;
  width: min(1180px, 100%);
  display: grid;
  gap: 14px;
  animation: pop .45s var(--ease) both;
}

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

.modal__close {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  transition: color .3s var(--ease);
}
.modal__close:hover { color: var(--ink); }
.modal__close svg { width: 11px; height: 11px; }

.modal__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.modal__stage iframe,
.modal__stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.modal__stage .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.modal__meta h3 {
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -.01em;
}
.modal__meta p {
  margin-top: 5px;
  font-size: 13px;
  color: var(--ink-2);
  max-width: 60ch;
}
.modal__meta .side {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .table__head,
  .row__line {
    grid-template-columns: 34px minmax(0, 1fr) 54px;
  }
  .table__head > span:nth-child(3),
  .row__format { display: none; }

  .row__inner { grid-template-columns: 1fr; }
  .row__still--cover { aspect-ratio: 4 / 5; }
  .row__still--cover .row__still-img { object-fit: cover; }
  .row__still--cover .row__still-bg { display: none; }
}

@media (max-width: 760px) {
  .nav__burger { display: flex; }

  .nav__links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 22px;
    padding: var(--pad);
    background: rgba(8, 13, 19, .97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .4s var(--ease), transform .4s var(--ease);
  }
  .nav__links.is-open { opacity: 1; pointer-events: auto; transform: none; }
  .nav__links a { font-size: 13px; letter-spacing: .22em; color: var(--ink); }

  .nav__links.is-open ~ .nav__actions .nav__burger i:first-child { transform: translateY(3px) rotate(45deg); }
  .nav__links.is-open ~ .nav__actions .nav__burger i:last-child  { transform: translateY(-3px) rotate(-45deg); }

  /* Переключатель языка виден на первом экране, палец в него попадает. */
  .nav__actions { gap: 16px; }
  .lang { gap: 2px; }
  .lang__btn { padding: 8px 7px; }

  .reel__stage { aspect-ratio: var(--reel-ar, 16 / 10); }
  .reel__btn svg { width: 42px; height: 42px; }

  .about { grid-template-columns: 1fr; }
  .about__text p, .about__text p + p { max-width: none; }
  .about__photo { width: 112px; }

  .contact { align-items: flex-start; flex-direction: column; }
  .socials { padding-bottom: 0; }

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