:root {
  --ink: #000;
  --ink-80: rgba(0, 0, 0, 0.8);
  --accent: #4b0b0c;  /* бордовый сайта */
  --btn: #a6bbd6;     /* заливка кнопок и звёздочки */
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: #f6f6f7; }

body {
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ============ DESKTOP (макет 1437 × 907) ============ */

.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: linear-gradient(to left, #f4f5f5, #f7f8f9);
}

/* Видео-кадры. --H — высота исходного кадра видео (762px),
   кроп 710×732 начинается с x=250, y=30; центр фигуры по x = 360 в кропе */
.stage {
  --H: min(71.2svh, 45vw);
  position: absolute;
  width: calc(var(--H) * 710 / 762);
  height: calc(var(--H) * 732 / 762);
  left: calc(50% - var(--H) * 360 / 762);
  top: calc(50% - var(--H) * 0.5 + var(--H) * 30 / 762 - 0.8%);
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to right, transparent 2%, #000 12%, #000 88%, transparent 98%),
    linear-gradient(to bottom, transparent 0, #000 4%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 2%, #000 12%, #000 88%, transparent 98%),
    linear-gradient(to bottom, transparent 0, #000 4%, #000 95%, transparent 100%);
  mask-composite: intersect;
}

.stage__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Папки */
.folder {
  position: absolute;
  width: 101.554px;
  height: 101.554px;
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1);
  z-index: 2;
}
.folder img {
  display: block;
  width: 100%;
  height: 100%;
}
.folder span {
  position: absolute;
  left: 8.16px;
  top: 93.39px;
  font-size: 12.694px;
  letter-spacing: -0.1269px;
  white-space: nowrap;
}
.folder:hover { transform: translateY(-6px) rotate(-2deg); }

.folder--portfolio { left: 18.16%; top: 20.73%; }
.folder--designers { left: 61.31%; top: 6.84%; }
.folder--clients   { left: 77.45%; top: 27.78%; }

/* Заголовок */
.title {
  font-weight: 400;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.title__name,
.title__surname,
.title__role {
  position: absolute;
  top: 44.76%;
  font-family: var(--serif);
  font-size: 64px;
  line-height: normal;
  letter-spacing: -1.28px;
  text-transform: uppercase;
  white-space: nowrap;
}
.title__name i { font-style: italic; }
.title__name { left: 20px; }
.title__role { right: 20px; }
.title__surname { display: none; }

.title__script {
  position: absolute;
  top: calc(44.76% + 39px);
  font-size: 64px;
  color: var(--accent);
}

/* Курсив — SVG-контуры шрифта Denistina (assets/fonts), высота = ascent + descent */
.ink {
  display: block;
  height: calc(2350em / 2048);
  width: auto;
  overflow: visible;
}
.ink__fill { fill: currentColor; }
.ink__stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 190;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.title__script--surname { left: 49px; }
.title__script--role { right: 38px; }

/* Низ */
.bottom {
  position: absolute;
  left: 0;
  right: 0;
  top: 85.45%;
  height: 51px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  letter-spacing: -0.14px;
  color: var(--ink-80);
  text-transform: uppercase;
  text-align: center;
  z-index: 2;
}
.tags {
  display: flex;
  gap: 44px;
  white-space: nowrap;
}
.tags--right { width: 181px; justify-content: flex-end; }

.cta,
.marquee,
.br-m { display: none; }

/* ============ MOBILE (макет 375 × 1023) ============ */

@media (max-width: 767px) {
  .hero {
    --u: calc(100vw / 375);
    height: calc(1063 * var(--u));
    min-height: 0;
    background: #f6f6f7;
  }

  /* высота кадра видео 500u, фигура по центру (187.5u), верх видео 336u */
  .stage {
    --H: calc(500 * var(--u));
    left: calc(187.5 * var(--u) - var(--H) * 360 / 762);
    top: calc(336 * var(--u) + var(--H) * 30 / 762);
  }

  .folder {
    width: calc(72.769 * var(--u));
    height: calc(72.769 * var(--u));
  }
  .folder span {
    left: calc(5.85 * var(--u));
    top: calc(66.92 * var(--u));
    font-size: calc(9.096 * var(--u));
    letter-spacing: -0.091px;
  }
  .folder--portfolio { left: calc(29 * var(--u));     top: calc(96.96 * var(--u)); }
  .folder--clients   { left: calc(156.57 * var(--u)); top: calc(34.7 * var(--u)); }
  .folder--designers { left: calc(281.23 * var(--u)); top: calc(116.96 * var(--u)); }

  .title__name,
  .title__surname,
  .title__role { font-size: calc(64 * var(--u)); }

  .title__name,
  .title__surname {
    left: calc(62 * var(--u));
    width: calc(245 * var(--u));
    text-align: center;
  }
  .title__name { top: calc(154 * var(--u)); }
  .title__surname {
    display: block;
    top: calc((154 + 77.5 - 23) * var(--u));
  }
  .title__role {
    left: calc(119 * var(--u));
    right: auto;
    top: calc(291 * var(--u));
  }

  .title__script--surname { display: none; }
  .title__script--role {
    left: calc(145 * var(--u));
    right: auto;
    top: calc(323 * var(--u));
    width: calc(167.443 * var(--u));
    height: calc(67.781 * var(--u));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(44.326 * var(--u));
    letter-spacing: -0.8865px;
    transform: rotate(-6.01deg);
  }

  .bottom {
    top: calc(860 * var(--u)); /* отступ от туфель до текста */
    height: auto;
    padding: 0;
    justify-content: center;
  }
  .bottom .tags { display: none; }
  .lead { width: calc(256 * var(--u)); }
  .lead .br-m { display: inline; }
  .lead .br-d { display: none; }

  .cta {
    position: absolute;
    left: 0;
    top: calc(940 * var(--u));
    width: 100%;
    padding: 0 8px;
    display: flex;
    gap: 2px;
    z-index: 2;
  }
  .cta__main,
  .cta__arrow {
    height: 60px;
    border-radius: 8px;
    background: var(--btn);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }
  .cta__main {
    flex: 1 0 0;
    padding: 8px 12px;
    font-family: "Inter Tight", var(--sans);
    font-weight: 500;
    font-size: 18px;
    line-height: 1;
    color: var(--ink);
    text-transform: uppercase;
  }
  .cta__arrow { width: 60px; flex-shrink: 0; }
  .cta__arrow img { transform: rotate(45deg); }

  .marquee {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(1028 * var(--u));
    overflow: hidden;
    font-weight: 500;
    font-size: 14px;
    line-height: normal;
    letter-spacing: -0.14px;
    color: var(--ink-80);
    text-transform: uppercase;
  }
  .marquee__track {
    display: flex;
    width: max-content;
    animation: marquee 14s linear infinite;
  }
  .marquee__track span { padding-left: 15px; padding-right: 29px; white-space: nowrap; }
}

/* ============ БЛОК 2: ПОРТФОЛИО (макет 1440 × 1980) ============
   Вступление (фото с булавкой и текст), ниже строка «Мої клієнти» с країнами и лента
   кейсов: на экране ровно три карточки. Если кейсов больше трёх, строка с лентой
   закрепляется у верха экрана (sticky), и прокрутка вниз двигает ленту влево до
   последнего кейса (works.js). Высоту .works__stage считает works.js. */

.works {
  --k: min(100vw / 1440, 100svh / 1000); /* масштаб от макета */
  position: relative;
  padding-top: calc(200 * var(--k));
  background: #f6f6f7;
}

.works__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(64 * var(--k));
  padding: 0 20px;
}
/* рамка фото не меняется; при прокрутке фото внутри приближается, и лицо
   приходит в центр рамки (--s, --ty считает works.js) */
.works__photo {
  position: relative;
  width: calc(212 * var(--k));
  height: calc(246 * var(--k));
}
.works__photo-frame { width: 100%; height: 100%; overflow: hidden; background: #d9d9d9; }
.works__photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  filter: grayscale(1);
  transform: translate(calc(var(--tx, 0) * 100%), calc(var(--ty, 0) * 100%)) scale(var(--s, 1));
  transform-origin: 50% 0;
  will-change: transform;
}
.works__pin {
  position: absolute;
  left: calc(150 * var(--k));
  top: calc(-36 * var(--k));
  width: calc(172 * var(--k));
  height: auto;
  pointer-events: none;
}
/* заливка текста при прокрутке (как на two26.studio): буквы бледные, по ним идёт
   волна — сначала бордовые, следом сразу чёрные. Цвет каждой буквы ставит works.js */
.works__lead .ch { color: var(--c, inherit); }
.works__lead .pill { background: var(--c, #060606); }
.works__lead {
  max-width: calc(900 * var(--k));
  font-size: calc(44 * var(--k));
  line-height: 1.1;
  letter-spacing: -0.05em;
  text-align: center;
  color: var(--ink);
}
.pill {
  display: inline-block;
  padding: 0.09em 0.27em;
  border-radius: calc(8 * var(--k));
  background: #060606;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.864em; /* 38 / 44 */
  line-height: 1.1;
  color: #fff;
}

.works__stage { position: relative; }
/* вступление (фото и текст о себе) — под лентой кейсов */
.works__intro { margin-top: calc(200 * var(--k)); padding-bottom: calc(80 * var(--k)); }
.works__viewport {
  position: sticky;
  top: 0;
  padding-top: calc(20 * var(--k));
  overflow: hidden;
  container-type: inline-size; /* ширина карточек — от ширины ленты (cqw) */
}

.works__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(51 * var(--k));
  padding: 0 calc(20 * var(--k));
}
.works__label,
.works__region {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink-80);
}
.works__regions { display: flex; gap: calc(44 * var(--k)); }


/* Большой заголовок блока (PORTFOLIO, SERVICES): буквы выезжают по очереди,
   когда секция получает .is-in */
.big-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: min(13.54vw, 19.5svh);
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
}
.big-title i { font-style: italic; }
.big-title__letters { display: inline-flex; }
.wl {
  display: inline-block;
  /* буква выезжает из-за своего нижнего края */
  clip-path: inset(-0.3em -0.2em 0 -0.2em);
}
.wl > span { display: inline-block; }
.js .wl > span { transform: translateY(105%); }
.is-in .wl > span {
  animation: slide-up 0.7s cubic-bezier(.16, 1, .3, 1) calc(var(--i) * 0.045s) both;
}

.works__track {
  display: flex;
  align-items: flex-start;
  gap: calc(8 * var(--k));
  margin-top: calc(48 * var(--k));
  padding: 0 calc(20 * var(--k));
  width: max-content;
  will-change: transform;
}
/* три карточки на экран: ширина ленты минус поля и два зазора, поровну */
.work {
  flex: none;
  width: calc((100cqw - 56 * var(--k)) / 3);
  transition: opacity 0.3s;
}

.work__media {
  position: relative;
  aspect-ratio: var(--w) / var(--h);
  overflow: hidden;
  background: #d9d9d9;
}
.work__img,
.work__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
/* видео лежит поверх картинки и проявляется, когда начало играть */
.work__video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.work.is-playing .work__video { opacity: 1; }

/* Клик по видео открывает сайт кейса (works.js). С мышью вместо обычного курсора —
   белый круг со стрелкой; mix-blend-mode: difference выворачивает видео под ним в негатив. */
.work__media { cursor: pointer; }
.works__cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  pointer-events: none;
  mix-blend-mode: difference;
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0);
}
.works__cursor > span {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(.16, 1, .3, 1);
}
.works__cursor img { width: 32px; height: 32px; transform: rotate(45deg); }
.works__cursor.is-on > span { transform: scale(1); }
@media (hover: hover) and (pointer: fine) {
  .work__media { cursor: none; }
}
@media not ((hover: hover) and (pointer: fine)) {
  .works__cursor { display: none; }
}

