/* =========================================================
   Yozh Pictures — палитра «REC»
   Чтобы сменить цвета, поменяйте переменные ниже.
   ========================================================= */
:root {
  --bg:        #0c0c0e;   /* графит */
  --surface:   #141417;
  --surface-2: #1b1b1f;
  --line:      rgba(241, 236, 228, 0.09);
  --text:      #f1ece4;   /* тёплый «бумажный» белый */
  --muted:     #8b877f;
  --accent:    #ff5b2e;   /* сигнальный оранжевый — огонёк записи */
  --accent-2:  #ffb199;

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body:    "Manrope", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(16px, 4vw, 56px);
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
em { font-style: normal; color: var(--accent); }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Плёночное зерно поверх всего */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.count { color: var(--accent); }

/* ================= NAV ================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(12, 12, 14, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  animation: blink 2s infinite;
}
.logo__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .04em;
}
.logo__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.logo--small .logo__word { font-size: 14px; }

.nav__links { display: flex; align-items: center; gap: 34px; font-size: 14px; }
.nav__links a { color: var(--muted); transition: color .25s; }
.nav__links a:hover { color: var(--text); }
.nav__links .nav__cta {
  color: var(--text);
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .25s, background .25s, color .25s;
}
.nav__links .nav__cta:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.nav__burger { display: none; width: 40px; height: 40px; position: relative; }
.nav__burger span {
  position: absolute; left: 9px; right: 9px; height: 1.5px; background: var(--text);
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav__burger span:first-child { top: 16px; }
.nav__burger span:last-child { top: 23px; }
.nav.is-open .nav__burger span:first-child { top: 19.5px; transform: rotate(45deg); }
.nav.is-open .nav__burger span:last-child  { top: 19.5px; transform: rotate(-45deg); }

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 96px var(--pad) 28px;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__video {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.hero__video.is-ready { opacity: .45; }
.hero__glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 78% 30%, rgba(255, 91, 46, .28), transparent 70%),
    radial-gradient(45% 45% at 15% 85%, rgba(255, 177, 153, .10), transparent 70%),
    linear-gradient(180deg, rgba(12,12,14,.2) 0%, rgba(12,12,14,.0) 40%, var(--bg) 100%);
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.12) translate(-3%, 2%); }
}

.hero__meta {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  padding-top: 8px;
}
.rec { display: inline-flex; align-items: center; gap: 8px; color: var(--text); letter-spacing: .12em; }
.rec__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.timecode { font-variant-numeric: tabular-nums; letter-spacing: .06em; }

.hero__content { max-width: 1100px; padding: 6vh 0; }
.hero__content .eyebrow { margin-bottom: 26px; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 8.2vw, 124px);
  line-height: .98;
  letter-spacing: -.035em;
}
.hero__title .line { display: block; }
.hero__lead {
  max-width: 520px;
  margin-top: 32px;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  transition: transform .3s var(--ease), background .3s, color .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: var(--text); }
.btn--ghost { border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--text); }
.play {
  width: 0; height: 0;
  border-left: 9px solid var(--accent);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.hero__bottom {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.hero__scroll span { display: inline-block; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ================= MARQUEE ================= */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 22px 0;
}
.marquee__track {
  display: flex; gap: 40px; width: max-content;
  align-items: center;
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(20px, 2.6vw, 34px);
  white-space: nowrap;
  animation: marquee 38s linear infinite;
}
.marquee__track i { font-style: normal; color: var(--accent); font-size: .5em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ================= SECTIONS ================= */
.section { padding: clamp(80px, 12vw, 160px) var(--pad) 0; }
.section__head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section__head .eyebrow { margin-bottom: 14px; }
.section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -.03em;
}
.section__note { max-width: 420px; color: var(--muted); }

/* ================= FILTERS ================= */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  transition: all .25s var(--ease);
}
.filter:hover { color: var(--text); border-color: rgba(241,236,228,.3); }
.filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ================= WORKS GRID ================= */
/* Мозаика по рядам: в ряду все карточки одной высоты и вместе заполняют
   ширину; ширина каждой пропорциональна формату ролика (--ar = ширина / высота) */
