/* PXLAB — лендинг. Макет: desktop 1920, mobile 375.
   --u — один пиксель макета. На десктопе не больше 1px (на широких экранах
   размеры как в макете, контент растягивается), ниже 1920 — пропорционально.
   На мобильной раскладке --u считается от ширины 375. */

@font-face { font-family: "Aileron"; font-weight: 300; font-style: normal; font-display: swap; src: url("../assets/fonts/aileron-light.woff2") format("woff2"); }
@font-face { font-family: "Aileron"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/aileron-regular.woff2") format("woff2"); }
@font-face { font-family: "Aileron"; font-weight: 700; font-style: normal; font-display: swap; src: url("../assets/fonts/aileron-bold.woff2") format("woff2"); }
/* «&» как в макете (Helvetica Light): у Aileron свой амперсанд, берём один глиф из Inter */
@font-face { font-family: "Aileron"; font-weight: 300; font-style: normal; font-display: swap; src: url("../assets/fonts/amp-inter-300.woff2") format("woff2"); unicode-range: U+0026; }
@font-face { font-family: "Aileron"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/amp-inter-400.woff2") format("woff2"); unicode-range: U+0026; }

:root {
  --bg: #F8F7F4;
  --ink: #000;
  --u: min(1px, calc(100vw / 1920));
  --side: 12.8125%;      /* 246 / 1920 — начало и конец контента */
  --label: 5.2083%;      /* 100 / 1920 — метки секций */
  --edge: 1.927%;        /* 37 / 1920 — стрелки */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-light: -0.015em;   /* трекинг Aileron подобран под ширины Helvetica */
  --t-reg: -0.045em;
  --t-bold: -0.025em;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Aileron", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  letter-spacing: var(--t-light);
  line-height: 1.375;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video, svg { display: block; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
[hidden] { display: none !important; }

/* Подчёркивание, которое выезжает слева направо */
.link-line { position: relative; display: inline-block; }
.link-line::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -0.06em;
  height: max(1px, .055em);
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .45s var(--ease);
}
.link-line.is-current::after,
.link-line:focus-visible::after { transform: scaleX(1); transform-origin: left center; }
@media (hover: hover) {
  .link-line:hover::after { transform: scaleX(1); transform-origin: left center; }
}

.label {
  position: absolute;
  left: var(--label);
  font-weight: 300;
  font-size: max(14px, calc(24 * var(--u)));
  line-height: 1.375;
  text-transform: uppercase;
}
.section { position: relative; }

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  background: #1a1a18;
  color: #fff;
}
.hero__slides { position: absolute; inset: 0; }
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero__video.is-active { opacity: 1; }

.hero__bar {
  position: absolute; z-index: 2;
  top: calc(20 * var(--u));
  left: 3.698%;           /* 71 / 1920 */
  display: flex;
  align-items: flex-start;
}
.logo svg { width: calc(307 * var(--u)); min-width: 150px; height: auto; }
.hero__nav {
  display: flex;
  gap: calc(20 * var(--u));
  margin: calc(62 * var(--u)) 0 0 calc(5 * var(--u));
  font-weight: 700;
  font-size: max(13px, calc(18 * var(--u)));
  letter-spacing: var(--t-bold);
  text-transform: uppercase;
}
.burger { display: none; }

.hero__arrow {
  position: absolute; z-index: 2;
  top: 50%;
  width: max(40px, calc(53 * var(--u)));
  height: max(40px, calc(53 * var(--u)));
  margin-top: calc(max(40px, calc(53 * var(--u))) / -2);
  color: #fff;
  transition: transform .35s var(--ease);
}
.hero__arrow svg { width: 100%; height: 100%; }
.hero__arrow--prev { left: var(--edge); transform: rotate(180deg); }
.hero__arrow--next { right: var(--edge); }
@media (hover: hover) {
  .hero__arrow--prev:hover { transform: rotate(180deg) scale(1.15); }
  .hero__arrow--next:hover { transform: scale(1.15); }
}
.hero__dots { display: none; }

/* ---------- Мобильное меню ---------- */
.menu { position: fixed; inset: 0; z-index: 50; }
.menu__backdrop { position: absolute; inset: 0; }
.menu__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  left: 4%;
  background: #fff;
  transform: translateX(100%);
  transition: transform .55s var(--ease);
  overflow-y: auto;
}
.menu.is-open .menu__panel { transform: none; }
.menu__close {
  position: absolute;
  top: calc(20 * var(--u)); right: calc(15 * var(--u));
  width: calc(28 * var(--u)); height: calc(28 * var(--u));
}
.menu__close svg { width: 100%; height: 100%; }
.menu__nav {
  position: absolute;
  top: calc(78 * var(--u)); left: calc(20 * var(--u));
  display: flex; flex-direction: column; align-items: flex-start;
  gap: calc(20 * var(--u));
  font-size: calc(20 * var(--u));
  line-height: 1.4;
  text-transform: uppercase;
}
.menu__nav .is-current { font-weight: 400; letter-spacing: var(--t-reg); }
.menu__social {
  position: absolute;
  top: calc(322 * var(--u)); left: calc(20 * var(--u));
}
.menu__label { font-size: calc(20 * var(--u)); line-height: 1.4; text-transform: uppercase; }
.menu__social ul { margin-top: calc(30 * var(--u)); display: flex; flex-direction: column; align-items: flex-start; gap: calc(10 * var(--u)); font-size: calc(14 * var(--u)); }

/* ---------- About ---------- */
.about { padding: calc(248 * var(--u)) var(--side); }
.about .label { top: calc(260 * var(--u)); }
.about__body { display: flex; flex-direction: column; align-items: center; gap: calc(120 * var(--u)); }
.about__statement {
  font-weight: 400;
  font-size: calc(87 * var(--u));
  line-height: 1;
  letter-spacing: var(--t-reg);
  text-align: center;
  opacity: .98;
}
/* на десктопе строки разбиты вручную, как в макете: внутри строки не переносим (мин. кегль 13px иначе ломает строки у 900–1100) */
@media (min-width: 900px) { .about__statement, .about__col p, .about__col h3 { white-space: nowrap; } }
.br-m { display: none; }
.about__rule { width: calc(500 * var(--u)); margin: 0; border: 0; border-top: 1px solid var(--ink); }
.about__cols {
  display: flex;
  align-items: flex-start;
  gap: calc(20 * var(--u));
  font-size: max(14px, calc(26 * var(--u)));
  line-height: calc(30 / 26);
}
.about__col h3 { font: inherit; margin-bottom: calc(50 * var(--u)); }
.about__col:nth-child(1) { width: calc(231 * var(--u)); text-align: left; }
.about__col:nth-child(2) { width: calc(372 * var(--u)); text-align: center; }
.about__col:nth-child(3) { width: calc(297 * var(--u)); text-align: right; }

/* ---------- Цифры ---------- */
.stats { padding: 0 var(--side); }
/* колонки начинаются там же, где в макете: 0 / 501 / 939 / 1346 из 1428 */
.stats__row {
  display: grid;
  grid-template-columns: 501fr 438fr 407fr 82fr;
  align-items: end;
  min-height: calc(215 * var(--u));
  padding-bottom: calc(11.5 * var(--u));   /* в макете под подписями запас до низа ряда */
}
.stats__item { white-space: nowrap; }
.stats__title { font-size: max(15px, calc(26 * var(--u))); margin-bottom: calc(50 * var(--u)); }
.stats__num {
  font-weight: 400;
  font-size: calc(87 * var(--u));
  line-height: .72;          /* высота цифр как у векторов в макете */
  letter-spacing: var(--t-reg);
}
.stats__cap { margin-top: calc(30 * var(--u)); font-size: max(13px, calc(18 * var(--u))); }
/* Счётчик: ширина зафиксирована по итоговому числу */
.stats__val { display: inline-block; }


/* ---------- Works ---------- */
.works { padding: calc(248 * var(--u)) var(--side); }
.works .label { top: calc(238 * var(--u)); }
.works__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: calc(32 * var(--u));
  row-gap: calc(30 * var(--u));
}
.card__btn { display: block; width: 100%; text-align: left; }
.card__media {
  display: block;
  aspect-ratio: 698 / 400;
  overflow: hidden;
  background: #e8e6e1;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
  -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none;
}
@media (hover: hover) {
  .card__btn:hover .card__media img { transform: scale(1.045); }
}
.card__cap { display: block; font-size: max(13px, calc(18 * var(--u))); }
.works__more { display: none; }