.work__meta {
  display: flex;
  gap: 0.6em;
  margin-top: 12px;
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  letter-spacing: -0.01em;
  color: var(--ink-80);
}
.work__client { text-transform: uppercase; }
.work__country { color: rgba(0, 0, 0, 0.6); }
.work__country::before { content: "·"; margin-right: 0.6em; }
.work__caption {
  margin-top: 12px;
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.6);
}
.work__link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
}
.work__link::after { content: " ↗"; }
.work__link:hover { color: var(--accent); }
.work__link:not([href]) { display: none; } /* ссылки ещё нет — не показываем */

/* Телефон: проекты просто друг за другом, без закрепления и движения вбок */
@media (max-width: 767px) {
  .works {
    --u: calc(100vw / 375);
    /* от бегущей строки первого экрана до «Мої клієнти» — 70px */
    padding: calc(70px - 20 * var(--u)) 0 calc(100 * var(--u));
  }
  .works__intro { gap: calc(32 * var(--u)); padding: 0 calc(16 * var(--u)); }
  .works__photo { width: calc(140 * var(--u)); height: calc(162 * var(--u)); }
  .works__pin {
    left: calc(99 * var(--u));
    top: calc(-24 * var(--u));
    width: calc(113 * var(--u));
  }
  .works__lead { max-width: none; font-size: calc(24 * var(--u)); }
  .br-d { display: none; } /* переносы строк из макета — только на десктопе */
  .pill { border-radius: calc(5 * var(--u)); }
  .works__stage { height: auto !important; }
  /* от последнего кейса до булавки над фото — 120px */
  .works__intro { margin-top: calc(120px + 24 * var(--u)); padding-bottom: 0; }
  .works__viewport { position: static; overflow: visible; padding-top: 0; }
  .works__bar {
    flex-direction: column;
    align-items: center;
    gap: calc(12 * var(--u));
    height: auto;
    padding: 0 calc(9 * var(--u));
  }
  .works__regions { flex-wrap: wrap; justify-content: center; gap: calc(8 * var(--u)) calc(20 * var(--u)); }
  .works__track {
    flex-direction: column;
    gap: calc(56 * var(--u)); /* между кейсами */
    margin-top: calc(24 * var(--u));
    width: auto;
    padding: 0 calc(9 * var(--u));
    transform: none !important;
  }
  .work { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .js .wl > span { transform: none; }
  .is-in .wl > span { animation: none; }
}

/* ============ БЛОК 3: УСЛУГИ ============
   Фон сайта, крупный заголовок SERVICES (Figma), ниже строки услуг (сетка и размеры —
   прежние). При прокрутке строка выезжает справа и проявляется, линия под ней
   дорисовывается — по --p (0…1) из services.js. */

.services {
  --k: min(100vw / 1440, 1px);
  --fp-ink: var(--ink);
  --fp-muted: rgba(0, 0, 0, 0.6);
  --fp-line: rgba(0, 0, 0, 0.1);
  padding: 160px 20px;
  overflow-x: clip; /* строки выезжают из-за правого края */
  background: #f6f6f7;
  color: var(--ink);
}
.services__title {
  padding-bottom: 40px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: min(8.4vw, 13.5svh); /* как «Let's make something cool» в финале */
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: uppercase;
}
.services__title i { font-style: italic; }
.services .fp__list { margin-top: 24px; }


/* появление строки: выезжает справа, проявляется, линия снизу дорисовывается */
.reveal { --p: 1; position: relative; }
.reveal > * {
  opacity: calc(0.25 + 0.75 * var(--p));
  transform: translateX(calc((1 - var(--p)) * 35vw));
}
.services .fp-row { border-bottom: 0; }
.services .fp-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--fp-line);
  transform: scaleX(var(--p));
  transform-origin: 100% 50%;
}

