/* ═══════════════════════════════════
   main.css — Все стили портфолио
═══════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
/* Фон страницы совпадает с фоном 3D-сцены, чтобы при первой загрузке
   (когда canvas ещё прозрачный) пользователь не видел белую вспышку. */
body { background: #ECEAE5; }
a { text-decoration: none; color: inherit; }

:root {
  --bg: #ECEAE5;
  --panel-bg: #ECEAE5;
  --nav-h: 60px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --nav-text: #1A1A1A;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.13); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }

/* ── Навигация ──
   Шапка полностью прозрачная — 3D-сцена визуально проходит ПОВЕРХ неё (canvas
   приподнят z-index'ом). Чтобы кнопки оставались читаемыми над верёвками,
   у них собственная подложка-«пилюля». При открытой панели шапка получает
   плотный фон, который и закрывает 3D-сцену сверху панели.
   При первой загрузке элементы навигации плавно появляются сверху. */
nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  background: transparent;
  pointer-events: none;
  transition: background 0.4s ease;
}
/* Возвращаем интерактивность только реальным интерактивным элементам шапки */
nav .logo-wrap,
nav .nav-center,
nav .nav-close { pointer-events: auto; }

/* Стартовое состояние интро для лого и центральной группы */
.logo-wrap,
.nav-center {
  opacity: 0;
  transform: translateY(-12px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.30, 1) 0.05s,
    transform 0.9s cubic-bezier(0.22, 1, 0.30, 1) 0.05s,
    background 0.3s ease,
    backdrop-filter 0.3s ease,
    padding 0.3s ease;
}
body.loaded .logo-wrap,
body.loaded .nav-center {
  opacity: 1;
  transform: translateY(0);
}

body.has-panel-open nav {
  background: var(--bg);
}

.logo-wrap {
  position: absolute; left: 40px;
  display: flex; align-items: center; cursor: pointer;
  /* Фиксированный padding — не меняется при открытии панели,
     чтобы лого не прыгало вправо */
  padding: 6px 8px;
  /* фон-пилюля, чтобы лого было видно над 3D-сценой */
  background: rgba(236, 234, 229, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 4px;
  /* transition объявлен выше в общем правиле для .logo-wrap, .nav-center */
}
body.has-panel-open .logo-wrap {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* padding остаётся 6px 8px — лого не сдвигается */
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.logo-wrap:hover .logo-img { opacity: 0.55; }

.logo-placeholder {
  width: 44px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed rgba(0,0,0,0.2); border-radius: 2px;
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.08em;
  color: rgba(0,0,0,0.3); transition: opacity 0.2s;
}

.logo-placeholder:hover { opacity: 0.5; }

.nav-center {
  display: flex; align-items: center; gap: 60px;
  /* фон-пилюля для центральной группы кнопок поверх 3D-сцены */
  padding: 8px 28px;
  background: rgba(236, 234, 229, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 4px;
  /* transition определён выше в общем правиле для .logo-wrap, .nav-center —
     включает intro-анимацию + переходы фона/паддинга. */
}
body.has-panel-open .nav-center {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-center button {
  position: relative;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px;
  letter-spacing: 0.05em; color: var(--nav-text);
  opacity: 0.55;
  padding: 6px 2px;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.nav-center button::after {
  content: '';
  position: absolute;
  left: 2px; right: 2px; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
}

.nav-center button:hover { opacity: 0.85; }

.nav-center button.active {
  opacity: 1;
  color: #000;
}

.nav-center button.active::after {
  transform: scaleX(1);
}

/* ── Кнопка Close в навигации ── */
.nav-close {
  position: absolute; right: 40px;
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px;
  letter-spacing: 0.05em; text-transform: none;
  color: var(--nav-text);
  opacity: 0; pointer-events: none;
  padding: 6px 2px;
  transform: translateX(6px);
  transition: opacity 0.28s ease, transform 0.28s ease, color 0.2s ease;
}
.nav-close span { opacity: 0.55; transition: opacity 0.2s ease; }
.nav-close svg  { width: 12px; height: 12px; stroke: currentColor; opacity: 0.55; transition: opacity 0.2s ease; }
.nav-close:hover span,
.nav-close:hover svg { opacity: 1; }

body.has-panel-open .nav-close {
  opacity: 1; pointer-events: auto; transform: translateX(0);
}

/* ── Мобильная шапка: единый прямоугольный бар (как на ПК) ──
   На телефонах и планшетах убираем отдельные «таблетки» у лого и nav-center,
   даём всей шапке сплошной фоновый прямоугольник.              */
@media (max-width: 1024px) {
  nav {
    background: rgba(236, 234, 229, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  body.has-panel-open nav {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  /* Убираем собственные фоны у лого и центральной группы */
  .logo-wrap {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body.has-panel-open .logo-wrap {
    background: transparent !important;
  }
  .nav-center {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    gap: 32px;
  }
  body.has-panel-open .nav-center {
    background: transparent !important;
  }
  /* Уменьшаем отступы лого и close-кнопки */
  .logo-wrap  { left: 20px; }
  .nav-close  { right: 20px; }
}

/* ── Canvas ──
   z-index: 250 — выше шапки (300? нет, ниже, см. ниже).
   Решение: canvas над фоном шапки, но НИЖЕ её интерактивных элементов.
   Делается через z-index canvas = 250, у nav = 300, но nav имеет
   pointer-events: none для пустых зон, а у canvas pointer-events работает только
   ниже строки шапки — этого можно добиться clip-path'ом, но проще: canvas
   остаётся над фоном страницы (z-index: 1), а ИЛЛЮЗИЯ «верёвок над шапкой»
   достигается через прозрачную шапку — мы видим canvas прямо через неё. */
#scene-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%; z-index: 1;
  /* Изолируем canvas от остального документа: его paint/layout не зависит
     от того, что происходит в панелях. translateZ(0) принудительно создаёт
     отдельный composite layer на GPU, чтобы перерисовки панели не задевали 3D-сцену. */
  transform: translateZ(0);
  will-change: transform, opacity;
  contain: strict;
  /* Стартует невидимым — проявляется одновременно с playIntro() через body.loaded.
     Короткий fade нужен только чтобы скрыть момент перехода: внутри сцены при этом
     уже идёт каскад появления штанги/верёвок/бирок (управляется JS через opacity
     материалов), который и составляет основную красоту intro. */
  opacity: 0;
  transition: opacity 0.25s ease-out;
}
body.loaded #scene-canvas { opacity: 1; }

/* Когда панель открыта — отключаем pointer-events на канвасе.
   Шапка nav имеет pointer-events:none для прозрачных зон, и без этого правила
   мышь, проходящая над шапкой, могла бы достигать канваса (он z-index:1, под
   панелью). Это безвредно для UI панели (панель z-index:150 всё равно перехватит
   события когда курсор над её областью), но при движении мыши над шапкой
   срабатывал raycaster и менял cursor канваса, что было лишней работой. */
body.has-panel-open #scene-canvas {
  pointer-events: none;
}

/* ── Hero: Имя ──
   Изначально невидимо; проявляется когда body получает класс .loaded
   (выставляется JS'ом в playIntro() — синхронно с появлением 3D-сцены). */
.hero-name {
  position: fixed; top: calc(var(--nav-h) + 84px); left: 0; right: 0;
  text-align: center;
  font-family: var(--font-serif); font-size: clamp(22px, 3vw, 42px);
  font-weight: 400; letter-spacing: 0.08em; color: var(--nav-text);
  z-index: 10; pointer-events: none;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 1.1s cubic-bezier(0.22, 1, 0.30, 1) 0.25s,
    transform 1.1s cubic-bezier(0.22, 1, 0.30, 1) 0.25s;
}
body.loaded .hero-name {
  opacity: 1;
  transform: translateY(0);
}

/* ── Подсказка ──
   Появляется самой последней — когда уже опустились все бирки.
   Базовая opacity цели — 0.28 (она нарочно приглушённая в дизайне). */
.hint {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em;
  color: var(--nav-text); opacity: 0; z-index: 100;
  text-transform: uppercase; pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.30, 1) 1.85s;
}
body.loaded .hint { opacity: 0.28; }
/* После открытия панели подсказку всё ещё нужно мочь скрыть быстро */
.hint.hide {
  opacity: 0 !important;
  transition: opacity 0.5s !important;
}

/* ── Панели ── */
.panel {
  position: fixed; z-index: 150; background: var(--panel-bg);
  top: var(--nav-h); left: 0; right: 0; bottom: 0;
  transform: translateY(100%) translateZ(0);
  transform-origin: 50% 0%;
  opacity: 0; pointer-events: none;
  transition:
    transform 0.78s cubic-bezier(0.22, 1, 0.30, 1),
    opacity   0.42s cubic-bezier(0.22, 1, 0.30, 1);
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  will-change: transform, opacity;
  /* Изолируем панель от остального документа — браузер не пересчитывает layout/paint
     родительских элементов и canvas, когда внутри панели что-то меняется.
     Это самый важный фикс для того, чтобы вешалка (canvas) не зависала во время
     открытия панели и каскадных анимаций контента. */
  contain: layout paint style;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.13) transparent;
  box-shadow: 0 -24px 60px -30px rgba(0,0,0,0.18);
}
.panel.open {
  transform: translateY(0) translateZ(0);
  opacity: 1;
  pointer-events: auto;
}

/* Закрытие: чуть резче, без масштаба */
.panel.closing {
  transition:
    transform 0.46s cubic-bezier(0.4, 0, 1, 1),
    opacity   0.32s ease-in;
  transform: translateY(100%) scale(1) translateZ(0);
  opacity: 0;
  pointer-events: none;
}

/* Мгновенное скрытие при свапе одной nav-панели на другую — без видимого «промежуточного кадра» */
.panel.swap-out {
  transition: none !important;
  transform: translateY(100%) scale(1) translateZ(0);
  opacity: 0;
  pointer-events: none;
}

/* Мгновенное появление новой панели при свапе nav-панелей.
   Применяется на одном кадре одновременно с .open: панель сразу стоит на месте,
   а содержимое внутри проиграет свой каскадный reveal как обычно.
   Так между двумя панелями не показывается фон страницы (главный экран). */
.panel.instant {
  transition: none !important;
}
.panel.instant.open {
  transform: translateY(0) scale(1) translateZ(0);
  opacity: 1;
}

/* ── Тело панели ── */
.panel-body { padding: 64px 48px 100px; }
.panel-body.constrained { max-width: 860px; }

/* Info: двухколоночный верхний блок (фото | инфа) + featured-список снизу.
   Скролл разрешён — если контента много, панель прокручивается. */
#panel-info { overflow-y: auto; }
#panel-info .panel-body {
  padding: 64px 56px 48px;
  height: auto;
  min-height: 100%;
}

/* Верхний блок: фото слева, основная инфа справа.
   align-items: stretch — обе колонки одинаковой высоты, нижние края совпадают
   (низ фото = низ блока «Languages / Russian»). Ширина фото фиксируется столбцом
   grid'а, а высота берётся от высоты правой колонки — лишнее по высоте просто
   обрезается через object-fit: cover. */
.info-layout {
  display: grid;
  /* Изменённые пропорции: текст узче, фото шире. Текст ~54%, фото ~46% */
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr);
  gap: 72px;
  align-items: stretch;
  margin-bottom: 0;
  min-height: calc(100vh - var(--nav-h) - 112px);
}

/* Левая колонка — фото на всю высоту правой колонки.
   Хитрость: .info-side имеет position: relative и берёт высоту grid-row
   (которую задаёт правая колонка с инфо). Внутри неё .info-photo лежит
   position: absolute и растягивается на всю площадь. Так img внутри
   физически не может вытолкнуть колонку выше высоты правой колонки —
   и нижняя часть фото обрезается ровно по строке «Russian». */
.info-side {
  min-width: 0;
  position: relative;
  /* min-height на случай очень короткой правой колонки — иначе фото
     схлопнется. На реальных данных правая колонка всегда длиннее. */
  min-height: 100%;
}
.info-photo {
  /* Абсолютное позиционирование = ровно высота .info-side, которая равна
     высоте grid-row (= высоте правой колонки .info-main). */
  position: absolute;
  inset: 0;
  background: #DEDAD4;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  /* Изолируем от scale-анимации панели — иначе фото дёргается при открытии */
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}
/* object-position: center 80% — фото поднято вверх в прямоугольнике */
.info-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 80%; display: block; }
.info-portrait  { width: 100%; height: 100%; object-fit: cover; object-position: center 80%; display: block; }
.info-photo-label {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.22);
}

/* Правая колонка — основная инфа */
.info-main {
  min-width: 0;
  display: flex; flex-direction: column;
}
.info-main .panel-title {
  margin-bottom: 32px;
  font-size: clamp(52px, 7vw, 96px);
}
.info-main .panel-text {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 22px;
  max-width: 760px;
  color: #444;
}
/* Доп.инфо под текстом */
.info-main .info-grid {
  margin-top: 40px;
  gap: 28px 48px;
}

/* Нижний блок: Additional Information — отдельная секция со своим заголовком */
.info-featured-section {
  border-top: none;
  padding-top: 0;
  padding-left: 48px;
  padding-right: 48px;
  margin-top: 56px;
}
.info-featured-section .featured-label {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--nav-text);
  opacity: 0.55;
  margin-bottom: 28px;
}
.featured-label {
  margin-bottom: 28px;
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--nav-text);
  opacity: 0.55;
}
.featured-list {
  display: flex;
  flex-direction: column;
}

