:root {
  --bg: #ffffff;
  --ink: #050505;
  --muted: #5f5f5f;
  --line: #111111;
  --soft: #eeeeee;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.08;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

img {
  display: block;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  padding: 0;
  color: inherit;
  font: inherit;
  background: none;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: none;
  padding: 9px 12px 10px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.logo,
.nav a,
.meta,
.index-row span,
.index-row em,
.project-copy li,
.contacts a,
.lightbox-close {
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

.logo,
.nav a,
.contacts a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.hero,
.work-index,
.about,
.project,
.paintings,
.contacts {
  padding: 12px 18px;
}

.hero {
  display: grid;
  gap: 4px;
  min-height: auto;
  align-content: start;
  padding-top: 38px;
}

.meta {
  margin: 0 0 12px;
  color: var(--muted);
}

.hero-meta {
  margin: 28px 0 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(46px, 15.5vw, 72px);
  font-weight: 500;
  line-height: 0.9;
  white-space: nowrap;
  text-transform: none;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(40px, 13vw, 64px);
  font-weight: 500;
  line-height: 0.96;
}

.about-text p,
.project-copy p {
  color: #202020;
  font-size: 18px;
  line-height: 1.18;
}

.project-copy strong {
  font-weight: 650;
}

.image-tile {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: zoom-in;
}

.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 360ms ease;
}

.image-tile:hover img {
  transform: scale(1.025);
}

.image-swap {
  background: var(--soft);
}

.image-swap-white {
  background: #ffffff;
}

.project-gallery .image-tile.image-swap-white {
  background: #ffffff;
}

.image-swap-fit,
.project-gallery .image-tile.image-swap-fit {
  background: #ffffff;
}

.image-swap .base-image {
  animation: baseSwap 6.4s ease-in-out infinite;
}

.image-swap .swap-image {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: overlaySwap 6.4s ease-in-out infinite;
}

/* Пока не все кадры готовы (класс is-ready ставит скрипт) — анимацию не запускаем:
   показываем статичный контур (base), swap скрыт. Так средняя не мигает пустотой,
   а старт у всех плиток одновременный. */
.image-swap:not(.is-ready) .base-image,
.image-swap:not(.is-ready) .swap-image {
  animation: none;
}

.image-swap-fit img {
  object-fit: contain;
}

@keyframes baseSwap {
  0%,
  38%,
  100% {
    opacity: 1;
  }

  50%,
  82% {
    opacity: 0;
  }
}

@keyframes overlaySwap {
  0%,
  38%,
  100% {
    opacity: 0;
  }

  50%,
  82% {
    opacity: 1;
  }
}

/* Переключалка на три кадра (у Ruff: дверь → собака → вывеска). Кадры делят цикл
   9.6s на три равные трети; всем задан один keyframes, а очередь — отрицательной
   задержкой, поэтому кадры не могут разойтись между собой. */
@keyframes tripleSwap {
  0%,
  25.33% {
    opacity: 1;
  }

  33.33%,
  92% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.image-swap-3 .base-image,
.image-swap-3 .swap-image {
  animation: tripleSwap 9.6s ease-in-out infinite;
}

/* base-image — первый img в плитке, поэтому кадры 2 и 3 это nth-of-type 2 и 3 */
.image-swap-3 .swap-image:nth-of-type(2) {
  animation-delay: -6.4s;
}

.image-swap-3 .swap-image:nth-of-type(3) {
  animation-delay: -3.2s;
}

.hero-photo {
  /* фото во всю ширину экрана — выходит за боковые отступы секции */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  aspect-ratio: 16 / 9;
  background: var(--soft);
  margin-top: 8px;
}

.hero-photo img {
  height: 100%;
  object-fit: cover;
  object-position: 52% 42%;
}

.work-index {
  display: grid;
  gap: 10px;
  padding-top: 92px;
  padding-bottom: 0;
}

.index-head h2 {
  font-size: clamp(38px, 11vw, 54px);
  font-weight: 500;
}

.index-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  border-top: 0;
  scrollbar-width: thin;
}

.index-row {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
  align-items: center;
  min-height: auto;
  padding: 0;
  border-bottom: 0;
}

.index-row strong {
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.index-row em {
  display: none;
  grid-column: auto;
  color: var(--muted);
  font-style: normal;
  line-height: 1.2;
}

.index-row img {
  display: none;
}

.about {
  display: grid;
  gap: 26px;
  padding-top: 58px;
  padding-bottom: 58px;
}

.about h2 {
  max-width: 430px;
  font-size: clamp(18px, 5.4vw, 24px);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.about-text {
  display: grid;
  gap: 26px;
}

dl {
  display: grid;
  gap: 16px;
  margin: 0;
}

dt,
dd {
  margin: 0;
  line-height: 1.2;
}

dt {
  margin-bottom: 4px;
  font-size: 15px;
  text-transform: uppercase;
}

dd {
  font-size: 13px;
  color: var(--muted);
}

.experience-link {
  display: inline;
  /* строка длинная — чуть уменьшаем, чтобы «(TSN) ↗» помещалось в одну строку на узких телефонах */
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* стрелка идёт сразу за «(TSN)» в потоке текста, а не отлетает вправо */
.experience-link span {
  display: inline-block;
  margin-left: 5px;
}

.detail-link {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.experience-link span,
.detail-link span {
  color: var(--ink);
  font-size: 0.82em;
}

.experience-page {
  display: grid;
  gap: 18px;
  min-height: 72vh;
  align-content: start;
  padding: 58px 12px;
}

/* Длинное название агентства должно переноситься: глобальный h1 стоит в nowrap
   (ради «Злата Гулик» на главной), здесь перенос возвращаем и уменьшаем кегль */
.experience-page h1 {
  max-width: min(760px, 100%);
  font-size: clamp(26px, 7.4vw, 64px);
  font-weight: 700;
  line-height: 1;
  white-space: normal;
  overflow-wrap: break-word;
}

.experience-page p {
  max-width: 420px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.18;
}

/* Подборка карточек = подпись + лента + счётчик. Блоков может быть несколько
   (по одному на пост), скрипт вешает счётчик на каждый отдельно. */
.cards-block {
  display: grid;
  gap: 6px;
}

.cards-block .meta {
  margin: 0;
}

/* Карточки для соцсетей: нативный горизонтальный скролл со snap.
   Карточка ровно во всю ширину экрана, без зазоров — соседняя не выглядывает.
   Отрицательные поля = padding секции (12px). */
.cards-carousel {
  display: flex;
  gap: 0;
  margin: 0 -12px;
  padding: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cards-carousel::-webkit-scrollbar {
  display: none;
}

.card-slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
  background: var(--soft);
}

.card-slide {
  overflow: hidden;
}

.card-slide img,
.card-slide video {
  display: block;
  width: 100%;
  height: auto;
}

/* У экспортированных роликов по краю остаётся тёмная кромка в 1–2 пикселя
   (криво обрезан кадр). Микрозум съедает её, вместе со слайдом в overflow: hidden. */
.card-video {
  transform: scale(1.012);
}

.experience-page .carousel-hint {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project {
  display: grid;
  gap: 8px;
  padding-top: 34px;
}

.project-copy {
  display: grid;
  gap: 8px;
}

.project-copy-tight {
  gap: 2px;
}

.project-copy-tight p {
  margin-bottom: 0;
}

.project-copy > .meta {
  color: #707070;
  margin-bottom: 4px;
  font-size: 14px;
}

.project-copy h2 {
  font-size: clamp(20px, 6vw, 30px);
  line-height: 1.04;
}

.project-copy h1 {
  max-width: none;
  margin-bottom: 0;
  font-size: clamp(32px, 9.8vw, 52px);
  font-weight: 500;
  line-height: 1.04;
}

.project-copy .ruff-heading {
  font-size: clamp(18px, 5.5vw, 27px);
  letter-spacing: 0;
  line-height: 1.05;
}

.project-copy p {
  max-width: 360px;
  font-size: 18px;
}

.project-info {
  display: block;
}

.project-info summary {
  width: max-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.1;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  list-style: none;
}

.project-info summary::-webkit-details-marker {
  display: none;
}

.project-info[open] summary {
  margin-bottom: 8px;
}

.project-info p {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.project-info p + p {
  margin-top: 6px;
}

.project-copy ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.project-copy p + ul {
  margin-top: 34px;
}

.project-info + ul {
  margin-top: 10px;
}

.project-info[open] + ul {
  margin-top: 34px;
}

.project-copy li {
  color: var(--muted);
}

.project-gallery {
  display: grid;
  gap: 10px;
}

.project-gallery .image-tile {
  width: 100%;
  background: var(--soft);
}

.project-gallery .image-tile img {
  height: auto;
  object-fit: contain;
}

/* Раскраска: три мокапа на чёрном идут сплошным блоком — без серых рамок и белых зазоров,
   и на всю ширину экрана (вытянут за боковые отступы секции = 18px на мобильном) */
.project-gallery.coloring-layout {
  gap: 0;
  margin-left: -18px;
  margin-right: -18px;
}

.project-gallery.coloring-layout .image-tile {
  background: #000;
}

.project-gallery.coloring-layout .image-tile img {
  display: block;
}

/* Винил: галерея во всю ширину экрана и сплошным блоком — без белых полей и промежутков */
.project-gallery.vinyl-layout {
  gap: 0;
  margin-left: -18px;
  margin-right: -18px;
}

.project-gallery.vinyl-layout .image-tile img {
  display: block;
}

/* Ruff: галерея во всю ширину экрана и сплошным блоком — без белых полей и промежутков */
.project-gallery.ruff-layout {
  gap: 0;
  margin-left: -18px;
  margin-right: -18px;
}

.project-gallery.ruff-layout .image-tile img {
  display: block;
}

/* Ruff: фасад ↔ упаковка. Кадры разной пропорции (900×1023 и 1300×739), поэтому
   второй не вписываем в кадр, а кадрируем по центру — там стоят оба пакета,
   иначе он утонул бы в пустых полях внутри вертикальной плитки. */
.ruff-layout .tall.image-swap .swap-image {
  /* без height второй кадр встал бы в собственную пропорцию и занял только верх
     плитки: у абсолютно позиционированной картинки height: auto берёт свой размер */
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Раскраска переключается быстрее, чем винил (у винила остаётся 6.4s) */
.coloring-layout .image-swap .base-image,
.coloring-layout .image-swap .swap-image {
  animation-duration: 3.4s;
}

/* Проект «Раскраска» целиком на чёрном фоне — однородный блок от заголовка до картинок.
   Секция во всю ширину, поэтому фон сам доходит до краёв экрана; текст делаем светлым. */
#coloring {
  background: #000;
}

#coloring h2 {
  color: #ffffff;
}

#coloring .meta,
#coloring .project-copy li {
  color: #a6a6a6;
}

#coloring .project-info summary {
  color: #d0d0d0;
}

#coloring .project-info p {
  color: #e6e6e6;
}

#coloring .project-info strong {
  color: #ffffff;
}

.project-gallery .image-tile.image-swap-fit img {
  height: 100%;
  object-fit: contain;
}

.competition-page {
  gap: 8px;
}

.competition-page .project-gallery {
  min-height: auto;
}

.poster-sequence {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  padding: 0;
  overflow: visible;
  background: var(--bg);
}

.poster-card {
  --angle: 2.2deg;
  --slide-x: 30px;
  position: relative;
  z-index: 2;
  align-self: flex-end;
  width: 62%;
  max-width: 62%;
  background: transparent;
  opacity: 0;
  transform: translate3d(var(--slide-x), 44px, 0) rotate(calc(var(--angle) * 3)) scale(1.07);
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.2);
  transition:
    opacity 440ms ease,
    transform 720ms cubic-bezier(0.22, 0.72, 0.24, 1),
    box-shadow 720ms cubic-bezier(0.22, 0.72, 0.24, 1);
}

.poster-card + .poster-card {
  margin-top: -16%;
}

.poster-card:nth-child(even) {
  --angle: -2.6deg;
  --slide-x: -30px;
  z-index: 1;
  align-self: flex-start;
  margin-top: -39%;
}

.poster-card:first-child {
  z-index: 0;
}

.poster-card.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(var(--angle)) scale(1);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.14);
}

