/* Черновик 2. Газетная сетка по мотивам Mother Design: чёрное на белом,
   линии 1px, без теней и скруглений. Цвет дают только работы.
   Шрифт Hanken Grotesk (выбран 11.11). */

:root {
  --bg: #fff;
  --ink: #000;
  --soft: #6b6b6b;
  --hair: #e4e4e4;                        /* тонкая рамка вокруг белых страниц */
  --gut: 20px;
  --cell: 44px;
  --th: clamp(80px, 8.5vw, 165px);        /* высота плитки в ленте */
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* мягкий выход */
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --sans: 'Hanken Grotesk';

  --t-display: clamp(32px, 4.2vw, 88px);  /* манифест, вступления */
  --t-title: clamp(44px, 7.6vw, 150px);   /* название проекта */
  --t-huge: clamp(56px, 8.4vw, 170px);    /* слова «How I work» */
  --t-list: clamp(30px, 3.9vw, 76px);     /* список «What I do» */
  --t-lede: clamp(20px, 1.7vw, 28px);
  --sec-gap: clamp(96px, 11vw, 180px);    /* воздух между секциями */
  --maxh: calc(100svh - 120px);           /* предмет не выше экрана */
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans), system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
p, h1, h2, h3, dl, dd, ul, ol, figure { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: 400; font-size: inherit; }
ul, ol { 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 { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--bg); }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.soft { color: var(--soft); }
.ul { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .3s var(--ease); }
a.ul:hover, button.ul:hover { color: var(--soft); }
svg.ic { width: 1em; height: 1em; flex: none; }

/* ---------- Ячейки и шапка ---------- */

.cells { display: flex; }
.cell {
  height: var(--cell);
  padding: 0 16px 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  margin-left: -1px;
  background: var(--bg);
  color: var(--ink);
  white-space: nowrap;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.cells > .cell:first-child { margin-left: 0; }
a.cell:hover, button.cell:hover, .cell:focus-visible, .cell.on { background: var(--ink); color: var(--bg); outline: none; }
.cell--ink { background: var(--ink); color: var(--bg); }
a.cell--ink:hover, a.cell--ink:focus-visible { background: var(--bg); color: var(--ink); }
.cell--mark { width: 52px; padding: 0 0 2px; justify-content: center; font-weight: 600; }
.cell--mark.on:hover { background: var(--bg); color: var(--ink); }
.cell--cv .short { display: none; }

/* кнопка звука в углу видео с музыкой */
.snd { position: absolute; right: 12px; bottom: 12px; z-index: 2; width: var(--cell); padding: 0; justify-content: center; }
.snd .ic { width: 18px; height: 18px; }
.pj-hero--bleed > .snd { width: var(--cell); height: var(--cell); right: var(--gut); bottom: var(--gut); }

.hd {
  position: fixed;
  top: var(--gut);
  left: var(--gut);
  right: var(--gut);
  z-index: 30;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}
.hd .cells { pointer-events: auto; }
.hd .cell { opacity: 0; transform: translateY(-8px); }
.hd.in .cell {
  opacity: 1;
  transform: none;
  transition: opacity .9s var(--ease) calc(var(--i, 0) * 60ms), transform .9s var(--ease) calc(var(--i, 0) * 60ms),
    background-color .35s var(--ease), color .35s var(--ease);
}
.hd__r { gap: 16px; }
.hd__r .cell { margin-left: 0; }
.ticker { width: min(34vw, 520px); padding: 0 0 2px; overflow: hidden; }
.ticker__run { display: flex; will-change: transform; }
.ticker__run span { padding-right: 34px; }

/* ---------- Смена страниц и появление ---------- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s var(--ease-io), visibility 0s linear .32s;
}
.veil.on { opacity: 1; visibility: visible; transition: opacity .32s var(--ease-io); }

[data-rv] { opacity: 0; transform: translateY(32px); }
[data-rv].in {
  opacity: 1;
  transform: none;
  transition: opacity 1s var(--ease) var(--d, 0ms), transform 1.25s var(--ease) var(--d, 0ms);
}

/* ---------- Сетка на 4 колонки ---------- */

.g4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gut);
  padding: 0 var(--gut);
}
.c1 { grid-column: 1 / 2; }
.c2 { grid-column: 2 / 3; }
.c23 { grid-column: 2 / 4; }
.c24 { grid-column: 2 / 5; }
.c3 { grid-column: 3 / 4; }
.c34 { grid-column: 3 / 5; }
.c4 { grid-column: 4 / 5; }
.call { grid-column: 1 / -1; }