.featured-item {
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.proj-featured-section .featured-item {
  border-bottom: none;
}

.featured-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 200px 60px 24px;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
/* Приглушение строки при hover делается через детей, не родителя — иначе
   конфликтует с CSS-animation `itemReveal both`, см. подробный комментарий
   у .work-row. */
.featured-name {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.8vw, 40px);
  font-weight: 300; letter-spacing: 0.01em;
  line-height: 1.2;
  transition:
    color 0.3s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.featured-cat {
  font-family: var(--font-sans);
  font-size: 13px; color: #aaa; letter-spacing: 0.02em;
  transition:
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.featured-year {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--nav-text);
  opacity: 0.55;
  text-align: right;
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.featured-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  color: rgba(0,0,0,0.35);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.featured-arrow svg {
  width: 12px; height: 12px; display: block;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.featured-arrow .arrow-v {
  transform-origin: 6px 6px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.featured-item.expanded .featured-arrow svg {
  transform: rotate(90deg);
}
.featured-item.expanded .featured-arrow .arrow-v {
  transform: scaleY(0);
}
.featured-item.expanded .featured-name { color: #000; }

/* Hover: лёгкое смещение вправо + приглушение детей (не родителя). */
.featured-row:hover .featured-name,
.featured-row:hover .featured-cat { opacity: 0.45; }
.featured-row:hover .featured-year,
.featured-row:hover .featured-arrow { opacity: 0.25; }
.featured-row:hover .featured-name { transform: translateX(14px); }
.featured-row:hover .featured-cat  { transform: translateX(10px); transition-delay: 0.04s; }

/* Раскрывающийся блок: анимируем через grid-template-rows */
.featured-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.featured-details > .featured-details-inner {
  overflow: hidden;
  min-height: 0;
}
.featured-item.expanded .featured-details {
  grid-template-rows: 1fr;
}

.featured-details-inner {
  padding: 4px 0 28px;
}

/* Каскадное появление внутренних блоков — они invisible пока строка свёрнута,
   при раскрытии плавно проявляются снизу-вверх с небольшой задержкой каждый */
.featured-details-inner > * {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.featured-item.expanded .featured-details-inner > * {
  opacity: 1;
  transform: translateY(0);
}
/* Каскад: каждый следующий элемент появляется чуть позже */
.featured-item.expanded .featured-details-inner > *:nth-child(1) { transition-delay: 0s; }
.featured-item.expanded .featured-details-inner > *:nth-child(2) { transition-delay: 0s; }
.featured-item.expanded .featured-details-inner > *:nth-child(3) { transition-delay: 0s; }
.featured-item.expanded .featured-details-inner > *:nth-child(4) { transition-delay: 0s; }
.featured-item.expanded .featured-details-inner > *:nth-child(5) { transition-delay: 0s; }
.featured-item.expanded .featured-details-inner > *:nth-child(n+6) { transition-delay: 0s; }

.featured-desc {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.75;
  color: #555;
  margin-bottom: 24px;
  max-width: 540px;
}
.featured-sublabel {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #bbb;
  margin: 20px 0 12px;
}
.featured-sublabel:first-child { margin-top: 0; }

.featured-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.featured-media .media-logo-slot {
  min-width: 180px; min-height: 80px;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 5px;
  background: rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, opacity 0.2s;
  overflow: hidden;
}
.featured-media .media-logo-slot:hover {
  border-color: rgba(0,0,0,0.22); opacity: 0.8;
}
/* Картинка логотипа издания */
.featured-media .media-logo-slot img {
  max-height: 64px;
  max-width: 160px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.featured-media .media-logo-fallback {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.10em;
  text-transform: uppercase; color: rgba(0,0,0,0.4);
}

.featured-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 100%;
}
.featured-img-slot {
  position: relative;
  background: #DEDAD4;
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.featured-img-slot.wide { grid-column: 1 / -1; aspect-ratio: 16/7; }
.featured-img-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-img-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(0,0,0,0.20);
}

/* Проект: full bleed */
#panel-project .panel-body { padding: 0 0 100px; }
#panel-project .proj-header { padding: 56px 48px 0; }
#panel-project .proj-featured-section { padding: 0 56px 0 48px; }

/* ── НОВОЕ: Gallery Grid ──
   Адаптивная сетка фото с текстом.
   На мобильных (< 768px): 1 колонка (span: 1-3 используется как 1)
   На планшетах (768-1200px): 2 колонки
   На десктопе (> 1200px): 3 колонки
*/
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  padding: 0 48px;
  margin-bottom: 56px;
  align-items: start;
}

.gallery-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: start;
}

/* Классы для span (ширина в колонках) */
.gallery-cell-span-1 { grid-column: span 1; }
.gallery-cell-span-2 { grid-column: span 2; }
.gallery-cell-span-3 { grid-column: span 3; }

/* Фото в gallery */
.gallery-figure {
  margin: 0;
  background: none;
}

.gallery-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Вертикальная картинка (portrait) — не растягиваем на всю ширину ячейки.
   Центрируем и ограничиваем по высоте экрана. */
.gallery-figure--portrait {
  display: flex;
  justify-content: center;
  background: none;
}
.gallery-figure--portrait .gallery-img {
  width: auto;
  max-height: 85vh;
  max-width: 100%;
}

/* Ссылка внутри gallery-текста */
.gallery-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(0,0,0,0.35);
  transition: text-decoration-color 0.2s, opacity 0.2s;
  cursor: pointer;
}
.gallery-link:hover {
  text-decoration-color: rgba(0,0,0,0.85);
  opacity: 0.7;
}

/* Текст в gallery — обычный (описательный) */
.gallery-text {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.85;
  color: #444;
  padding: 20px 8px;
  background: transparent;
  border: none;
  align-self: center;
}

/* Текст-спецификация (материал, Pantone) — моноширинный, мелкий */
.gallery-text--spec {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.05em;
  color: #666;
  align-self: flex-start;
  padding-top: 24px;
}

/* Заголовки в gallery */
.gallery-heading {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 300;
  letter-spacing: 0.01em;
  color: #1A1A1A;
  padding: 24px;
  background: transparent;
  align-self: center;
}

/* Адаптив: Планшеты (768-1200px) */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 40px;
    gap: 4px;
  }
  
  .gallery-cell-span-3 {
    grid-column: span 2;
  }
  
  .gallery-text {
    font-size: 14px;
    min-height: 160px;
    padding: 20px;
  }
}

/* Адаптив: Мобильные (< 768px) */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    padding: 0 24px;
    gap: 8px;
  }
  
  .gallery-cell-span-1,
  .gallery-cell-span-2,
  .gallery-cell-span-3 {
    grid-column: span 1;
  }
  
  .gallery-text {
    font-size: 13px;
    min-height: 120px;
    padding: 16px;
  }
  
  .gallery-heading {
    font-size: clamp(22px, 5vw, 32px);
    padding: 16px;
  }
}