.poster-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .poster-card,
  .poster-card.is-visible {
    transform: rotate(var(--angle));
    transition: opacity 300ms ease;
  }
}

.paintings {
  display: grid;
  gap: 18px;
  min-height: 62vh;
  padding-top: 64px;
  padding-bottom: 64px;
  background: var(--bg);
}

.paintings h2 {
  font-size: clamp(38px, 11vw, 54px);
  font-weight: 500;
  line-height: 0.96;
  text-transform: uppercase;
}

.paintings-strip {
  display: grid;
  gap: 76px;
  overflow-x: visible;
  padding-bottom: 10px;
  scroll-snap-type: none;
}

/* Обёртка нужна там, где под работой есть «Купить»: ссылку нельзя вложить
   в button (карточка сама по себе кнопка, открывающая лайтбокс), поэтому
   кладём их рядом внутрь одного элемента ленты. */
.painting-item {
  display: grid;
  gap: 12px;
}

.buy-link {
  justify-self: start;
  padding: 9px 16px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  transition: color 200ms ease, background-color 200ms ease;
}

.buy-link:hover,
.buy-link:focus-visible {
  color: var(--bg);
  background: var(--ink);
}

.painting-card {
  width: 100%;
  display: grid;
  gap: 6px;
  align-content: start;
  background: var(--bg);
  scroll-snap-align: start;
}