.grid {
  --gap: clamp(16px, 2vw, 28px);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.grid__row { display: flex; gap: var(--gap); align-items: flex-start; justify-content: center; }
.grid__row.is-hidden { display: none; }
.card {
  flex: var(--ar) 1 0;
  /* не выше ~600px: после фильтра в ряду может остаться 1–2 ролика */
  max-width: calc(var(--ar) * 600px);
  min-width: 0;
  cursor: pointer;
}
.card.is-hidden { display: none; }
.card.is-static { cursor: default; }
.card.is-static:hover .card__title { color: inherit; }

.card__media {
  position: relative;
  aspect-ratio: var(--ar);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.card__poster,
.card__media video,
.card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease), opacity .5s var(--ease);
}
.card__media video { opacity: 0; }
.card.is-playing .card__media video { opacity: 1; }
.card:hover .card__poster,
.card:hover .card__media video,
.card:hover .card__media img { transform: scale(1.04); }

/* Заглушка-постер, пока нет своего видео */
.card__poster {
  background:
    radial-gradient(70% 90% at var(--px, 70%) var(--py, 30%), hsla(var(--h), 95%, 60%, .55), transparent 65%),
    radial-gradient(60% 70% at 15% 90%, hsla(calc(var(--h) + 40), 80%, 55%, .25), transparent 70%),
    linear-gradient(135deg, var(--surface-2), var(--bg));
}
.card__ph {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(241,236,228,.5);
}

.card__overlay {
  position: absolute; inset: 0;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; align-content: flex-start; gap: 6px;
  padding: 14px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  background: linear-gradient(180deg, rgba(12,12,14,.5), transparent 35%);
  pointer-events: none;
}
.card__badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(12,12,14,.55); backdrop-filter: blur(6px);
}
.card__badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  opacity: 0; transition: opacity .3s;
}
.card.is-playing .card__badge::before { opacity: 1; animation: blink 1.2s infinite; }

.card__playbtn {
  position: absolute; left: 50%; top: 50%;
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  transform: translate(-50%, -50%) scale(.6);
  opacity: 0;
  transition: transform .4s var(--ease), opacity .4s var(--ease);
  pointer-events: none;
}
.card__playbtn::after {
  content: ""; margin-left: 4px;
  border-left: 14px solid var(--bg);
  border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.card:hover .card__playbtn { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.card__info {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px;
  padding: 16px 2px 0;
}
.card__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(17px, 1.6vw, 22px);
  letter-spacing: -.01em;
  transition: color .25s;
}
.card:hover .card__title { color: var(--accent); }
.card__meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ================= SERVICES ================= */
.services { border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: padding .4s var(--ease);
}
.service:hover { padding-left: 14px; }
.service__num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.service__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(22px, 3vw, 40px); letter-spacing: -.02em; line-height: 1.1;
  transition: color .3s;
}
.service:hover .service__title { color: var(--accent); }
.service__text { color: var(--muted); max-width: 420px; }

/* ================= PROCESS ================= */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.step { background: var(--bg); padding: 32px 26px 40px; transition: background .3s; }
.step:hover { background: var(--surface); }
.step__tc {
  display: inline-block;
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  margin-bottom: 56px;
}
.step h3 { font-family: var(--font-display); font-weight: 500; font-size: 19px; line-height: 1.25; margin-bottom: 12px; }
.step p { color: var(--muted); font-size: 15px; }

.tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px;
  margin-top: 40px;
}
.tools__label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tools__list { display: flex; flex-wrap: wrap; gap: 8px; }
.tools__list li {
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px;
}