/* ---------- Клиенты ---------- */
.clients { padding: 0 var(--side); }
.clients__row { display: flex; justify-content: space-between; align-items: flex-end; }
.clients__title { font-size: max(15px, calc(26 * var(--u))); margin-bottom: calc(50 * var(--u)); white-space: nowrap; }
.clients__name {
  font-weight: 400;
  font-size: calc(80 * var(--u));
  letter-spacing: var(--t-reg);
  white-space: nowrap;
}
.clients__geo { margin-top: calc(20 * var(--u)); font-size: max(13px, calc(18 * var(--u))); }

/* ---------- Контакты ---------- */
.contact { padding-top: calc(240 * var(--u)); }
.contact .label { top: calc(242 * var(--u)); }
.contact__body {
  margin: 0 var(--side);
  display: grid;
  grid-template-columns: 880fr 548fr;
  align-items: start;
}
.contact__sub { font-size: max(15px, calc(26 * var(--u))); }
.contact__mail {
  margin-top: calc(31 * var(--u));
  font-weight: 400;
  font-size: calc(80 * var(--u));
  letter-spacing: var(--t-reg);
  white-space: nowrap;
}
.contact__label { margin-top: calc(2 * var(--u)); font-size: max(14px, calc(24 * var(--u))); text-transform: uppercase; }
.contact__social ul { margin-top: calc(50 * var(--u)); display: flex; flex-direction: column; align-items: flex-start; gap: calc(10 * var(--u)); font-size: max(15px, calc(26 * var(--u))); }
.legal {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  margin: calc(284 * var(--u)) var(--label) 0;
  padding-bottom: calc(100 * var(--u));
  font-size: max(12px, calc(14 * var(--u)));
  text-transform: uppercase;
}
.legal__home { text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }

/* ---------- Просмотр фото ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(248, 247, 244, .97);
  opacity: 0;
  transition: opacity .4s ease;
  -webkit-user-select: none; user-select: none;
}
.lightbox.is-open { opacity: 1; }
.lightbox__figure { max-width: min(84vw, 1600px); }
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 80vh; max-height: 80svh;
  width: auto; height: auto;
  pointer-events: none;            /* правый клик попадает в подложку, а не в картинку */
  -webkit-user-drag: none; -webkit-touch-callout: none;
  transition: opacity .35s ease;
}
.lightbox__img.is-loading { opacity: 0; }
.lightbox__cap { margin-top: 0; font-size: max(13px, calc(18 * var(--u))); }   /* как .card__cap */
.lightbox__close {
  position: absolute; top: 24px; right: 24px;
  width: 32px; height: 32px;
}
.lightbox__close svg { width: 100%; height: 100%; }
.lightbox__arrow {
  position: absolute; top: 50%;
  width: max(40px, calc(53 * var(--u))); height: max(40px, calc(53 * var(--u)));
  margin-top: calc(max(40px, calc(53 * var(--u))) / -2);
  color: var(--ink);
  transition: transform .35s var(--ease);
}
.lightbox__arrow svg { width: 100%; height: 100%; }
.lightbox__arrow--prev { left: var(--edge); transform: rotate(180deg); }
.lightbox__arrow--next { right: var(--edge); }
.lightbox__count { display: none; }
@media (hover: hover) {
  .lightbox__arrow--prev:hover { transform: rotate(180deg) scale(1.15); }
  .lightbox__arrow--next:hover { transform: scale(1.15); }
}