.painting-card img {
  /* изображение во всю ширину экрана, подпись под ним остаётся с отступами */
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: auto;
  object-fit: cover;
  object-position: center center;
}

.painting-card span {
  display: grid;
  gap: 1px;
  color: var(--muted);
  line-height: 1.2;
  text-align: left;
  text-transform: none;
}

.painting-card span strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

.painting-card span em {
  color: var(--muted);
  font-size: 15px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.2;
}

.contacts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  min-height: 38vh;
  align-content: start;
  padding-top: 36px;
}

.contacts h2,
.contacts .meta {
  grid-column: 1 / -1;
}

.contacts-links {
  display: grid;
  gap: 12px;
  align-content: start;
}

/* --- Стикер: белый контур + отклеивающийся уголок --- */

@property --peel {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.contacts .sticker {
  --peel: 0;
  --size: 150px;
  /* вырубка с запасом: тонкие ножки стула сливаются в цельный силуэт */
  --edge: 9px;
  /* глубина подворота снизу — неглубоко, иначе изнанка закрывает рисунок */
  --fold: calc(var(--peel) * var(--size) * 0.2);
  position: relative;
  display: block;
  width: auto;
  height: var(--size);
  aspect-ratio: 540 / 990;
  justify-self: end;
  align-self: end;
  margin-right: 22px;
  cursor: pointer;
  text-decoration: none;
  touch-action: pan-y;
  transform: rotate(-3deg);
  transition: --peel 420ms cubic-bezier(0.22, 0.72, 0.24, 1);
}

.contacts .sticker.is-dragging {
  transition: none;
}

.sticker-base,
.sticker-flap {
  position: absolute;
  inset: 0;
  display: block;
}

.sticker-base img,
.sticker-flap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* приклеенная часть — всё выше линии сгиба */
.sticker-base {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--fold)),
    0 calc(100% - var(--fold))
  );
}