/* ================= CONTACT ================= */
.contact {
  margin-top: clamp(100px, 14vw, 180px);
  padding: clamp(80px, 12vw, 150px) var(--pad);
  border-top: 1px solid var(--line);
  background: radial-gradient(60% 80% at 50% 120%, rgba(255, 91, 46, .18), transparent 70%);
  text-align: center;
}
.contact .eyebrow { margin-bottom: 26px; }
.contact__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(34px, 6.4vw, 96px); line-height: 1.02; letter-spacing: -.035em;
}
.contact__mail {
  display: inline-block;
  margin-top: 48px;
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(18px, 2.6vw, 34px);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 6px;
  transition: color .25s;
  overflow-wrap: anywhere;
}
.contact__mail:hover { color: var(--accent); }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 28px; margin-top: 40px; font-size: 15px; color: var(--muted); }
.socials a:hover { color: var(--text); }

/* ================= FOOTER ================= */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 26px var(--pad);
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.footer a:hover { color: var(--text); }

/* ================= LIGHTBOX ================= */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: var(--pad);
}
.lightbox[hidden] { display: none; }
.lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 8, 10, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade .35s var(--ease);
}
.lightbox__panel {
  position: relative;
  width: min(1200px, 100%);
  max-height: 100%;
  overflow: auto;
  animation: rise .5s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }

.lightbox__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(12,12,14,.7); border: 1px solid var(--line);
  font-size: 14px;
  transition: background .25s, color .25s;
}
.lightbox__close:hover { background: var(--accent); color: var(--bg); }

.lightbox__media {
  position: relative;
  aspect-ratio: var(--lb-ar, 16 / 9);
  width: min(100%, calc(72vh * var(--lb-ar, 1.7778)));
  margin-inline: auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.lightbox__media video,
.lightbox__media iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; object-fit: contain; background: #000;
}
.lightbox__empty {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  padding: 24px;
  color: var(--muted); font-size: 14px;
}
.lightbox__empty code { font-family: var(--font-mono); color: var(--accent-2); }

.lightbox__info {
  display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 24px; align-items: start;
  padding: 24px 2px 4px;
}
.lightbox__cat { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.lightbox__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -.02em; line-height: 1.15; }
.lightbox__desc { color: var(--muted); }
.lightbox__tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.lightbox__tags li { font-family: var(--font-mono); font-size: 11px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }

body.is-locked { overflow: hidden; }

/* ================= REVEAL ================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .1s; }
.hero .reveal:nth-child(3) { transition-delay: .2s; }
.hero .reveal:nth-child(4) { transition-delay: .3s; }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  /* Планшет и телефон — две колонки: широкие ролики во всю ширину, вертикальные парами */
  .grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: dense; }
  .grid__row { display: contents; }
  .card { max-width: none; }
  .card[data-shape="wide"],
  .card[data-solo] { grid-column: span 2; }
  .card[data-shape][data-solo] .card__media { aspect-ratio: 1; }
  .card[data-shape="tall"] .card__media { aspect-ratio: 3 / 4; }
  .card[data-shape="tall"] .card__badge:last-child { display: none; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .service { grid-template-columns: 56px 1fr; }
  .service__text { grid-column: 2; }
  .lightbox__info { grid-template-columns: 1fr; gap: 12px; }
  .lightbox__tags { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .nav__burger { display: block; }
  .nav__links {
    position: fixed; inset: 0 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 22px;
    padding: 90px var(--pad) 36px;
    background: rgba(12,12,14,.97);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display); font-size: 26px;
    transform: translateY(-100%);
    transition: transform .5s var(--ease);
    z-index: -1;
  }
  .nav__links a { color: var(--text); }
  .nav__links .nav__cta { padding: 0; border: 0; color: var(--accent); }
  .nav__links .nav__cta:hover { background: none; color: var(--accent); }
  .nav.is-open .nav__links { transform: none; }

  .logo__sub { display: none; }
  .card[data-shape][data-solo] .card__media { aspect-ratio: 4 / 5; }
  .card__playbtn { opacity: 1; transform: translate(-50%, -50%) scale(.8); }
  .process { grid-template-columns: 1fr; }
  .step__tc { margin-bottom: 24px; }
  .hero__bottom span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