/* ═══════════════════════════════════════════════════════════
   GALLERY OVERLAP — тип 'overlap' в gallery[]
   Фото (или текст) накладывается поверх другого фото.

   Переменные, доступные через style на .go-over:
     --go-scale  : доля ширины контейнера для верхнего слоя (0..1, default 0.5)
     --go-shift  : насколько over вылезает за край back (px / %, default -8%)
   ═══════════════════════════════════════════════════════════ */

.go-wrap {
  position: relative;
  width: 100%;
  /* Даём место снизу/сверху, чтобы вылезающий слой не обрезался */
  padding-bottom: 10%;
}

/* ── Фоновое фото ── */
.go-back {
  margin: 0;
  display: block;
  width: 100%;
}
.go-back .go-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Верхний слой (общие правила) ── */
.go-over {
  position: absolute;
  width: calc(var(--go-scale, 0.5) * 100%);
  z-index: 2;
}
.go-over .go-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── layout: default — over слева, немного выходит за нижний край ── */
.go-wrap--default .go-back { width: 80%; margin-left: auto; }
.go-over--default {
  left: 0;
  bottom: var(--go-shift, -8%);
}

/* ── layout: flip — over справа ── */
.go-wrap--flip .go-back { width: 80%; margin-right: auto; }
.go-over--flip {
  right: 0;
  bottom: var(--go-shift, -8%);
}

/* ── layout: corner-tl — over в левом верхнем углу ── */
.go-over--corner-tl {
  top: var(--go-shift, -8%);
  left: var(--go-shift, -8%);
}

/* ── layout: corner-br — over в правом нижнем углу ── */
.go-wrap--corner-br { padding-bottom: 12%; }
.go-over--corner-br {
  right: 0;
  bottom: var(--go-shift, -8%);
}