[data-fx] { opacity: 0; }
[data-fx].in { opacity: 1; transition: opacity 1.4s var(--ease); }

.sec { margin-top: var(--sec-gap); }
.sec--tight { margin-top: 40px; }
.blk { padding: 0 var(--gut); }
.sec__head { border-top: 1px solid var(--ink); padding-top: 16px; margin-bottom: 40px; row-gap: 6px; }
.sec__label { font-weight: 600; }
.sec__note { color: var(--soft); }
.pj-text p, .ab__text p, .part__l, .pj-meta dd, .card__l, .next__l, .sec__note, .cap__l, .lrow .t { text-wrap: pretty; }

/* метка секции и крупный текст рядом висят на одной верхней линии: верх заглавных, а не верх строки */
.sec__label, .sec__note, .next__t, .part__head .big, .pj-text p:first-child, .ab__text p:first-child,
.svc__list, .exp__row:first-child > span, .sk__g:first-child .sk__h, .pj-meta > div:first-child dt { text-box: trim-start cap alphabetic; }
.rule { border-top: 1px solid var(--ink); }

/* ---------- Главная: лента работ ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
}
/* двигает d2.js (stripTick): ряд как док, размер каждой работы считается каждый кадр от положения курсора */
.strip {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  align-items: center;
  gap: var(--gut);
  will-change: transform;
}
.tile {
  position: relative;
  flex: none;
  display: block;
  height: calc(var(--th) * var(--s, 1));
  aspect-ratio: var(--ar);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: translateY(28px);
}
.tile.in img {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s var(--ease) var(--d, 0ms), transform 1.3s var(--ease) var(--d, 0ms);
}