/* ---------- Курсор-квадрат ---------- */
.cursor { display: none; }
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor .cursor {
  position: fixed; left: 0; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background-color .3s, opacity .2s;
  will-change: transform;
}
.cursor span {
  font-weight: 400; font-size: 13px; letter-spacing: 0; text-transform: uppercase;
  color: #fff; opacity: 0; transition: opacity .2s;
}
html.has-cursor .cursor.is-link { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
html.has-cursor .cursor.is-view { width: 80px; height: 80px; margin: -40px 0 0 -40px; background: #000; mix-blend-mode: normal; }
.cursor.is-view span { opacity: 1; transition-delay: .1s; }
html.has-cursor .cursor.is-out { opacity: 0; }

/* ======================================================
   Мобильная раскладка (макет 375)
   ====================================================== */
@media (max-width: 899px) {
  :root { --u: clamp(0.85px, calc(100vw / 375), 1.6px); --side: 4%; }

  .label { position: static; font-size: calc(20 * var(--u)); line-height: 1.4; margin-bottom: calc(60 * var(--u)); }

  .hero__bar { left: 0; right: 4%; justify-content: space-between; align-items: flex-start; }
  .logo svg { width: calc(161 * var(--u)); min-width: 0; }
  .hero__nav, .hero__arrow { display: none; }
  .burger {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: calc(5 * var(--u));
    width: calc(37 * var(--u)); height: calc(39 * var(--u));
    margin-top: calc(10.5 * var(--u));
    padding-top: calc(5 * var(--u));
  }
  .burger span { width: calc(24 * var(--u)); height: calc(3 * var(--u)); border-radius: calc(3 * var(--u)); background: #fff; }   /* 80:748–749 */
  .hero__dots {
    position: absolute; z-index: 2; left: 50%; bottom: calc(20 * var(--u));
    transform: translateX(-50%);
    display: flex; align-items: center; gap: calc(5 * var(--u));
  }
  .hero__dot {
    width: calc(7.87 * var(--u)); height: calc(7.87 * var(--u));
    border-radius: 50%;
    background: var(--bg);
    transition: width .3s var(--ease), height .3s var(--ease), background-color .3s;
  }
  .hero__dot.is-active { width: calc(13.31 * var(--u)); height: calc(13.31 * var(--u)); background: #000; box-shadow: 0 0 0 1px rgba(248, 247, 244, .55); }

  .about { padding: calc(60 * var(--u)) var(--side); }
  .about__body { gap: calc(60 * var(--u)); }
  .about__statement { font-size: calc(40 * var(--u)); }
  .br-m { display: inline; }
  .br-d { display: none; }
  .about__rule { width: calc(159 * var(--u)); }
  .about__cols { align-self: stretch; gap: calc(13 * var(--u)); font-size: calc(14 * var(--u)); line-height: calc(16 / 14); }
  .about__col h3 { margin-bottom: calc(30 * var(--u)); white-space: nowrap; }
  .about__col:nth-child(1) { width: auto; flex: 97 1 0; }
  .about__col:nth-child(2) { width: auto; flex: 114 1 0; }
  .about__col:nth-child(3) { width: auto; flex: 109 1 0; }

  .stats { padding: calc(60 * var(--u)) var(--side); }
  .stats__row { display: flex; flex-direction: column; align-items: center; gap: calc(60 * var(--u)); min-height: 0; padding-bottom: 0; text-align: center; }
  .stats__item { display: flex; flex-direction: column; align-items: center; }
  .stats__title { font-size: calc(16 * var(--u)); margin-bottom: calc(30 * var(--u)); }
  .stats__num { font-size: calc(68 * var(--u)); }
  .stats__cap { margin-top: calc(20 * var(--u)); font-size: calc(14 * var(--u)); }

  .works { padding: calc(60 * var(--u)) var(--side); }
  .works__grid { grid-template-columns: 1fr; row-gap: calc(30 * var(--u)); }
  .card__media { aspect-ratio: 345 / 210; }
  .card__cap { font-size: calc(16 * var(--u)); }
  .works:not(.is-open) .card.is-extra { display: none; }
  .card.is-revealed { animation: card-in .7s var(--ease) both; }
  .works__more {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: calc(47 * var(--u));
    margin-top: calc(30 * var(--u));
    border: 1px solid var(--ink);
    font-weight: 400; font-size: calc(16 * var(--u)); letter-spacing: var(--t-reg);
  }
  .works.is-open .works__more { display: none; }

  .clients { padding: calc(60 * var(--u)) var(--side); }
  .clients__row { flex-direction: column; align-items: center; gap: calc(60 * var(--u)); text-align: center; }
  .clients__item { display: flex; flex-direction: column; align-items: center; }
  .clients__title { font-size: calc(16 * var(--u)); margin-bottom: calc(30 * var(--u)); }
  .clients__name { font-size: calc(65 * var(--u)); line-height: calc(90 / 65); }
  .clients__geo { font-size: calc(14 * var(--u)); }

  .contact { padding: calc(60 * var(--u)) 0 0; }
  .contact .label { margin: 0 var(--side) calc(10 * var(--u)); }
  .contact__body { display: block; }
  .contact__sub { font-size: calc(16 * var(--u)); }
  .contact__mail { margin-top: calc(10 * var(--u)); font-size: calc(40 * var(--u)); }
  .contact__social { margin-top: calc(60 * var(--u)); }
  .contact__label { margin: 0; font-size: calc(20 * var(--u)); line-height: 1.4; }
  .contact__social ul { margin-top: calc(10 * var(--u)); font-size: calc(14 * var(--u)); }
  .legal { margin: calc(160 * var(--u)) var(--side) 0; padding-bottom: calc(60 * var(--u)); font-size: calc(14 * var(--u)); }

  .lightbox__figure { max-width: 100%; padding: 0 var(--side); }
  .lightbox__cap { font-size: calc(16 * var(--u)); }
  /* На телефоне стрелки и счётчик внизу, свайп тоже листает */
  .lightbox__arrow { top: auto; bottom: 28px; margin-top: 0; width: 40px; height: 40px; }
  .lightbox__arrow--prev { left: calc(50% - 90px); }
  .lightbox__arrow--next { right: calc(50% - 90px); }
  .lightbox__count {
    display: block; position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
    line-height: 40px; font-size: 14px; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  }
  .lightbox__close { top: 16px; right: 16px; width: 28px; height: 28px; }
}

/* Планшет: мобильная раскладка, но работы в две колонки */
@media (min-width: 600px) and (max-width: 899px) {
  :root { --u: clamp(0.85px, calc(100vw / 480), 1.6px); }
  .works__grid { grid-template-columns: 1fr 1fr; column-gap: calc(16 * var(--u)); }
  /* колонки шире телефонных: ручные переносы дают висячие слова — текст течёт сам, строки выравниваются */
  .about__col:nth-child(n+2) p br { display: none; }
  .about__col p { text-wrap: balance; }
}

@keyframes card-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ======================================================
   Оптическое выравнивание по левому краю: у Aileron пустой припуск слева у первой буквы
   (S 5%, B 10%, «1» 13% кегля…), из-за чего крупное слово отъезжает от подписи под ним.
   Каждую строку сдвигаем на припуск её первой буквы — буквы встают в одну вертикаль.
   Значения сняты из файлов шрифта (aileron-regular / aileron-light).
   ====================================================== */
@media (min-width: 900px) {
  /* Studio in numbers: 13 / 65+ / 2018 / 12 и подписи Y / P / S / C */
  .stats__title { margin-left: -0.047em; }
  .stats__num[data-count^="1"] { margin-left: -0.13em; }
  .stats__num[data-count^="2"] { margin-left: -0.06em; }
  .stats__num[data-count^="6"] { margin-left: -0.043em; }
  .stats__item:nth-child(1) .stats__cap { margin-left: -0.021em; }
  .stats__item:nth-child(2) .stats__cap { margin-left: -0.099em; }
  .stats__item:nth-child(3) .stats__cap { margin-left: -0.047em; }
  .stats__item:nth-child(4) .stats__cap { margin-left: -0.049em; }

  /* Selected clients: Sberbank / Burj Azizi / Valley / Others и Russia / Dubai / Netherlands / Worldwide */
  .clients__title { margin-left: -0.047em; }
  .clients__item:nth-child(1) .clients__name { margin-left: -0.052em; }
  .clients__item:nth-child(2) .clients__name { margin-left: -0.1em; }
  .clients__item:nth-child(3) .clients__name { margin-left: -0.032em; }
  .clients__item:nth-child(4) .clients__name { margin-left: -0.047em; }
  .clients__item:nth-child(1) .clients__geo,
  .clients__item:nth-child(2) .clients__geo,
  .clients__item:nth-child(3) .clients__geo { margin-left: -0.099em; }
  .clients__item:nth-child(4) .clients__geo { margin-left: -0.026em; }
}
/* Contact выровнен влево и на телефоне: «New projects…» над «hello@pxlab.art» */
.contact__sub { margin-left: -0.099em; }
.contact__mail { margin-left: -0.074em; }