/* ── Текстовый оверлей (если over — текст, а не фото) ── */
.go-over--text {
  background: var(--bg, #ECEAE5);
  padding: 20px 24px;
  width: auto;
  max-width: calc(var(--go-scale, 0.5) * 100%);
}
.go-over-text {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.85;
  color: #444;
  margin: 0;
}

/* ── Адаптив — мобильные ── */
@media (max-width: 768px) {
  .go-wrap { padding-bottom: 6%; }
  .go-wrap--default .go-back,
  .go-wrap--flip .go-back { width: 85%; }
}

/* ═══════════════════════════════════════════════════════════
   COMPOSITE SLIDE — тип 'composite' в gallery[]
   Несколько слоёв (картинки + тексты) в одном слайде.
   При листании все слои появляются вместе.
   ═══════════════════════════════════════════════════════════ */

/* Обёртка — занимает весь слайд */
.cs-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Каждый слой */
.cs-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Картинка в слое */
.cs-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Текст в слое */
.cs-text {
  font-family: var(--font-serif);
  font-size: clamp(16px, 2.2vw, 26px);
  line-height: 1.55;
  color: var(--panel-fg, #1A1208);
  max-width: 52ch;
  padding: 32px 40px;
  background: var(--panel-bg, #F0EDE6);
  border-radius: 2px;
}

/* Layout: stack — слои один поверх другого (z-index задаётся через position.zIndex) */
.cs-wrap--stack .cs-layer { position: absolute; }

/* Layout: side-by-side — картинки рядом */
.cs-wrap--side {
  flex-direction: row;
  gap: 0;
}
.cs-wrap--side .cs-layer {
  position: relative;
  inset: auto;
  flex: 1;
  height: 100%;
}
.cs-wrap--side .cs-img { object-fit: cover; }

/* Layout: text-over — текст поверх картинки, по центру */
.cs-wrap--text-over .cs-layer--0 { inset: 0; }
.cs-wrap--text-over .cs-layer--1 {
  inset: auto;
  bottom: 8%;
  left: 6%;
  right: auto;
  top: auto;
  width: auto;
  max-width: 48%;
  background: transparent;
}

/* Layout: corner — маленькая картинка в углу */
.cs-wrap--corner .cs-layer--0 { inset: 0; }
.cs-wrap--corner .cs-layer--1 {
  inset: auto;
  width: 38%;
  height: auto;
  bottom: -3%;
  right: -2%;
  top: auto;
  left: auto;
  align-items: flex-end;
  justify-content: flex-end;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25));
}
.cs-wrap--corner .cs-layer--1 .cs-img {
  width: 100%; height: auto; object-fit: contain;
}


.proj-desc {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: #444;
  max-width: 720px;
  margin: 0 0 56px;
}
.proj-desc:empty { display: none; }

/* ── Типографика панели ── */
.panel-title {
  font-family: var(--font-serif); font-size: clamp(44px,7vw,96px);
  font-weight: 300; letter-spacing: 0.01em; margin-bottom: 40px;
  line-height: 0.95; color: #1A1A1A;
}

.panel-text {
  font-family: var(--font-sans); font-size: 15px;
  line-height: 1.85; color: #555; max-width: 500px; margin-bottom: 56px;
}

/* ── Info grid ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 80px; }
.info-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #bbb; margin-bottom: 10px;
}
.info-value { font-family: var(--font-sans); font-size: 16px; line-height: 1.9; color: #333; }

/* ── Контакты ── */
#panel-contact .panel-body { max-width: none; padding: 56px 48px 100px; }
/* Больше воздуха между заголовком Contact и списком: базовое 40px меняем
   только в этой панели, чтобы не затронуть Work / Project / Info. */
#panel-contact .panel-title { margin-bottom: 72px; }

.contact-row {
  position: relative;
  display: flex;
  align-items: center;
  padding: 20px 0;
  cursor: pointer;
  color: inherit;
}
/* Приглушение через ребёнка, не родителя — см. комментарий у .work-row. */

/* Скрываем handle и стрелку — оставляем только название */
.contact-handle,
.contact-arrow { display: none; }

.contact-name {
  font-family: var(--font-serif);
  font-size: clamp(28px,4vw,52px);
  font-weight: 300;
  letter-spacing: 0.01em;
  transition:
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hover: лёгкое смещение вправо + приглушение */
.contact-row:hover .contact-name {
  transform: translateX(14px);
  opacity: 0.45;
}

/* ── Мета-бар проекта ── */
.project-meta {
  display: flex; gap: 0; margin-bottom: 48px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  padding: 24px 0;
}
.meta-item { flex: 1; min-width: 120px; padding-right: 32px; }
.meta-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #ccc; margin-bottom: 8px;
}
.meta-val { font-family: var(--font-sans); font-size: 14px; color: #333; }

/* ── Изображения проекта (masonry, Pinterest-style) ──
   JS-masonry: контейнер .project-images становится flex-rowом, внутри которого
   живут .masonry-col — независимые колонки. Каждая картинка попадает в самую
   КОРОТКУЮ колонку на момент вставки. Это гарантирует отсутствие пустот:
   все колонки заканчиваются примерно на одной высоте, и картинки сохраняют
   свои натуральные пропорции (берём width=100%, height=auto).

   Раскладка делается в hanger.js функцией layoutMasonry() сразу после загрузки
   каждой картинки — поэтому уже подгрузившиеся встают без перепрыгивания.

   Адаптив: 3 / 2 / 1 колонка по брейкпоинтам (data-cols ставится из JS).

   Класс .wide — больше НЕ нужен в data.js. Если он указан, картинка занимает
   всю ширину сетки, но визуально это часто создаёт пустоты в соседних колонках,
   поэтому лучше им не пользоваться и просто положить рядом нормальные картинки.
   Сохраняем поддержку для совместимости со старыми данными. */
.project-images {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
}
.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.img-ph {
  background: #DEDAD4;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em;
  color: rgba(0,0,0,0.2); text-transform: uppercase;
  width: 100%;
  /* Минимальная высота нужна только для пустых плейсхолдеров (когда картинки ещё нет).
     Как только внутрь добавлен <img> — min-height сбрасывается, чтобы слот сжался
     до натуральной высоты картинки и masonry уложил всё плотно. */
  min-height: 220px;
  overflow: hidden;
}
.img-ph img {
  width: 100%;
  height: auto;
  display: block;
}
.img-ph:has(img) { min-height: 0; }

/* .wide — старый класс для картинки на всю ширину сетки.
   В новой схеме: убираем элемент из masonry-колонок, кладём его как
   полноширинный блок ВНЕ flex-row. JS отрисует такие картинки отдельной строкой.
   Здесь только стиль для случая, когда они оказались в потоке. */
.project-images > .img-ph.wide {
  flex-basis: 100%;
  width: 100%;
  min-height: 340px;
}
.img-ph.wide:has(img) { min-height: 0; }
/* .tall — больше не задаёт пропорции, оставлено для обратной совместимости */
.img-ph.tall { /* ничего: пропорции берутся из реального изображения */ }

/* Полноширинный ряд между группами masonry-колонок.
   Создаётся в JS, когда у картинки указан wide: true. Это разрывает masonry
   и кладёт картинку в собственную строку шириной 100%. */
.project-images-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}
.masonry-row {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
}
.masonry-row.wide-row {
  display: block;
}

/* ── Work list ── */
#panel-work .panel-body { max-width: none; padding: 56px 48px 100px; }
#panel-work .panel-title { margin-bottom: 72px; }

.work-row {
  position: relative;
  display: grid; grid-template-columns: 1fr 200px 60px;
  align-items: center; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
}
/* ВАЖНО: НЕ используем здесь :hover на .work-row с opacity — это конфликтует
   с CSS-animation `itemReveal both` (которая forwards-удерживает opacity:1).
   Конфликт animation forwards + :hover opacity + !important + transition давал
   мерцание при наведении на свежеоткрытой панели Work. Вместо этого приглушение
   делаем на детях через transition + opacity, animation на детей не вешаем. */

.work-name,
.work-cat,
.work-year {
  transition:
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.work-name { font-family: var(--font-serif); font-size: clamp(22px,2.8vw,40px); font-weight: 300; }
.work-cat  { font-family: var(--font-sans); font-size: 13px; color: #aaa; letter-spacing: 0.02em; }
.work-year { font-family: var(--font-mono); font-size: 10px; color: #ccc; text-align: right; }

/* Hover: лёгкое смещение вправо + приглушение всех детей строки.
   Применяется ТОЛЬКО к детям — opacity родителя .work-row остаётся 1
   (управляется CSS-animation на открытии панели, никаких конфликтов). */
.work-row:hover .work-name,
.work-row:hover .work-cat,
.work-row:hover .work-year { opacity: 0.45; }
.work-row:hover .work-name { transform: translateX(14px); }
.work-row:hover .work-cat  { transform: translateX(10px); transition-delay: 0.04s; }

/* ── Selected Press: шапка (subtitle + year) ── */
.press-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 0 12px;
}
.press-header-spacer {
  flex: 1;
}
.press-header .featured-cat {
  font-family: var(--font-sans);
  font-size: 13px;
  color: #aaa;
  letter-spacing: 0.02em;
}
.press-header .featured-year {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--nav-text);
  opacity: 0.55;
}

/* ── Selected Press: единая строка ── */
.press-single-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 0;
  cursor: pointer;
  text-align: left;
}

.press-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.press-row-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.press-logo-slot {
  min-width: 140px;
  height: 70px;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 5px;
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, opacity 0.2s, transform 0.25s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
a.press-logo-slot:hover {
  border-color: rgba(0,0,0,0.28);
  opacity: 0.8;
  transform: translateY(-2px);
}

.press-logo-slot img {
  max-height: 52px;
  max-width: 130px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.press-logo-fallback {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.4);
}

/* ── "About the project" кнопка-тоггл ── */
.press-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0 10px;
  font: inherit;
  color: inherit;
  margin-bottom: 0;
}
.press-toggle-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bbb;
  transition: color 0.2s;
}
.press-toggle:hover .press-toggle-label { color: #888; }
.press-toggle .featured-arrow { color: #ccc; }
.press-toggle:hover .featured-arrow { color: #888; }
.featured-item.expanded .press-toggle .featured-arrow svg { transform: rotate(90deg); }
.featured-item.expanded .press-toggle .arrow-v { transform: scaleY(0); }

@media (max-width: 700px) {
  .press-grid { flex-wrap: wrap; }
  .press-logo-slot { min-width: 110px; height: 56px; }
}


.press-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.press-logo-slot {
  min-width: 180px;
  min-height: 80px;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 5px;
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, opacity 0.2s, transform 0.25s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
a.press-logo-slot {
  cursor: pointer;
}
a.press-logo-slot:hover {
  border-color: rgba(0,0,0,0.28);
  opacity: 0.8;
  transform: translateY(-2px);
}

.press-logo-slot img {
  max-height: 64px;
  max-width: 160px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.press-logo-fallback {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.4);
}

/* ── "About the project" кнопка-тоггл ── */
.press-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0 10px;
  font: inherit;
  color: inherit;
  margin-bottom: 0;
}
.press-toggle-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bbb;
  transition: color 0.2s;
}
.press-toggle:hover .press-toggle-label {
  color: #888;
}
.press-toggle .featured-arrow {
  color: #ccc;
}
.press-toggle:hover .featured-arrow {
  color: #888;
}
.featured-item.expanded .press-toggle .featured-arrow svg {
  transform: rotate(90deg);
}
.featured-item.expanded .press-toggle .arrow-v {
  transform: scaleY(0);
}

/* Адаптив для press-grid */
@media (max-width: 700px) {
  .press-logo-slot {
    min-width: 130px;
    min-height: 64px;
  }
}


.amtrak-section { margin-top: 72px; }

/* ── Amtrak custom layout ── */
.amtrak-layout {
  padding: 0 48px;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 56px;
}
.al-row { display: flex; width: 100%; }
.al-row--side { align-items: flex-start; gap: 48px; padding: 32px 0; }
.al-row--text-center { justify-content: center; padding: 32px 80px 16px; }
.al-row--centered-img { justify-content: center; }
.al-overlap-wrap { width: 100%; padding: 20px 0; }
.al-overlap { position: relative; width: 100%; }

/* фото занимает ~52% справа */
.al-back { display: block; width: 52%; height: auto; margin-left: auto; }
.al-over { position: absolute; height: 115%; width: auto; bottom: -8%; }
.al-over--left { left: 0; }

.al-overlap--flip .al-back { margin-left: 0; margin-right: auto; }
.al-overlap--flip .al-over--right { right: 0; left: auto; bottom: -5%; height: 110%; }

.al-overlap--three .al-back { width: 45%; margin-left: 0; }
.al-overlap--three .al-over--right { right: 0; left: auto; bottom: -5%; height: 108%; width: 45%; }

.al-col--video { flex: 0 0 auto; }
.al-video { display: block; width: 420px; max-width: 100%; height: auto; }
.al-col--text-block { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }

.al-img { display: block; height: auto; }
.al-img--full { width: 100%; height: auto; display: block; }
.al-img--below-text { width: 100%; height: auto; display: block; }
.al-img--center { max-width: 50%; height: auto; display: block; margin: 0 auto; }

.al-img--r9 {
  display: block;
  width: 55%;
  height: auto;
  margin-left: 0;
}

.al-text { font-family: var(--font-sans); font-size: 14px; line-height: 1.85; color: #444; }
.al-text-center { font-family: var(--font-sans); font-size: 14px; line-height: 1.85; color: #444; text-align: center; max-width: 500px; }
.al-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.al-link:hover { opacity: 0.6; }

@media (max-width: 768px) {
  .amtrak-layout { padding: 0 24px; }
  .al-row--side { flex-direction: column; gap: 24px; padding: 24px 0; }
  .al-img--center { max-width: 100%; }
  .al-back { width: 75%; }
  .al-video { width: 100%; }
}
/* ── Row 2: фото правее — сдвигаем вправо от центра ── */
.al-overlap--r2 { }
.al-back--r2 { margin-left: 30%; }

/* ── Row 3: скетч ниже ── */
.al-over--r3 { bottom: -18% !important; }

/* ── Row 2: 2.1.png опущен ниже ── */
.al-over--r2-lower { bottom: -30% !important; }

/* ── Подпись под блоком (текст под 2 и 2.1, под 8) ── */
.al-row--caption {
  padding: 20px 0 32px;
  max-width: 620px;
}
.al-text--caption {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.85;
  color: #444;
}

/* ── Row 5: фото 4 слева, скетч 4.1 залазит на неё ── */
.al-row--r5 {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
}
.al-col--r5-photo {
  flex: 0 0 42%;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.al-col--r5-sketch {
  flex: 0 0 65%;
  display: flex;
  align-items: flex-start;
  margin-left: -20%;
  margin-top: -8%;
  z-index: 2;
}
.al-img--r5-sketch {
  width: 100%;
  height: auto;
  display: block;
}
.al-img--r5-photo {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Row 8: текст сверху слева + 9 под ним, 8 справа ── */
.al-row--r8-wrap {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: -480px;
}
.al-r8-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 0 0 42%;
  min-width: 0;
  padding-top: 35%;
}
.al-img--r8 {
  display: block;
  flex: 0 0 55%;
  width: 55%;
  height: auto;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 15%;
}
.al-r8-text {
  flex: 0 0 auto;
}
.al-img--r9 {
  display: block;
  width: 100%;
  height: auto;
  flex-shrink: 0;
}
.al-img--r8 {
  display: block;
  flex: 0 0 55%;
  width: 55%;
  height: auto;
  flex-shrink: 0;
  align-self: flex-start;
}

@media (max-width: 768px) {
  .al-row--r8-wrap { flex-direction: column; gap: 16px; margin-top: 0; }
  .al-r8-left { flex: none; width: 100%; }
  .al-img--r8 { width: 100%; flex: none; }
}

/* ── Row 6: текст + картинка в одну строку ── */
.al-row--last {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 32px 0;
}
.al-text-inline {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.85;
  color: #444;
  flex: 0 0 auto;
  max-width: 320px;
  white-space: nowrap;
}
.al-img--last {
  flex: 1;
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .al-row--last { flex-direction: column; gap: 20px; }
  .al-text-inline { white-space: normal; max-width: 100%; }
  .al-back--r2 { margin-left: 0; }
  .al-back--r5 { width: 55%; margin-top: 8%; }
  .al-over--r5 { width: 55% !important; }
}

.amtrak-rule { border-top: 1px solid rgba(0,0,0,0.08); margin-bottom: 36px; }
.amtrak-title {
  font-family: var(--font-serif); font-size: clamp(32px,5vw,64px);
  font-weight: 300; letter-spacing: 0.02em; color: #1A1A1A;
  margin-bottom: 24px; line-height: 1.0;
}

/* Media logos */
.media-logos { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.media-logo-slot {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,0,0,0.10); border-radius: 6px;
  padding: 14px 22px; background: rgba(255,255,255,0.5);
  min-width: 140px; min-height: 60px;
  transition: border-color 0.2s, opacity 0.2s;
}
.media-logo-slot:hover { border-color: rgba(0,0,0,0.22); opacity: 0.8; }
.media-logo-img { max-height: 32px; max-width: 160px; width: auto; display: block; }
.media-logo-img[src=""] { display: none; }
.media-logo-fallback {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.10em;
  text-transform: uppercase; color: rgba(0,0,0,0.4);
}
.media-logo-img[src=""] + .media-logo-fallback { display: block; }
.media-logo-img:not([src=""]) { display: block; }
.media-logo-img:not([src=""]) + .media-logo-fallback { display: none; }

/* Amtrak images */
.amtrak-images { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 100%; }
.amtrak-img-slot {
  position: relative; background: #DEDAD4; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.amtrak-img-slot.wide { grid-column: 1 / -1; aspect-ratio: 16/7; }
.amtrak-img-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.amtrak-img-label {
  position: absolute; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase; color: rgba(0,0,0,0.20);
}
.amtrak-img-slot img ~ .amtrak-img-label { display: none; }

/* ── Анимации ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Контент панели — плавный, чуть отложенный относительно самой панели.
   ВАЖНО: НЕ используем filter: blur — он заставляет браузер повторно блюрить
   весь огромный контент панели каждый кадр и душит главный поток, из-за чего
   3D-сцена (canvas) пропускает кадры и визуально замирает. */
@keyframes contentReveal {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered появление ключевых блоков внутри панели.
   Только opacity — никаких transform, так как множество одновременных transform-анимаций
   создают пиковую нагрузку на главный поток и душат 3D-сцену рядом. Чистый opacity
   браузер композитит на GPU без перерасчёта layout. */
@keyframes itemReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.panel.open .panel-body {
  animation: contentReveal 0.55s cubic-bezier(0.22, 1, 0.30, 1) 0.18s both;
}
/* Info: у фото position:absolute внутри grid — translateY на panel-body
   вызывает пересчёт grid и фото чуть едет вправо. Используем только opacity. */
#panel-info.open .panel-body {
  animation: itemReveal 0.55s cubic-bezier(0.22, 1, 0.30, 1) 0.18s both;
}

/* Дочерние элементы внутри panel-body — лёгкий каскад через opacity */
.panel.open .panel-title,
.panel.open .panel-text,
.panel.open .info-grid,
.panel.open .project-meta,
.panel.open .project-images,
.panel.open .info-featured,
.panel.open .contact-row,
.panel.open .work-row,
.panel.open .featured-row {
  animation: itemReveal 0.45s ease-out both;
}
.panel.open .panel-title    { animation-delay: 0.22s; }
.panel.open .panel-text     { animation-delay: 0.28s; }
.panel.open .project-meta   { animation-delay: 0.28s; }
.panel.open .info-grid      { animation-delay: 0.34s; }
.panel.open .project-images { animation-delay: 0.36s; }
.panel.open .info-featured  { animation-delay: 0.32s; }

.panel.open .featured-row:nth-child(1) { animation-delay: 0.38s; }
.panel.open .featured-row:nth-child(2) { animation-delay: 0.42s; }
.panel.open .featured-row:nth-child(3) { animation-delay: 0.46s; }
.panel.open .featured-row:nth-child(4) { animation-delay: 0.50s; }
.panel.open .featured-row:nth-child(n+5) { animation-delay: 0.54s; }

/* Контакты и список Work — построчный каскад */
.panel.open #contact-list .contact-row:nth-child(1) { animation-delay: 0.26s; }
.panel.open #contact-list .contact-row:nth-child(2) { animation-delay: 0.30s; }
.panel.open #contact-list .contact-row:nth-child(3) { animation-delay: 0.34s; }
.panel.open #contact-list .contact-row:nth-child(4) { animation-delay: 0.38s; }
.panel.open #contact-list .contact-row:nth-child(5) { animation-delay: 0.42s; }

.panel.open .work-row:nth-child(1) { animation-delay: 0.24s; }
.panel.open .work-row:nth-child(2) { animation-delay: 0.28s; }
.panel.open .work-row:nth-child(3) { animation-delay: 0.32s; }
.panel.open .work-row:nth-child(4) { animation-delay: 0.36s; }
.panel.open .work-row:nth-child(5) { animation-delay: 0.40s; }
.panel.open .work-row:nth-child(n+6) { animation-delay: 0.44s; }

/* Уважение к prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .panel,
  .panel.closing,
  .panel.open .panel-body,
  .panel.open .panel-title,
  .panel.open .panel-text,
  .panel.open .info-grid,
  .panel.open .project-meta,
  .panel.open .project-images,
  .panel.open .info-featured,
  .panel.open .contact-row,
  .panel.open .work-row,
  .panel.open .featured-row {
    transition-duration: 0.2s !important;
    animation: none !important;
  }
}

/* ── Адаптив ── */
@media (max-width: 1100px) {
  #panel-info .panel-body { padding: 56px 48px 80px; }
  /* Планшет: две колонки, фото справа — возвращаем фото в поток */
  .info-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(200px, 0.8fr);
    gap: 40px;
    margin-bottom: 64px;
  }
  .info-side {
    min-height: 0;
  }
  .info-photo {
    position: relative;
    inset: auto;
    height: auto;
    aspect-ratio: 3/4;
    max-width: none;
  }
  /* Masonry на средних экранах: количество колонок задаётся из JS через data-cols.
     CSS-фоллбек ничего не делает — он не нужен, потому что masonry-колонки
     уже flex 1 1 0, ширина равная. */
}

@media (max-width: 700px) {
  .panel-body { padding: 48px 24px 80px; }
  #panel-info .panel-body { padding: 48px 24px 80px; }
  #panel-project .proj-header { padding: 48px 24px 0; }
  .nav-close { right: 20px; }
  .nav-close span { display: none; }
  .logo-wrap { left: 20px; }
  .info-grid { grid-template-columns: 1fr; }
  /* Телефон: одна колонка, фото поднимаем ВЫШЕ текста */
  .info-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .info-side {
    order: -1;
  }
  .info-photo {
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 4/5;
  }
  .info-main .panel-title { font-size: clamp(40px, 8vw, 60px); }
  .info-main .panel-text { font-size: 14px; }
  /* Мобильный: одна колонка задаётся через data-cols в JS, тут ничего не нужно */
  .amtrak-images { grid-template-columns: 1fr; }
  .media-logos { gap: 10px; }
  .media-logo-slot { min-width: 110px; }
  .work-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 16px;
  }
  .work-name { grid-column: 1; grid-row: 1; }
  .work-cat  { grid-column: 1; grid-row: 2; display: block; font-size: 11px; }
  .work-year { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .featured-row {
    grid-template-columns: 1fr 50px 16px;
    gap: 16px;
  }
  .featured-cat { display: none; }
  .featured-images { grid-template-columns: 1fr; }
  .nav-center { padding: 6px 16px; gap: 32px; }
}

/* ═══════════════════════════════════════════════════════
   PROJECT SLIDESHOW
═══════════════════════════════════════════════════════ */

/* Override panel-project to be a flex column (no scroll until press section) */
#panel-project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Slideshow fills the panel */
.proj-slideshow {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Click zones: left half = prev, right half = next.
   They stop ABOVE the footer bar (leave 56px at bottom for controls).
   On touch devices these zones block links — navigation is handled
   by touch handlers in JS, so we disable pointer-events on touch. */
.proj-click-prev,
.proj-click-next {
  position: absolute;
  top: var(--nav-h);   /* start below title bar */
  bottom: 64px;        /* stop above footer bar */
  width: 50%;
  z-index: 10;
}

@media (hover: none) and (pointer: coarse) {
  .proj-click-prev,
  .proj-click-next {
    pointer-events: none;
  }
}
.proj-click-prev { left: 0; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Ctext y='34' font-size='32' fill='%231a1a1a' opacity='.65'%3E%E2%86%90%3C/text%3E%3C/svg%3E") 0 24, w-resize; }
.is-first-slide .proj-click-prev { cursor: default; }
.proj-click-next { right: 0; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Ctext y='34' font-size='32' fill='%231a1a1a' opacity='.65'%3E%E2%86%92%3C/text%3E%3C/svg%3E") 48 24, e-resize; }

/* Slides container */
.proj-slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Individual slide */
/* ═══ SLIDE TRANSITIONS v2 (clean rewrite) ═══ */

.proj-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  /* Transition применяется только к классам entering/leaving */
  transition: opacity 0.44s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
}

.proj-slide-active {
  opacity: 1;
  transform: translateX(0);
  z-index: 2;
}

/* Въезжающий слайд — стартовая позиция (transition уберёт смещение) */
.proj-slide-entering {
  opacity: 0;
  transform: translateX(calc(var(--slide-dir, 1) * 36px));
  z-index: 3;
  pointer-events: none;
}

/* Уходящий слайд */
.proj-slide-leaving {
  opacity: 0;
  transform: translateX(calc(var(--slide-dir, 1) * -36px));
  z-index: 1;
  pointer-events: none;
}

/* ═══ OVERLAP SLIDE — фото накладываются в одном слайде ═══
   Использует новый тип 'overlap' / 'composite' в data.js.
   Слои задаются через layers[] с полем pos (tl/tr/bl/br/c).
   ─────────────────────────────────────────────────────────── */

/* Обёртка — занимает весь слайд */
.slide-overlap-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

@media (max-width: 700px) {
  .slide-overlap-wrap {
    top: var(--nav-h, 56px);
    bottom: 64px;
    left: 0;
    right: 0;
  }
}

/* Фоновый слой (первый без pos) */
.sol-back {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.sol-back .sol-img--cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Позиционированный слой */
.sol-layer {
  position: absolute;
  /* Размер задаётся inline */
}
.sol-layer .sol-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Текстовый блок в overlap */
.sol-text {
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.6vw, 22px);
  line-height: 1.75;
  color: #333;
  background: var(--panel-bg);
  padding: 18px 22px;
  margin: 0;
}

@media (max-width: 1024px) {
  .sol-text {
    background: var(--panel-bg);
    padding: 10px 14px;
    font-size: clamp(17px, 2.8vw, 24px);
  }
}

@media (max-width: 700px) {
  /* Убираем скролл — текст масштабируется под экран */
  .sol-text {
    font-size: clamp(12px, 3.5vw, 16px);
    line-height: 1.55;
    padding: 6px 10px;
  }
}

/* Пара: картинка материала + текст рядом (только мобайл) */
.sol-pair {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}

.sol-pair__item {
  flex: 1 1 0;
  min-width: 0;
}

.sol-pair__img {
  width: 100%;
  height: auto;
  display: block;
}

.sol-text--spec {
  font-family: var(--font-serif);
  font-size: clamp(13px, 1.3vw, 17px);
  line-height: 1.9;
  white-space: pre-line;
}

@media (max-width: 1024px) {
  .sol-text--spec {
    font-size: clamp(15px, 2.5vw, 20px);
  }
}

@media (max-width: 700px) {
  .sol-text--spec {
    font-size: clamp(11px, 3.2vw, 14px);
    line-height: 1.7;
  }
}

/* "Next project" slide */
.slide-end-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

/* Slide image — natural proportions, slightly inset */
.proj-slide-img {
  display: block;
  max-width: var(--slide-img-size, 88%);
  max-height: var(--slide-img-max-h, 88%);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ── Мобильные и планшеты: картинки до краёв экрана ──────────────
   JS задаёт --slide-img-size и --slide-img-max-h через inline style
   на :root — переопределяем !important.
   Слайд получает padding чтобы не залезать под шапку и футер.
   object-fit: contain сам решает: горизонт. → до левого/правого,
   вертикаль. → до верхнего/нижнего края.                          */
@media (max-width: 1024px) {
  .proj-slide {
    padding-top: var(--nav-h, 56px);
    padding-bottom: 64px;
    box-sizing: border-box;
    /* Сетка вместо flex — img надёжно занимает всю оставшуюся зону */
    display: grid;
    place-items: center;
  }
  .proj-slide-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Не даём grid растягивать изображение за его aspect ratio */
    align-self: center;
    justify-self: center;
  }
}

/* Caption text slide — centered, slightly left of center, photo overlaps from right */
.proj-slide-caption {
  font-family: var(--font-sans);
  font-size: clamp(18px, 2.2vw, 28px);
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: #1A1A1A;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-65%, -50%);
  width: 38%;
}

/* HTML slide (galleryHTML) — scrollable content within slide */
.proj-slide:has(.amtrak-layout) {
  align-items: flex-start;
  overflow-y: auto;
  padding-top: 56px;
}

/* Placeholder for auto-detected images */
.proj-slide-placeholder {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.2);
}

/* ── Top overlay: project title ── */
.proj-slide-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 0 48px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 5;
  pointer-events: none;
}
/* Toggle button inside header needs pointer-events restored */
.proj-press-toggle { pointer-events: auto; }

.proj-slide-title {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.4vw, 32px);
  font-weight: 300;
  letter-spacing: 0.03em;
  color: #1A1A1A;
}

/* ── Bottom bar: centered cluster [prev-proj ← N/N → next-proj] ── */
.proj-slide-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: auto;
  background: var(--bg);
  /* no border */
}

/* One inline cluster: all elements in a row, centered */
.proj-footer-center {
  display: flex;
  align-items: center;
  gap: 32px;
}

.proj-slide-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(26,26,26,0.38);
  min-width: 44px;
  text-align: center;
  pointer-events: none;
}

/* No separate slide arrows — project switcher IS the arrow on each side */
.proj-arrow-btn { display: none; }

/* Project switcher buttons — flanking the counter */
.proj-switch-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(26,26,26,0.32);
  padding: 8px 0;
  transition: color 0.22s, opacity 0.22s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.proj-switch-btn--right { text-align: left; }
.proj-switch-btn:hover { color: rgba(26,26,26,0.9); }

/* ── Project transition animation ── */
@keyframes projFadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes projFadeSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

.proj-transitioning-out {
  animation: projFadeSlideOut 0.22s cubic-bezier(0.4, 0, 1, 1) both;
  pointer-events: none;
}
.proj-transitioning-in {
  animation: projFadeSlideIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.18s;
}

/* Hide legacy nav element */
.proj-slide-nav { display: none; }

/* Photo slide coming after a text slide — full cover, text peeks from behind on left */
.proj-slide-after-text {
  background: transparent;
}
.proj-slide-after-text .proj-slide-img {
  max-width: 88%;
  max-height: 92%;
}

/* ── End of slides overlay — next project prompt ── */
.proj-end-overlay {
  position: absolute;
  inset: 0;
  bottom: 64px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  animation: pressSlideUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.proj-end-overlay[hidden] { display: none; }

.proj-end-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.proj-end-label {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26,26,26,0.35);
  transition: color 0.2s;
}

.proj-end-name {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #1A1A1A;
  transition: opacity 0.2s;
}

.proj-end-arrow {
  font-family: var(--font-sans);
  font-size: 20px;
  color: rgba(26,26,26,0.35);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), color 0.2s;
  display: block;
}

.proj-end-btn:hover .proj-end-label { color: rgba(26,26,26,0.7); }
.proj-end-btn:hover .proj-end-name  { opacity: 0.65; }
.proj-end-btn:hover .proj-end-arrow { transform: translateX(8px); color: rgba(26,26,26,0.7); }

/* ── Press toggle button (in header) ── */
.proj-press-toggle {
  margin-left: 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(26,26,26,0.38);
  padding: 3px 0;
  transition: color 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.proj-press-toggle:hover { color: rgba(26,26,26,0.8); }

/* Backdrop for press overlay — click above overlay to close */
.proj-press-backdrop {
  position: absolute;
  inset: 0;
  bottom: 64px;
  z-index: 24;
  cursor: default;
  background: transparent;
}
.proj-press-backdrop[hidden] { display: none; }

/* ── Press overlay (slides up from bottom, sits above footer) ── */
.proj-press-overlay {
  position: absolute;
  left: 0; right: 0;
  bottom: 64px;   /* footer height — overlay floats above it */
  max-height: 48vh;
  background: var(--bg);
  /* no border */
  overflow-y: auto;
  z-index: 25;    /* above slides, below footer (z:20 but footer has solid bg) */
  animation: pressSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.proj-press-overlay.closing {
  animation: pressSlideDown 0.26s cubic-bezier(0.4, 0, 1, 1) both;
  pointer-events: none;
}
/* Using display:none via [hidden] — but we need to animate out first,
   so we remove [hidden] via JS only after animation ends */
.proj-press-overlay[hidden] { display: none; }

@keyframes pressSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pressSlideDown {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(16px); }
}

.proj-press-overlay-inner {
  padding: 24px 48px 32px;
}

.proj-press-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.proj-press-overlay-label {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(26,26,26,0.4);
}

.proj-press-overlay-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: rgba(26,26,26,0.35);
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.proj-press-overlay-close:hover { color: rgba(26,26,26,0.85); }

/* Mobile */
@media (max-width: 700px) {
  .proj-slide-header { padding: 0 24px; background: transparent; }
  .proj-slide-footer { padding: 0 16px; background: transparent; }
  .proj-press-inner  { padding: 24px; }
  .proj-slide-title  { font-size: clamp(16px, 4vw, 22px); }
  .proj-switch-btn   { font-size: 10px; }
}
/* ── Combined slide: two items side by side ──────────────────── */
.proj-slide-combined {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 48px;
  padding: 0 64px;
  box-sizing: border-box;
}

.proj-slide-combined__side {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
}

.proj-slide-combined__caption {
  font-family: var(--font-sans);
  font-size: clamp(14px, 1.6vw, 22px);
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: #1A1A1A;
  text-align: left;
}

.proj-slide-combined__caption a {
  color: inherit;
  text-decoration: underline;
}

.proj-slide-combined__img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (max-width: 700px) {
  .proj-slide-combined {
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    justify-content: center;
    overflow-y: auto;
  }
  .proj-slide-combined__side {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
  }
  .proj-slide-combined__img {
    max-height: 45vh;
  }

  /* Caption text slides — полная ширина на телефоне */
  .proj-slide-caption {
    width: 88%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: left;
    font-size: clamp(16px, 4.5vw, 22px);
  }
}
/* ── YouTube slide ──────────────────────────────────────────── */
.proj-slide-yt-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* iframe масштабируем 300% по центру, чтобы обрезать логотип, паузу и кнопки */
.proj-slide-yt-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

/* Прозрачный overlay поверх iframe — блокирует все клики на HUD */
.proj-slide-yt-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════
   2K / 4K — Масштабирование типографики и UI
   Брейкпоинты:
     2K  ≥ 1920px  (QHD / 2560×1440 тоже попадает сюда)
     4K  ≥ 2560px
   ═══════════════════════════════════════════════════════════ */

/* ── 2K (1920px+) ── */
@media (min-width: 1920px) {
  :root {
    --nav-h: 76px;
  }

  /* Nav */
  nav { height: var(--nav-h); }
  .logo-img { height: 52px; }
  .logo-wrap { left: 56px; padding: 8px 12px; }
  .nav-close  { right: 56px; font-size: 16px; }
  .nav-close svg { width: 15px; height: 15px; }

  .nav-center {
    gap: 72px;
    padding: 10px 36px;
    font-size: 15px;
  }
  .nav-center button { font-size: 15px; }

  /* Hero name */
  .hero-name { font-size: clamp(32px, 3vw, 56px); top: calc(var(--nav-h) + 100px); }

  /* Hint */
  .hint { font-size: 10px; bottom: 40px; }

  /* Panels */
  .panel-body { padding: 80px 72px 120px; }
  #panel-info .panel-body { padding: 80px 72px 60px; }
  #panel-work .panel-body { padding: 72px 72px 120px; }
  #panel-contact .panel-body { padding: 72px 72px 120px; }
  #panel-project .proj-header { padding: 72px 72px 0; }
  #panel-project .proj-featured-section { padding: 0 80px 0 72px; }

  /* Typography */
  .panel-title { font-size: clamp(56px, 7vw, 120px); margin-bottom: 52px; }
  .panel-text { font-size: 18px; line-height: 1.9; max-width: 680px; margin-bottom: 64px; }

  .info-main .panel-title { font-size: clamp(64px, 7vw, 120px); margin-bottom: 40px; }
  .info-main .panel-text { font-size: 18px; line-height: 1.9; margin-bottom: 28px; max-width: 900px; }

  /* Info grid */
  .info-label { font-size: 10px; }
  .info-value { font-size: 18px; }

  /* Info layout */
  .info-layout { gap: 96px; }
  .info-featured-section { padding-left: 72px; padding-right: 72px; margin-top: 72px; }
  .featured-label { font-size: 15px; }

  /* Work list */
  .work-name { font-size: clamp(28px, 2.8vw, 52px); }
  .work-cat  { font-size: 15px; }
  .work-year { font-size: 12px; }
  .work-row  { padding: 22px 0; grid-template-columns: 1fr 240px 72px; }
  #panel-work .panel-title { margin-bottom: 88px; }

  /* Featured rows */
  .featured-name { font-size: clamp(28px, 2.8vw, 52px); }
  .featured-cat  { font-size: 15px; }
  .featured-year { font-size: 15px; }
  .featured-row  { padding: 22px 0; grid-template-columns: 1fr 240px 72px 28px; }
  .featured-desc { font-size: 15px; max-width: 680px; }
  .featured-sublabel { font-size: 10px; }

  /* Contact */
  .contact-name { font-size: clamp(36px, 4vw, 68px); }
  .contact-row  { padding: 26px 0; }
  #panel-contact .panel-title { margin-bottom: 88px; }

  /* Gallery */
  .gallery-grid { padding: 0 72px; gap: 5px; }
  .gallery-text { font-size: 17px; line-height: 1.9; }
  .gallery-text--spec { font-size: 12px; }
  .gallery-heading { font-size: clamp(36px, 4vw, 60px); }

  /* Project meta */
  .meta-label { font-size: 10px; }
  .meta-val   { font-size: 16px; }

  /* Project header */
  .proj-title { font-size: clamp(40px, 5vw, 80px); }
  .proj-cat   { font-size: 15px; }
  .proj-desc  { font-size: 18px; line-height: 1.85; max-width: 900px; }

  /* Project slide — title bar */
  .proj-slide-title   { font-size: clamp(24px, 2.2vw, 40px); }
  .proj-slide-header  { padding: 0 56px; height: var(--nav-h); }
  .proj-slide-footer  { padding: 0 56px; height: 76px; }

  /* Slide counter & switcher */
  .proj-slide-counter { font-size: 13px; }
  .proj-switch-btn    { font-size: 15px; max-width: 320px; }
  .proj-press-toggle  { font-size: 13px; }

  /* Caption text slides */
  .proj-slide-caption { font-size: clamp(22px, 2.2vw, 34px); }

  /* Overlap / composite text */
  .sol-text      { font-size: clamp(18px, 1.6vw, 26px); }
  .sol-text--spec{ font-size: clamp(15px, 1.3vw, 20px); }

  /* Combined slide caption */
  .proj-slide-combined__caption { font-size: clamp(18px, 1.6vw, 28px); }

  /* Press */
  .press-logo-slot { min-width: 170px; height: 84px; }
  .press-logo-slot img { max-height: 64px; max-width: 150px; }

  /* End overlay */
  .proj-end-name  { font-size: clamp(36px, 4vw, 64px); }
  .proj-end-label { font-size: 13px; }
}

/* ── 4K (2560px+) ── */
@media (min-width: 2560px) {
  :root {
    --nav-h: 92px;
  }

  /* Nav */
  .logo-img { height: 64px; }
  .logo-wrap { left: 80px; padding: 10px 16px; }
  .nav-close  { right: 80px; font-size: 19px; }
  .nav-close svg { width: 18px; height: 18px; }

  .nav-center {
    gap: 96px;
    padding: 12px 48px;
  }
  .nav-center button { font-size: 18px; }

  /* Hero name */
  .hero-name { font-size: clamp(44px, 3vw, 72px); top: calc(var(--nav-h) + 130px); }

  /* Hint */
  .hint { font-size: 12px; letter-spacing: 0.2em; bottom: 56px; }

  /* Panels */
  .panel-body { padding: 100px 100px 160px; }
  #panel-info .panel-body { padding: 100px 100px 80px; }
  #panel-work .panel-body { padding: 96px 100px 160px; }
  #panel-contact .panel-body { padding: 96px 100px 160px; }
  #panel-project .proj-header { padding: 96px 100px 0; }
  #panel-project .proj-featured-section { padding: 0 108px 0 100px; }

  /* Typography */
  .panel-title { font-size: clamp(72px, 7vw, 160px); margin-bottom: 72px; }
  .panel-text { font-size: 22px; line-height: 1.95; max-width: 860px; margin-bottom: 80px; }

  .info-main .panel-title { font-size: clamp(80px, 7vw, 160px); margin-bottom: 56px; }
  .info-main .panel-text { font-size: 22px; line-height: 1.95; margin-bottom: 36px; max-width: 1100px; }

  /* Info grid */
  .info-label { font-size: 12px; letter-spacing: 0.2em; }
  .info-value { font-size: 22px; }

  /* Info layout */
  .info-layout { gap: 128px; }
  .info-featured-section { padding-left: 100px; padding-right: 100px; margin-top: 96px; }
  .featured-label { font-size: 18px; }

  /* Work list */
  .work-name { font-size: clamp(36px, 2.8vw, 68px); }
  .work-cat  { font-size: 18px; }
  .work-year { font-size: 14px; }
  .work-row  { padding: 28px 0; grid-template-columns: 1fr 300px 88px; gap: 32px; }
  #panel-work .panel-title { margin-bottom: 112px; }

  /* Featured rows */
  .featured-name { font-size: clamp(36px, 2.8vw, 68px); }
  .featured-cat  { font-size: 18px; }
  .featured-year { font-size: 18px; }
  .featured-row  { padding: 28px 0; grid-template-columns: 1fr 300px 88px 34px; gap: 32px; }
  .featured-desc { font-size: 18px; line-height: 1.8; max-width: 900px; }
  .featured-sublabel { font-size: 12px; }

  /* Contact */
  .contact-name { font-size: clamp(48px, 4vw, 88px); }
  .contact-row  { padding: 34px 0; }
  #panel-contact .panel-title { margin-bottom: 112px; }

  /* Gallery */
  .gallery-grid { padding: 0 100px; gap: 6px; }
  .gallery-text { font-size: 20px; line-height: 1.95; }
  .gallery-text--spec { font-size: 14px; }
  .gallery-heading { font-size: clamp(48px, 4vw, 80px); }

  /* Project meta */
  .meta-label { font-size: 12px; letter-spacing: 0.2em; }
  .meta-val   { font-size: 20px; }

  /* Project header */
  .proj-title { font-size: clamp(52px, 5vw, 110px); }
  .proj-cat   { font-size: 20px; }
  .proj-desc  { font-size: 22px; line-height: 1.85; max-width: 1100px; }

  /* Project slide — title bar */
  .proj-slide-title   { font-size: clamp(30px, 2.2vw, 52px); }
  .proj-slide-header  { padding: 0 80px; height: var(--nav-h); }
  .proj-slide-footer  { padding: 0 80px; height: 92px; }

  /* Slide counter & switcher */
  .proj-slide-counter { font-size: 16px; }
  .proj-switch-btn    { font-size: 18px; max-width: 400px; }
  .proj-press-toggle  { font-size: 16px; }

  /* Caption text slides */
  .proj-slide-caption { font-size: clamp(28px, 2.2vw, 44px); }

  /* Overlap / composite text */
  .sol-text      { font-size: clamp(22px, 1.6vw, 32px); }
  .sol-text--spec{ font-size: clamp(18px, 1.3vw, 24px); }

  /* Combined slide caption */
  .proj-slide-combined__caption { font-size: clamp(22px, 1.6vw, 36px); }

  /* Press */
  .press-logo-slot { min-width: 210px; height: 106px; }
  .press-logo-slot img { max-height: 80px; max-width: 190px; }

  /* End overlay */
  .proj-end-name  { font-size: clamp(48px, 4vw, 84px); }
  .proj-end-label { font-size: 16px; letter-spacing: 0.14em; }
}

/* ── True 4K (3840px+) ── */
@media (min-width: 3840px) {
  :root {
    --nav-h: 130px;
  }

  /* Nav */
  nav { height: var(--nav-h); }
  .logo-img { height: 90px; }
  .logo-wrap { left: 120px; padding: 16px 24px; border-radius: 8px; }
  .logo-placeholder { font-size: 32px; }
  .nav-close  { right: 120px; font-size: 28px; gap: 14px; }
  .nav-close svg { width: 26px; height: 26px; }
  .nav-close span { font-size: 28px; }

  .nav-center {
    gap: 140px;
    padding: 18px 72px;
    border-radius: 8px;
    font-size: 26px;
  }
  .nav-center button { font-size: 26px; }

  /* Hero name */
  .hero-name {
    font-size: clamp(64px, 3.2vw, 110px);
    top: calc(var(--nav-h) + 190px);
  }

  /* Hint */
  .hint { font-size: 18px; letter-spacing: 0.24em; bottom: 80px; }

  /* Panels */
  .panel-body { padding: 150px 160px 240px; }
  #panel-info .panel-body { padding: 150px 160px 120px; }
  #panel-work .panel-body { padding: 140px 160px 240px; }
  #panel-contact .panel-body { padding: 140px 160px 240px; }
  #panel-project .proj-header { padding: 140px 160px 0; }
  #panel-project .proj-featured-section { padding: 0 170px 0 160px; }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 8px; }

  /* Typography */
  .panel-title { font-size: clamp(110px, 7.5vw, 220px); margin-bottom: 100px; }
  .panel-text  { font-size: 34px; line-height: 2; max-width: 1300px; margin-bottom: 120px; }

  .info-main .panel-title { font-size: clamp(120px, 7.5vw, 220px); margin-bottom: 80px; }
  .info-main .panel-text  { font-size: 34px; line-height: 2; margin-bottom: 56px; max-width: 1600px; }

  /* Info grid */
  .info-label { font-size: 18px; letter-spacing: 0.22em; }
  .info-value { font-size: 34px; }
  .info-grid  { gap: 48px; }

  /* Info layout */
  .info-layout { gap: 180px; }
  .info-featured-section { padding-left: 160px; padding-right: 160px; margin-top: 140px; }
  .featured-label { font-size: 26px; letter-spacing: 0.16em; }

  /* Work list */
  .work-name { font-size: clamp(54px, 3vw, 96px); }
  .work-cat  { font-size: 26px; }
  .work-year { font-size: 20px; letter-spacing: 0.14em; }
  .work-row  { padding: 42px 0; grid-template-columns: 1fr 440px 120px; gap: 48px; border-bottom-width: 1.5px; }
  #panel-work .panel-title { margin-bottom: 160px; }

  /* Featured rows */
  .featured-name { font-size: clamp(54px, 3vw, 96px); }
  .featured-cat  { font-size: 26px; }
  .featured-year { font-size: 26px; }
  .featured-row  { padding: 42px 0; grid-template-columns: 1fr 440px 120px 50px; gap: 48px; border-bottom-width: 1.5px; }
  .featured-desc { font-size: 28px; line-height: 1.85; max-width: 1400px; }
  .featured-sublabel { font-size: 18px; letter-spacing: 0.18em; }

  /* Contact */
  .contact-name  { font-size: clamp(72px, 4.2vw, 130px); }
  .contact-row   { padding: 52px 0; border-bottom-width: 1.5px; }
  #panel-contact .panel-title { margin-bottom: 160px; }

  /* Gallery */
  .gallery-grid    { padding: 0 160px; gap: 10px; }
  .gallery-text    { font-size: 32px; line-height: 2; }
  .gallery-text--spec { font-size: 22px; }
  .gallery-heading { font-size: clamp(72px, 4.5vw, 130px); }

  /* Project meta */
  .meta-label { font-size: 18px; letter-spacing: 0.22em; }
  .meta-val   { font-size: 32px; }
  .project-meta { gap: 60px; margin-bottom: 80px; }

  /* Project header */
  .proj-title { font-size: clamp(80px, 5.5vw, 160px); }
  .proj-cat   { font-size: 30px; letter-spacing: 0.14em; }
  .proj-desc  { font-size: 34px; line-height: 1.9; max-width: 1600px; }

  /* Project slide — title bar & footer */
  .proj-slide-title   { font-size: clamp(44px, 2.4vw, 76px); }
  .proj-slide-header  { padding: 0 120px; height: var(--nav-h); }
  .proj-slide-footer  { padding: 0 120px; height: 130px; }

  /* Slide counter & switcher */
  .proj-slide-counter { font-size: 24px; }
  .proj-switch-btn    { font-size: 28px; max-width: 600px; }
  .proj-fcluster      { gap: 48px; }
  .proj-press-toggle  { font-size: 24px; }

  /* Caption text slides */
  .proj-slide-caption { font-size: clamp(42px, 2.4vw, 66px); }

  /* Overlap / composite text */
  .sol-text       { font-size: clamp(32px, 1.8vw, 48px); }
  .sol-text--spec { font-size: clamp(26px, 1.4vw, 36px); }

  /* Combined slide caption */
  .proj-slide-combined__caption { font-size: clamp(32px, 1.8vw, 52px); }

  /* Press logos */
  .press-logo-slot     { min-width: 300px; height: 150px; }
  .press-logo-slot img { max-height: 110px; max-width: 270px; }

  /* End overlay */
  .proj-end-name  { font-size: clamp(72px, 4.5vw, 130px); }
  .proj-end-label { font-size: 24px; letter-spacing: 0.16em; }
}