.cap {
  position: absolute;
  left: var(--gut);
  bottom: var(--gut);
  max-width: 400px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.cap.in { opacity: 1; transform: none; }
.cap.swap { opacity: 0; transform: translateY(6px); transition-duration: .25s; }
.cap__t { font-weight: 600; }
.cap__l { color: var(--soft); }

/* счётчик работ в ленте: внизу справа, напротив подписи */
.cnt {
  position: absolute;
  right: var(--gut);
  bottom: var(--gut);
  text-align: right;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.cnt.in { opacity: 1; transform: none; }
.cnt__n { color: var(--soft); font-variant-numeric: tabular-nums; }
.cnt__n b { font-weight: 600; color: var(--ink); }
.cnt { display: flex; flex-direction: column-reverse; }
.cnt__bar { display: flex; justify-content: flex-end; gap: 4px; margin: 0 0 10px; }
.cnt__bar i { width: 22px; height: 2px; background: var(--hair); transition: background-color .6s var(--ease); }
.cnt__bar i.on { background: var(--ink); }

/* ---------- Крупный текст: слова в масках, строки поднимаются по очереди ---------- */

.big {
  font-size: var(--t-display);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.u {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .2em;
  margin-bottom: -.2em;
  transition: opacity .4s var(--ease), background-color .4s var(--ease), box-shadow .4s var(--ease), color .4s var(--ease);
}
.u__in { display: inline-block; transform: translateY(110%); }
.lines.in .u__in { transform: none; transition: transform 1.25s var(--ease) calc(var(--ln, 0) * 90ms); }

.mf { padding: clamp(40px, 6vw, 96px) var(--gut) 0; }

/* ---------- «Подсмотреть»: слой с работой на весь экран ---------- */

.ph { position: relative; z-index: 21; }  /* над слоем, чтобы выбранное слово было видно */
.pk { cursor: pointer; outline: none; }
.w { text-decoration: underline; text-decoration-thickness: .035em; text-underline-offset: .12em; }
[data-fade] { transition: opacity .4s var(--ease), color .4s var(--ease), background-color .4s var(--ease), box-shadow .4s var(--ease); }
.ph .sec__head { transition: border-color .4s var(--ease); }
.ph.peeking .sec__head { border-color: transparent; }
.ph.peeking [data-fade] { opacity: 0; }
.ph.peeking [data-fade].on { opacity: 1; }
.ph.peeking[data-tone="light"] [data-fade].on { color: #fff; }
.ph.peeking[data-tone="dark"] [data-fade].on.u,
.ph.peeking[data-tone="dark"] .svc__item.on { background: var(--bg); box-shadow: 0 0 0 .14em var(--bg), 0 0 0 calc(.14em + 1px) var(--ink); }

.peek {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--ease), visibility 0s linear .5s;
  overflow: hidden;
}
.peek.on { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
.peek > * { position: absolute; inset: 0; opacity: 0; transform: scale(1.06); transition: opacity .5s var(--ease), transform 1.6s var(--ease); }
.peek > .on { opacity: 1; transform: none; }
.peek__media { width: 100%; height: 100%; object-fit: cover; }
.peek__page { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: calc(var(--cell) + var(--gut) * 3) var(--gut) var(--gut); }
.peek__page img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; outline: 1px solid var(--hair); }
.peek__page.pad img { height: 46%; outline: 0; }

.igrid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  border-left: 1px solid var(--ink);
  border-top: 1px solid var(--ink);
}
.igrid i {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.igrid img { width: 34%; height: auto; transition: opacity .5s var(--ease); }
.igrid img.swap { opacity: 0; }
.peek .igrid { border-top: 0; }

/* ---------- Главная: How I work ---------- */

.how { margin-top: var(--sec-gap); border-top: 1px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; position: relative; }
.how__label { position: absolute; left: var(--gut); top: 16px; font-weight: 600; z-index: 1; }
.how__cell {
  position: relative;
  min-height: clamp(300px, 26vw, 440px);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--ink);
  padding: 60px var(--gut);
  overflow: hidden;
}
.how__cell:nth-of-type(odd) { border-right: 1px solid var(--ink); }
.how__word { font-size: var(--t-huge); letter-spacing: -0.045em; line-height: 1; transition: transform .8s var(--ease), opacity .6s var(--ease); }
.how__text {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(17em, 80%);
  transform: translate(-50%, -40%);
  opacity: 0;
  text-align: center;
  font-size: var(--t-lede);
  line-height: 1.28;
  text-wrap: balance;
  transition: transform .8s var(--ease), opacity .5s var(--ease);
}
.how__word.in { transition: transform .8s var(--ease), opacity .6s var(--ease); }
/* наведение и фокус только там, где есть мышь; на касании текст стоит открыто */
@media (hover: hover) and (min-width: 761px) {
  .how__cell:hover .how__word, .how__cell:focus-within .how__word { transform: translateY(-38%); opacity: 0; }
  .how__cell:hover .how__text, .how__cell:focus-within .how__text { transform: translate(-50%, -50%); opacity: 1; transition-delay: .08s; }
}
@media (hover: none) and (min-width: 761px) {
  .how__cell { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; }
  .how__text { position: static; transform: none; opacity: 1; }
}

/* в ячейке Story игра «башня»: холст на всю ячейку, сверху только счёт */
.how__cell.how__game { display: block; padding: 0; cursor: pointer; touch-action: manipulation; outline: none; }
.how__game canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stk__hud { position: absolute; left: 0; right: 0; top: clamp(16px, 2vw, 32px); text-align: center; pointer-events: none; }
.stk__score { font-size: var(--t-display); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
/* до старта вместо счёта кнопка; после клика она уходит, счёт встаёт на её место */
.stk__start { position: absolute; left: 50%; top: 50%; z-index: 1; margin: 0; transform: translate(-50%, -50%); transition: opacity .5s var(--ease), transform .7s var(--ease), background-color .35s var(--ease), color .35s var(--ease); }
.stk__score { opacity: 0; transition: opacity .6s var(--ease) .15s; }
.stk__start:hover, .stk__start:focus-visible { background: var(--bg); color: var(--ink); }
.how__game.playing .stk__start { opacity: 0; transform: translate(-50%, calc(-50% - 10px)); pointer-events: none; }
.how__game.playing .stk__score { opacity: 1; }
.stk__score.bump { animation: stk-bump .4s var(--ease); }
@keyframes stk-bump { from { transform: translateY(10px); opacity: .25; } }
.stk__best { margin-top: 10px; color: var(--soft); opacity: 0; transition: opacity .6s var(--ease); }
.how__game.over .stk__best { opacity: 1; }

/* ---------- Главная: What I do ---------- */

.svc { margin-top: var(--sec-gap); }
.svc .sec__head { margin-bottom: 0; }
.svc__side { align-self: start; position: sticky; top: calc(var(--cell) + var(--gut) * 2); }
.svc__all { display: inline-block; margin-top: clamp(32px, 3.4vw, 56px); color: var(--soft); }
/* Картинка никогда не обрезается: целиком, во всю ширину колонки, прижата к верху.
   Слишком высокая уменьшается по высоте места. */
/* чуть крупнее колонки: растёт влево, в пустое поле под меткой, список справа не двигается */
.svc__frame { --grow: clamp(40px, 6vw, 120px); position: relative; container-type: size; aspect-ratio: 2 / 3; width: calc(100% + var(--grow)); margin-left: calc(var(--grow) * -1); }
.svc__m {
  position: absolute; top: 0; left: 0;
  width: min(100cqw, 100cqh * var(--ar)); height: auto; aspect-ratio: var(--ar); object-fit: cover;
  opacity: 0; transform: translateY(14px);
  transition: opacity .55s var(--ease), transform 1.1s var(--ease);
}
.svc__m--page { outline: 1px solid var(--hair); outline-offset: -1px; }
.svc__m.on { opacity: 1; transform: none; }
@media (hover: none) { .svc__frame { display: none; } }
.svc__list { font-size: var(--t-display); line-height: 1.04; letter-spacing: -0.04em; }
.svc__item { display: block; width: fit-content; cursor: default; outline: none; transition: color .45s var(--ease); }
.svc__list.has .svc__item { color: var(--soft); }
.svc__list.has .svc__item.on { color: var(--ink); }

/* ---------- Список работ ---------- */

.wk { padding-top: calc(var(--cell) + var(--gut) + clamp(120px, 15vw, 220px)); }
.wk__bar { margin-bottom: 26px; align-items: baseline; }
.wk__ctl { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.wk__ctl button { color: var(--soft); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; text-decoration-color: var(--hair); transition: color .3s var(--ease); }
.wk__ctl button.on { color: var(--ink); text-decoration-color: var(--ink); }
.wk__ctl button:hover { color: var(--ink); }
.wk__ctl i { font-style: normal; color: var(--soft); }

.wk__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 56px var(--gut);
  padding: 0 var(--gut);
  grid-auto-flow: row dense; /* без пустой клетки посреди сетки */
  align-items: start;
}
.card { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.card__img { align-self: end; }
.card--2 { grid-column: span 2; }
.card__img { position: relative; overflow: hidden; background: var(--bg); }
.card__img img { width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.card__img.page img { outline: 1px solid var(--hair); outline-offset: -1px; }
.card:hover .card__img img { transform: scale(1.025); }
.card__t { margin-top: 14px; font-weight: 600; }
.card__cap { align-self: start; }
.card__l { color: var(--soft); max-width: 46ch; }
.card.hide, .lrow.hide { display: none; }

.wk__list { margin: 0 var(--gut); border-bottom: 1px solid var(--ink); }
.lrow {
  display: grid;
  grid-template-columns: 60px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 90px;
  column-gap: var(--gut);
  align-items: baseline;
  padding: 18px 0 20px;
  border-top: 1px solid var(--ink);
  font-size: var(--t-lede);
  transition: color .3s var(--ease);
}
.lrow .n, .lrow .y { color: var(--soft); font-size: 16px; }
.lrow .y { text-align: right; }
.lrow .c, .lrow .g { color: var(--soft); font-size: 16px; }
.wk__list:hover .lrow { color: var(--soft); }
.wk__list:hover .lrow:hover { color: var(--ink); }

.float {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 25;
  width: clamp(180px, 17vw, 280px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.float.on { opacity: 1; }
.float { aspect-ratio: 1; }
.float img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s var(--ease); }
.float img.on { opacity: 1; }

/* ---------- Страница проекта ---------- */

.pj-hero { position: relative; }
.pj-hero--bleed { height: 100vh; height: 100svh; min-height: 480px; overflow: hidden; }
.pj-hero--bleed > * { width: 100%; height: 100%; object-fit: cover; }
.pj-hero--embed { background: #05080F; }
@media (max-aspect-ratio: 1/1) {
  .pj-hero--wide { height: auto; min-height: 0; padding-top: calc(var(--cell) + var(--gut) * 2); }
  .pj-hero--wide > video, .pj-hero--wide > img { height: auto; aspect-ratio: var(--ar); }
}
.pj-hero--embed iframe { display: block; border: 0; }
.pj-hero--row { padding: calc(var(--cell) + var(--gut) * 4) var(--gut) 0; }
.pj-hero--row .jrow { --maxh: calc(100svh - var(--cell) - var(--gut) * 6); margin: 0 auto; }
.pj-hero--grid { padding-top: calc(var(--cell) + var(--gut) * 2); }

.pj-intro { padding-top: 40px; row-gap: 48px; }
.pj-intro--top { padding-top: calc(var(--cell) + var(--gut) + clamp(120px, 15vw, 220px)); }
.pj-title { font-size: var(--t-title); line-height: .98; letter-spacing: -0.05em; }
.pj-meta { display: grid; gap: 18px; align-content: start; }
.pj-meta dt { font-weight: 600; }
.pj-meta dd { color: var(--soft); }
.pj-text { font-size: var(--t-lede); line-height: 1.28; }
.pj-text p + p { margin-top: 1em; }
.pj-text .cell { margin-top: 32px; margin-left: 0; font-size: 16px; }

/* ряд предметов одной высоты: ширина каждого пропорциональна его формату */
.jrow {
  display: flex;
  gap: var(--gut);
  align-items: flex-start;
  max-width: calc(var(--sum) * var(--maxh) + (var(--n) - 1) * var(--gut));
}
.jrow > * { flex: var(--ar) 1 0%; min-width: 0; }
.jrow[style*="--w"] { max-width: min(var(--w), calc(var(--sum) * var(--maxh) + (var(--n) - 1) * var(--gut))); }
.jrow--r { margin-left: auto; }
/* цвета палитры в ряду с логотипами: шесть плашек в ряд, HEX внизу слева; в узкой ячейке 3 × 2 */
.sw { container-type: inline-size; }
.sw__in { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); aspect-ratio: var(--ar); margin: 0; padding: 0; list-style: none; }
.sw__c { display: flex; align-items: flex-end; padding: clamp(6px, 0.7vw, 12px); color: #0b1220; font-size: clamp(10px, 0.85vw, 15px); font-weight: 600; line-height: 1; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.sw__c--dark { color: #fff; }
.sw__c--pale { box-shadow: inset 0 0 0 1px var(--hair); }
@container (max-width: 400px) { .sw__in { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.jrow--c { margin-left: auto; margin-right: auto; }
.it { position: relative; }
.it img, .it video { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; }
.it--page img, .it--page video { outline: 1px solid var(--hair); outline-offset: -1px; }

.spread { gap: 0; }
.spread .it + .it img { border-left: 1px solid var(--hair); }

.bleed { margin: 0 calc(var(--gut) * -1); }

.mgrid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gut); align-items: start; }

/* слайды: один кадр, листаются сами, внизу ячейки */
.slides { position: relative; }
.slides__frame { position: relative; aspect-ratio: var(--ar); overflow: hidden; outline: 1px solid var(--hair); outline-offset: -1px; }
.slides__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0s linear .9s; }
.slides__frame img.on { opacity: 1; z-index: 1; transition: opacity .9s var(--ease); }
.slides__bar { display: flex; justify-content: space-between; margin-top: var(--gut); }
.slides__bar .cell { min-width: 44px; justify-content: center; }
.slides__count { font-variant-numeric: tabular-nums; }

/* длинная картинка медленно едет в окне */
.scrollwin { position: relative; height: min(84svh, 900px); overflow: hidden; outline: 1px solid var(--hair); outline-offset: -1px; }
.scrollwin img { width: 100%; height: auto; will-change: transform; } /* двигает d2.js, winsTick */

.logos { border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.logos > div { position: relative; aspect-ratio: 4 / 3; min-height: 0; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.logos img { position: absolute; left: 22%; top: 24%; width: 56%; height: 52%; max-width: none; object-fit: contain; }

/* разделы внутри одной работы (BARNES): крупное название, под ним строка, блоки раздела сразу следом */
.part__head .sec__head { row-gap: 18px; }
.part__l { margin-top: 22px; max-width: 34ch; font-size: var(--t-lede); line-height: 1.28; color: var(--soft); }
.sec--first { margin-top: 0; }

.next { margin-top: var(--sec-gap); }
.next .sec__head { margin-bottom: 0; }
.next__t { font-size: var(--t-title); line-height: .98; letter-spacing: -0.05em; display: inline-block; }
.next__l { margin-top: 18px; color: var(--soft); }

/* ---------- Info ---------- */

.info { padding-top: calc(var(--cell) + var(--gut) + clamp(120px, 15vw, 220px)); }
.info__intro { padding: 0 var(--gut); }
.ab { row-gap: 32px; }
.ab__pic img { width: 100%; height: auto; }
.ab__text { font-size: var(--t-lede); line-height: 1.28; }
.ab__text p + p { margin-top: 1em; }
.exp__row { display: grid; grid-template-columns: calc((100% - var(--gut)) / 2) minmax(0, 1fr) auto; gap: var(--gut); padding: 14px 0 16px; border-bottom: 1px solid var(--ink); align-items: baseline; }
.exp__row:first-child { padding-top: 0; }
.exp__row .y { color: var(--soft); font-variant-numeric: tabular-nums; }
.exp__row .r { color: var(--soft); }
.list li + li { margin-top: 2px; }
/* Skills на Info: группы с тихим подзаголовком */
.sk { display: grid; align-content: start; gap: 28px; }
.sk__h { color: var(--soft); margin-bottom: 8px; }
.contact-list { display: grid; gap: 10px; justify-items: start; }

/* ---------- Подвал ---------- */

.ft { margin-top: calc(var(--sec-gap) - 3.9vw); overflow: hidden; }
.ft__stage { position: relative; }

/* Имя на всю ширину: каждая буква в окошке, внутри две одинаковые, при наведении перекат на одну */
.nm { padding: 0 var(--gut); white-space: nowrap; user-select: none; }
.nm__in { display: inline-block; line-height: 1; letter-spacing: -0.055em; }
.nm__l { display: inline-block; vertical-align: top; height: 1.2em; clip-path: inset(0 -0.5em); }
.nm__roll { display: block; }
.nm__roll i { display: block; height: 1.2em; line-height: 1.2em; font-style: normal; }
.nm__sp { display: inline-block; width: .24em; }

/* Контакты: крупные строки, при наведении заливаются чёрным снизу вверх */
.ft__rows { margin-top: clamp(28px, 3vw, 48px); border-bottom: 1px solid var(--ink); }
.ft__row {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gut); align-items: center;
  padding: clamp(14px, 1.3vw, 22px) var(--gut);
  border-top: 1px solid var(--ink);
  color: var(--ink);
  transition: color .5s var(--ease);
}
.ft__row::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform .7s var(--ease);
}
.ft__row:hover, .ft__row:focus-visible { color: var(--bg); outline: none; }
.ft__row:hover::before, .ft__row:focus-visible::before { transform: none; }
.ft__k { grid-column: 1 / 2; opacity: .55; }
.ft__v { grid-column: 2 / 4; font-size: clamp(26px, 3vw, 58px); line-height: 1.04; letter-spacing: -0.04em; transition: transform .7s var(--ease); }
.ft__row:hover .ft__v { transform: translateX(14px); }
.ft__go { grid-column: 4 / 5; justify-self: end; display: flex; margin-right: calc(clamp(26px, 2.6vw, 46px) * -0.26); }
.ft__go .ic { width: clamp(26px, 2.6vw, 46px); height: clamp(26px, 2.6vw, 46px); transition: transform .7s var(--ease); }
.ft__row:hover .ft__go .ic { transform: rotate(45deg); }

.ft__bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gut); align-items: center; padding: 18px var(--gut) var(--gut); color: var(--soft); }
.ft__bar > :nth-child(2) { grid-column: 2 / 4; }
.ft__bar > :last-child { grid-column: 4; justify-self: end; }

/* ---------- Главная: логотипы брендов, тихий ряд ---------- */
/* Логотип рисуется маской по своему файлу цветом --soft: разные исходники (светлые webp, тёмные svg)
   выходят одним тоном. Картинка под маской прозрачна, она даёт размер и имя для поиска и диктора. */
/* строка логотипов стоит в промежутке между How I work и What I do, по центру по высоте */
.brands { height: var(--sec-gap); display: grid; align-content: center; }
.brands .sec__head { margin-bottom: 0; border-top: 0; padding-top: 0; align-items: center; }
.brands + .svc { margin-top: 0; }
/* Одна строка, которая сама плавно едет по кругу; края строки мягко гаснут. */
.brands__line {
  overflow: hidden;
  padding: 2px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.brands__run {
  --logo-h: clamp(15px, 1.3vw, 22px);
  --bgap: clamp(34px, 3.1vw, 56px);
  list-style: none;
  display: flex;
  align-items: center;
  width: max-content;
  animation: brands-run 42s linear infinite;
}
@keyframes brands-run { to { transform: translate3d(-50%, 0, 0); } }
.brand {
  position: relative;
  flex: none;
  margin-right: var(--bgap);
  color: var(--soft);
  transform: translateY(calc(var(--dy, 0) * var(--logo-h) * var(--k, 1))); /* центры знаков на одной линии */
}
.brand img { display: block; width: auto; height: calc(var(--logo-h) * var(--k, 1)); opacity: 0; }
.brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: currentColor;
  -webkit-mask: var(--logo) center / 100% 100% no-repeat;
          mask: var(--logo) center / 100% 100% no-repeat;
}

/* ---------- Планшет ---------- */

@media (min-width: 761px) and (max-aspect-ratio: 1/1) { :root { --th: 16vw; } }
@media (min-width: 761px) and (max-width: 1100px) {
  .exp__row { grid-template-columns: minmax(0, 1fr) auto; }
  .exp__row .r { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Телефон ---------- */

@media (max-width: 760px) {
  :root { --gut: 12px; --cell: 44px; --th: 30vw; --sec-gap: 88px; }
  .cell { padding: 0 10px 2px; font-size: 14px; }
  .cell--mark { width: 44px; }
  .hero { touch-action: pan-y; }
  /* текстовые кнопки: больше места под палец, вид тот же */
  .wk__ctl button, .ft__bar .ul, .svc__all { padding-block: 12px; margin-block: -12px; }
  .ticker { display: none; }
  .cell--cv .long { display: none; }
  .cell--cv .short { display: inline; }
  .cap { max-width: calc(100% - 2 * var(--gut) - 120px); }
  .cnt__bar { gap: 3px; }
  .cnt__bar i { width: 11px; }

  .g4 { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .g4 > * { grid-column: 1 / -1; }
  .svc__side { display: none; }
  /* общий шаг 14px не должен съедать воздух там, где он задан своим */
  .pj-intro { row-gap: 32px; }
  .pj-text { order: 1; }
  .pj-meta { order: 2; }
  .ab { row-gap: 24px; }
  .sk + .sk { margin-top: 14px; }

  .how { grid-template-columns: 1fr; }
  .how__cell { min-height: 0; padding: 64px var(--gut) 40px; border-right: 0 !important; display: block; place-items: start; text-align: left; }
  .how__label { top: 14px; }
  .how__word { display: block; }
  .how__text { position: static; transform: none; opacity: 1; width: auto; text-align: left; margin-top: 16px; }
  .how__cell.how__game { min-height: 440px; padding: 0; }

  .wk__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px var(--gut); }
  .card--2 { grid-column: 1 / -1; }
  .lrow { grid-template-columns: 34px minmax(0, 1fr) auto; font-size: 20px; }
  .lrow .c, .lrow .g { display: none; }

  .jrow { flex-wrap: wrap; max-width: none; }
  .jrow[style*="--w"] { max-width: none; }
  /* ширина по формату: в каждой строке переноса предметы одной высоты, без дыр */
  .jrow > * { flex: var(--ar) 1 calc(var(--ar) * 120px); }
  .jrow > :only-child { flex-basis: 100%; }
  .spread { flex-wrap: nowrap; }
  .pj-hero--row .jrow { flex-wrap: nowrap; }
  .pj-hero--row .jrow > *, .spread > * { flex: var(--ar) 1 0%; }
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logos { --cols: 2 !important; }
  .exp__row { grid-template-columns: minmax(0, 1fr) auto; }
  .exp__row .r { grid-column: 1 / -1; grid-row: 2; }
  .ft__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .ft__k { grid-column: 1; grid-row: 1; }
  .ft__v { grid-column: 1; grid-row: 2; font-size: 24px; }
  .ft__go { grid-column: 2; grid-row: 1 / 3; }
  .brands__run { --logo-h: 16px; --bgap: 30px; animation-duration: 34s; }
  .ft__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
}
@media (max-width: 420px) {
  .ft__bar { display: grid; grid-template-columns: 1fr auto; }
  .ft__bar > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .ft__bar > :last-child { grid-column: 2; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile img, .u__in, .hd .cell, .cap, .cnt, [data-rv] { transition: none !important; transform: none !important; opacity: 1; }
  .peek > *, .svc__m { transition: none !important; transform: none !important; }
  .brands__run { animation: none; }
}