/* белая обводка вырубки + тень на странице */
.sticker-art {
  filter:
    drop-shadow(var(--edge) 0 0 #fff)
    drop-shadow(calc(var(--edge) * -1) 0 0 #fff)
    drop-shadow(0 var(--edge) 0 #fff)
    drop-shadow(0 calc(var(--edge) * -1) 0 #fff)
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
}

/* отогнутый низ: тот же силуэт, отражённый через линию сгиба */
.sticker-flap {
  clip-path: polygon(
    0 calc(100% - var(--fold)),
    100% calc(100% - var(--fold)),
    100% 100%,
    0 100%
  );
  /* отражение считается от левого верхнего угла, а не от центра */
  transform-origin: 0 0;
  transform: translateY(calc(200% - 2 * var(--fold))) scaleY(-1);
}

/* изнанка стикера — подложка чуть темнее лицевой стороны, иначе сливается с белым фоном */
.sticker-flap img {
  filter:
    brightness(0) invert(0.91)
    drop-shadow(var(--edge) 0 0 #e8e8e6)
    drop-shadow(calc(var(--edge) * -1) 0 0 #e8e8e6)
    drop-shadow(0 var(--edge) 0 #e8e8e6)
    drop-shadow(0 calc(var(--edge) * -1) 0 #e8e8e6)
    drop-shadow(0 -9px 10px rgba(0, 0, 0, 0.3));
}

@media (prefers-reduced-motion: reduce) {
  .contacts .sticker {
    transition: none;
  }
}

.contacts .meta {
  margin-bottom: 2px;
}

.contacts h2 {
  font-size: clamp(38px, 11vw, 54px);
  font-weight: 500;
  line-height: 0.96;
  text-transform: uppercase;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto 1fr;
  gap: 12px;
  justify-items: center;
  align-content: center;
  padding: 78px 12px 12px;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  justify-self: auto;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  text-decoration: none;
}

.lightbox img {
  width: auto;
  max-width: 100%;
  max-height: 72vh;
  height: auto;
  justify-self: center;
  object-fit: contain;
  /* тень, чтобы у светлых постеров были видны границы на белом фоне лайтбокса */
  box-shadow: 0 8px 34px rgba(0, 0, 0, 0.22);
}

/* у анимированной плитки в лайтбоксе два кадра — по тапу листаются */
.lightbox.has-multiple #lightboxImage {
  cursor: pointer;
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
}

.lightbox.has-multiple .lightbox-counter {
  opacity: 1;
}

.lightbox.is-cropped-bottom img {
  clip-path: inset(0 0 12% 0);
}

.lightbox p {
  display: grid;
  gap: 3px;
  width: 100%;
  max-width: min(100%, 980px);
  margin: 0;
  color: var(--muted);
  line-height: 1.25;
  text-transform: none;
}

.lightbox-title-name {
  color: var(--ink);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

.lightbox-title-meta {
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  white-space: pre-line;
}

@media (min-width: 760px) {
  /* на большом экране карточка во всю ширину была бы огромной — ограничиваем ленту */
  .cards-carousel {
    max-width: 460px;
    margin: 0;
  }

  .site-header {
    display: none;
    padding: 10px 12px;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero,
  .work-index,
  .about,
  .project,
  .paintings,
  .contacts {
    padding: 12px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: minmax(220px, 0.34fr) minmax(360px, 0.66fr);
    gap: 24px;
    align-items: start;
    padding-top: 38px;
  }

  .hero-title {
    min-width: 0;
  }

  h1 {
    max-width: none;
    font-size: clamp(48px, 5vw, 86px);
    font-weight: 500;
  }

  .hero-photo {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .work-index {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 72px;
    padding-bottom: 0;
  }

  .index-head {
    position: static;
    align-self: start;
  }

  .index-head h2 {
    font-size: clamp(38px, 5.2vw, 72px);
    font-weight: 500;
  }

  .index-list {
    align-self: start;
  }

  .index-row {
    gap: 6px;
  }

  .index-row strong {
    font-size: 20px;
    line-height: 1;
  }

  .index-row em {
    display: none;
  }

  .index-row img {
    display: none;
  }

  .index-row:hover img {
    opacity: 0;
  }

  .about {
    min-height: 70vh;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 42px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .about h2 {
    max-width: 860px;
    font-size: clamp(34px, 5.6vw, 84px);
    line-height: 0.92;
  }

  .project {
    min-height: 100vh;
    grid-template-columns: minmax(0, 36%) minmax(0, calc(64% - 18px));
    gap: 18px;
    padding-top: 12px;
    align-items: start;
  }

  .project.alt {
    grid-template-columns: minmax(0, calc(64% - 18px)) minmax(0, 36%);
  }

  .project.alt .project-copy {
    grid-column: 2;
  }

  .project.alt .project-gallery {
    grid-column: 1;
    grid-row: 1;
  }

  .project-copy {
    position: sticky;
    top: 46px;
    gap: 12px;
  }

  .project-copy-tight {
    gap: 3px;
  }

  .project-copy h2 {
    font-size: clamp(28px, 3.4vw, 52px);
    line-height: 1.02;
  }

  .project-copy h1 {
    font-size: clamp(34px, 4.8vw, 76px);
    line-height: 0.98;
  }

  .project-copy .ruff-heading {
    font-size: clamp(28px, 3.25vw, 48px);
    line-height: 1.02;
  }

  .project-copy p {
    max-width: none;
    font-size: clamp(17px, 1.95vw, 27px);
  }

  .project-copy p + ul {
    margin-top: 34px;
  }

  .competition-page.project {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 38px;
  }

  .competition-page .project-copy {
    position: static;
    top: auto;
    max-width: 720px;
  }

  .competition-page .project-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
  }

  .competition-page .project-gallery .image-tile,
  .competition-page .manezh-layout .wide,
  .competition-page .manezh-layout .small,
  .competition-page .manezh-layout .tall {
    grid-column: auto;
    grid-row: auto;
  }

  .competition-page .project-gallery .image-tile img {
    height: auto;
    object-fit: contain;
  }

  .project-gallery {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: 78px;
    gap: 8px;
    min-height: calc(100vh - 24px);
  }

  .project-gallery .image-tile img {
    height: 100%;
    object-fit: cover;
  }

  .project-gallery .wide {
    grid-column: span 5;
    grid-row: span 4;
  }

  .project-gallery .tall {
    grid-column: span 3;
    grid-row: span 7;
  }

  .project-gallery .small {
    grid-column: span 3;
    grid-row: span 3;
  }

  .project-gallery .full {
    grid-column: 2 / span 6;
    grid-row: span 5;
  }

  .manezh-layout .wide {
    grid-column: 1 / span 5;
    grid-row: 2 / span 6;
  }

  .manezh-layout .small {
    grid-column: 6 / span 2;
    grid-row: 1 / span 3;
  }

  .manezh-layout .tall {
    grid-column: 4 / span 5;
    grid-row: 8 / span 5;
  }

  .competition-page .project-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    min-height: auto;
  }

  .competition-page .project-gallery .image-tile,
  .competition-page .manezh-layout .wide,
  .competition-page .manezh-layout .small,
  .competition-page .manezh-layout .tall {
    grid-column: auto;
    grid-row: auto;
  }

  .competition-page .project-gallery .image-tile img {
    height: auto;
    object-fit: contain;
  }

  .project-gallery.ruff-layout {
    margin-left: 0;
    margin-right: 0;
  }

  .ruff-layout .tall {
    grid-column: 1 / span 3;
    grid-row: 1 / span 7;
  }

  .ruff-layout .wide {
    grid-column: 4 / span 5;
    grid-row: 2 / span 4;
  }

  .ruff-layout .full {
    grid-column: 3 / span 6;
    grid-row: 7 / span 5;
  }

  .project-gallery.coloring-layout {
    margin-left: 0;
    margin-right: 0;
  }

  .coloring-layout .full {
    grid-column: 1 / span 7;
    grid-row: 1 / span 6;
  }

  .coloring-layout .wide {
    grid-column: 3 / span 5;
    grid-row: 7 / span 4;
  }

  .coloring-layout .small {
    grid-column: 1 / span 2;
    grid-row: 8 / span 3;
  }

  .coloring-layout .extra {
    grid-column: 1 / span 7;
    grid-row: 11 / span 6;
  }

  .coloring-layout .extra2 {
    grid-column: 1 / span 7;
    grid-row: 17 / span 6;
  }

  .project-gallery.vinyl-layout {
    margin-left: 0;
    margin-right: 0;
  }

  .vinyl-layout .tall {
    grid-column: 1 / span 4;
    grid-row: 1 / span 8;
  }

  .vinyl-layout .wide {
    grid-column: 4 / span 5;
    grid-row: 6 / span 5;
  }

  .vinyl-layout .hand {
    grid-column: 5 / span 4;
    grid-row: 1 / span 5;
  }

  .posters-layout .wide {
    grid-column: 1 / span 5;
    grid-row: 2 / span 5;
  }

  .posters-layout .tall {
    grid-column: 5 / span 4;
    grid-row: 5 / span 7;
  }

  .project#posters {
    min-height: auto;
  }

  .poster-sequence {
    display: flex;
    flex-direction: column;
    height: auto;
    margin: 24px 0 0;
    padding: 0;
    overflow: visible;
    background: var(--bg);
  }

  .poster-card {
    width: 40%;
    max-width: 40%;
  }

  .poster-card + .poster-card {
    margin-top: -10%;
  }

  .poster-card:nth-child(even) {
    margin-top: -25%;
  }

  .poster-card img {
    height: auto;
  }

  .poster-card-wide {
    width: 40%;
    max-width: 40%;
  }

  .paintings {
    min-height: 70vh;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .paintings h2 {
    font-size: clamp(40px, 5.8vw, 78px);
    font-weight: 500;
  }

  .painting-card {
    width: 100%;
  }

  .painting-card img {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    height: auto;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  }

  .contacts {
    min-height: 42vh;
    grid-template-columns: 1fr auto;
    align-items: start;
    padding-top: 44px;
  }

  .contacts .sticker {
    --size: 210px;
  }

  .contacts h2 {
    grid-column: 1 / -1;
    font-size: clamp(40px, 5.8vw, 78px);
    font-weight: 500;
  }
}

.competition-page.project {
  min-height: auto;
  grid-template-columns: 1fr;
  gap: 8px;
}

.competition-page .project-copy {
  position: static;
  top: auto;
  max-width: none;
}

/* Заголовок мельче общего .project-copy h1: название длинное и переносится,
   при крупном кегле оно занимало бы шесть строк. Абзацы — 15px/1.3, как у винила */
.competition-page .project-copy h1 {
  max-width: 720px;
  font-size: clamp(24px, 7.3vw, 38px);
  line-height: 1.02;
  white-space: normal;
  overflow-wrap: normal;
}

.competition-page .project-copy p:not(.meta) {
  font-size: 15px;
  line-height: 1.3;
}

/* Между «Задачей» и «Концепцией» остаётся только gap контейнера (8px):
   браузерный margin-bottom абзаца убираем, но лишь у того, за которым идёт другой
   абзац, — отступ перед списком техник не трогаем */
.competition-page .project-copy p:not(.meta):has(+ p) {
  margin-bottom: 0;
}

@media (min-width: 760px) {
  .competition-page .project-copy p:not(.meta) {
    font-size: clamp(17px, 1.95vw, 27px);
  }
}

.competition-page .project-gallery {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  gap: 10px;
  min-height: auto;
}

.competition-page .project-gallery .image-tile,
.competition-page .manezh-layout .wide,
.competition-page .manezh-layout .small,
.competition-page .manezh-layout .tall {
  grid-column: auto;
  grid-row: auto;
}

.competition-page .project-gallery .image-tile img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* На мобильном галерея Ruff идёт во всю ширину и упирается в чёрный блок
   «Раскраска» — нижний отступ секции оставлял белую полосу на стыке.
   На странице проекта (.project-page) и на десктопе галерея не во всю ширину,
   там отступ нужен. */
#ruff:not(.project-page) {
  padding-bottom: 0;
}

@media (min-width: 760px) {
  #ruff:not(.project-page) {
    padding-bottom: 12px;
  }
}
