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

  /* Боковое поле секции. На мобильном — фиксированное, на десктопе растёт. */
  --pad: 18px;
  /* Предел ширины контента: дальше строка становится нечитаемо длинной,
     а картины — неестественно огромными. */
  --maxw: 1520px;
  /* Центрирующий отступ вместо обёртки-контейнера: контент не шире --maxw
     и стоит по центру, но фон секции остаётся во всю ширину экрана
     (это важно для чёрного блока «Раскраска» и полноэкранных картинок).
     Считаем от 100vw, а не от 100%: значение должно быть одинаковым и в
     padding секции, и в отрицательном margin у элементов, которые выходят
     за поле (фото в шапке). Проценты в margin считаются от своего контейнера
     — у грид-элемента это его ячейка, и цифры разъехались бы. */
  --gutter: max(var(--pad), calc((100vw - var(--maxw)) / 2));
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  /* Только clip, не hidden: hidden по одной оси включает overflow-y: auto по
     другой, и body становится вторым прокручиваемым слоем поверх страницы —
     на телефоне скролл из-за этого дёргается. clip обрезает так же (постеры
     специально торчат за край), но своей прокрутки не заводит.
     hidden оставлен фолбэком для браузеров без поддержки clip. */
  overflow-x: hidden;
  overflow-x: clip;
  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;
}

/* ---- Мобильное меню разделов ---------------------------------------- */

/* Кнопка висит поверх страницы (fixed), а не уезжает с первым экраном:
   разделы нужны и в середине длинной прокрутки. Без плашки и обводки —
   только две полоски. Правый край полосок совпадает с правым краем фото
   на обложке (оно во всю ширину экрана), поэтому right: 0 и выравнивание
   содержимого кнопки по правому краю; сама кнопка при этом остаётся
   44×44 — это минимальная площадь для уверенного попадания пальцем. */
.menu-toggle {
  position: fixed;
  top: 12px;
  right: 0;
  z-index: 40;
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-toggle-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 220ms ease, opacity 160ms ease;
}

/* Открыто — те же две полоски складываются в крестик, третьей не нужно */
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  gap: 26px;
  align-content: center;
  padding: 0 var(--pad);
  background: var(--bg);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu a {
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
}

/* Пока меню открыто, страница под ним не прокручивается. overflow вешаем на
   html (он и есть скроллер страницы), а не на body: у body от этого включился
   бы собственный слой прокрутки — ровно то, что чинили ради телефона. */
html.menu-open {
  overflow: hidden;
}

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

.hero {
  display: grid;
  gap: 4px;
  min-height: auto;
  align-content: start;
  padding-top: 38px;
  /* Имя и подпись по центру — как на десктопе. Центруем текстом, а не
     justify-items: фотография ниже растянута во всю ширину экрана
     отрицательными полями, и выравнивание элементов грида её бы сдвинуло. */
  text-align: center;
}

.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;
}

.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;
  text-align: center;
}

.about h2 {
  max-width: 430px;
  /* при ограниченной ширине блок нужно ещё и поставить по центру колонки */
  margin-inline: auto;
  font-size: clamp(18px, 5.4vw, 24px);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

/* Список «Опыт / Образование / …» — отдельный блок под обложкой */
.facts {
  display: grid;
  padding: 58px var(--pad);
}

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;
}

/* Глобальный h1 стоит в nowrap ради «Злата Гулик» на главной. В заголовке
   проекта это ломало вёрстку: длинное название («…выставочного пространства
   Манеж») уезжало одной строкой за правый край экрана. */
.project-copy h1 {
  max-width: none;
  margin-bottom: 0;
  font-size: clamp(32px, 9.8vw, 52px);
  font-weight: 500;
  line-height: 1.04;
  white-space: normal;
  overflow-wrap: break-word;
}

.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: calc(var(--pad) * -1);
  margin-right: calc(var(--pad) * -1);
}

.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: calc(var(--pad) * -1);
  margin-right: calc(var(--pad) * -1);
}

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

/* Винил: кадры показываем целиком, в своих пропорциях — ни один не кадрируем.
   Плитка берёт высоту от картинки, поэтому серого поля под ней не остаётся. */
.vinyl-stack {
  display: grid;
  gap: 0;
}

.project-gallery.vinyl-layout .image-tile img:not(.swap-image) {
  height: auto;
  object-fit: contain;
}

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

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

