/* ==========================================================================
   Lagom Products — карьерный лендинг
   Сетка: контейнер 1200, отступ между блоками 180 (мобайл — 100)
   ========================================================================== */

@font-face { font-family: "Bebas"; src: url("../fonts/BebasNeue-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Suisse"; src: url("../fonts/SuisseIntl-Book.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Suisse"; src: url("../fonts/SuisseIntl-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Suisse"; src: url("../fonts/SuisseIntl-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Suisse"; src: url("../fonts/SuisseIntl-SemiBold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Suisse"; src: url("../fonts/SuisseIntl-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --purple: #6100fe;
  --accent: #d3f0fe;
  --ink: #202020;
  --ink-btn: #111111;
  --text: #4a5359;
  --muted: #8b959b;
  --tile: #f4f4f4;
  --line: #e2e0db;
  --white: #ffffff;

  --container: 1200px;
  --gutter: 24px;
  --gap-section: 180px;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* высота экрана: svh там, где поддерживается */
  --vh: 100vh;
}
@supports (height: 100svh) { :root { --vh: 100svh; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 56px; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Suisse", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.section { margin-top: var(--gap-section); }

/* ---------- Типографика ---------- */
.title, .hero__title, .tile__title, .slide__title, .numbers__num, .cta__title .w {
  font-family: "Bebas", "Suisse", Impact, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: 0;
}
.title {
  font-size: clamp(56px, 6.94vw, 100px);
  text-align: center;
  color: var(--ink);
}
.title--mixed { display: flex; align-items: center; justify-content: center; gap: 0.22em; flex-wrap: wrap; }
/* Граффити-надписи из макета — вектор (SVG инлайн в index.html, исходники в img/svg-src).
   Рядом с капсом Bebas вектор сдвинут вверх на 0.145em: в макете совпадают оптические центры
   надписей, а CSS выравнивает боксы строки. Сдвиг в em масштабируется вместе со шрифтом. */
.vec { display: block; }
.title__vec { height: clamp(46px, 6.25vw, 90px); width: auto; transform: translateY(-0.145em); }

.label { font-size: 20px; line-height: 1.5; color: var(--ink); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 16px; line-height: 24px; font-weight: 500;
  white-space: nowrap;
  transition: transform 0.35s var(--ease-out), background-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.btn .ico { width: 24px; height: 24px; transition: transform 0.35s var(--ease-out); }
.btn:hover { transform: translateY(-2px); }
.btn:hover .ico { transform: translate(2px, -2px); }
.btn:active { transform: translateY(0); }
.btn--white { background: var(--white); color: var(--ink-btn); }
.btn--white:hover { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); }
.btn--ghost { background: rgba(0, 0, 0, 0.12); color: var(--white); }
.btn--ghost:hover { background: rgba(0, 0, 0, 0.2); }
.btn--sm { padding: 10px 16px; border-radius: 10px; font-size: 14px; line-height: 20px; gap: 8px; }
.btn--sm .ico { width: 18px; height: 18px; }
.ico { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* ---------- Шапка: закреплена, на первом экране прозрачная, дальше — светлая плашка ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  color: var(--white);
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.header__row { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.header__right { display: flex; align-items: center; gap: 12px; }
.header__logo { font-weight: 700; font-size: 20px; line-height: 1; opacity: 0; transform: translateY(-8px); }
.header__btn { opacity: 0; transform: translateY(-8px); }
body.is-loaded .header__logo, body.is-loaded .header__btn { opacity: 1; transform: none; transition: opacity 0.8s var(--ease-out) 0.1s, transform 0.8s var(--ease-out) 0.1s, background-color 0.4s, color 0.4s; }

.header.is-scrolled { background: rgba(255, 255, 255, 0.55); color: var(--ink); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); }
.header.is-scrolled .header__btn { background: var(--purple); color: var(--white); }
.header.is-scrolled .header__btn:hover { box-shadow: 0 12px 32px rgba(97, 0, 254, 0.28); }

/* ---------- 01 · Hero ---------- */
.hero {
  position: relative;
  min-height: var(--vh);
  background: var(--purple);
  color: var(--white);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; padding-top: 100px; padding-bottom: 60px; }
.hero__content { max-width: 500px; }
.hero__graffiti { width: clamp(190px, 24.4vw, 352px); height: auto; margin-left: -8px; }
.hero__title { font-size: clamp(64px, 8.61vw, 124px); margin-top: 8px; }
.hero__lead { margin-top: 36px; font-size: 20px; line-height: 1.25; font-weight: 300; max-width: 430px; }
.hero__btn { margin-top: 44px; }

.hero__photo {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 43.06%;
  overflow: hidden;
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }

/* Появление первого экрана: логотип → заголовок → текст → кнопка, фото выезжает справа */
.hero__graffiti, .hero__title, .hero__lead, .hero__btn { opacity: 0; }
.hero__graffiti { transform: translateY(24px) rotate(-4deg) scale(0.92); transform-origin: left bottom; }
.hero__title, .hero__lead, .hero__btn { transform: translateY(32px); }
.hero__photo { clip-path: inset(0 0 0 100%); }
body.is-loaded .hero__graffiti { opacity: 1; transform: none; transition: opacity 0.9s var(--ease-out) 0.25s, transform 1.1s cubic-bezier(0.2, 0.9, 0.25, 1.15) 0.25s; }
body.is-loaded .hero__title { opacity: 1; transform: none; transition: opacity 0.9s var(--ease-out) 0.55s, transform 0.9s var(--ease-out) 0.55s; }
body.is-loaded .hero__lead { opacity: 1; transform: none; transition: opacity 0.8s var(--ease-out) 0.85s, transform 0.8s var(--ease-out) 0.85s; }
body.is-loaded .hero__btn { opacity: 1; transform: none; transition: opacity 0.8s var(--ease-out) 1.05s, transform 0.8s var(--ease-out) 1.05s; }
body.is-loaded .hero__photo { clip-path: inset(0); transition: clip-path 1.3s cubic-bezier(0.7, 0, 0.2, 1) 0.35s; }

/* ---------- Scroll-reveal ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft); transition-delay: calc(var(--i, 0) * 100ms); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 02 · Lagom в цифрах ---------- */
.numbers__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px 32px;
  margin-top: 100px;
}
.numbers__item { text-align: center; }
.numbers__num { font-size: clamp(72px, 9.65vw, 139px); color: var(--purple); font-variant-numeric: tabular-nums; }
.numbers__cap { margin-top: 22px; font-size: 20px; line-height: 1.5; color: var(--text); max-width: 253px; margin-left: auto; margin-right: auto; }

/* ---------- 03 · Что мы делаем ---------- */
.wwd__grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 72px; }
.tile { position: relative; min-height: 620px; overflow: hidden; }
.tile--purple {
  background: var(--purple); color: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 50px 40px 60px;
  text-align: center;
}
.tile__head { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.tile__graffiti { height: clamp(40px, 4.4vw, 63px); width: auto; }
.tile__title { font-size: clamp(48px, 5vw, 72px); max-width: 360px; }
.pixelwave { display: block; width: 100%; height: 200px; margin: 24px 0; }
.stats { display: flex; gap: 48px; justify-content: center; align-items: flex-start; text-align: left; }
.stats__num { font-size: clamp(40px, 3.9vw, 56px); line-height: 1; font-weight: 500; letter-spacing: -0.03em; display: inline-flex; align-items: center; }
.stats__num .ico--star { width: 0.75em; height: 0.75em; margin-left: 0.04em; }
.stats__cap { margin-top: 10px; font-size: 16px; line-height: 1.2; opacity: 0.7; }

.tile--photo { background: var(--tile); }
.tile--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; transform: scale(1.04); transition: transform 1.4s var(--ease-soft); }
.tile--photo.is-in img { transform: scale(1); }
.tile__btn { position: absolute; right: 120px; bottom: 48px; }

/* ---------- 04 · Новые продукты ---------- */
.products__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 590px); gap: 48px; align-items: start; }
.products__text { font-size: 24px; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); }
.marquee { margin-top: 72px; overflow: hidden; }
.marquee__track { display: flex; width: max-content; animation: marquee 56s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__set { display: flex; gap: 14px; padding-right: 14px; }
.ptile { width: 229px; height: 229px; border-radius: 8px; overflow: hidden; background: #f5f5f5; flex: none; transition: transform 0.5s var(--ease-out); }
.ptile:hover { transform: translateY(-6px); }
.ptile img { width: 100%; height: 100%; object-fit: cover; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Появление плиток по очереди при первом показе */
.marquee .ptile { opacity: 0; transform: translateY(24px) scale(0.96); }
.marquee.is-in .ptile { opacity: 1; transform: none; transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.marquee.is-in .ptile:nth-child(1) { transition-delay: 0.05s; }
.marquee.is-in .ptile:nth-child(2) { transition-delay: 0.13s; }
.marquee.is-in .ptile:nth-child(3) { transition-delay: 0.21s; }
.marquee.is-in .ptile:nth-child(4) { transition-delay: 0.29s; }
.marquee.is-in .ptile:nth-child(5) { transition-delay: 0.37s; }
.marquee.is-in .ptile:nth-child(6) { transition-delay: 0.45s; }
.marquee.is-in .ptile:nth-child(7) { transition-delay: 0.53s; }
.marquee.is-in .ptile:nth-child(8) { transition-delay: 0.61s; }

/* ---------- 05 · В Lagom мы все на равных ----------
   Блок высотой N экранов; внутренняя «сцена» прилипает и занимает весь экран.
   По мере скролла следующая карточка выезжает снизу и накрывает предыдущую стопкой —
   страница не уедет дальше, пока не пролистаны все. Положение карточек считает JS
   (transform), степень «готовности» текста — через переменную --t. */
.equals {
  position: relative;
  height: calc(var(--vh) * var(--slides, 5));
  color: var(--white);
}
.equals__stage {
  position: sticky; top: 0;
  height: var(--vh);
  min-height: 600px;
  overflow: hidden;
  background: var(--ink);
  user-select: none;
}
.equals__slides { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: 32px 32px 0 0;
  transform: translate3d(0, 100%, 0);
  will-change: transform;
  --t: 0;
}
.slide:first-child { transform: none; border-radius: 0; --t: 1; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); will-change: transform; }
.slide__shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 100%); }
.slide__shade--flat { background: rgba(0, 0, 0, 0.2); }
.slide__body { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: 120px; }
.slide__title { font-size: clamp(48px, 6.94vw, 100px); max-width: 700px; }
.slide__desc { margin-top: 32px; font-size: 24px; line-height: 1.3; max-width: 606px; }
.slide__title, .slide__desc { opacity: var(--t); transform: translateY(calc((1 - var(--t)) * 48px)); }
.slide__desc { transition: opacity 0.15s linear, transform 0.15s linear; }

/* ---------- 06 · Что мы предлагаем ---------- */
.offer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 72px; }
.card {
  position: relative;
  background: var(--tile);
  border-radius: 16px;
  padding: 32px;
  min-height: 300px;
  display: flex; flex-direction: column; gap: 40px;
  transition: transform 0.5s var(--ease-out), background-color 0.5s var(--ease-out);
}
.card:hover { transform: translateY(-4px); }
.card--wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 48px; }
.card--wide .card__text { flex: 1; }

/* Иллюстрации из макета — в широких карточках справа, по центру по вертикали */
.card__art { width: 224px; height: 224px; flex: none; align-self: center; }

/* Мелкие знаки — в правом нижнем углу карточки, как в макете */
.card__mark { position: absolute; right: 32px; bottom: 32px; width: 48px; height: 48px; transition: transform 0.5s var(--ease-out); }
.card:hover .card__mark { transform: rotate(-10deg) scale(1.1); }
.card__title { font-size: 24px; line-height: 1.2; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.card__desc { margin-top: 12px; font-size: 18px; line-height: 1.4; color: var(--text); }

/* ---------- 07 · CTA ---------- */
.cta { background: var(--purple); color: var(--white); padding: 140px 0; text-align: center; }
.cta__title { display: flex; flex-direction: column; align-items: center; gap: 22px; font-size: clamp(48px, 6.94vw, 100px); line-height: 0.9; }
.cta__line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 0.22em; }
.cta__title .g { display: inline-flex; align-items: center; }
.cta__title .g .vec { height: 0.7em; width: auto; display: block; transform: translateY(-0.145em); }
.cta__set { display: flex; flex-direction: column; align-items: center; gap: inherit; }
.cta__set[hidden] { display: none; }
.cta__br { display: none; }

/* Прорисовка граффити: контур каждой буквы рисуется по очереди (stroke-dashoffset задаёт JS) */
.vec--draw path[stroke] { will-change: stroke-dashoffset; }
.cta__title .w, .cta__title .g { opacity: 0; transform: translateY(0.3em); }
.cta__title .w { display: inline-block; }
.cta__title.is-in .w, .cta__title.is-in .g { opacity: 1; transform: none; transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.cta__title.is-in .g { transition: opacity 0.8s var(--ease-out), transform 1s cubic-bezier(0.2, 0.9, 0.25, 1.2); }
.cta__title.is-in .cta__line:nth-child(1) > :nth-child(1) { transition-delay: 0.05s; }
.cta__title.is-in .cta__line:nth-child(1) > :nth-child(2) { transition-delay: 0.18s; }
.cta__title.is-in .cta__line:nth-child(1) > :nth-child(3) { transition-delay: 0.3s; }
.cta__title.is-in .cta__line:nth-child(2) > :nth-child(1) { transition-delay: 0.42s; }
.cta__title.is-in .cta__line:nth-child(2) > :nth-child(2) { transition-delay: 0.55s; }
.cta__title.is-in .cta__line:nth-child(3) > :nth-child(1) { transition-delay: 0.66s; }
.cta__title.is-in .cta__line:nth-child(3) > :nth-child(2) { transition-delay: 0.78s; }
.cta__title.is-in .cta__line:nth-child(3) > :nth-child(3) { transition-delay: 0.9s; }
.cta__actions { display: flex; justify-content: center; gap: 12px; margin-top: 64px; flex-wrap: wrap; --i: 6; }

/* ---------- Футер ---------- */
.footer { border-top: 1px solid var(--line); }
.footer__row { display: flex; justify-content: space-between; gap: 16px; padding: 32px var(--gutter); font-size: 15px; line-height: 1.2; color: var(--muted); }
.footer a:hover { text-decoration: underline; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1100px) {
  .numbers__grid { grid-template-columns: repeat(2, 1fr); }
  .tile__btn { right: 40px; bottom: 32px; }
  .card__art { width: 176px; height: 176px; }
}

@media (max-width: 900px) {
  :root { --gap-section: 100px; --gutter: 20px; }
  body { font-size: 18px; }

  .header__row { height: 52px; }
  .header__logo { font-size: 18px; }

  .hero { flex-direction: column; align-items: stretch; }
  .hero__inner { padding-top: 84px; padding-bottom: 40px; flex: none; }
  .hero__content { max-width: none; }
  .hero__graffiti { margin-left: -4px; }
  .hero__lead { margin-top: 24px; font-size: 18px; }
  .hero__btn { margin-top: 32px; }
  .hero__photo { position: relative; width: 100%; flex: 1; min-height: calc(var(--vh) * 0.42); }
  .hero__photo img { position: absolute; inset: 0; }
  .hero__photo { clip-path: inset(100% 0 0 0); }
  body.is-loaded .hero__photo { clip-path: inset(0); transition: clip-path 1.1s cubic-bezier(0.7, 0, 0.2, 1) 0.6s; }

  .numbers__grid { margin-top: 56px; gap: 40px 16px; }
  .numbers__cap { margin-top: 12px; font-size: 16px; }

  .wwd__grid { grid-template-columns: 1fr; margin-top: 40px; }
  .tile { min-height: 0; }
  .tile--purple { padding: 40px 20px 44px; }
  .pixelwave { height: 150px; margin: 16px 0 28px; }
  .stats { gap: 28px; }
  .stats__cap { font-size: 14px; }
  .tile--photo { aspect-ratio: 720 / 620; }
  .tile__btn { right: 20px; bottom: 20px; }

  .products__head { grid-template-columns: 1fr; gap: 16px; }
  .products__text { font-size: 18px; }
  .marquee { margin-top: 40px; }
  .marquee__track { animation-duration: 40s; }
  .ptile { width: 160px; height: 160px; }

  .header__btn { display: none; }

  .equals__stage { min-height: 560px; }
  .slide { border-radius: 24px 24px 0 0; }
  .slide__body { padding-bottom: 64px; }
  .slide__desc { margin-top: 20px; font-size: 18px; }

  .offer__grid { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .card { min-height: 0; padding: 24px; gap: 28px; }
  .card--wide { grid-column: auto; flex-direction: column; align-items: flex-start; gap: 20px; }
  /* на мобильном вся графика одного размера — 44px в правом нижнем углу карточки */
  .card--gfx { padding-bottom: 78px; }
  .card__art, .card__mark { position: absolute; right: 20px; bottom: 20px; width: 44px; height: 44px; align-self: auto; }
  .card__title { font-size: 20px; }
  .card__desc { font-size: 16px; }

  .cta { padding: 96px 0; }
    .cta__title { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px 10px; font-size: 38px; }
  .cta__line { display: contents; }
  /* строки как в мобильном макете (переносы задаёт .cta__br): Давай вместе / сделаем свободный / доступ в интернет / нормой */
  .cta__set { display: contents; }
  .cta__br { display: block; flex-basis: 100%; height: 0; }
  .cta__actions { margin-top: 40px; flex-direction: column; align-items: stretch; }
  .cta__actions .btn { justify-content: center; }

  .footer__row { flex-direction: column; gap: 8px; padding: 24px var(--gutter); }
}

@media (max-width: 480px) {
  .stats { gap: 20px; }
  .stats__num { font-size: 34px; }
}

/* Без анимаций для тех, кто их отключил */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal, .hero__graffiti, .hero__title, .hero__lead, .hero__btn, .header__logo, .header__btn, .marquee .ptile, .cta__title .w, .cta__title .g { opacity: 1; transform: none; }
  .hero__photo { clip-path: none; }
}