/* ============ ПАПКИ (общее для этапов) ============
   Вкладка нужной формы + тело папки; цвета — переменными у конкретной папки. */
.fp {
  --fp-ink: #fff;
  --fp-muted: rgba(255, 255, 255, 0.6);
  --fp-line: rgba(255, 255, 255, 0.1);
  color: var(--fp-ink);
}

/* вкладка: форма из макета, текст по центру */
.fp__tab {
  position: relative;
  width: calc(310 * var(--k));
  min-width: 170px;
  height: 65px;
  margin-left: calc(var(--tab-x) * var(--k));
  display: grid;
  place-items: center;
}
.fp__tab svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--fp-bg);
}
.fp__tab h2 {
  position: relative;
  padding-top: 6px;
  font-weight: 500;
  font-size: 16px;
  line-height: normal;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.fp__body {
  padding: 64px 20px;
  background: var(--fp-bg);
}

.fp-row {
  display: grid;
  grid-template-columns: 1fr minmax(0, 500px) 1fr;
  align-items: center;
  column-gap: 24px;
  padding: 25px 0;
  border-bottom: 1px solid var(--fp-line);
}
.fp-row--cta { grid-template-columns: 1fr auto 1fr; padding: 35px 0; }
.fp-row--cta:first-child { padding-top: 25px; }
.fp-row__head { display: grid; gap: 12px; max-width: 334px; }
.fp-row__name {
  font-family: "Inter Tight", var(--sans);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.fp-row__desc {
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  letter-spacing: -0.01em;
  color: var(--fp-muted, rgba(255, 255, 255, 0.6));
}
.fp-row__price {
  justify-self: end;
  font-family: "Inter Tight", var(--sans);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.fp-row--cta .fp-row__price { justify-self: center; }
.fp-row--cta .fp-btn { justify-self: end; }

/* белая кнопка со стрелкой (как .order, только на тёмном) */
.fp-btn { display: flex; gap: 2px; }
.fp-btn__main,
.fp-btn__arrow {
  height: 60px;
  border-radius: 8px;
  background: var(--btn);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.fp-btn__main {
  width: 306px;
  padding: 8px 12px;
  font-family: "Inter Tight", var(--sans);
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  color: #000;
  text-transform: uppercase;
}
.fp-btn__arrow { width: 60px; }
.fp-btn__arrow img { transform: rotate(45deg); }
/* стрелки на голубых кнопках — чёрные (белая картинка инвертируется) */
.cta__arrow img[src$="arrow.svg"],
.fp-btn__arrow img[src$="arrow.svg"],
.finale__arrow img[src$="arrow.svg"] { filter: invert(1); }

.fp__actions {
  margin-top: 89px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.fp-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "Inter Tight", var(--sans);
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
}
/* чёрная стрелка; при наведении она улетает, на её месте проявляется логотип Telegram */
.fp-link__icon { position: relative; display: grid; width: 34px; height: 34px; place-items: center; }
.fp-link__icon img { grid-area: 1 / 1; transition: opacity 0.3s, translate 0.35s cubic-bezier(.16, 1, .3, 1), scale 0.35s; }
.fp-link__arrow { transform: rotate(45deg); }
.fp-link__tg { opacity: 0; scale: 0.6; }
.fp-link:hover .fp-link__arrow { opacity: 0; translate: 8px -8px; }
.fp-link:hover .fp-link__tg { opacity: 1; scale: 1; }

/* Телефон: вкладки уже, пункты в две строки (название и цена, под ними описание) */
@media (max-width: 767px) {
  .services { padding: 80px 8px; }
  .services__title { padding-bottom: 24px; font-size: 12.5vw; }
  .fp__body { padding: 32px 8px 48px; }
  .fp-row,
  .fp-row--cta {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name price" "desc desc";
    align-items: start;
    row-gap: 12px;
    padding: 20px 0;
  }
  .fp-row--cta {
    grid-template-areas: "head price" "btn btn";
    row-gap: 20px;
  }
  .fp-row__head { grid-area: head; }
  .fp-row__name { grid-area: name; font-size: 18px; }
  .fp-row__name br { display: none; }
  .fp-row__desc { grid-area: desc; }
  .fp-row__head > * { grid-area: auto; } /* внутри шапки пункта — обычный столбик */
  .fp-row__price { grid-area: price; font-size: 18px; }
  .fp-row--cta .fp-row__price { justify-self: end; }
  .fp-row--cta .fp-btn { grid-area: btn; justify-self: stretch; }
  .fp-btn__main { flex: 1; width: auto; }
  .fp__actions {
    margin-top: 48px;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  .fp-link { align-self: center; }
}

/* ============ ЕТАПИ РОБОТИ: 4 ПАПКИ ============
   Фон сайта, 3 папки, вкладки слева — справа — по центру.
   Стопка папок: папка i закреплена (sticky) на i × 48px от верха экрана. Высота
   папки — общая H минус этот отступ, где H подогнана под самую полную папку
   (--stack-h, stages.js), поэтому пустых половин нет и следующая папка приходит
   сразу за содержимым. Следующая наезжает и встаёт на 48px ниже — у предыдущих
   остаются видны вкладки. Последняя не закреплена: когда она ложится, низы всех
   папок совпадают, закреплённые отпускаются одновременно, и стопка уходит целиком. */

.stages {
  --k: min(100vw / 1440, 1px);
  --step: 48px;
  --tab-h: 65px;
  position: relative;
  padding-top: 120px;
  background: #f6f6f7;
}
.sf {
  position: sticky;
  top: calc(var(--i) * var(--step));
  height: calc(var(--stack-h, 100svh) - var(--i) * var(--step));
  display: flex;
  flex-direction: column;
}
.sf:last-child { position: relative; top: auto; }
.sf .fp__body { flex: 1; }

/* вкладки: слева — справа — по центру; цвета: чёрная → бордо → цвет фона */
.sf--1 { --fp-bg: #1b1b1b; --tab-x: 86; }
.sf--2 { --fp-bg: var(--accent); --tab-x: 1044; }
.sf--3 {
  --fp-bg: #f6f6f7;
  --tab-x: 565;
  --fp-ink: var(--ink);
  --fp-muted: rgba(0, 0, 0, 0.6);
  --fp-line: rgba(0, 0, 0, 0.1);
}
/* последняя папка того же цвета, что фон: прикрывает край папки под ней,
   иначе на стыке проступает тонкая линия */
.sf--3 .fp__body { box-shadow: 0 2px 0 #f6f6f7; }
/* пункты в папках свободнее */
.sf .fp-row { padding: 40px 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .stages { --step: 44px; --tab-h: 52px; padding-top: 80px; }
  /* вкладки шире (190 из 375): слева — справа — по центру */
  .sf--1 { --tab-x: 6; }
  .sf--2 { --tab-x: 179; }
  .sf--3 { --tab-x: 92.5; }
  .sf .fp-row { padding: 28px 0; }
  .sf .fp__tab { width: calc(190 * 100vw / 375); min-width: 0; height: 52px; margin-left: calc(var(--tab-x) * 100vw / 375); }
  .sf .fp__tab h2 { font-size: 12px; letter-spacing: 0; white-space: nowrap; }
}

/* ============ ФИНАЛ (как первый экран onlines.com.ar) ============
   Сцена на весь экран, фон сайта. По центру надпись в рамке выделения (как в Figma),
   вокруг всё расставлено в процентах от сцены: иконки инструментов, макеты с кейсами,
   чаты, наброски страниц. Когда сцена показалась, элементы по очереди появляются
   (.is-in, задержка --d), а курсоры Yuliia UI/UX и Claude Code гуляют (finale.js). */

.finale { padding-top: 100px; background: #f6f6f7; }
.finale__stage {
  position: relative;
  height: max(100svh, 760px);
  overflow: hidden;
}

/* появление */
.fin { position: absolute; }
.js .fin {
  opacity: 0;
  scale: 0.85;
  transition: opacity 0.6s ease, scale 0.8s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--d, 0s);
}
.js .finale.is-in .fin { opacity: 1; scale: 1; }

/* приложения как на рабочем столе: белая иконка, подпись снизу (как у папок
   на первом экране), при наведении подпрыгивает так же */
.fin--logo {
  left: var(--x);
  top: var(--y);
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 72px;
}
.app__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1);
}
.fin--logo:hover .app__icon { transform: translateY(-6px) rotate(-2deg); }
.app__name {
  font-size: 12.694px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--ink);
}

/* ноутбук у левого края */
.fin--laptop { left: -3%; top: 47%; width: 21%; }
.laptop__screen {
  aspect-ratio: 16 / 10.4;
  border: 7px solid #1b1b1b;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: #000;
}
.laptop__base {
  height: 12px;
  margin: 0 -6%;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(#e2e2e4, #b9b9bd);
}
.fin--laptop img,
.fin--poster video,
.fin--phone video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* экран с видео у правого верхнего края */
.fin--poster {
  left: 79.5%; top: 16%;
  width: 22%;
  aspect-ratio: 2082 / 1248;
  padding: 5px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  rotate: -3deg;
}

/* телефон у правого края */
.fin--phone {
  left: 88%; top: 49%;
  width: 8.5%;
  aspect-ratio: 9 / 19;
  border: 5px solid #1b1b1b;
  border-radius: 26px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 2px #d1d1d4;
}
.phone__island {
  position: absolute; left: 50%; top: 6px; translate: -50% 0;
  width: 34%; height: 12px; border-radius: 8px; background: #1b1b1b;
}

/* чаты */
.fin--chat {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 18px;
  min-width: 270px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-size: 14px; line-height: 1.5; color: var(--ink);
}
.fin--chat b { font-weight: 500; }
.fin--chat span { color: rgba(0, 0, 0, 0.4); margin-left: 4px; }
.fin--c1 { left: 68.5%; top: 26%; }
.chat__ava {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font: 500 11px/1 var(--sans); font-style: normal; color: #fff;
}
.chat__ava--yz { background: var(--accent); }
.chat__ava--cc { background: #f4ede8; }

/* надпись в рамке выделения + кнопка под ней — на заднем плане,
   иконки, макеты и чаты лежат поверх рамки */
.finale__stage > .fin { z-index: 1; }
.finale__center {
  position: absolute; inset: 0;
  z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 40px;
  pointer-events: none;
}
.finale__center .fin { position: relative; }
.finale__box { padding: 20px 40px; }
.finale__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: min(8.4vw, 13.5svh);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
}
.finale__title i { font-style: italic; }
.finale__cta { display: flex; gap: 2px; pointer-events: auto; }
.finale__btn,
.finale__arrow {
  height: 60px; border-radius: 8px; background: var(--btn);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.finale__btn {
  width: 306px; padding: 8px 12px;
  font-family: "Inter Tight", var(--sans); font-weight: 500; font-size: 18px; line-height: 1;
  color: var(--ink); text-transform: uppercase;
}
.finale__arrow { width: 60px; }
.finale__arrow img { transform: rotate(45deg); }

/* курсоры: позицию (--cx, --cy в px) меняет finale.js, движение — переходом */
.cur {
  position: absolute; left: 0; top: 0; z-index: 2;
  pointer-events: none;
  translate: var(--cx, -100px) var(--cy, -100px);
  transition: translate 2.4s cubic-bezier(.45, 0, .25, 1), opacity 0.6s;
  opacity: 0;
}
.finale.is-in .cur { opacity: 1; }
.cur svg { display: block; width: 16px; height: 16px; fill: var(--c); stroke: #fff; stroke-width: 1; }
.cur span {
  display: inline-block; margin: 2px 0 0 12px; padding: 3px 7px;
  border-radius: 4px; background: var(--c);
  font-weight: 500; font-size: 13px; line-height: 1.2; color: #fff; white-space: nowrap;
}
.cur--yz { --c: var(--accent); }
.cur--cc { --c: #d97757; }

/* Телефон: только надпись, кнопка, курсоры и иконки по краям */
@media (max-width: 767px) {
  .finale__stage { height: max(100svh, 640px); }
  .fin--laptop, .fin--poster, .fin--phone, .fin--chat { display: none; }
  .fin--logo { left: var(--mx); top: var(--my); }
  .app__icon { width: 52px; height: 52px; border-radius: 12px; }
  .app__icon img { width: 26px; height: 26px; }
  .finale__box { padding: 14px 16px; }
  .finale__title { font-size: 12.5vw; }
  .finale__cta { width: calc(100% - 32px); }
  .finale__btn { flex: 1; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .js .fin { opacity: 1; scale: 1; transition: none; }
  .cur { transition: opacity 0.6s; }
}

/* ============ КНОПКИ СО СТРЕЛКОЙ ============
   Все двойные кнопки (текст + квадрат со стрелкой): при наведении (на телефоне —
   при нажатии) зазор пропадает, половинки сливаются в одну цельную кнопку,
   стрелка поворачивается ↗ → →. При наведении фон становится голубым. */
.cta, .fp-btn, .finale__cta { transition: gap 0.35s cubic-bezier(.16, 1, .3, 1); }
.cta > *, .fp-btn > *, .finale__cta > * {
  transition: border-radius 0.35s cubic-bezier(.16, 1, .3, 1);
}
.cta img, .fp-btn img, .finale__cta img {
  transition: transform 0.35s cubic-bezier(.16, 1, .3, 1);
}
:is(.cta, .fp-btn, .finale__cta):is(:hover, :active) { gap: 0; }
:is(.cta, .fp-btn, .finale__cta):is(:hover, :active) > :first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
:is(.cta, .fp-btn, .finale__cta):is(:hover, :active) > :last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
:is(.cta, .fp-btn, .finale__cta):is(:hover, :active) img { transform: rotate(90deg); }

/* ============ ЗАГРУЗОЧНЫЙ ЭКРАН ============
   Красный фон, фото как снимок из фотобудки, вокруг мерцают голографические звёзды,
   под фото проценты. Затем экран уезжает вверх (.is-done, loader.js). */
html.is-loading { overflow: hidden; }
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  background: var(--accent);
  transition: translate 1s cubic-bezier(.76, 0, .24, 1);
}
.loader.is-done { translate: 0 -100%; }
.loader__photo {
  position: relative;
  width: min(220px, 52vw);
  aspect-ratio: 260 / 330;
  /* белая рамка старого снимка: бумага чуть желтит, свет сверху слева, край
     приподнят (внутренние тени), под фото мягкая тень — ощущение объёма */
  padding: 9px 9px 11px;
  background: linear-gradient(145deg, #fdfcf8 0%, #f2efe7 55%, #e6e1d6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.12),
    inset 1px 0 1px rgba(255, 255, 255, 0.6),
    0 1px 1px rgba(0, 0, 0, 0.25),
    0 6px 10px rgba(0, 0, 0, 0.2),
    0 22px 40px rgba(0, 0, 0, 0.35);
  rotate: -1.5deg;
  animation: loader-in 0.8s cubic-bezier(.16, 1, .3, 1) both;
}
.loader__photo img {
  display: block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); /* граница снимка в рамке */
  outline: 1px solid rgba(0, 0, 0, 0.08);
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 20%;
}
@keyframes loader-in { from { opacity: 0; translate: 0 20px; scale: 0.94; } }
/* звезда: пятиконечная, голографический перелив, мерцает и чуть вращается */
.loader__star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  background: var(--btn);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  rotate: var(--r);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
  animation: star-pop 0.6s cubic-bezier(.16, 1, .3, 1) calc(0.1s + var(--d) * 0.35) both,
    star-twinkle 2.4s ease-in-out calc(var(--d) + 0.8s) infinite;
}
@keyframes star-pop { from { opacity: 0; scale: 0; } }
@keyframes star-twinkle { 50% { scale: 0.75; opacity: 0.7; rotate: calc(var(--r) + 25deg); } }
.loader__count {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  .loader__star { animation: none; }
  .loader { transition-duration: 0.3s; }
}

/* ============ ПЛАВНАЯ ПРОКРУТКА (Lenis, smooth.js) ============ */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
[data-lenis-prevent] { overscroll-behavior: contain; }

/* ============ ОКНО «ДЛЯ ДИЗАЙНЕРІВ» (macOS) ============
   <dialog>: строка заголовка с тремя кнопками (красная закрывает), внутри две карточки.
   Появляется с лёгким увеличением, фон за окном размыт. */
.mac {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100svh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f6f6f7;
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 30px 80px rgba(0, 0, 0, 0.35);
  opacity: 0;
  scale: 0.96;
  transition: opacity 0.25s ease, scale 0.35s cubic-bezier(.16, 1, .3, 1), display 0.35s allow-discrete, overlay 0.35s allow-discrete;
}
.mac[open] { opacity: 1; scale: 1; }
@starting-style { .mac[open] { opacity: 0; scale: 0.96; } }
.mac::backdrop {
  background: rgba(0, 0, 0, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background 0.3s, backdrop-filter 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;
}
.mac[open]::backdrop {
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@starting-style { .mac[open]::backdrop { background: rgba(0, 0, 0, 0); backdrop-filter: blur(0); } }

.mac__bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(#ececee, #e3e3e6);
}
.mac__dots { display: flex; gap: 8px; }
.mac__dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2);
}
.mac__dot--close { background: #ff5f57; cursor: pointer; position: relative; }
.mac__dot--min { background: #febc2e; }
.mac__dot--max { background: #28c840; }
/* крестик на красной кнопке при наведении, как в macOS */
.mac__dot--close::before {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 600 11px/1 var(--sans);
  color: rgba(0, 0, 0, 0.55);
  opacity: 0;
}
.mac__dots:hover .mac__dot--close::before { opacity: 1; }
.mac__title {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.7);
}

.mac__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  overflow: auto;
  max-height: calc(100svh - 48px - 44px);
}
.offer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border-radius: 8px;
  background: #fff;
}
.offer__tag {
  font-weight: 500;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.4);
}
.offer__name {
  font-family: "Inter Tight", var(--sans);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.offer__desc,
.offer__list {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.6);
}
.offer__list { list-style: none; }
.offer__list li { padding: 10px 0; border-bottom: 1px dashed rgba(0, 0, 0, 0.12); }
.offer__preview {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.offer__preview img {
  display: block;
  width: 100%;
  height: auto;
  transition: scale 0.6s cubic-bezier(.16, 1, .3, 1);
}
.offer__preview:hover img { scale: 1.03; }
.offer__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 8px;
}
.offer__price {
  font-family: "Inter Tight", var(--sans);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.offer .fp-btn__main { width: auto; min-width: 200px; }
html:has(.mac[open]) { overflow: hidden; } /* страница под окном не прокручивается */
.offer__note {
  font-family: "Inter Tight", var(--sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.25;
  text-transform: uppercase;
}

/* форма заявки */
.mac--form { width: min(640px, calc(100vw - 32px)); }
.order {
  display: grid;
  gap: 20px;
  padding: 28px;
  overflow: auto;
  max-height: calc(100svh - 48px - 44px);
}
/* шаги: полоска прогресса, «Крок 1 з 3 · название», внутри шага — группы вариантов */
.order__progress { height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.08); overflow: hidden; }
.order__progress i {
  display: block;
  height: 100%;
  width: calc(var(--step, 1) / 3 * 100%);
  background: var(--ink);
  transition: width 0.4s cubic-bezier(.16, 1, .3, 1);
}
.order__stepname { font-size: 14px; color: rgba(0, 0, 0, 0.55); }
.order__stepname b { font-weight: 500; color: var(--ink); }
.order__step { display: grid; gap: 22px; animation: step-in 0.35s cubic-bezier(.16, 1, .3, 1); }
.order__step[hidden] { display: none; }
@keyframes step-in { from { opacity: 0; translate: 16px 0; } }
.order__field em { font-style: normal; text-transform: none; letter-spacing: 0; color: rgba(0, 0, 0, 0.35); }
.order__nav { display: flex; align-items: center; gap: 16px; }
.order__back {
  border: 0;
  background: none;
  padding: 0 4px;
  font: 500 16px/1 "Inter Tight", var(--sans);
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.order__back:hover { color: var(--ink); }
.order__submit { flex: 1; }
.order__field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.order__field > span,
.order__field > legend {
  padding: 0;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
}
.order__field > span { margin-bottom: 0; }
.order input[type="text"],
.order textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #fff;
  font: 500 16px/1.35 var(--sans); /* 16px — чтобы iPhone не приближал поле */
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s;
}
.order input[type="text"]:focus,
.order textarea:focus { outline: none; border-color: var(--ink); }
.order .is-invalid { border-color: var(--accent) !important; }
.order__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.order__chips input { position: absolute; opacity: 0; pointer-events: none; }
.order__chips span {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: #fff;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.order__chips input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.order__chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.order__status { min-height: 1.3em; font-weight: 500; font-size: 14px; color: var(--accent); }
.order__status:empty { display: none; }
.order__submit button { border: 0; cursor: pointer; font-family: "Inter Tight", var(--sans); }
.order__submit .fp-btn__main { flex: 1; width: auto; }
.order__submit button:disabled { opacity: 0.5; cursor: progress; }
@media (max-width: 767px) { .order { padding: 20px; gap: 16px; } }

@media (max-width: 767px) {
  .mac__body { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .offer { padding: 20px; }
  .offer__name { font-size: 22px; }
  .offer__foot { flex-direction: column; align-items: stretch; }
  .offer .fp-btn__main { flex: 1; min-width: 0; }
}

/* ============ НИЖНЕЕ МЕНЮ ============
   Плашка по центру внизу экрана: пункты разделов и кнопка «Написати» с фото.
   Пока виден первый экран или футер — уезжает вниз (.is-shown, dock.js). */
.dock {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(27, 27, 27, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  translate: -50% calc(100% + 40px);
  transition: translate 0.6s cubic-bezier(.16, 1, .3, 1);
}
.dock.is-shown { translate: -50% 0; }
.dock__link,
.dock__cta {
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dock__link {
  padding: 14px 14px;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}
.dock__link:hover { color: #fff; }
/* кнопка «Написати»: при наведении фото уезжает влево, текст сдвигается на его
   место, справа появляется логотип Telegram (как на marcuslorenzet.com) */
.dock__cta {
  display: flex;
  align-items: center;
  margin-left: 10px;
  padding: 6px 18px 6px 6px;
  border-radius: 6px;
  background: var(--btn);
  color: var(--ink);
  overflow: hidden;
}
.dock__ava,
.dock__tg {
  flex: none;
  transition: width 0.45s cubic-bezier(.16, 1, .3, 1), margin 0.45s cubic-bezier(.16, 1, .3, 1),
    opacity 0.3s, translate 0.45s cubic-bezier(.16, 1, .3, 1);
}
.dock__ava { margin-right: 10px; }
.dock__tg { width: 0; margin-left: 0; opacity: 0; translate: 12px 0; }
.dock__cta:hover .dock__ava { width: 0; margin-right: 0; opacity: 0; translate: -12px 0; }
.dock__cta:hover .dock__tg { width: 20px; margin-left: 10px; opacity: 1; translate: 0 0; }
.dock__ava {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--accent);
  font-size: 11px;
  color: #fff;
}
.dock__ava img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* avatar.jpg уже обрезан по лицу */
}
@media (max-width: 767px) {
  .dock {
    left: 8px;
    right: 8px;
    bottom: 12px;
    justify-content: space-between;
    padding: 6px 6px 6px 8px;
    gap: 0;
    translate: 0 calc(100% + 40px);
  }
  .dock.is-shown { translate: 0 0; }
  .dock__link { padding: 16px 6px; font-size: 13px; }
  .dock__cta { margin-left: 4px; padding: 6px 12px 6px 6px; font-size: 13px; }
  .dock__ava { margin-right: 8px; width: 38px; height: 38px; }
}

/* ============ ПОЯВЛЕНИЕ ============
   Порядок: видео пятнами (script.js) → заголовки выезжают → курсив пишется.
   На десктопе левая и правая стороны одновременно, папки — вместе с текстом;
   на телефоне — сверху вниз, папки после заголовков.
   Мелкий текст внизу проявляется через прозрачность вместе со всем.
   Скрытое состояние только при .js, чтобы без скриптов всё было видно. */

.title__name,
.title__surname,
.title__role {
  /* текст выезжает из-за своего нижнего края */
  clip-path: inset(-0.3em -0.3em 0 -0.3em);
}
.slide { display: inline-block; }

.js .slide { transform: translateY(105%); }
.js .ink__stroke { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.js .ink__fill { opacity: 0; }
.js .folder { opacity: 0; translate: 0 18px; scale: 0.86; }
.js .bottom,
.js .marquee { opacity: 0; }

.is-playing .slide {
  animation: slide-up 1s cubic-bezier(.16, 1, .3, 1) var(--t, 0s) both;
}
.is-playing .ink__stroke {
  /* каждый контур пишется в свою долю общего времени --w */
  animation: ink-draw calc(var(--w) * var(--l)) linear calc(var(--t) + var(--w) * var(--s)) both;
}
.is-playing .ink__fill {
  animation: fade-in 0.35s ease-out calc(var(--t) + var(--w) - 0.1s) both;
}
/* мелкий текст внизу — мягко через прозрачность, вместе с заголовками */
.is-playing .bottom,
.is-playing .marquee {
  animation: fade-in 1s ease-out var(--t, 0.5s) both;
}
.is-playing .folder {
  animation: folder-in 0.75s cubic-bezier(.34, 1.56, .64, 1) var(--t) both;
}

/* тайминги — десктоп: левая и правая стороны одновременно, папки — вместе с текстом */
.title__name,
.title__role                { --t: 0.35s; }
.title__script--surname,
.title__script--role        { --t: 0.85s; --w: 0.85s; }
.folder--portfolio          { --t: 0.5s; }
.folder--designers          { --t: 0.65s; }
.folder--clients            { --t: 0.8s; }

/* телефон: сверху вниз — имя, фамилия, UI/UX, Web-design, потом папки сверху вниз */
@media (max-width: 767px) {
  .title__name              { --t: 0.35s; }
  .title__surname           { --t: 0.55s; }
  .title__role              { --t: 0.8s; }
  .title__script--role      { --t: 1.2s;  --w: 0.8s; }
  .folder--clients          { --t: 2.05s; }
  .folder--portfolio        { --t: 2.25s; }
  .folder--designers        { --t: 2.45s; }
}

@keyframes slide-up { to { transform: none; } }
@keyframes ink-draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in  { to { opacity: 1; } }
@keyframes folder-in { to { opacity: 1; translate: 0 0; scale: 1; } }

@media (prefers-reduced-motion: reduce) {
  .js .slide,
  .js .folder { transform: none; translate: none; scale: none; opacity: 1; }
  .js .ink__stroke { stroke-dashoffset: 0; }
  .js .ink__fill { opacity: 1; }
  .js .bottom,
  .js .marquee { opacity: 1; }
  .is-playing .slide,
  .is-playing .ink__stroke,
  .is-playing .ink__fill,
  .is-playing .bottom,
  .is-playing .marquee,
  .is-playing .folder { animation: none; }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* Нейтральные кнопки; голубой фон появляется только при наведении мышью. */
:is(.cta, .fp-btn, .finale__cta) > * {
  background: #fff;
  color: #000;
  transition: background .2s, color .2s, border-radius .35s cubic-bezier(.16, 1, .3, 1);
}
.finale__cta > * { background: #000; color: #fff; }
.finale__arrow img[src$="arrow.svg"] { filter: none; }
.dock__cta { background: #fff; color: #000; transition: background .2s; }
@media (hover: hover) and (pointer: fine) {
  :is(.cta, .fp-btn, .finale__cta):hover > *, .dock__cta:hover {
    background: var(--btn);
    color: #fff;
  }
  :is(.cta, .fp-btn, .finale__cta):hover img[src$="arrow.svg"] { filter: none; }
}

/* Основные действия — чёрные, включая кнопку формы заявки. */
.fp-btn > * { background: #000; color: #fff; }
.fp-btn__arrow img[src$="arrow.svg"] { filter: none; }
.cursor-star {
  position: fixed;
  left: 0; top: 0;
  width: var(--size); height: var(--size);
  pointer-events: none;
  z-index: 2147483647;
  background: var(--btn);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: cursor-star-fade .75s ease-out forwards;
}
@keyframes cursor-star-fade {
  from { transform: translate(-50%, -50%) rotate(var(--turn)) scale(1); opacity: .95; }
  to { transform: translate(calc(-50% + var(--drift)), 24px) rotate(calc(var(--turn) + 80deg)) scale(0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .cursor-star { display: none; } }

.skip-link { position: fixed; left: 16px; top: 16px; padding: 12px 18px; background: #000; color: #fff; z-index: 2147483647; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }

.order__trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.order__privacy { font-size: 12px; line-height: 1.4; color: rgba(0,0,0,.6); }

/* Мобильный финал: свободная композиция вокруг центральной надписи. */
@media (max-width: 767px) {
  .cta > * { background: #000; color: #fff; }
  .cta__arrow img[src$="arrow.svg"] { filter: none; }
  .finale { padding-top: 32px; }
  .finale__stage { height: max(100svh, 760px); }
  .finale .fin--logo { left: var(--mx); top: var(--my); width: 64px; }
  .finale__center { gap: 24px; }
  .finale__box { width: 100%; padding: 0 16px; }
  .finale__title { font-size: 12.5vw; line-height: 1.05; }
  .finale__cta { width: calc(100% - 32px); }
  .finale__btn { min-width: 0; font-size: 16px; }
  .finale__arrow { flex: 0 0 60px; }
  .finale .cur { display: none; }
  .finale .app__name { font-size: 11px; }
}
/* Строка клиентов убрана: лента начинается без дополнительного отступа. */
.works__track { margin-top: 0; }

.order[hidden], .order-success[hidden] { display: none; }
.order-success {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 20px; color: #000; min-height: 440px;
  padding: 32px 24px 40px; font-family: var(--sans); outline: none;
}
.order-success__art { position: relative; width: 150px; height: 150px; }
.order-success__art img { position: relative; display: block; width: 100%; height: 100%; z-index: 1; }
.order-success h3 { font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -.04em; font-weight: 500; }
.order-success p { color: #000; font-size: 16px; line-height: 1.45; }
.order-success__done { background: #000; color: #fff; border: 0; border-radius: 8px; min-height: 56px; min-width: 190px; font: 500 16px var(--sans); text-transform: uppercase; padding: 16px 24px; cursor: pointer; }
@media (hover: hover) { .order-success__done:hover { background: var(--btn); } }
/* Логотипы мягко проявляются по очереди, без масштабирования. */
.js .finale .fin--logo {
  scale: 1;
  transition: opacity 1.2s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--d, 0s);
}
@media (prefers-reduced-motion: reduce) {
  .js .finale .fin--logo { transition: none; }
}

.stage__mobile-motion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity .1s linear; }
.stage__mobile-motion.is-playing { opacity: 1; }

/* A folded paper object: independent lit faces, no icon outline. */
.order-success { position: relative; box-sizing: border-box; overflow: hidden; }
.order-success__art { flex: 0 0 150px; }
.order-flight { position: absolute; left: -70px; top: -40px; width: 140px; height: 80px; z-index: 2; pointer-events: none; perspective: 700px; will-change: transform; }
.paper-aircraft { position: relative; width: 140px; height: 80px; transform-style: preserve-3d; transform: rotateX(26deg) rotateZ(24deg); filter: drop-shadow(0 12px 10px #0002); }
.paper-aircraft i { position: absolute; display: block; inset: 0; backface-visibility: visible; }
.paper-aircraft__wing { transform-origin: 50% 50%; }
.paper-aircraft__wing--left { clip-path: polygon(0 8%,100% 40%,43% 54%); background: linear-gradient(155deg,#fff 15%,#f6f5f2 60%,#bcbcc1); }
.paper-aircraft__wing--right { clip-path: polygon(0 96%,100% 40%,43% 54%); background: linear-gradient(32deg,#c3c5cd,#f4f3ef 48%,#fff); }
.paper-aircraft__keel { clip-path: polygon(43% 54%,100% 40%,48% 83%); background: linear-gradient(120deg,#777d8a,#d3d5dc 65%,#fff); transform: translateZ(-3px); }
@media(max-width:767px) { .order-success { gap:16px; padding:20px 18px; } .order-success__art { width:130px;height:130px;flex-basis:130px; } .order-success p {font-size:15px;} }

/* Lift the whole closing composition while retaining its internal spacing. */
.finale { margin-top: -100px; }
@media (max-width: 767px) { .finale { margin-top: -60px; } }