/* Ruff: фасад → собака → вывеска в одной плитке. Высоту плитки задаёт базовый
   кадр (фасад 900×1023), а второй и третий другой пропорции — особенно вывеска
   927×1400, она заметно уже. Вписывать их целиком нельзя: по бокам вставали
   серые поля и плитка переставала совпадать краями с соседними. Поэтому
   кадрируем по центру — сюжет у всех трёх в середине кадра.
     собака  1059×1200 → срезает доли процента
     вывеска  927×1400 → срезает по 12% сверху и снизу, сама вывеска остаётся */
.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;
}

/* На главной заголовок проекта — h2, на отдельной странице (coloring.html) — h1.
   Красили только h2, поэтому на странице проекта название пропадало: чёрный
   текст на чёрном фоне. */
#coloring h1,
#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) {
  :root {
    /* поле растёт вместе с экраном, но не бесконечно */
    --pad: clamp(28px, 4vw, 88px);
  }

  /* Все секции получают одинаковый центрирующий отступ: контент выравнен
     по общей сетке и не расползается на широком мониторе. */
  .hero,
  .work-index,
  .about,
  .facts,
  .project,
  .paintings,
  .contacts,
  .experience-page {
    padding-right: var(--gutter);
    padding-left: var(--gutter);
  }

  /* Мелкий служебный текст на десктопе: 10px читается только с телефона,
     на мониторе он превращается в серую пыль. */
  .meta,
  .index-row span,
  .index-row em,
  .project-copy li,
  .nav a,
  .logo {
    font-size: 12px;
    letter-spacing: 0.02em;
  }

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

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

  /* На широком экране разделы уже стоят в шапке — кнопка и панель не нужны */
  .menu-toggle,
  .mobile-menu {
    display: none;
  }

  /* Меню первого экрана: полусерые вкладки в правом верхнем углу.
     position: absolute, а не sticky, — иначе шапка вошла бы в поток и
     обложка перестала бы точно совпадать с высотой экрана. Прокрутку до
     раздела делает сам браузер: у html стоит scroll-behavior: smooth,
     а якоря #about / #work / #paintings / #contacts уже есть в разметке. */
  .site-header-home {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    display: block;
    padding: clamp(22px, 2.4vw, 40px) var(--gutter);
    background: none;
    border-bottom: 0;
    backdrop-filter: none;
  }

  .site-header-home .nav {
    justify-content: flex-end;
    gap: clamp(18px, 2vw, 36px);
  }

  .site-header-home .nav a {
    color: #9a9a9a;
    text-decoration: none;
    transition: color 180ms ease;
  }

  .site-header-home .nav a:hover,
  .site-header-home .nav a:focus-visible {
    color: var(--ink);
  }

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

  /* Первый экран целиком: шапка сверху, «Обо мне» прижато к нижнему краю.
     space-between сам раздаёт остаток высоты между ними, поэтому подгонять
     отступы под каждую диагональ не нужно. svh вместо vh — в мобильных
     браузерах блок не прыгает при сворачивании адресной строки. */
  .cover {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100svh;
  }

  /* Шапка: имя над фотографией, всё выровнено по центру страницы.
     Ширина кадра вынесена в переменную: от неё считается кегль обеих
     строк, чтобы они были ровно по ширине фотографии. */
  .hero {
    --photo-w: clamp(360px, 34vw, 680px);
    min-height: auto;
    grid-template-columns: 1fr;
    justify-items: center;
    /* Зазор до фотографии намеренно меньше, чем отбивка подписи от имени:
       подпись притянута к кадру и читается как его надпись, а не как хвост
       заголовка. Сумма двух зазоров сохранена, поэтому имя и кадр стоят
       там же, где стояли. */
    row-gap: calc(var(--photo-w) / 60);
    align-items: start;
    padding-top: clamp(56px, 6.5vw, 120px);
    padding-bottom: 0;
    text-align: center;
  }

  .hero-title {
    width: var(--photo-w);
    max-width: 100%;
    min-width: 0;
    padding-bottom: 0;
  }

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

  /* Обе строки набраны ровно по ширине фотографии. Ширина строки прямо
     пропорциональна кеглю, поэтому кегль = ширина кадра / коэффициент;
     коэффициенты (ширина строки при кегле 1px) замерены для Arial с теми
     же начертанием, трекингом и регистром, что стоят здесь. Меняете текст —
     коэффициент нужно замерить заново. */
  .hero-title h1 {
    font-size: calc(var(--photo-w) / 5.755);
    line-height: 1.05;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .hero-meta {
    margin-top: calc(var(--photo-w) / 22);
    font-size: calc(var(--photo-w) / 30.271);
    white-space: nowrap;
  }

  .hero-photo {
    /* по центру страницы; за поле секции больше не выходит */
    width: var(--photo-w);
    max-width: 100%;
    margin: 0 auto;
    /* кадр остаётся горизонтальным, как в оригинале */
    aspect-ratio: 3 / 2;
  }

  /* Опыт уходит за сгиб — обложка занимает весь первый экран */
  .facts {
    justify-items: start;
    padding-top: clamp(80px, 10vw, 170px);
    padding-bottom: clamp(88px, 11vw, 180px);
    text-align: left;
  }

  .facts dl {
    gap: clamp(20px, 2.2vw, 36px);
    width: 100%;
    max-width: 620px;
  }

  .work-index {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: clamp(96px, 11vw, 190px);
    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: auto;
    grid-template-columns: 1fr;
    gap: clamp(10px, 1.1vw, 16px);
    justify-items: center;
    align-items: start;
    padding-top: clamp(24px, 2.8vw, 48px);
    /* отбивка от нижнего края экрана — вплотную к нему текст не ставим */
    padding-bottom: clamp(36px, 4.4vw, 80px);
    text-align: center;
  }

  /* Мера в ch, а не в пикселях: символ масштабируется вместе с кеглем,
     поэтому фраза остаётся ровно в двух строках на любой ширине экрана. */
  .about h2 {
    max-width: 47ch;
    margin-inline: auto;
    font-size: clamp(24px, 2.4vw, 38px);
    line-height: 1.14;
    letter-spacing: -0.01em;
  }

  /* Переносы в разметке расставлены под узкий экран. На десктопе они рвут
     фразу в случайных местах — отключаем и даём тексту набраться самому. */
  .about h2 br {
    display: none;
  }

  dl {
    gap: clamp(18px, 1.9vw, 30px);
  }

  dt {
    margin-bottom: 6px;
    font-size: clamp(14px, 1.05vw, 17px);
  }

  dd,
  .experience-link {
    font-size: clamp(14px, 1.05vw, 17px);
  }

  .project {
    min-height: auto;
    /* Колонка описания шире текста не нужна: абзац всё равно упирается в свои
       46ch, а лишние пиксели отбрасывали галерею далеко вправо. Сужаем колонку
       ровно под текст — кадры встают рядом с описанием. */
    grid-template-columns: minmax(280px, min(32%, 46ch)) minmax(0, 1fr);
    gap: clamp(24px, 2.4vw, 48px);
    padding-top: clamp(80px, 9vw, 170px);
    padding-bottom: clamp(80px, 9vw, 170px);
    align-items: start;
  }

  .project.alt {
    grid-template-columns: minmax(0, 1fr) minmax(280px, min(32%, 46ch));
  }

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

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

  .project-copy {
    position: sticky;
    top: clamp(48px, 8vh, 96px);
    gap: 14px;
    /* колонка с текстом узкая — длинная строка в ней всё равно не наберётся,
       но ограничение страхует на сверхшироких мониторах */
    max-width: 46ch;
  }

  /* в перевёрнутом блоке текст стоит справа — прижимаем его к правому краю
     сетки, иначе между ним и полем страницы висит случайная дыра */
  .project.alt .project-copy {
    justify-self: end;
  }

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

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

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

  .project-copy .ruff-heading {
    font-size: clamp(26px, 2.4vw, 40px);
    line-height: 1.04;
  }

  .project-copy p {
    max-width: none;
    font-size: clamp(16px, 1.15vw, 20px);
  }

  .project-info summary {
    font-size: clamp(14px, 1vw, 17px);
  }

  .project-info p {
    font-size: clamp(14px, 1vw, 17px);
  }

  .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;
  }

  /* Раньше строки были фиксированной высоты, а картинки вписывались в них
     через object-fit: cover — то есть срезались по краям. Теперь высоту
     плитки задаёт сама картинка, и ни один кадр не обрезан. Ширины колонок
     в каждой раскладке ниже посчитаны из пропорций файлов, чтобы соседние
     колонки заканчивались на одной высоте. */
  .project-gallery {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: auto;
    align-items: start;
    gap: clamp(8px, 0.7vw, 14px);
    min-height: 0;
  }

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

  /* Манеж: сумка и знак в одном ряду, серия носителей во всю ширину под ними.
     Знак — мелкий файл (450×429), поэтому колонку под него берём уже, чтобы
     не растягивать выше исходного размера. */
  .manezh-layout .wide {
    grid-column: 1 / span 5;
    grid-row: 1;
  }

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

  .manezh-layout .tall {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .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: слева фасад во всю высоту, справа баннер и серия носителей друг
     под другом. Ни один кадр не обрезан, поэтому ширины колонок посчитаны
     из пропорций файлов: при ширине колонки w высота равна w * (h / w файла),
       фасад   900×1023        → 1.1367w
       баннер  900×1023  ┐
       носители 1300×739 ┘ стопка → 1.1367w + 0.5685w = 1.7052w
     колонки равны по высоте при a * 1.1367 = b * 1.7052 и a + b = 1,
     отсюда a = 60%, b = 40%. */
  .project-gallery.ruff-layout {
    grid-template-columns: 60fr 40fr;
  }

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

  .ruff-layout .wide {
    grid-column: 2;
    grid-row: 1;
  }

  .ruff-layout .full {
    grid-column: 2;
    grid-row: 2;
  }

  .project-gallery.coloring-layout {
    margin-left: 0;
    margin-right: 0;
    /* первая строка — по содержимому: кадр с обложками показываем целиком,
       в его собственной пропорции. Остальные строки остаются в общей сетке
       (их высоту задаёт grid-auto-rows), поэтому развороты стоят как стояли. */
    grid-template-rows: auto;
  }

  /* Раскраска: обложки во всю ширину, развороты парами. Развороты почти
     одной пропорции (0.57–0.70), поэтому колонки равные, а align-items: start
     прижимает более низкий кадр к верху вместо растягивания. */
  .project-gallery.coloring-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .coloring-layout .wide {
    grid-column: 1;
    grid-row: 2;
  }

  .coloring-layout .small {
    grid-column: 2;
    grid-row: 2;
  }

  .coloring-layout .extra {
    grid-column: 1;
    grid-row: 3;
  }

  .coloring-layout .extra2 {
    grid-column: 2;
    grid-row: 3;
  }

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

  /* Винил: три кадра собраны в один прямоугольник — слева главный, справа
     обложка и пластинка друг под другом, верх и низ у колонок общие.
     Ни один кадр не обрезан, поэтому ширины колонок посчитаны из пропорций:
     при ширине колонки w высота кадра равна w * (высота / ширина файла),
       левый  2100×2800          → 1.3333w
       обложка 1587×1800  ┐
       пластинка 900×895  ┘ стопка → 1.1342w + 0.9944w = 2.1287w
     колонки равны по высоте при a * 1.3333 = b * 2.1287 и a + b = 1,
     отсюда a = 61.49%, b = 38.51% — их и раздаём как fr. */
  .project-gallery.vinyl-layout {
    grid-template-columns: 61.49fr 38.51fr;
    grid-auto-rows: auto;
  }

  .vinyl-layout .tall {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .vinyl-stack {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  /* плитки лежат внутри стопки — общие раскладочные правила галереи им больше
     не нужны, иначе они пытаются встать в колонки 5-8 несуществующей сетки */
  .vinyl-layout .hand,
  .vinyl-layout .wide {
    grid-column: auto;
    grid-row: auto;
  }

  /* порядок как был: обложка в руке сверху, пластинка под ней */
  .vinyl-layout .hand {
    order: -1;
  }

  /* высоту плитки задаёт базовый кадр — ему height: auto, чтобы он показывался
     целиком. Второй кадр лежит поверх абсолютом: при height: auto он вставал
     в свою пропорцию и прилипал к верху, а под ним оставалась белая дыра —
     правая колонка выглядела короче левой. Ему нужна полная высота плитки,
     тогда contain вписывает его по центру и низ блока держится ровно. */
  .project-gallery.vinyl-layout .image-tile img:not(.swap-image) {
    height: auto;
    object-fit: contain;
  }

  .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;
    grid-template-columns: 1fr;
  }

  .project#posters .project-copy {
    position: static;
    max-width: none;
  }

  /* Постеры: лента-зигзаг. На десктопе она уезжала к правому краю, а слева
     оставалась пустая половина экрана — теперь колонка ограничена по ширине
     и стоит по центру, постеры расходятся от общей оси. */
  .poster-sequence {
    display: flex;
    flex-direction: column;
    width: min(100%, 1080px);
    height: auto;
    margin: clamp(24px, 3vw, 48px) auto 0;
    padding: 0;
    overflow: visible;
    background: var(--bg);
  }

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

  /* нахлёст побольше, чем на мобильном: карточки уже относительно колонки,
     и с прежними значениями лента растягивалась на четыре экрана */
  .poster-card + .poster-card {
    margin-top: -20%;
  }

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

  .poster-card img {
    height: auto;
  }

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

  .paintings {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: clamp(28px, 3vw, 56px);
    align-items: start;
    padding-top: clamp(64px, 8vw, 140px);
    padding-bottom: clamp(64px, 8vw, 140px);
  }

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

  /* Раньше картины шли одной колонкой во всю ширину: на мониторе каждая
     занимала весь экран, а секция вытягивалась на 8000px. Теперь — сетка. */
  .paintings-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(40px, 4.5vw, 88px) clamp(24px, 3vw, 56px);
    align-items: start;
    padding-bottom: 0;
  }

  .painting-item {
    gap: 16px;
  }

  .painting-card {
    width: 100%;
  }

  .painting-card img {
    /* width: auto вместе с max-height — иначе высокий холст растянулся бы
       на пол-экрана: без него max-height у картинки с width: 100% не работает */
    width: auto;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    height: auto;
    max-height: 74vh;
    object-fit: contain;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  }

  .buy-link {
    padding: 11px 20px;
    font-size: 12px;
  }

  .contacts {
    min-height: auto;
    grid-template-columns: 1fr auto;
    /* ссылки идут сразу под заголовком, а стикер (у него свой align-self: end)
       остаётся внизу справа — иначе между заголовком и почтой зияла пустая полоса */
    align-items: start;
    gap: clamp(16px, 2vw, 32px);
    padding-top: clamp(64px, 8vw, 140px);
    padding-bottom: clamp(48px, 6vw, 96px);
  }

  .contacts-links {
    gap: 14px;
  }

  .contacts a {
    font-size: clamp(14px, 1.1vw, 18px);
    letter-spacing: 0.02em;
  }

  /* стикер стоял вплотную к правому полю страницы и выглядел прилипшим к краю —
     отодвигаем его внутрь, отступ растёт вместе с шириной экрана */
  .contacts .sticker {
    --size: clamp(210px, 17vw, 280px);
    margin-right: clamp(32px, 4vw, 96px);
  }

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

  .lightbox {
    padding: 88px clamp(24px, 4vw, 72px) 32px;
  }

  .lightbox img {
    max-height: 78vh;
  }

  .lightbox p {
    max-width: min(100%, var(--maxw));
  }

  /* Страница опыта: на мобильном это одна колонка, и на мониторе она
     оставалась узкой полоской у левого края. Раскладываем три подборки
     карточек в ряд, а текст оставляем во всю ширину сетки. */
  .experience-page {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(24px, 3vw, 56px);
    min-height: auto;
    padding-top: clamp(56px, 7vw, 120px);
    padding-bottom: clamp(56px, 7vw, 120px);
  }

  .experience-page > .meta,
  .experience-page > h1,
  .experience-page > p {
    grid-column: 1 / -1;
  }

  .experience-page h1 {
    max-width: 22ch;
  }

  .experience-page p {
    max-width: 62ch;
    font-size: clamp(16px, 1.2vw, 20px);
  }

  .experience-page .cards-block {
    gap: 10px;
    align-content: start;
  }

  /* внутри своей колонки лента занимает всю ширину — жёсткие 460px
     оставляли пустоту справа от карточек */
  .cards-carousel {
    max-width: 100%;
  }
}

.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) {
    max-width: 68ch;
    font-size: clamp(16px, 1.2vw, 20px);
  }

  .competition-page .project-copy h1 {
    max-width: 20ch;
    font-size: clamp(34px, 3.6vw, 60px);
  }

  /* картинки на странице конкурса — по центру колонки и не во весь экран */
  .competition-page .project-gallery {
    justify-items: center;
    gap: clamp(12px, 1.4vw, 24px);
  }

  .competition-page .project-gallery .image-tile {
    width: min(100%, 1180px);
  }
}

.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: clamp(80px, 9vw, 170px);
  }
}
