/* ============================================================
   Aysel Moondelfy
   Кириллица: Playfair Display (display) / Manrope (текст)
   Латиница: Cormorant italic (акценты)
   ============================================================ */

:root {
  --paper:    #ffffff;
  --cream:    #ece6da;
  --ink:      #1a1620;
  --ink-2:    #5b525f;
  --ink-3:    #8b8090;
  --line:     rgba(26, 22, 32, 0.12);

  --pink:     #efc9d4;
  --yellow:   #ecd9a3;
  --blue:     #b8d3df;
  --lilac:    #cdb9e4;

  /* Современный набор шрифтов: жирные сансы + минимум курсива */
  --display:  'Unbounded', 'Space Grotesk', sans-serif;
  --serif:    'Playfair Display', Georgia, serif;
  --sans:     'Space Grotesk', 'Manrope', -apple-system, sans-serif;
  --sans-2:   'Manrope', -apple-system, sans-serif;
  --serif-it: 'Cormorant', 'Playfair Display', serif;

  --pad-x: clamp(24px, 5vw, 80px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans-2);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

/* Глобальная инверсия: состояние ставится кнопкой на главной и хранится для всего сайта */
body.inverted {
  filter: invert(1) hue-rotate(180deg);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Close controls: no browser-blue rings or glow on opening a viewer.
   Keep a quiet neutral indicator only for deliberate keyboard navigation. */
:is(button, a)[class*="close"]:focus {
  outline: none; box-shadow: none; -webkit-tap-highlight-color: transparent;
}
html.is-keyboard-nav :is(button, a)[class*="close"]:focus-visible {
  outline: 1px solid currentColor; outline-offset: 5px; box-shadow: none;
}

ul { list-style: none; }

.lat {
  font-family: var(--serif-it);
  font-style: italic;
  font-weight: 500;
}

/* ============== ЗАСТАВКА ============== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, visibility 1s ease;
}
.loader-canvas {
  width: min(46vw, 320px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  animation: spin 14s linear infinite;
  filter: drop-shadow(0 12px 50px rgba(60, 40, 80, 0.18));
}
@keyframes spin { to { transform: rotate(360deg); } }
body.loaded .loader { opacity: 0; visibility: hidden; pointer-events: none; }

/* ============== ШАПКА (одинаковая на всех страницах) ============== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px var(--pad-x);
  background: #ffffff;
  border-bottom: 0;
  z-index: 100;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
}
/* Текст ссылок в шапке одинаковый везде */
.site-header .logo,
.site-header .logo .logo-anim,
.site-header .nav a {
  color: var(--ink-2);
}
.site-header .nav a:hover,
.site-header .nav a.active { color: var(--ink); }
body.loaded .site-header { opacity: 1; transform: translateY(0); }

.logo {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  display: inline-block;
}

/* Глитч-анимашка: лёгкая левитация + смена шрифтов как при наборе кода */
.logo-anim {
  display: inline-block;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  animation: levitate 5.5s ease-in-out infinite;
  will-change: transform, filter;
  transition: filter 0.35s ease;
}
.logo-anim.burst {
  filter: blur(1.6px);
}
@keyframes levitate {
  0%, 100% { transform: translateY(0) translateX(0); }
  25%      { transform: translateY(-1.6px) translateX(0.3px); }
  50%      { transform: translateY(-2.2px) translateX(-0.3px); }
  75%      { transform: translateY(-1.1px) translateX(0.2px); }
}

.logo-anim .word {
  display: inline-block;
  white-space: nowrap;
}
.logo-anim .word + .word { margin-left: 0.35em; }

.logo-anim .ltr {
  display: inline-block;
  font-size: 22px;
  line-height: 1;
  vertical-align: baseline;
  transition: color 0.25s ease, text-shadow 0.25s ease, font-weight 0.2s ease, transform 0.2s ease;
  will-change: color, text-shadow, font-weight;
}

/* ---- Палитра: Klein Blue / Citric / Aquamarine / Fushia / Tangerine / Black ---- */
.ltr.c1 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: #191414; }
.ltr.c2 { font-family: 'Manrope', sans-serif;       font-weight: 800; color: #4100F5;
          text-shadow: 0 0 6px rgba(65, 0, 245, 0.35); }
.ltr.c3 { font-family: 'Unbounded', sans-serif;     font-weight: 600; color: #4100F5; font-size: 19px;
          text-shadow: 0 0 8px rgba(65, 0, 245, 0.45); }
.ltr.c4 { font-family: 'Manrope', sans-serif;       font-weight: 700; color: #CDF564;
          text-shadow: 0 0 4px rgba(120,140,40,0.4), 0 0 10px rgba(205,245,100,0.55); }
.ltr.c5 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #9BF0E1;
          text-shadow: 0 0 4px rgba(60,140,130,0.35), 0 0 10px rgba(155,240,225,0.55); }
.ltr.c6 { font-family: 'Manrope', sans-serif;       font-weight: 800; color: #F037A5;
          text-shadow: 0 0 6px rgba(240,55,165,0.45); }
.ltr.c7 { font-family: 'Unbounded', sans-serif;     font-weight: 700; color: #F037A5; font-size: 19px;
          text-shadow: 0 0 8px rgba(240,55,165,0.5); }
.ltr.c8 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #FF4632;
          text-shadow: 0 0 6px rgba(255,70,50,0.4); }
.ltr.c9 { font-family: 'Manrope', sans-serif;       font-weight: 800; color: #191414; }
.ltr.c10 { font-family: 'Unbounded', sans-serif;    font-weight: 700; color: #191414; font-size: 19px; }

/* ---- Глитч-всплеск (RGB-сдвиг) ---- */
.ltr.glitching {
  text-shadow: 1.5px 0 #F037A5, -1.5px 0 #9BF0E1, 0 0 6px currentColor !important;
  filter: blur(0.6px);
  transform: translateX(0.4px);
}
.nav {
  display: flex;
  gap: 32px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  font-weight: 400;
}
.nav a {
  color: var(--ink-2);
  transition: color 0.3s ease;
  position: relative;
}
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a.active::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0; right: 0;
  height: 1px;
  background: var(--ink);
}

/* ============== ВНУТРЕННИЕ СТРАНИЦЫ ============== */
.inner {
  flex: 1;
  padding: 140px var(--pad-x) 120px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.page-head {
  margin-bottom: 80px;
  max-width: 760px;
}
.page-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(48px, 8vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}
.page-lede {
  font-family: var(--sans-2);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(17px, 1.7vw, 21px);
  color: var(--ink-2);
  max-width: 560px;
  line-height: 1.5;
}

/* ============== ФИЛЬТР НА СТРАНИЦЕ РАБОТ ============== */
.filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.filter-btn {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--ink-2);
  transition: all 0.3s ease;
}
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ============== ГАЛЕРЕЯ — масонри, картинки в полный размер ============== */
.gallery {
  columns: 3;
  column-gap: 24px;
}
.g-item {
  break-inside: avoid;
  margin: 0 0 24px 0;
  position: relative;
  display: block;
  cursor: pointer;
  transition: opacity 0.4s ease;
}
.g-item.hidden { display: none; }

.g-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.g-item:hover img { transform: scale(1.015); }

.g-item figcaption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  flex-direction: column;
  padding: 32px 20px 20px;
  color: var(--paper);
  background: linear-gradient(to top, rgba(20, 18, 24, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.g-item:hover figcaption { opacity: 1; }
.g-title {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.g-year {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(246, 243, 236, 0.7);
}

/* ============== МОДАЛКА РАБОТЫ ============== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 24, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px var(--pad-x);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.modal.open { opacity: 1; visibility: visible; }

.modal-close {
  position: absolute;
  top: 24px; right: 32px;
  font-size: 32px;
  color: var(--paper);
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  line-height: 1;
}
.modal-close:hover { background: rgba(246, 243, 236, 0.1); }

.modal-inner {
  background: var(--paper);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  max-width: 1200px;
  max-height: 85vh;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.open .modal-inner { transform: translateY(0); }

.modal-image {
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
}
.modal-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.modal-text {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}
.modal-meta {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.modal-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.modal-tech {
  font-family: var(--serif-it);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-2);
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.modal-desc {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* ============== РАБОТЫ — НАКЛОННЫЕ ПОЛОСЫ С КАРТИНАМИ ============== */
body.page-works,
body.page-works .site-header {
  background:
    radial-gradient(ellipse at 20% 18%, rgba(255,255,255,0.62) 0 7%, transparent 18%),
    radial-gradient(ellipse at 76% 24%, rgba(255,255,255,0.5) 0 6%, transparent 17%),
    linear-gradient(180deg, #acdfff 0%, #d6f2ff 48%, #f4fbff 100%);
}
body.page-works { overflow-x: hidden; }
body.page-works::before,
body.page-works::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 20% 55%, rgba(255,255,255,0.95) 0 18%, transparent 42%),
    radial-gradient(ellipse at 42% 45%, rgba(255,255,255,0.88) 0 20%, transparent 46%),
    radial-gradient(ellipse at 66% 56%, rgba(255,255,255,0.82) 0 18%, transparent 44%),
    radial-gradient(ellipse at 82% 46%, rgba(255,255,255,0.7) 0 14%, transparent 38%);
  filter: blur(10px);
  mix-blend-mode: screen;
}
body.page-works::before {
  left: -16vw;
  top: 14vh;
  width: 70vw;
  height: 24vh;
  opacity: 0.86;
  animation: works-clouds-gather 16s ease-in-out infinite;
}
body.page-works::after {
  right: -18vw;
  top: 56vh;
  width: 76vw;
  height: 28vh;
  opacity: 0.78;
  animation: works-clouds-drift 21s ease-in-out infinite;
}

.works-strips {
  position: relative;
  z-index: 1;
  max-width: none;
  padding: 84px clamp(70px, 9vw, 180px) 28px;
  margin: 0;
  background: transparent;
  overflow: hidden;
}
.works-cloud {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  width: 260px;
  height: 104px;
  opacity: 0.78;
  filter: blur(0.4px) drop-shadow(0 18px 34px rgba(92, 162, 207, 0.18));
  animation: works-cloud-pulse 15s ease-in-out infinite;
}
.works-cloud span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,0.98), rgba(255,255,255,0.78) 58%, rgba(255,255,255,0.16) 100%);
  box-shadow:
    inset -18px -18px 28px rgba(178, 219, 244, 0.34),
    inset 14px 14px 24px rgba(255,255,255,0.72);
  animation: works-cloud-bump 7s ease-in-out infinite alternate;
}
.works-cloud span:nth-child(1) { left: 0; top: 42px; width: 126px; height: 48px; animation-delay: -1s; }
.works-cloud span:nth-child(2) { left: 58px; top: 12px; width: 92px; height: 82px; animation-delay: -3s; }
.works-cloud span:nth-child(3) { left: 126px; top: 28px; width: 116px; height: 58px; animation-delay: -5s; }
.works-cloud span:nth-child(4) { left: 32px; top: 58px; width: 205px; height: 38px; animation-delay: -2s; }
.works-cloud span:nth-child(5) { left: 18px; top: 28px; width: 54px; height: 42px; opacity: 0; animation-delay: -4s; }
.works-cloud span:nth-child(6) { left: 154px; top: 8px; width: 48px; height: 44px; opacity: 0; animation-delay: -6s; }
.works-cloud span:nth-child(7) { left: 206px; top: 44px; width: 42px; height: 34px; opacity: 0; animation-delay: -8s; }
.works-cloud span:nth-child(8) { left: 92px; top: 0; width: 38px; height: 34px; opacity: 0; animation-delay: -10s; }
.works-cloud-a { left: 5vw; top: 112px; transform: scale(1.05); animation-duration: 18s; }
.works-cloud-b { right: 5vw; top: 230px; transform: scale(0.78); animation-delay: -5s; animation-duration: 20s; }
.works-cloud-c { left: 13vw; bottom: 48px; transform: scale(0.62); animation-delay: -9s; animation-duration: 17s; }
.works-cloud-d { right: 18vw; bottom: 92px; transform: scale(0.48); animation-delay: -12s; animation-duration: 14s; }
.works-cloud-e { left: 42vw; top: 64px; transform: scale(0.54); animation-delay: -7s; animation-duration: 19s; }
.works-cloud-f { right: 34vw; top: 150px; transform: scale(0.42); animation-delay: -11s; animation-duration: 16s; }
.works-cloud-g { left: 2vw; top: 355px; transform: scale(0.55); animation-delay: -14s; animation-duration: 22s; }
.works-cloud-h { right: 3vw; bottom: 18px; transform: scale(0.7); animation-delay: -3s; animation-duration: 18s; }

.strips {
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(0.7);
  transform-origin: top center;
}

.strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(100px, 12.5vh, 160px);
  margin-top: -32px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  background: transparent;
  z-index: 1;
  contain: layout paint;
  transition: height 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.strip:first-child { margin-top: 0; }

/* Верхняя — большая, нижняя — чуть меньше */
.strips .strip:first-child { height: clamp(256px, 32vh, 410px); }
.strips .strip:last-child  { height: clamp(200px, 25vh, 330px); }

/* Один раздел намеренно с белой полосой между предыдущим */
.strips .strip:nth-child(5) { margin-top: 2px; }

/* Средние полосы перекрываются снизу следующей полосой — компенсируем
   падингом снизу, чтобы текст выглядел ровно по центру видимой части */
.strips .strip:not(:first-child):not(:last-child) {
  padding-bottom: 28px;
}

/* Раздел «Динозавры» — чуть уже по ширине */
.strips .strip:nth-child(4) {
  height: clamp(118px, 14.5vh, 185px);
  padding-bottom: 8px;
  width: 94%;
  margin-left: auto;
  margin-right: auto;
}

/* Более узкие полосы по центру композиции. */
.strips .strip[href="series.html?s=key-questions"] {
  width: 76%;
  margin-left: auto;
  margin-right: auto;
}
.strips .strip:nth-child(3) {
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}
.strips .strip:nth-child(5) {
  width: 84%;
  margin-left: auto;
  margin-right: auto;
}

/* Косые края: каждая полоса — четырёхугольник с разными углами */
.strip:nth-child(1) { clip-path: polygon(0 18%, 100% 0,    100% 88%, 0 100%); }
.strip:nth-child(2) { clip-path: polygon(0 0,   100% 14%, 100% 100%, 0 86%); }
.strip:nth-child(3) { clip-path: polygon(0 12%, 100% 0,    100% 92%, 0 100%); }
.strip:nth-child(4) { clip-path: polygon(0 0,   100% 18%, 100% 88%, 0 100%); }
.strip:nth-child(5) { clip-path: polygon(0 16%, 100% 0,    100% 100%, 0 92%); }
.strip:nth-child(6) { clip-path: polygon(0 0,   100% 12%, 100% 92%, 0 100%); }

/* Фон-картина — крупнее, насыщеннее, статична */
.strip-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.22);
  z-index: 0;
}

/* Круглые картины — приближаем, чтобы круг залил полосу */
.strip-round .strip-bg {
  background-size: auto 520%;
  background-position: center;
  transform: scale(1);
}

/* Завеса оставлена прозрачной — никакого серого */
.strip-veil {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 1;
}

.strip-title {
  position: relative;
  z-index: 2;
  font-family: 'Impact', 'Oswald', 'Anton', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400;
  font-size: clamp(18px, 2.1vw, 32px);
  letter-spacing: 0.01em;
  line-height: 1.02;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Ключевые вопросы — белый лист внутри самой работы, поэтому кадрируем крупнее */
.strips .strip:nth-child(2) .strip-bg {
  background-size: 116% auto;
  background-position: center;
}

/* Верхняя — фокус на верхний край круга; Нижняя — точечно ниже и мельче, чтобы круг не срезался грубо */
.strips .strip:first-child .strip-bg {
  background-size: auto 400%;
  background-position: center 12%;
}
.strips .strip:last-child .strip-bg {
  background-size: auto 410%;
  background-position: center bottom;
}

/* === Hover: полоса плавно расширяется === */
.strip:hover {
  height: clamp(122px, 14vh, 180px);
  z-index: 10;
}
.strips .strip:first-child:hover {
  height: clamp(283px, 35.5vh, 455px);
}
.strips .strip:last-child:hover {
  height: clamp(230px, 28.5vh, 370px);
}
.strip:hover .strip-title { transform: scale(1.04); }

@keyframes works-cloud-pulse {
  0% {
    opacity: 0.24;
    filter: blur(8px) drop-shadow(0 18px 34px rgba(92, 162, 207, 0.12));
    translate: -18px 4px;
    scale: 0.78 0.74;
  }
  38% {
    opacity: 0.9;
    filter: blur(0.2px) drop-shadow(0 20px 40px rgba(92, 162, 207, 0.25));
    translate: 10px -8px;
    scale: 1.04 1;
  }
  64% {
    opacity: 0.42;
    filter: blur(7px) drop-shadow(0 16px 28px rgba(92, 162, 207, 0.12));
    translate: 28px 6px;
    scale: 1.26 0.72;
  }
  100% {
    opacity: 0.82;
    filter: blur(1px) drop-shadow(0 20px 40px rgba(92, 162, 207, 0.22));
    translate: -8px -4px;
    scale: 0.92 0.94;
  }
}
@keyframes works-cloud-bump {
  0% { transform: translate3d(-8px, 5px, 0) scale(0.72); opacity: 0.18; }
  35% { transform: translate3d(2px, -4px, 0) scale(1.04); opacity: 0.9; }
  65% { transform: translate3d(10px, 3px, 0) scale(0.82); opacity: 0.36; }
  100% { transform: translate3d(-3px, -2px, 0) scale(1.18); opacity: 0.82; }
}

@keyframes works-clouds-gather {
  0% {
    transform: translate3d(-6vw, 0, 0) scaleX(0.7) scaleY(0.72);
    opacity: 0.2;
    filter: blur(24px);
  }
  38% {
    transform: translate3d(1vw, 1vh, 0) scaleX(1.08) scaleY(1);
    opacity: 0.9;
    filter: blur(8px);
  }
  64% {
    transform: translate3d(4vw, -1vh, 0) scaleX(1.28) scaleY(0.78);
    opacity: 0.42;
    filter: blur(22px);
  }
  100% {
    transform: translate3d(10vw, 1vh, 0) scaleX(0.82) scaleY(0.68);
    opacity: 0.74;
    filter: blur(12px);
  }
}
@keyframes works-clouds-drift {
  0% {
    transform: translate3d(8vw, 1vh, 0) scaleX(1.18) scaleY(0.76);
    opacity: 0.25;
    filter: blur(26px);
  }
  45% {
    transform: translate3d(-1vw, -1vh, 0) scaleX(0.86) scaleY(1.06);
    opacity: 0.88;
    filter: blur(9px);
  }
  70% {
    transform: translate3d(-5vw, 1vh, 0) scaleX(1.35) scaleY(0.7);
    opacity: 0.36;
    filter: blur(25px);
  }
  100% {
    transform: translate3d(-12vw, 0, 0) scaleX(0.95) scaleY(0.92);
    opacity: 0.8;
    filter: blur(10px);
  }
}

@media (max-width: 720px) {
  .works-strips { padding: 60px 20px 60px; }
  .strip { height: 120px; margin-top: 0; }
  .strip:hover { height: 140px; }
  .strip-title { font-size: 17px; }
}

/* ============== СТРАНИЦА СЕРИИ (заглушка) ============== */
.series-main { padding-top: 100px; }
.series-back {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  margin-bottom: 40px;
  transition: color 0.3s ease, transform 0.3s ease;
}
.series-back:hover { color: var(--ink); transform: translateX(-4px); }

.series-placeholder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.ph-tile {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.02));
  border: 1px dashed var(--line);
  border-radius: 6px;
}

/* ============== СЕРИЯ: ПОЗИТИВНЫЕ АФФИРМАЦИИ ============== */
body.page-affirmations { background: #fff; overflow-x: hidden; }
body.page-affirmations .site-footer {
  position: relative;
  z-index: 5;
  background: #fff;
  border-top: 0;
}

.aff-room {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(100vh - 70px);
  height: calc(100svh - 70px);
  margin-top: 70px;
  max-width: none;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
}

.aff-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.aff-painting {
  position: relative;
  z-index: 1;
  width: min(55vw, 570px, calc((100svh - 230px) * 0.9496));
  pointer-events: none;
}
.aff-painting img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 var(--aff-glow-radius, 0px) rgba(139, 214, 249, var(--aff-glow-alpha, 0)))
    drop-shadow(0 0 var(--aff-glow-radius, 0px) rgba(228, 174, 218, var(--aff-glow-alpha, 0)));
}

.aff-low-beat .aff-painting,
.aff-low-beat .aff-wave {
  animation: aff-gentle-vibration var(--aff-vibration-speed, 0.4s) linear infinite;
}
@keyframes aff-gentle-vibration {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(var(--aff-vibration, 0px), 0); }
  50% { transform: translate(0, var(--aff-vibration, 0px)); }
  75% { transform: translate(calc(-1 * var(--aff-vibration, 0px)), 0); }
}

.aff-sound-panel {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: #596874;
  font: 11px/1.5 'Manrope', sans-serif;
  text-align: center;
}
.aff-sound-controls { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.aff-sound-toggle {
  border: 1px solid #c8dfeb;
  border-radius: 24px;
  padding: 8px 15px;
  background: #f4fbff;
  color: #405e70;
  font: inherit;
  cursor: pointer;
}
.aff-sound-toggle[aria-pressed="true"] { background: #e5f4fb; }
.aff-sound-toggle:focus-visible, .aff-sound-panel input:focus-visible { outline: 2px solid #7cb6d7; outline-offset: 4px; }
.aff-sound-volume, .aff-sound-frequency { display: flex; align-items: center; gap: 7px; }
.aff-sound-panel input { width: 70px; accent-color: #91bfd8; cursor: pointer; }
.aff-beat-value {
  min-width: 64px;
  padding: 5px 9px;
  border-radius: 20px;
  background: var(--aff-note-color, #ec9bc9);
  color: var(--aff-note-ink, #403647);
  font-variant-numeric: tabular-nums;
  transition: background 0.4s, color 0.4s;
}
.aff-sound-panel .aff-beat {
  width: 132px;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  --aff-track: linear-gradient(90deg, #514653 0%, #83708b 20%, #c392bf 38%, #e9b2ce 52%, #d3dfac 67%, #afdce0 82%, #e2eef3 100%);
}
.aff-beat::-webkit-slider-runnable-track { height: 6px; border-radius: 10px; background: var(--aff-track); }
.aff-beat::-moz-range-track { height: 6px; border-radius: 10px; background: var(--aff-track); }
.aff-beat::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--aff-note-color, #ec9bc9);
  box-shadow: 0 0 0 1px rgba(70, 54, 75, 0.2);
}
.aff-beat::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--aff-note-color, #ec9bc9);
  box-shadow: 0 0 0 1px rgba(70, 54, 75, 0.2);
}
.aff-sound-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .aff-low-beat .aff-painting, .aff-low-beat .aff-wave { animation: none; }
}
@media (max-width: 600px) {
  .aff-painting { width: min(72vw, calc((100svh - 270px) * 0.9496)); }
  .aff-sound-panel { padding: 8px 10px; }
  .aff-sound-controls { gap: 8px 12px; }
  .aff-sound-panel input { width: 55px; }
  .aff-sound-panel .aff-beat { width: 104px; }
}

/* ============== КЛЮЧЕВЫЕ ВОПРОСЫ МИРОЗДАНИЯ ============== */
html:has(body.page-key-questions) { background: #ffffff; color-scheme: light; }
body.page-key-questions { background: #ffffff; }
body.page-key-questions .site-footer {
  background: #ffffff !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.page-key-questions .series-main { background: #ffffff; }

.kq-room {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 70px);
  margin-top: 70px;
  max-width: none;
  padding: 80px 4vw;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5vw;
  overflow: hidden;
}

.kq-back-link {
  position: absolute;
  top: 22px;
  left: 32px;
  z-index: 20;
  color: #1a1a1a;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease, transform 0.3s ease;
}
.kq-back-link:hover { opacity: 0.55; transform: translateX(-3px); }

.kq-piece {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
/* Боковые портретные рамы — чуть крупнее центральной квадратной */
.kq-piece:has(.kq-frame-portrait) { width: 27vw; max-width: 380px; }
.kq-piece:has(.kq-frame-square)   { width: 22vw; max-width: 320px; }

/* ===== Барочная резная рама — реалистичная, цвет меняется как слайд-шоу ===== */
.kq-frame-baroque {
  position: relative;
  padding: 11%;
  background-color: #d4af6a; /* устанавливается через JS, без плавного перехода */
  /* Многослойная резьба: чередование светлых рёбер и тёмных канавок */
  box-shadow:
    /* внешний тёмный кант — край рамы */
    0 0 0 2px rgba(20, 12, 2, 0.85),
    /* первый светлый профиль */
    inset 0 0 0 3px rgba(255, 245, 215, 0.55),
    inset 0 0 0 5px rgba(20, 12, 2, 0.5),
    /* плоская поверхность с орнаментом — между 5 и 26px */
    inset 0 0 0 26px rgba(20, 12, 2, 0.55),
    inset 0 0 0 29px rgba(255, 245, 215, 0.55),
    /* широкое плоское вытянутое поле — от 29 до 50px */
    inset 0 0 0 50px rgba(20, 12, 2, 0.45),
    inset 0 0 0 53px rgba(255, 245, 215, 0.6),
    /* внутренний рельеф у картины */
    inset 0 0 0 58px rgba(20, 12, 2, 0.6),
    /* объём — тень падающая от рамы */
    0 36px 70px rgba(0, 0, 0, 0.4),
    0 14px 26px rgba(0, 0, 0, 0.25);
}

/* Барочный орнамент: растительные завитки + акант, плотный узор */
.kq-frame-baroque::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3Cpattern id='b' x='0' y='0' width='64' height='64' patternUnits='userSpaceOnUse'%3E%3C!--%20центральный%20медальон%20--%3E%3Cpath d='M32 6 C26 10 24 18 32 24 C40 18 38 10 32 6 Z' fill='rgba(255,245,215,0.45)' stroke='rgba(30,18,3,0.55)' stroke-width='0.7'/%3E%3Cpath d='M6 32 C10 26 18 24 24 32 C18 40 10 38 6 32 Z' fill='rgba(255,245,215,0.45)' stroke='rgba(30,18,3,0.55)' stroke-width='0.7'/%3E%3Cpath d='M58 32 C54 26 46 24 40 32 C46 40 54 38 58 32 Z' fill='rgba(255,245,215,0.45)' stroke='rgba(30,18,3,0.55)' stroke-width='0.7'/%3E%3Cpath d='M32 58 C26 54 24 46 32 40 C40 46 38 54 32 58 Z' fill='rgba(255,245,215,0.45)' stroke='rgba(30,18,3,0.55)' stroke-width='0.7'/%3E%3C!--%20угловые%20завитки%20--%3E%3Cpath d='M10 10 Q 16 8 18 14 Q 20 18 14 20 Q 8 18 10 10 Z' fill='rgba(255,245,215,0.4)' stroke='rgba(30,18,3,0.5)' stroke-width='0.6'/%3E%3Cpath d='M54 10 Q 48 8 46 14 Q 44 18 50 20 Q 56 18 54 10 Z' fill='rgba(255,245,215,0.4)' stroke='rgba(30,18,3,0.5)' stroke-width='0.6'/%3E%3Cpath d='M10 54 Q 16 56 18 50 Q 20 46 14 44 Q 8 46 10 54 Z' fill='rgba(255,245,215,0.4)' stroke='rgba(30,18,3,0.5)' stroke-width='0.6'/%3E%3Cpath d='M54 54 Q 48 56 46 50 Q 44 46 50 44 Q 56 46 54 54 Z' fill='rgba(255,245,215,0.4)' stroke='rgba(30,18,3,0.5)' stroke-width='0.6'/%3E%3C!--%20бусины%20по%20краям%20--%3E%3Ccircle cx='32' cy='32' r='1.6' fill='rgba(30,18,3,0.6)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23b)'/%3E%3C/svg%3E");
  background-size: 64px 64px;
  mix-blend-mode: overlay;
  opacity: 0.95;
  z-index: 1;
}

/* Световая лепка: блик от верхне-левого источника + тень снизу-справа */
.kq-frame-baroque::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(140% 100% at 15% 0%, rgba(255, 252, 235, 0.42) 0%, transparent 45%),
    radial-gradient(130% 95% at 95% 100%, rgba(0, 0, 0, 0.32) 0%, transparent 50%),
    /* лёгкая «зернистость» лака */
    linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.1) 100%);
  z-index: 2;
}

.kq-frame-baroque img {
  display: block;
  position: relative;
  width: 100%;
  height: auto;
  z-index: 3;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ===== Барочные рамы — фото настоящих рам, тонкая граница ===== */
/* Все рамы выровнены под общее «окно»: 13% L/R и 12-13% T/B.
   Картина имеет лёгкий нахлёст (1%), чтобы не было зазора. */
.kq-frame-photo {
  position: relative;
  width: 100%;
  /* Без теней — чтобы вокруг рамы был чистый белый фон без серого ореола */
}
/* «Матричный» глитч-переход: цифровой лаг + хроматическая аберрация + срез по горизонтали.
   Применяется ТОЛЬКО к слою рамы (::after), картина (<img>) остаётся в фокусе. */
@keyframes kq-glitch {
  0%   { filter: blur(0); transform: translate(0, 0) skewX(0); clip-path: inset(0); }
  8%   { filter: blur(2px)
                drop-shadow( 8px 0 0 rgba(240, 55,165, 0.95))
                drop-shadow(-8px 0 0 rgba(120,240,225, 0.95));
         transform: translate(-3px, 0) skewX(-2deg); clip-path: inset(0 0 60% 0); }
  16%  { filter: blur(3px) hue-rotate(40deg) saturate(1.8)
                drop-shadow( 6px 0 0 rgba(0, 255, 90, 0.85))
                drop-shadow(-6px 0 0 rgba(240, 55,165, 0.85));
         transform: translate(2px, 1px) skewX(1deg); clip-path: inset(30% 0 0 0); }
  28%  { filter: blur(4px)
                drop-shadow(-10px 1px 0 rgba(255, 40,200, 0.90))
                drop-shadow( 10px -1px 0 rgba( 80,220,255, 0.90));
         transform: translate(3px, -1px) skewX(-1deg); clip-path: inset(0 0 0 0); }
  40%  { filter: blur(2px) contrast(1.4)
                drop-shadow( 5px 2px 0 rgba(0, 255,120, 0.70))
                drop-shadow(-5px -2px 0 rgba(240, 55,165, 0.70));
         transform: translate(-2px, 1px); clip-path: inset(0 40% 0 0); }
  52%  { filter: blur(3.5px)
                drop-shadow(-7px 0 0 rgba(255, 40,200, 0.85))
                drop-shadow( 7px 0 0 rgba( 80,220,255, 0.85));
         transform: translate(2.5px, 0); clip-path: inset(0); }
  66%  { filter: blur(1.5px)
                drop-shadow( 3px 0 0 rgba(240, 55,165, 0.55))
                drop-shadow(-3px 0 0 rgba(120,240,255, 0.55));
         transform: translate(-1px, 0); clip-path: inset(0 0 20% 0); }
  82%  { filter: blur(0.5px)
                drop-shadow( 1px 0 0 rgba(240, 55,165, 0.30))
                drop-shadow(-1px 0 0 rgba(120,240,255, 0.30));
         transform: translate(0.5px, 0); clip-path: inset(0); }
  100% { filter: blur(0); transform: translate(0, 0); clip-path: inset(0); }
}
.kq-frame-photo.kq-glitch::after {
  /* steps() даёт «лагающий» цифровой стробоскоп — будто кадры дёргает */
  animation: kq-glitch 1.5s steps(26, end);
}

/* Правая рама — добавочная «пиксельная» дезинтеграция через SVG-фильтр.
   В пике глитча рама буквально рассыпается на мозаичные квадраты. */
@keyframes kq-glitch-pixel {
  0%, 100% { filter: blur(0); transform: translate(0, 0); }
  10%      { filter: url(#kq-pixelate) blur(1px)
                    drop-shadow( 6px 0 0 rgba(240, 55,165, 0.9))
                    drop-shadow(-6px 0 0 rgba(120,240,225, 0.9));
             transform: translate(-2px, 0) skewX(-1.5deg); }
  30%      { filter: url(#kq-pixelate) blur(2px) hue-rotate(30deg) saturate(1.8)
                    drop-shadow( 8px 0 0 rgba(0, 255, 90, 0.85))
                    drop-shadow(-8px 0 0 rgba(240, 55,165, 0.85));
             transform: translate(3px, -1px); }
  50%      { filter: url(#kq-pixelate) blur(1.5px)
                    drop-shadow(-9px 1px 0 rgba(255, 40,200, 0.9))
                    drop-shadow( 9px -1px 0 rgba( 80,220,255, 0.9));
             transform: translate(-2px, 1px) skewX(1deg); }
  72%      { filter: url(#kq-pixelate) blur(0.5px)
                    drop-shadow( 4px 0 0 rgba(240, 55,165, 0.55))
                    drop-shadow(-4px 0 0 rgba(120,240,255, 0.55));
             transform: translate(1px, 0); }
  88%      { filter: blur(0.5px)
                    drop-shadow( 1px 0 0 rgba(240, 55,165, 0.3))
                    drop-shadow(-1px 0 0 rgba(120,240,255, 0.3));
             transform: translate(0, 0); }
}
.kq-frame-photo.kq-pos-2.kq-glitch::after {
  animation: kq-glitch-pixel 1.6s steps(22, end);
}

/* Левая рама — почти без блюра, чисто пиксельный distortion с RGB-сдвигом */
@keyframes kq-glitch-pixel-sharp {
  0%, 100% { filter: blur(0); transform: translate(0, 0); }
  10%      { filter: url(#kq-pixelate)
                    drop-shadow( 7px 0 0 rgba(240, 55,165, 0.95))
                    drop-shadow(-7px 0 0 rgba(120,240,225, 0.95));
             transform: translate(-2px, 0) skewX(-1deg); }
  28%      { filter: url(#kq-pixelate) hue-rotate(25deg) saturate(1.6)
                    drop-shadow( 9px 0 0 rgba(0, 255, 90, 0.85))
                    drop-shadow(-9px 0 0 rgba(240, 55,165, 0.85));
             transform: translate(3px, -1px); }
  46%      { filter: url(#kq-pixelate) contrast(1.3)
                    drop-shadow(-10px 1px 0 rgba(255, 40,200, 0.9))
                    drop-shadow( 10px -1px 0 rgba( 80,220,255, 0.9));
             transform: translate(-2px, 1px) skewX(1deg); }
  62%      { filter: url(#kq-pixelate)
                    drop-shadow( 6px 0 0 rgba(240, 55,165, 0.75))
                    drop-shadow(-6px 0 0 rgba(120,240,255, 0.75));
             transform: translate(2px, 0); }
  80%      { filter: url(#kq-pixelate)
                    drop-shadow( 3px 0 0 rgba(240, 55,165, 0.5))
                    drop-shadow(-3px 0 0 rgba(120,240,255, 0.5));
             transform: translate(-1px, 0); }
  92%      { filter: drop-shadow( 1px 0 0 rgba(240, 55,165, 0.25))
                    drop-shadow(-1px 0 0 rgba(120,240,255, 0.25));
             transform: translate(0, 0); }
}
.kq-frame-photo.kq-pos-0.kq-glitch::after {
  animation: kq-glitch-pixel-sharp 1.5s steps(24, end);
}
.kq-frame-photo img {
  position: absolute;
  object-fit: cover;
  z-index: 1;
}
.kq-frame-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--frame-bg);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 2;
}

/* Портретный вариант (PNG 1000×1294, отверстие 13%/12%/74%/76%) */
.kq-frame-portrait { aspect-ratio: 1000 / 1294; }
.kq-frame-portrait img {
  left: 12%; top: 11%; width: 76%; height: 78%;
}

/* Квадратный вариант (PNG 1200×1200, отверстие 13%/13%/74%/74%) */
.kq-frame-square { aspect-ratio: 1 / 1; }
.kq-frame-square img {
  left: 12%; top: 12%; width: 76%; height: 76%;
}


/* ===== Белая минималистичная рама для Connection Lost ===== */
.kq-frame-white {
  position: relative;
  padding: 4% 4% 14%;  /* нижний отступ как у паспарту */
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(0, 0, 0, 0.04),
    0 28px 50px rgba(0, 0, 0, 0.2),
    0 10px 20px rgba(0, 0, 0, 0.12);
}

/* Контейнер для cross-fade слоёв Connection Lost */
.kq-cl-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f4f0e8;
}
.kq-cl-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
}
.kq-cl-stage img.active { opacity: 1; }

@media (max-width: 1100px) {
  .kq-room { gap: 2vw; padding: 60px 3vw; }
  .kq-piece:has(.kq-frame-portrait) { width: 36vw; }
  .kq-piece:has(.kq-frame-square)   { width: 26vw; }
}
@media (max-width: 800px) {
  .kq-room {
    flex-direction: column;
    gap: 40px;
    padding: 100px 6vw 60px;
    min-height: auto;
  }
  .kq-piece { width: 80vw; max-width: 460px; }
}

/* Общая ссылка «назад» для всех серий-комнат */
.room-back {
  position: absolute;
  top: 22px;
  left: 32px;
  z-index: 30;
  color: #1a1a1a;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.3s;
}
.room-back:hover { opacity: 0.55; transform: translateX(-3px); }

/* ============== ЛИЧНОСТИ МАСШТАБА ПОРТРЕТА ============== */
body.page-musicians { background: #ffffff; color: #111; }
body.page-musicians .site-footer { background: #ffffff; }

.mus-room {
  position: relative;
  margin-top: 70px;
  padding: 160px 6vw 40px;
  max-width: none;
  min-height: calc(100vh - 70px);
  background: #ffffff;
}
.mus-room .room-back { color: #111; }

body.page-musicians .site-footer { display: none; }

/* ============== ИНСТАЛЛЯЦИИ ============== */
body.page-installations {
  background: #15090a;
  color: #fff;
  margin: 0;
  overflow: hidden;
}
body.page-installations .site-header { background: transparent; border: none; }
body.page-installations .site-header .nav a,
body.page-installations .site-header .logo { color: #f4ece6; }
body.page-installations .site-footer { display: none; }
.inst-back-arrow {
  position: fixed;
  left: 44px;
  top: 82px;
  z-index: 80;
  color: rgba(244, 236, 230, 0.7);
  font-family: var(--sans, 'Space Grotesk', sans-serif);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 300;
  line-height: 1;
  text-decoration: none;
  text-shadow:
    0 0 8px rgba(240, 55, 165, 0.34),
    0 0 18px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}
.inst-back-arrow:hover,
.inst-back-arrow:focus-visible {
  color: #f4ece6;
  transform: translateX(-3px);
  text-shadow:
    0 0 10px rgba(240, 55, 165, 0.58),
    0 0 22px rgba(240, 55, 165, 0.26);
  outline: none;
}

/* Reuse the installations chevron for nested painting series. */
.series-nav-back { color: var(--ink-2); }
.series-nav-back:hover, .series-nav-back:focus-visible { color: var(--ink); }
@media (max-width: 650px) { .series-nav-back { left: var(--pad-x); } }

.inst-main {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  padding: 90px 130px 6vh 6vw;
  background:
    radial-gradient(ellipse at 30% 80%, #2a1416 0%, #15090a 55%, #060304 100%);
}

/* «Телек» — небольшое изображение в нижнем-левом углу, мягко затухает в темноту */
.inst-main::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(42vw, 560px);
  height: min(58vh, 560px);
  background:
    url('images/installations/bg-8435.jpg') left bottom / cover no-repeat;
  -webkit-mask-image: radial-gradient(ellipse at 28% 78%, #000 35%, transparent 78%);
          mask-image: radial-gradient(ellipse at 28% 78%, #000 35%, transparent 78%);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

/* === Кнопка Play поверх "телека" === */
.inst-play {
  position: absolute;
  left: min(11vw, 150px);
  bottom: min(8vh, 80px);
  width: 86px;
  height: 86px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 5;
  color: #F037A5;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s;
  filter:
    drop-shadow(0 0 8px rgba(240,55,165,0.85))
    drop-shadow(0 0 18px rgba(240,55,165,0.55))
    drop-shadow(0 0 32px rgba(240,55,165,0.35));
  animation: play-pulse 2.2s ease-in-out infinite;
}
.inst-play:hover {
  transform: scale(1.12);
  filter:
    drop-shadow(0 0 10px rgba(255,90,200,1))
    drop-shadow(0 0 24px rgba(240,55,165,0.85))
    drop-shadow(0 0 48px rgba(240,55,165,0.55));
}
.inst-play svg { width: 100%; height: 100%; display: block; }
.inst-play svg circle {
  fill: rgba(20, 6, 14, 0.35);
  stroke: currentColor;
  stroke-width: 2.4;
}
.inst-play svg polygon {
  fill: currentColor;
}
@keyframes play-pulse {
  0%, 100% { filter:
    drop-shadow(0 0 8px rgba(240,55,165,0.85))
    drop-shadow(0 0 18px rgba(240,55,165,0.55))
    drop-shadow(0 0 32px rgba(240,55,165,0.35)); }
  50%      { filter:
    drop-shadow(0 0 12px rgba(255,90,200,1))
    drop-shadow(0 0 28px rgba(240,55,165,0.75))
    drop-shadow(0 0 50px rgba(240,55,165,0.5)); }
}

/* === Модалка видео === */
.inst-video-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 4, 6, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
}
.inst-video-modal[hidden] { display: none; }
.inst-video-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inst-video-stage video {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 0 60px rgba(240,55,165,0.45);
  border-radius: 6px;
}
.inst-video-credit {
  position: absolute;
  bottom: 4vh;
  left: 4vw;
  width: min(260px, 24vw);
  margin: 0;
  text-align: left;
  font-family: var(--sans, 'Space Grotesk', sans-serif);
  font-weight: 300;
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: rgba(255, 138, 200, 0.55);
  pointer-events: none;
}
.inst-video-credit em {
  color: rgba(255, 138, 200, 0.85);
  font-style: italic;
  font-weight: 400;
}

@media (max-width: 900px) {
  .inst-video-credit {
    position: static;
    width: auto;
    max-width: 86vw;
    margin-top: 16px;
    text-align: center;
    font-size: 11px;
    padding: 0 6vw;
  }
  .inst-video-stage { flex-direction: column; }
}
.inst-video-close {
  position: absolute;
  top: 96px;
  right: 32px;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 50%;
  background: rgba(20, 8, 14, 0.72);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.inst-video-close:hover {
  background: rgba(240, 55, 165, 0.85);
  border-color: rgba(255,255,255,0.6);
  transform: scale(1.06);
}
.inst-hero {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 1;
}
.inst-hero img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}

/* ===== БИЛЕТ-ПРИГЛАСИТЕЛЬНОЕ ===== */
.inst-ticket {
  position: fixed;
  top: 50%;
  right: 0;
  /* закрыт: торчит только правый «корешок» ~95px, с лёгким наклоном */
  transform: translate(calc(100% - 95px), -50%) rotate(-4deg);
  width: 360px;
  height: 560px;
  max-height: 80vh;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 60;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(-14px 16px 32px rgba(0,0,0,0.55));
  transform-origin: center;
}
.inst-ticket:hover {
  transform: translate(calc(100% - 160px), -50%) rotate(-6deg);
}
.inst-ticket.open {
  top: 50%;
  right: auto;
  left: 50%;
  /* открыт: уезжает левее центра и оставляет место под текст справа, чуть-чуть диагонально */
  transform: translate(calc(-50% - 220px), -50%) rotate(-5deg);
  z-index: 200;
  cursor: default;
}

.ticket-card {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
}
.ticket-img {
  position: absolute;
  inset: 0;
  background: url('images/installations/invitation.jpg') center / cover no-repeat;
}

/* Текстовая колонка справа от открытой картины — печатная машинка */
.inst-ticket-text {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(440px, 34vw);
  max-height: 84vh;
  overflow: auto;
  transform: translate(60px, -50%);
  color: #f0e8d8;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
  z-index: 201;
  pointer-events: none;
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.inst-ticket-text.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.55s ease 0.25s, visibility 0s linear 0s;
  pointer-events: auto;
}
.ttx-line {
  margin: 0 0 18px;
  color: rgba(248,240,222,0.92);
  text-shadow: 0 0 1px rgba(0,0,0,0.5);
}
.ttx-line:last-child { margin-bottom: 0; }
/* "Зашифрованные" строки — каждое слово отдельно размыто, чтобы можно было
   на лету «лагом» прочистить одно-два слова через .cw-reveal */
.ttx-cipher {
  color: rgba(140,255,170,0.85);
  letter-spacing: 0.02em;
  user-select: none;
  position: relative;
  animation: cipher-flicker 3.6s ease-in-out infinite;
}
.ttx-cipher::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(0, 30, 10, 0.18) 2px,
    rgba(0, 30, 10, 0.18) 3px
  );
  pointer-events: none;
  mix-blend-mode: overlay;
}
@keyframes cipher-flicker {
  0%, 100% { opacity: 0.78; }
  45%      { opacity: 0.5;  }
  60%      { opacity: 0.92; }
  72%      { opacity: 0.6;  }
}

/* Каждое слово в шифре — размытое и в зелёном цвете. На .cw-reveal — Matrix-вспышка */
.ttx-cipher .cw {
  display: inline-block;
  filter: blur(3.2px);
  color: rgba(120,255,150,0.9);
  transition: filter 0.06s steps(3, end), color 0.06s steps(3, end);
}
.ttx-cipher .cw-reveal {
  filter: blur(0);
  color: #39ff7a;
  text-shadow:
    0 0 4px rgba(57,255,122,0.95),
    0 0 10px rgba(57,255,122,0.7),
    0 0 22px rgba(57,255,122,0.45),
    1px 0 0 rgba(255,0,80,0.45),
    -1px 0 0 rgba(0,180,255,0.45);
  animation: cw-matrix 0.42s steps(8, end);
}
@keyframes cw-matrix {
  0%   { transform: translateY(0)    skewX(0deg);   filter: blur(0)   contrast(1.2); }
  15%  { transform: translateY(-1px) skewX(6deg);   filter: blur(0.8px) contrast(1.6); }
  30%  { transform: translateY(1px)  skewX(-4deg);  filter: blur(0)   contrast(1.4); }
  45%  { transform: translateY(0)    skewX(2deg);   filter: blur(1.2px) contrast(1.7); }
  60%  { transform: translateY(-1px) skewX(-3deg);  filter: blur(0)   contrast(1.3); }
  75%  { transform: translateY(0)    skewX(4deg);   filter: blur(0.6px) contrast(1.5); }
  100% { transform: translateY(0)    skewX(0deg);   filter: blur(0)   contrast(1); }
}

/* Инлайновая «шифр-вставка» внутри обычной строки — без сканлайнов и без отдельной строки */
.ttx-cipher-inline {
  position: static;
  animation: none;
}
.ttx-cipher-inline::after { content: none; }

/* Подложка под открытый билет */
.inst-ticket-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 6, 0.82);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
  z-index: 150;
}
.inst-ticket-backdrop.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0s linear 0s;
}

@media (max-width: 720px) {
  .inst-ticket { width: 78vw; height: 70vh; }
  .inst-ticket.open { left: 50%; transform: translate(-50%, -50%) rotate(-3deg); }
  .inst-ticket-text {
    top: auto; bottom: 6vh; left: 50%;
    width: 86vw; transform: translateX(-50%);
    text-align: center;
  }
}

/* ===== ПРОМЕЖУТОЧНАЯ СТРАНИЦА ИНСТАЛЛЯЦИЙ: КОРОБКИ ===== */
body.page-installations-boxes {
  background: #020202;
  color: #f5f2ec;
  overflow: hidden;
}
body.page-installations-boxes .site-header {
  background: transparent;
}
body.page-installations-boxes .site-footer { display: none; }
.boxes-main {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 58%, rgba(116, 228, 255, 0.13), transparent 32%),
    radial-gradient(circle at 18% 24%, rgba(58, 116, 170, 0.14), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(155, 240, 225, 0.09), transparent 30%),
    linear-gradient(90deg, rgba(116, 228, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(116, 228, 255, 0.026) 1px, transparent 1px),
    linear-gradient(135deg, rgba(1, 6, 18, 0.98), rgba(3, 14, 31, 0.99) 48%, rgba(0, 2, 9, 1));
  background-size: 100% 100%, 100% 100%, 100% 100%, 42px 42px, 42px 42px, 100% 100%;
  padding: 82px 24px 34px;
}
.boxes-stage {
  position: relative;
  width: min(92vmin, 1024px);
  aspect-ratio: 1 / 1;
  isolation: isolate;
}
.boxes-stage::before {
  content: '';
  position: absolute;
  inset: 12% 4% 8%;
  background:
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(116, 228, 255, 0.04) 34px 35px, transparent 35px 70px),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(116, 228, 255, 0.032) 28px 29px, transparent 29px 58px),
    radial-gradient(ellipse at center, rgba(155, 240, 225, 0.12), transparent 62%);
  filter: blur(0.2px);
  opacity: 0.72;
  pointer-events: none;
}
.boxes-stage::after {
  content: '';
  position: absolute;
  inset: 7% 0 6%;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(155, 240, 225, 0.06) 18% 18.4%, transparent 18.4% 51%, rgba(116, 228, 255, 0.045) 51% 51.3%, transparent 51.3% 100%),
    linear-gradient(0deg, transparent 0 33%, rgba(116, 228, 255, 0.04) 33% 33.35%, transparent 33.35% 72%, rgba(155, 240, 225, 0.035) 72% 72.3%, transparent 72.3% 100%);
  opacity: 0.45;
  mix-blend-mode: screen;
  pointer-events: none;
}
.installation-cow {
  position: absolute;
  left: -39%;
  top: -11%;
  z-index: 18;
  display: block;
  width: clamp(310px, 54vmin, 620px);
  height: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  filter:
    drop-shadow(0 0 10px rgba(116, 228, 255, 0.46))
    drop-shadow(0 0 26px rgba(70, 156, 255, 0.24))
    saturate(1.04)
    brightness(1.04);
  transform-origin: 44% 22%;
  animation: cowSoftSway 7.6s ease-in-out infinite;
}
.installation-cow img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.installation-cow::selection { background: transparent; }
body.inverted .installation-cow {
  z-index: 90;
  pointer-events: auto;
}
.installation-cow.is-returned {
  animation: none;
}
.installation-cow.is-flying {
  animation: cowFastShake 0.46s ease-in-out 0s 1, cowFlyAway 0.78s cubic-bezier(0.45, 0, 0.2, 1) 0.42s forwards;
  pointer-events: none;
}
.pixel-clouds {
  position: absolute;
  inset: auto 0 0;
  z-index: 6;
  height: 31%;
  pointer-events: none;
  overflow: visible;
  mix-blend-mode: screen;
}
.pixel-clouds span {
  position: absolute;
  display: block;
  width: var(--cloud-w, 16%);
  height: var(--cloud-h, 12%);
  left: var(--cloud-x, 0);
  bottom: var(--cloud-y, 0);
  opacity: var(--cloud-opacity, 0.34);
  filter: blur(0.1px) drop-shadow(0 0 9px rgba(116, 228, 255, 0.12));
  background:
    linear-gradient(rgba(183, 247, 255, 0.76) 0 0) 12% 46% / 14% 24% no-repeat,
    linear-gradient(rgba(116, 228, 255, 0.58) 0 0) 26% 34% / 18% 32% no-repeat,
    linear-gradient(rgba(212, 255, 255, 0.66) 0 0) 43% 42% / 22% 28% no-repeat,
    linear-gradient(rgba(92, 188, 255, 0.5) 0 0) 63% 52% / 18% 22% no-repeat,
    linear-gradient(rgba(180, 244, 255, 0.42) 0 0) 78% 44% / 13% 20% no-repeat,
    linear-gradient(rgba(116, 228, 255, 0.24) 0 0) 8% 72% / 78% 12% no-repeat;
  animation: pixelCloudDrift var(--cloud-speed, 11s) steps(6, end) infinite;
}
.pixel-clouds-back {
  z-index: 1;
  height: 36%;
  opacity: 0.62;
}
.pixel-clouds-front {
  z-index: 24;
  height: 29%;
  opacity: 0.86;
}
.pixel-clouds-back span:nth-child(1) { --cloud-x: 3%; --cloud-y: 10%; --cloud-w: 18%; --cloud-h: 20%; --cloud-opacity: 0.18; --cloud-speed: 14s; }
.pixel-clouds-back span:nth-child(2) { --cloud-x: 21%; --cloud-y: 0%; --cloud-w: 22%; --cloud-h: 17%; --cloud-opacity: 0.16; --cloud-speed: 16s; animation-delay: -4s; }
.pixel-clouds-back span:nth-child(3) { --cloud-x: 48%; --cloud-y: 7%; --cloud-w: 18%; --cloud-h: 15%; --cloud-opacity: 0.15; --cloud-speed: 13s; animation-delay: -7s; }
.pixel-clouds-back span:nth-child(4) { --cloud-x: 66%; --cloud-y: 2%; --cloud-w: 25%; --cloud-h: 19%; --cloud-opacity: 0.19; --cloud-speed: 15s; animation-delay: -2s; }
.pixel-clouds-back span:nth-child(5) { --cloud-x: 83%; --cloud-y: 12%; --cloud-w: 15%; --cloud-h: 14%; --cloud-opacity: 0.14; --cloud-speed: 17s; animation-delay: -9s; }
.pixel-clouds-front span:nth-child(1) { --cloud-x: -3%; --cloud-y: 1%; --cloud-w: 22%; --cloud-h: 22%; --cloud-opacity: 0.34; --cloud-speed: 10s; }
.pixel-clouds-front span:nth-child(2) { --cloud-x: 14%; --cloud-y: -4%; --cloud-w: 27%; --cloud-h: 18%; --cloud-opacity: 0.28; --cloud-speed: 12s; animation-delay: -5s; }
.pixel-clouds-front span:nth-child(3) { --cloud-x: 35%; --cloud-y: 4%; --cloud-w: 18%; --cloud-h: 16%; --cloud-opacity: 0.25; --cloud-speed: 9s; animation-delay: -3s; }
.pixel-clouds-front span:nth-child(4) { --cloud-x: 52%; --cloud-y: -2%; --cloud-w: 29%; --cloud-h: 19%; --cloud-opacity: 0.3; --cloud-speed: 11s; animation-delay: -8s; }
.pixel-clouds-front span:nth-child(5) { --cloud-x: 73%; --cloud-y: 3%; --cloud-w: 20%; --cloud-h: 17%; --cloud-opacity: 0.27; --cloud-speed: 13s; animation-delay: -6s; }
.pixel-clouds-front span:nth-child(6) { --cloud-x: 87%; --cloud-y: -3%; --cloud-w: 18%; --cloud-h: 14%; --cloud-opacity: 0.23; --cloud-speed: 10s; animation-delay: -1s; }
@keyframes cowSoftSway {
  0%, 100% { transform: rotate(-2.4deg) translate3d(0, 0, 0); }
  50% { transform: rotate(2.1deg) translate3d(2px, -3px, 0); }
}
@keyframes cowFastShake {
  0% { transform: rotate(-2.4deg) translate3d(0, 0, 0) scale(1); }
  32% { transform: rotate(3.2deg) translate3d(1px, -1px, 0) scale(1.004); }
  66% { transform: rotate(-3.4deg) translate3d(-1px, 0, 0) scale(1.006); }
  100% { transform: rotate(2.2deg) translate3d(1px, -1px, 0) scale(1.002); }
}
@keyframes cowFlyAway {
  0% {
    opacity: 1;
    transform: rotate(-2.4deg) translate3d(0, 0, 0) scale(1);
    filter:
      drop-shadow(0 0 10px rgba(116, 228, 255, 0.46))
      drop-shadow(0 0 26px rgba(70, 156, 255, 0.24))
      saturate(1.04)
      brightness(1.04);
  }
  100% {
    opacity: 0;
    transform: rotate(-10deg) translate3d(28px, -118vh, 0) scale(0.72);
    filter:
      drop-shadow(0 0 18px rgba(116, 228, 255, 0.72))
      drop-shadow(0 0 42px rgba(70, 156, 255, 0.34))
      saturate(1.12)
      brightness(1.16);
  }
}
@keyframes pixelCloudDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(9px, -5px, 0) scale(1.025); }
}
.box-button {
  --box-depth: clamp(12px, 1.65vmin, 21px);
  --box-edge: rgba(116, 228, 255, 0.1);
  --box-edge-soft: rgba(116, 228, 255, 0.04);
  --box-fibers:
    repeating-linear-gradient(8deg, rgba(158, 205, 224, 0.018) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(98deg, rgba(11, 18, 34, 0.09) 0 1px, transparent 1px 9px),
    radial-gradient(ellipse at 28% 22%, rgba(116, 228, 255, 0.055), transparent 36%),
    radial-gradient(ellipse at 76% 72%, rgba(58, 116, 170, 0.095), transparent 42%);
  --box-surface:
    radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.06) 0 0.7px, transparent 1.5px),
    radial-gradient(circle at 72% 42%, rgba(155, 240, 225, 0.06) 0 0.7px, transparent 1.6px),
    radial-gradient(circle at 44% 78%, rgba(255, 255, 255, 0.04) 0 0.65px, transparent 1.5px);
  --box-top-texture:
    repeating-linear-gradient(8deg, rgba(158, 205, 224, 0.016) 0 1px, transparent 1px 7px),
    radial-gradient(ellipse at 42% 36%, rgba(116, 228, 255, 0.05), transparent 48%);
  --box-side-texture:
    repeating-linear-gradient(98deg, rgba(9, 16, 31, 0.12) 0 1px, transparent 1px 9px),
    radial-gradient(ellipse at 70% 48%, rgba(58, 116, 170, 0.08), transparent 50%);
  position: absolute;
  right: auto;
  bottom: auto;
  z-index: 3;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background:
    var(--box-surface),
    var(--box-fibers),
    linear-gradient(135deg, rgba(7, 13, 29, 0.99), rgba(13, 34, 58, 0.98) 48%, rgba(4, 8, 20, 0.99));
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  box-shadow:
    0 10px 14px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px var(--box-edge),
    inset 0 0 0 2px rgba(255, 255, 255, 0.014),
    inset 0 0 20px rgba(8, 28, 54, 0.28);
  cursor: grab;
  overflow: visible;
  transform-origin: 50% 100%;
  touch-action: none;
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
  will-change: left, top, transform, filter;
}
body.inverted .box-button {
  cursor: pointer;
}
.box-button.is-dragging {
  cursor: grabbing;
  transition: filter 0.12s ease, box-shadow 0.12s ease;
}
.box-button::before {
  content: '';
  position: absolute;
  left: 0;
  top: calc(var(--box-depth) * -1);
  z-index: 0;
  width: calc(100% + var(--box-depth));
  height: var(--box-depth);
  clip-path: polygon(var(--box-depth) 0, 100% 0, calc(100% - var(--box-depth)) 100%, 0 100%);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.032), transparent 44%),
    var(--box-top-texture),
    linear-gradient(135deg, rgba(16, 42, 68, 0.99), rgba(5, 15, 34, 0.99));
  background-size: 100% 100%, 100% 100%, 100% 100%;
  box-shadow:
    inset 0 0 0 1px var(--box-edge-soft),
    inset 0 -1px 0 rgba(116, 228, 255, 0.07),
    inset 0 0 10px rgba(8, 28, 54, 0.2);
  pointer-events: none;
  transition: opacity 0.24s ease;
}
.box-button::after {
  content: '';
  position: absolute;
  left: 100%;
  top: calc(var(--box-depth) * -1);
  z-index: 0;
  width: var(--box-depth);
  height: calc(100% + var(--box-depth));
  clip-path: polygon(0 var(--box-depth), 100% 0, 100% calc(100% - var(--box-depth)), 0 100%);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 74%),
    var(--box-side-texture),
    linear-gradient(135deg, rgba(3, 9, 24, 0.99), rgba(8, 24, 45, 0.98));
  background-size: 100% 100%, 100% 100%, 100% 100%;
  box-shadow:
    8px 9px 13px rgba(0, 0, 0, 0.32),
    inset 1px 0 0 rgba(116, 228, 255, 0.07),
    inset 0 0 0 1px var(--box-edge-soft);
  pointer-events: none;
  transition: opacity 0.24s ease;
}
.box-button:hover,
.box-button:focus-visible {
  z-index: calc(var(--box-z, 3) + 1);
  transform: translateY(-2px) scale(1.01) rotate(var(--box-tilt, 0deg));
  filter: saturate(1.03) contrast(1.02);
  box-shadow:
    0 11px 15px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(116, 228, 255, 0.13),
    inset 0 0 0 2px rgba(255, 255, 255, 0.018),
    inset 0 0 20px rgba(8, 28, 54, 0.32);
  outline: none;
}
.box-button:hover::before,
.box-button:focus-visible::before,
.box-button:hover::after,
.box-button:focus-visible::after {
  opacity: 0.94;
}
.box-button:active {
  transform: translateY(-1px) scale(0.996) rotate(var(--box-tilt, 0deg));
}
.box-button.matrix-cosmos {
  --box-edge: rgba(180, 244, 255, 0.24);
  --box-edge-soft: rgba(180, 244, 255, 0.12);
  --box-fibers:
    repeating-linear-gradient(90deg, rgba(154, 238, 255, 0.11) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(0deg, rgba(197, 249, 255, 0.075) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(135deg, rgba(94, 166, 255, 0.07) 0 1px, transparent 1px 18px),
    radial-gradient(ellipse at 26% 24%, rgba(178, 249, 255, 0.23), transparent 38%),
    radial-gradient(ellipse at 78% 70%, rgba(93, 178, 255, 0.2), transparent 44%);
  --box-surface:
    radial-gradient(circle at 17% 22%, rgba(238, 255, 255, 0.92) 0 0.95px, transparent 1.9px),
    radial-gradient(circle at 68% 31%, rgba(164, 244, 255, 0.9) 0 0.8px, transparent 1.8px),
    radial-gradient(circle at 42% 66%, rgba(220, 251, 255, 0.75) 0 0.7px, transparent 1.7px),
    radial-gradient(circle at 82% 78%, rgba(115, 206, 255, 0.72) 0 0.8px, transparent 1.8px),
    linear-gradient(90deg, transparent 0 24%, rgba(193, 249, 255, 0.16) 24% 24.8%, transparent 24.8% 58%, rgba(120, 207, 255, 0.12) 58% 58.7%, transparent 58.7%),
    linear-gradient(0deg, transparent 0 36%, rgba(193, 249, 255, 0.12) 36% 36.7%, transparent 36.7% 76%, rgba(120, 207, 255, 0.1) 76% 76.7%, transparent 76.7%);
  --box-top-texture:
    radial-gradient(circle at 24% 40%, rgba(238, 255, 255, 0.62) 0 0.75px, transparent 1.7px),
    repeating-linear-gradient(90deg, rgba(193, 249, 255, 0.105) 0 1px, transparent 1px 10px),
    radial-gradient(ellipse at 46% 42%, rgba(176, 246, 255, 0.28), transparent 50%);
  --box-side-texture:
    repeating-linear-gradient(0deg, rgba(117, 207, 255, 0.1) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(115deg, rgba(214, 252, 255, 0.065) 0 1px, transparent 1px 16px),
    radial-gradient(ellipse at 62% 52%, rgba(101, 184, 255, 0.22), transparent 52%);
  background:
    var(--box-surface),
    var(--box-fibers),
    linear-gradient(135deg, rgba(31, 76, 106, 0.99), rgba(19, 101, 142, 0.98) 48%, rgba(9, 33, 68, 0.99));
  box-shadow:
    0 10px 16px rgba(0, 0, 0, 0.46),
    0 0 18px rgba(122, 219, 255, 0.08),
    inset 0 0 0 1px var(--box-edge),
    inset 0 0 0 2px rgba(255, 255, 255, 0.035),
    inset 0 0 24px rgba(129, 226, 255, 0.18);
}
.box-button.matrix-cosmos::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), transparent 44%),
    var(--box-top-texture),
    linear-gradient(135deg, rgba(61, 140, 174, 0.99), rgba(13, 61, 111, 0.99));
}
.box-button.matrix-cosmos::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 74%),
    var(--box-side-texture),
    linear-gradient(135deg, rgba(9, 42, 82, 0.99), rgba(22, 91, 126, 0.98));
}
body.inverted .box-button.matrix-cosmos .box-art {
  opacity: 0.3;
  filter:
    saturate(1.22)
    contrast(1.05)
    brightness(1.24)
    drop-shadow(0 0 5px rgba(179, 246, 255, 0.16));
}
.box-art,
.box-replacement,
.box-dino {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.box-art {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 72%;
  height: 72%;
  object-fit: contain;
  opacity: 0;
  mix-blend-mode: screen;
  filter:
    saturate(0.9)
    contrast(0.95)
    drop-shadow(0 0 2px rgba(116, 228, 255, 0.05));
  animation: boxTwinkle 6.8s ease-in-out infinite;
  transform: translate(-50%, -50%);
  transition: transform 0.24s ease, opacity 0.24s ease, filter 0.24s ease;
}
body.inverted .box-art {
  width: 115%;
  height: 115%;
  opacity: 0.18;
  transform: translate(-50%, -50%);
}
body.inverted .box-button:hover .box-art,
body.inverted .box-button:focus-visible .box-art {
  transform: translate(-50%, calc(-50% - 0.5px));
  opacity: 0.24;
  filter:
    saturate(0.96)
    contrast(0.99)
    drop-shadow(0 0 3px rgba(116, 228, 255, 0.07));
}
.box-replacement {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 115%;
  height: 115%;
  border-radius: 1px;
  object-fit: contain;
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate(-50%, -50%);
  filter:
    saturate(1.02)
    contrast(1.02)
    drop-shadow(0 0 4px rgba(155, 240, 225, 0.1));
}
body.inverted .box-replacement {
  opacity: 0.84;
}
body.inverted .box-button.has-replacement .box-art { opacity: 0.17; }
.box-dino {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 122%;
  height: 122%;
  opacity: 0;
  mix-blend-mode: screen;
  object-fit: contain;
  transform: translate(-50%, -50%) scale(0.96);
  filter:
    saturate(1.1)
    contrast(1.06)
    brightness(1.12)
    drop-shadow(0 0 7px rgba(155, 240, 225, 0.26));
  transition: opacity 0.24s ease, transform 0.24s ease, filter 0.24s ease;
}
body.inverted .box-dino {
  opacity: 0.88;
}
body.inverted .box-button:hover .box-dino,
body.inverted .box-button:focus-visible .box-dino {
  opacity: 0.96;
  transform: translate(-50%, calc(-50% - 1px)) scale(1);
  filter:
    saturate(1.18)
    contrast(1.08)
    brightness(1.18)
    drop-shadow(0 0 10px rgba(155, 240, 225, 0.34));
}
.box-04 .box-dino {
  width: 132%;
  height: 132%;
}

.box-button .box-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 58%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(183, 247, 255, 0.34);
  border-radius: 50%;
  color: #d9ffff;
  font-family: var(--display, 'Unbounded', sans-serif);
  font-size: clamp(16px, 4.2vmin, 44px);
  line-height: 1;
  text-shadow:
    0 0 8px rgba(155, 240, 225, 0.92),
    0 0 20px rgba(116, 228, 255, 0.55),
    0 0 34px rgba(240, 55, 165, 0.28);
  background:
    radial-gradient(circle, rgba(5, 18, 34, 0.72) 0 44%, rgba(116, 228, 255, 0.13) 45% 46%, transparent 48%),
    conic-gradient(from 0deg, transparent 0 18%, rgba(155, 240, 225, 0.95) 19% 28%, transparent 29% 54%, rgba(240, 55, 165, 0.72) 55% 63%, transparent 64% 100%);
  box-shadow:
    0 0 18px rgba(116, 228, 255, 0.3),
    inset 0 0 14px rgba(155, 240, 225, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.72) rotate(0deg);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.box-button .box-loader::before {
  content: var(--box-loader-symbol, '✦');
  position: relative;
  z-index: 2;
  animation: boxLoaderPulse 0.58s ease-in-out infinite alternate;
}
.box-button .box-loader::after {
  content: '';
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  border: 1px dashed rgba(217, 255, 255, 0.48);
  animation: boxLoaderReverse 1.2s linear infinite;
}
.box-button.is-unpacking .box-loader {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(360deg);
  animation: boxLoaderSpin 0.86s linear infinite;
}
.box-03 .box-loader,
.box-11 .box-loader,
.box-15 .box-loader {
  width: 64%;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: clamp(20px, 5vmin, 52px);
}
.box-03 .box-loader::before,
.box-11 .box-loader::before,
.box-15 .box-loader::before {
  content: var(--box-loader-symbol, '✦');
  animation: boxLoaderPulse 0.44s ease-in-out infinite alternate;
}
.box-03 .box-loader::after,
.box-11 .box-loader::after,
.box-15 .box-loader::after {
  inset: auto;
  width: 68%;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(155, 240, 225, 0.95), rgba(240, 55, 165, 0.82), transparent);
  box-shadow: 0 0 12px rgba(116, 228, 255, 0.72);
  animation: boxLoaderBarSpin 0.72s linear infinite;
}
.box-11 .box-loader::after {
  width: 3px;
  height: 72%;
}
.box-15 .box-loader::after {
  width: 82%;
  height: 82%;
  border-radius: 1px;
  background:
    linear-gradient(rgba(155, 240, 225, 0.95) 0 0) 50% 0 / 3px 100% no-repeat,
    linear-gradient(rgba(240, 55, 165, 0.78) 0 0) 0 50% / 100% 3px no-repeat;
}
.box-04 .box-loader {
  width: 78%;
  height: 30%;
  aspect-ratio: auto;
  border-radius: 999px;
  border-color: rgba(217, 255, 255, 0.28);
  background: rgba(2, 8, 18, 0.74);
  box-shadow:
    0 0 20px rgba(116, 228, 255, 0.22),
    inset 0 0 0 1px rgba(155, 240, 225, 0.12);
  overflow: hidden;
}
.box-04 .box-loader::before {
  content: attr(data-percent);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  font-size: clamp(10px, 1.9vmin, 18px);
  letter-spacing: 0.08em;
}
.box-04 .box-loader::after {
  inset: 4px auto 4px 4px;
  width: calc(100% - 8px);
  border: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #9BF0E1, #74E4FF 58%, #F037A5);
  box-shadow: 0 0 18px rgba(116, 228, 255, 0.62);
  transform: scaleX(0);
  transform-origin: left center;
}
.box-04.is-unpacking .box-loader::after {
  animation: boxLoaderProgress var(--box-loader-duration, 2800ms) linear forwards;
}
.box-button.is-unpacking .box-art,
.box-button.is-unpacking .box-replacement {
  opacity: 0.08;
  filter: blur(0.7px) saturate(1.25) drop-shadow(0 0 8px rgba(116, 228, 255, 0.42));
}

@keyframes boxLoaderSpin {
  to { transform: translate(-50%, -50%) scale(1) rotate(360deg); }
}
@keyframes boxLoaderReverse {
  to { transform: rotate(-360deg); }
}
@keyframes boxLoaderBarSpin {
  to { transform: rotate(360deg); }
}
@keyframes boxLoaderPulse {
  from { transform: scale(0.84); opacity: 0.74; }
  to { transform: scale(1.14); opacity: 1; }
}
@keyframes boxLoaderProgress {
  to { transform: scaleX(1); }
}
@keyframes boxTwinkle {
  0%, 100% {
    filter:
      saturate(0.88)
      contrast(0.95)
      drop-shadow(0 0 1px rgba(116, 228, 255, 0.04));
  }
  50% {
    filter:
      saturate(0.96)
      contrast(0.99)
      drop-shadow(0 0 2px rgba(116, 228, 255, 0.065));
  }
}

/* Композиция: пять коробок сложены как реальная складская стопка, три лежат отдельно по краям */
.box-01,
.box-02,
.box-03,
.box-04,
.box-05 {
  --box-depth: clamp(10px, 1.35vmin, 17px);
  --box-tilt: 0deg;
  transform: rotate(var(--box-tilt));
}
.box-01 {
  left: 46.0%; top: 49.0%; width: 21.4%; height: 15.5%; --box-z: 14; z-index: var(--box-z);
  --box-surface: linear-gradient(rgba(116, 228, 255, 0.055) 0 0) 72% 24% / 3px 3px no-repeat, linear-gradient(135deg, rgba(12, 28, 48, 0.18), transparent 58%);
}
.box-02 {
  left: 34.0%; top: 61.2%; width: 18.8%; height: 13.6%; --box-z: 12; z-index: var(--box-z);
}
.box-03 {
  left: 57.6%; top: 62.0%; width: 18.8%; height: 13.6%; --box-z: 12; z-index: var(--box-z);
  --box-surface: linear-gradient(rgba(116, 228, 255, 0.048) 0 0) 30% 66% / 4px 3px no-repeat, linear-gradient(135deg, rgba(8, 20, 39, 0.18), transparent 60%);
}
.box-04 {
  left: 31.0%; top: 75.6%; width: 24.2%; height: 15.6%; --box-z: 10; z-index: var(--box-z);
  --box-surface: linear-gradient(rgba(155, 240, 225, 0.045) 0 0) 22% 34% / 3px 3px no-repeat, linear-gradient(135deg, rgba(5, 18, 34, 0.2), transparent 58%);
}
.box-05 {
  left: 55.6%; top: 76.0%; width: 21.4%; height: 13.8%; --box-z: 10; z-index: var(--box-z);
}
.box-06 {
  left: 20.5%; top: 64.0%; width: 17.0%; height: 13.5%; --box-z: 7; z-index: var(--box-z); --box-tilt: -3deg;
  transform: rotate(var(--box-tilt));
}
.box-07 {
  left: 73.4%; top: 65.2%; width: 20.6%; height: 15.4%; --box-z: 7; z-index: var(--box-z); --box-tilt: 3deg;
  transform: rotate(var(--box-tilt));
  --box-surface: linear-gradient(rgba(116, 228, 255, 0.046) 0 0) 24% 28% / 3px 3px no-repeat, linear-gradient(135deg, rgba(8, 20, 38, 0.18), transparent 58%);
}
.box-08 {
  left: 15.8%; top: 78.4%; width: 19.0%; height: 12.8%; --box-z: 8; z-index: var(--box-z); --box-tilt: 0.8deg;
  transform: rotate(var(--box-tilt));
}
.box-small {
  --box-depth: clamp(6px, 0.82vmin, 11px);
}
.box-09 {
  left: 38.0%; top: 50.6%; width: 9.4%; height: 6.8%; --box-z: 9; z-index: var(--box-z); --box-tilt: -4deg;
  transform: rotate(var(--box-tilt));
}
.box-10 {
  left: 77.0%; top: 81.2%; width: 10.7%; height: 6.9%; --box-z: 9; z-index: var(--box-z); --box-tilt: 5deg;
  transform: rotate(var(--box-tilt));
}
.box-11 {
  left: 63.6%; top: 48.0%; width: 9.4%; height: 6.8%; --box-z: 8; z-index: var(--box-z); --box-tilt: 2deg;
  transform: rotate(var(--box-tilt));
}
.box-12 {
  left: 19.8%; top: 55.4%; width: 10.7%; height: 6.9%; --box-z: 8; z-index: var(--box-z); --box-tilt: -1.5deg;
  transform: rotate(var(--box-tilt));
}
.box-13 {
  left: 43.6%; top: 91.0%; width: 9.5%; height: 6.4%; --box-z: 9; z-index: var(--box-z); --box-tilt: 3.5deg;
  transform: rotate(var(--box-tilt));
}
.box-round {
  --box-depth: clamp(7px, 0.95vmin, 12px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.14), transparent 22%),
    radial-gradient(circle at 66% 78%, rgba(0, 0, 0, 0.24), transparent 34%),
    var(--box-surface),
    var(--box-fibers),
    linear-gradient(135deg, rgba(10, 30, 52, 0.99), rgba(18, 74, 102, 0.98) 48%, rgba(5, 12, 30, 0.99));
  box-shadow:
    9px 11px 16px rgba(0, 0, 0, 0.42),
    -4px -5px 10px rgba(155, 240, 225, 0.07),
    inset -9px -11px 17px rgba(0, 0, 0, 0.36),
    inset 7px 7px 14px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px var(--box-edge);
}
.box-round::before {
  left: 12%;
  top: 8%;
  width: 54%;
  height: 28%;
  border-radius: 50%;
  clip-path: none;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.22), transparent 70%);
  box-shadow: none;
  opacity: 0.78;
}
.box-round::after {
  left: 56%;
  top: 18%;
  width: 36%;
  height: 70%;
  border-radius: 50%;
  clip-path: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.26), transparent 72%);
  box-shadow: none;
  opacity: 0.76;
}
.box-round .box-art,
.box-round .box-replacement {
  border-radius: 50%;
}
.box-pentagon {
  --box-depth: clamp(7px, 1vmin, 13px);
  clip-path: polygon(50% 0, 100% 36%, 82% 100%, 18% 100%, 0 36%);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 36%),
    linear-gradient(35deg, transparent 0 55%, rgba(0, 0, 0, 0.28) 55% 100%),
    var(--box-surface),
    var(--box-fibers),
    linear-gradient(135deg, rgba(9, 27, 52, 0.99), rgba(24, 82, 109, 0.98) 52%, rgba(5, 12, 30, 0.99));
  filter: drop-shadow(10px 12px 10px rgba(0, 0, 0, 0.38));
  box-shadow:
    inset -8px -10px 14px rgba(0, 0, 0, 0.34),
    inset 7px 6px 13px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px var(--box-edge);
}
.box-pentagon::before {
  left: 15%;
  top: 9%;
  width: 70%;
  height: 42%;
  clip-path: polygon(50% 0, 100% 48%, 78% 100%, 22% 100%, 0 48%);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
  box-shadow: none;
  opacity: 0.74;
}
.box-pentagon::after {
  left: 50%;
  top: 33%;
  width: 42%;
  height: 62%;
  clip-path: polygon(20% 0, 100% 18%, 72% 100%, 0 86%);
  background: linear-gradient(120deg, rgba(0, 0, 0, 0.24), transparent 72%);
  box-shadow: none;
  opacity: 0.78;
}
.box-14 {
  left: 25.2%; top: 79.8%; width: 8.8%; height: 8.8%; --box-z: 11; z-index: var(--box-z); --box-tilt: -7deg;
  transform: rotate(var(--box-tilt));
}
.box-15 {
  left: 77.0%; top: 55.0%; width: 6.8%; height: 6.8%; --box-z: 12; z-index: var(--box-z); --box-tilt: 5deg;
  transform: rotate(var(--box-tilt));
}
.box-16 {
  left: 66.8%; top: 84.0%; width: 10.2%; height: 9.6%; --box-z: 10; z-index: var(--box-z); --box-tilt: -4deg;
  transform: rotate(var(--box-tilt));
}
.box-17 {
  left: 30.4%; top: 52.2%; width: 7.4%; height: 7.0%; --box-z: 13; z-index: var(--box-z); --box-tilt: 6deg;
  transform: rotate(var(--box-tilt));
}
.box-01,
.box-03,
.box-07,
.box-10,
.box-12,
.box-14,
.box-16 {
  --box-edge: rgba(20, 64, 88, 0.42);
  --box-edge-soft: rgba(72, 18, 92, 0.2);
  --box-fibers:
    linear-gradient(rgba(28, 76, 98, 0.78) 0 0) 20% 22% / 8px 1px no-repeat,
    linear-gradient(rgba(28, 76, 98, 0.78) 0 0) 23% 19% / 1px 7px no-repeat,
    linear-gradient(rgba(86, 18, 95, 0.6) 0 0) 68% 34% / 9px 1px no-repeat,
    linear-gradient(rgba(86, 18, 95, 0.6) 0 0) 72% 31% / 1px 7px no-repeat,
    repeating-linear-gradient(90deg, rgba(22, 72, 95, 0.11) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(0deg, rgba(74, 30, 92, 0.08) 0 1px, transparent 1px 13px);
  --box-surface:
    radial-gradient(circle at 22% 26%, rgba(22, 75, 98, 0.36), transparent 22%),
    radial-gradient(circle at 74% 62%, rgba(86, 16, 92, 0.26), transparent 28%),
    linear-gradient(rgba(18, 62, 86, 0.84) 0 0) 18% 18% / 6px 2px no-repeat,
    linear-gradient(rgba(18, 62, 86, 0.84) 0 0) 21% 16% / 2px 6px no-repeat,
    repeating-linear-gradient(110deg, rgba(0, 0, 0, 0.055) 0 1px, transparent 1px 12px);
  box-shadow:
    0 10px 16px rgba(0, 0, 0, 0.44),
    0 0 24px rgba(40, 16, 80, 0.22),
    0 0 16px rgba(18, 70, 98, 0.18),
    inset 0 0 0 1px var(--box-edge),
    inset 0 0 0 2px rgba(0, 0, 0, 0.055),
    inset 0 0 25px rgba(18, 70, 98, 0.16);
}
.box-02,
.box-05,
.box-08 {
  --box-edge: rgba(172, 242, 255, 0.3);
  --box-edge-soft: rgba(172, 242, 255, 0.14);
  --box-fibers:
    linear-gradient(rgba(195, 250, 255, 0.72) 0 0) 18% 24% / 7px 1px no-repeat,
    linear-gradient(rgba(195, 250, 255, 0.72) 0 0) 21% 21% / 1px 6px no-repeat,
    linear-gradient(rgba(116, 220, 255, 0.64) 0 0) 66% 31% / 8px 1px no-repeat,
    linear-gradient(rgba(116, 220, 255, 0.64) 0 0) 70% 28% / 1px 6px no-repeat,
    linear-gradient(rgba(226, 255, 255, 0.68) 0 0) 42% 68% / 6px 1px no-repeat,
    linear-gradient(rgba(226, 255, 255, 0.68) 0 0) 45% 65% / 1px 5px no-repeat,
    repeating-linear-gradient(90deg, rgba(145, 232, 255, 0.055) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(215, 253, 255, 0.035) 0 1px, transparent 1px 16px);
  --box-surface:
    linear-gradient(rgba(215, 253, 255, 0.9) 0 0) 15% 18% / 5px 2px no-repeat,
    linear-gradient(rgba(215, 253, 255, 0.9) 0 0) 17% 16% / 2px 5px no-repeat,
    linear-gradient(rgba(144, 229, 255, 0.8) 0 0) 33% 47% / 6px 2px no-repeat,
    linear-gradient(rgba(144, 229, 255, 0.8) 0 0) 36% 45% / 2px 6px no-repeat,
    linear-gradient(rgba(239, 255, 255, 0.86) 0 0) 61% 27% / 7px 2px no-repeat,
    linear-gradient(rgba(239, 255, 255, 0.86) 0 0) 64% 25% / 2px 7px no-repeat,
    linear-gradient(rgba(111, 212, 255, 0.76) 0 0) 79% 62% / 6px 2px no-repeat,
    linear-gradient(rgba(111, 212, 255, 0.76) 0 0) 82% 60% / 2px 6px no-repeat,
    linear-gradient(rgba(198, 248, 255, 0.5) 0 0) 48% 82% / 4px 4px no-repeat,
    linear-gradient(rgba(184, 242, 255, 0.38) 0 0) 24% 74% / 9px 1px no-repeat,
    linear-gradient(rgba(105, 202, 255, 0.36) 0 0) 72% 46% / 1px 8px no-repeat,
    repeating-linear-gradient(90deg, rgba(178, 246, 255, 0.05) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(0deg, rgba(104, 202, 255, 0.04) 0 1px, transparent 1px 18px);
  background:
    var(--box-surface),
    var(--box-fibers),
    linear-gradient(135deg, rgba(36, 92, 126, 0.99), rgba(19, 114, 158, 0.98) 46%, rgba(10, 43, 86, 0.99));
  box-shadow:
    0 10px 16px rgba(0, 0, 0, 0.46),
    0 0 20px rgba(123, 224, 255, 0.12),
    inset 0 0 0 1px var(--box-edge),
    inset 0 0 0 2px rgba(255, 255, 255, 0.035),
    inset 0 0 24px rgba(117, 224, 255, 0.18);
}
.box-02::before,
.box-05::before,
.box-08::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 48%),
    linear-gradient(rgba(223, 255, 255, 0.72) 0 0) 24% 42% / 7px 1px no-repeat,
    linear-gradient(rgba(223, 255, 255, 0.72) 0 0) 27% 39% / 1px 6px no-repeat,
    linear-gradient(rgba(129, 220, 255, 0.58) 0 0) 63% 30% / 6px 1px no-repeat,
    linear-gradient(rgba(129, 220, 255, 0.58) 0 0) 66% 27% / 1px 5px no-repeat,
    repeating-linear-gradient(90deg, rgba(198, 249, 255, 0.05) 0 1px, transparent 1px 17px),
    linear-gradient(135deg, rgba(66, 148, 178, 0.99), rgba(16, 69, 118, 0.99));
}
.box-02::after,
.box-05::after,
.box-08::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 76%),
    linear-gradient(rgba(206, 252, 255, 0.48) 0 0) 40% 24% / 5px 1px no-repeat,
    linear-gradient(rgba(206, 252, 255, 0.48) 0 0) 43% 21% / 1px 5px no-repeat,
    linear-gradient(rgba(114, 210, 255, 0.46) 0 0) 69% 65% / 6px 1px no-repeat,
    linear-gradient(rgba(114, 210, 255, 0.46) 0 0) 72% 62% / 1px 5px no-repeat,
    repeating-linear-gradient(0deg, rgba(178, 239, 255, 0.045) 0 1px, transparent 1px 15px),
    linear-gradient(135deg, rgba(9, 45, 88, 0.99), rgba(22, 96, 134, 0.98));
}
body.inverted .box-02 .box-art,
body.inverted .box-05 .box-art,
body.inverted .box-08 .box-art {
  opacity: 0.36;
  filter:
    saturate(1.18)
    contrast(1.05)
    brightness(1.18)
    drop-shadow(0 0 6px rgba(185, 247, 255, 0.18));
}

.boxes-hint,
.inst-saved-link,
.boxes-unpacking-note {
  position: fixed;
  z-index: 20;
  font-family: var(--sans, 'Space Grotesk', sans-serif);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: rgba(245, 242, 236, 0.62);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}
.boxes-hint {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  text-align: center;
  width: min(88vw, 620px);
}
.inst-saved-link {
  right: 24px;
  bottom: 18px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.inst-saved-link:hover {
  color: #9BF0E1;
  transform: translateX(3px);
}
.boxes-unpacking-note {
  top: 94px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(42vw, 520px);
  min-height: 112px;
  padding: 16px 20px;
  border: 1px solid rgba(155, 240, 225, 0.2);
  border-radius: 22px;
  background: rgba(2, 8, 18, 0.42);
  box-shadow:
    0 0 22px rgba(116, 228, 255, 0.12),
    inset 0 0 18px rgba(155, 240, 225, 0.05);
  color: rgba(245, 242, 236, 0.9);
  font-size: clamp(13px, 1.08vw, 17px);
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: none;
  line-height: 1.36;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(10px, -8px, 0);
  transition: opacity 0.32s ease, visibility 0.32s ease, transform 0.32s ease;
  pointer-events: none;
}
.boxes-unpacking-note.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
}

@media (max-width: 760px) {
  body.page-installations-boxes { overflow: auto; }
  .boxes-main {
    position: relative;
    min-height: 100vh;
    padding: 92px 12px 72px;
  }
  .boxes-stage { width: 96vw; }
  .installation-cow {
    left: -40%;
    top: -8%;
    width: clamp(250px, 66vw, 390px);
  }
  .pixel-clouds-front { height: 25%; }
  .pixel-clouds-back { height: 32%; }
  .box-button:hover,
  .box-button:focus-visible {
    transform: translateY(-1px) scale(1.008);
  }
  .boxes-hint {
    bottom: 42px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .boxes-unpacking-note {
    top: 86px;
    right: 12px;
    width: min(82vw, 380px);
    min-height: 96px;
    padding: 12px 14px;
    font-size: 12px;
    letter-spacing: 0.025em;
  }
  .inst-saved-link {
    right: 50%;
    bottom: 14px;
    transform: translateX(50%);
  }
  .inst-saved-link:hover { transform: translateX(50%); }
}

.mus-title { display: none; }

.mus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5vw;
  align-items: center;
  justify-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.mus-card {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  text-align: center;
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mus-card:hover { transform: translateY(-6px); }
.mus-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mus-card-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mus-card:hover .mus-card-img img { transform: scale(1.04); }
.mus-card-label {
  margin-top: 22px;
  font-family: var(--sans, 'Space Grotesk', sans-serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #1a1320;
}

@media (max-width: 900px) {
  .mus-grid { grid-template-columns: 1fr; gap: 40px; }
  .mus-room { padding: 90px 6vw 60px; }
}

/* Модалка с работой / эффектом */
.mus-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 8, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 4vh 4vw;
}
.mus-modal[hidden] { display: none; }
.mus-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  color: #f4f0e8;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.mus-close:hover { opacity: 1; }
.mus-modal-stage {
  position: relative;
  width: min(90vw, 1100px);
  height: min(80vh, 760px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mus-modal-stage canvas { display: block; cursor: crosshair; }
.mus-modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.mus-clickable { cursor: pointer; user-select: none; -webkit-user-select: none; }
.mus-pulse { animation: mus-pulse-anim 220ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes mus-pulse-anim {
  0%   { transform: scale(1); filter: brightness(1); }
  35%  { transform: scale(0.965); filter: brightness(1.15); }
  100% { transform: scale(1); filter: brightness(1); }
}
.mus-modal-caption {
  margin-top: 22px;
  font-family: var(--sans, 'Space Grotesk', sans-serif);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(244,240,232,0.75);
}
.mus-modal-hint {
  margin-top: 4px;
  font-family: var(--sans, 'Manrope', sans-serif);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244,240,232,0.45);
}

/* ============== КАК НА МЕНЯ ПОВЛИЯЛИ ДИНОЗАВРЫ ============== */
body.page-dinosaurs {
  background: #1a0612;
  overflow: hidden;
  /* пиксельная кирка 128×128 (максимум для курсоров); hotspot в кончике головы */
  cursor: url('images/works/pickaxe-cursor.png') 112 16, crosshair;
}
body.page-dinosaurs * { cursor: inherit; }
body.page-dinosaurs .site-footer { background: #1a0612; color: #d99bb8; }

.din-room {
  position: relative;
  margin-top: 70px;
  padding: 0;
  width: 100%;
  height: calc(100vh - 70px);
  min-height: 600px;
  overflow: hidden;
}

.din-glitter {
  position: absolute;
  inset: 0;
  background-image: url('images/works/pink-glitter-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* мягкая виньетка чтобы текст лучше читался */
.din-glitter::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 45%, rgba(20,4,12,0.45) 100%);
  pointer-events: none;
}

.din-quote {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 5;
  font-family: var(--serif, 'Playfair Display', serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(28px, 4.5vw, 64px);
  line-height: 1.2;
  text-align: center;
  color: #ffffff;
  letter-spacing: 0.005em;
  text-shadow:
    0 2px 18px rgba(80, 10, 40, 0.55),
    0 0 40px rgba(255, 180, 210, 0.25);
  padding: 0 6vw;
  pointer-events: none;
  user-select: none;
}

.din-back {
  position: absolute;
  top: 22px;
  left: 32px;
  z-index: 30;
  color: #fff;
  text-shadow: 0 1px 8px rgba(60,10,30,0.7);
}
.din-back:hover { color: #ffd6e8; }

/* ============== ТЕКСТОВЫЕ БЛОКИ (about) ============== */
.page-about .inner { padding-top: 105px; }
.page-about .page-head { margin-bottom: 30px; }
.page-about .page-title { margin-bottom: 0; color: #efb3de; }
.page-about .text-block { border-top: 0; }
.page-about .page-head + .text-block { padding: 0 0 40px; }
.page-about .text-block + .text-block { padding-top: 24px; }
.page-about .text-block .block-label {
  margin-bottom: 32px;
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 42px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.035em;
  color: #4d7489;
  opacity: .68;
  filter: blur(.35px);
  text-shadow: -1.4px 0 rgba(96, 187, 226, .25), 1.4px .5px rgba(53, 92, 186, .2), 0 0 9px rgba(92, 170, 217, .22);
  animation: cv-chromatic 16s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .page-about .text-block .block-label { animation: none; } }
@media (max-width: 560px) { .page-about .inner { padding-top: 92px; } }
.text-block {
  padding: 80px 0;
  border-top: 1px solid var(--line);
}
.text-block:first-of-type { border-top: 0; padding-top: 0; }
.block-label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 40px;
}
.text-cols {
  columns: 2;
  column-gap: 60px;
}
.text-cols p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 18px;
  break-inside: avoid;
}
.lede {
  font-family: var(--serif-it);
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 56px;
  max-width: 900px;
}

/* ============== CV / ОБРАЗОВАНИЕ ============== */
.cv-page { padding-top: 105px; padding-bottom: 80px; font-family: var(--sans-2); font-size: 14px; }
.cv-hero { position: relative; height: clamp(100px, 15vw, 185px); margin-bottom: 12px; }
.cv-hero-title { position: relative; height: 100%; font-family: var(--display); font-weight: 500; cursor: default; }
.cv-hero-blur {
  position: absolute;
  top: 6%; left: 0;
  width: max-content;
  padding-right: .2em;
  white-space: nowrap;
  font-size: clamp(31px, 8vw, 124px);
  line-height: 1.2;
  letter-spacing: -.065em;
  /* Размываем сами буквы, а не весь прямоугольник слоя: filter + движущаяся
     mask в WebKit может оставлять цветную полосу при перерисовке. */
  color: transparent;
  text-shadow: 0 0 clamp(4px, .7vw, 10px) #7baec8;
  opacity: .95;
  user-select: none;
  -webkit-mask-image: radial-gradient(circle 90px at var(--education-x, -300px) var(--education-y, -300px), rgba(0, 0, 0, .3), rgba(0, 0, 0, .7) 45px, #000 90px);
  mask-image: radial-gradient(circle 90px at var(--education-x, -300px) var(--education-y, -300px), rgba(0, 0, 0, .3), rgba(0, 0, 0, .7) 45px, #000 90px);
}
@media (hover: none), (prefers-reduced-motion: reduce) {
  .cv-hero-blur { -webkit-mask-image: none; mask-image: none; }
}
.cv-hero-foreground {
  position: absolute;
  top: 44%; left: 2%;
  font-size: clamp(32px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -.04em;
  color: #253d4c;
  text-shadow: -1.4px 0 rgba(96, 187, 226, .4), 1.4px .5px rgba(53, 92, 186, .3), 0 0 5px rgba(92, 170, 217, .15);
  animation: cv-chromatic 16s ease-in-out infinite;
}
@keyframes cv-chromatic {
  0%, 78%, 89%, 100% {
    transform: translateX(0);
    text-shadow: -1.4px 0 rgba(96, 187, 226, .4), 1.4px .5px rgba(53, 92, 186, .3), 0 0 5px rgba(92, 170, 217, .15);
  }
  80%, 86% {
    transform: translateX(.35px);
    text-shadow: -3px 0 rgba(96, 187, 226, .55), 3px .3px rgba(53, 92, 186, .5), 0 0 7px rgba(92, 170, 217, .2);
  }
  83% {
    transform: translateX(-.35px);
    text-shadow: -4.5px 0 rgba(96, 187, 226, .65), 4.5px .4px rgba(53, 92, 186, .6), 0 0 8px rgba(92, 170, 217, .24);
  }
}
@media (prefers-reduced-motion: reduce) { .cv-hero-foreground { animation: none; } }
.cv-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 5vw, 80px); }
.cv-section { min-width: 0; }
.cv-section-title { margin-bottom: 12px; font-family: inherit; font-size: 20px; font-weight: 600; line-height: 1.4; letter-spacing: 0; cursor: default; }
.cv-category { margin: 22px 0 4px; font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #56768a; }
.cv-section-title + .cv-category { margin-top: 0; }
.cv-entries { list-style: none; margin: 0; padding: 0; }
.cv-entries li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cv-entries li:last-child { border-bottom: 0; }
.cv-year { padding-top: 1px; font-family: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; letter-spacing: 0; color: #95bbcf; }
.cv-entries h3, .cv-entries h4 { margin: 0; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; letter-spacing: 0; }
.cv-entries p { margin: 4px 0 0; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.cv-entries li.cv-exhibition-feature { display: block; margin: 4px -14px; padding: 0; border: 0; border-radius: 5px; background: #edf7fc; }
.cv-exhibition-link { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 14px; border-radius: inherit; text-decoration: none; }
.cv-exhibition-link:hover { background: #e4f3fa; }
.cv-exhibition-link:focus-visible { outline: 2px solid #486d82; outline-offset: 3px; }
.cv-practice { margin-top: 36px; padding-top: 16px; }
.cv-practice .cv-category { margin: 0 0 12px; }
.cv-section-title, .cv-practice .cv-category {
  width: fit-content;
  max-width: 100%;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #496779;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .cv-section-title, .cv-practice .cv-category {
    background: linear-gradient(100deg, #405b71, #5d8193 58%, #70919e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.cv-section .cv-category {
  width: fit-content;
  max-width: 100%;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: #91bace;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .cv-section .cv-category {
    background: linear-gradient(100deg, #91bace, #bbdbe9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.cv-practice-list { display: grid; grid-template-columns: 1fr; list-style: none; }
.cv-practice-list li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cv-practice-list li:last-child { border-bottom: 0; }
.cv-practice-list h3 { font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; }
.cv-practice-list p { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.cv-download { display: inline-flex; align-items: center; gap: 16px; margin-top: 36px; padding: 11px 17px; border: 1px solid var(--ink); border-radius: 100px; font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.4; transition: background .2s, color .2s; }
.cv-download:hover, .cv-download:focus-visible { background: var(--ink); color: var(--paper); }
.cv-download:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cv-download span { font-size: 14px; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .cv-download { transition: none; } }
@media (max-width: 860px) {
  .cv-columns { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 560px) {
  .cv-page { padding-top: 88px; padding-bottom: 64px; }
  .cv-hero { height: 92px; margin-bottom: 12px; }
  .cv-hero-blur { font-size: clamp(28px, 7.6vw, 48px); }
  .cv-hero-foreground { top: 38%; left: 0; }
  .cv-entries li, .cv-practice-list li, .cv-exhibition-link { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }
}

/* ============== КОНТАКТЫ ============== */
.page-contact .inner { padding-top: 108px; }
.page-contact .page-head { max-width: none; margin-bottom: 52px; }
.page-contact .page-lede { max-width: none; white-space: nowrap; }
@media (max-width: 900px) { .page-contact .page-lede { white-space: normal; text-wrap: balance; } }
.page-contact .contact-title { font-size: clamp(40px, 7vw, 110px); line-height: 1.1; }
.contact-title-effect {
  position: relative;
  display: inline-block;
  background: linear-gradient(105deg, #7898b8, #e9a9d5 48%, #9acbea 72%, #7898b8);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: contact-shimmer 8s ease-in-out infinite alternate;
}
.contact-title-effect::before,
.contact-title-effect::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  animation: contact-afterimage 8s ease-in-out infinite;
}
.contact-title-effect::before {
  color: #e9acd8;
  transform: translateX(-.035em);
  text-shadow: -2px 0 #efc7a5;
}
.contact-title-effect::after {
  color: #89cbe6;
  transform: translateX(.035em);
  text-shadow: 2px 0 #abb1ed;
  animation-delay: -.14s;
}
.contact-title-effect:hover,
.contact-title-effect:hover::before,
.contact-title-effect:hover::after { animation-duration: 4s; }
@keyframes contact-shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
@keyframes contact-afterimage {
  0%, 28%, 44%, 62%, 80%, 100% { opacity: 0; filter: blur(0); }
  34%, 70% { opacity: .48; filter: blur(.7px); }
}
@media (prefers-reduced-motion: reduce) {
  .contact-title-effect, .contact-title-effect::before, .contact-title-effect::after { animation: none; }
}
@media (max-width: 560px) { .page-contact .inner { padding-top: 92px; } }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.contact-card {
  background: var(--paper);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: background 0.3s ease;
}
a.contact-card:hover { background: var(--cream); }
.page-contact .contact-card:nth-child(1):is(:hover, :focus-visible) { background: #f8d8ea; }
.page-contact .contact-card:nth-child(2):is(:hover, :focus-visible) { background: #d8ecff; }
.page-contact .contact-card:nth-child(3):is(:hover, :focus-visible) { background: #d9f7e8; }
.c-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.c-value {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.page-contact .c-value {
  font-family: var(--display);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(15px, 1.6vw, 21px);
  line-height: 1.45;
  letter-spacing: -.025em;
  text-transform: uppercase;
}
.contact-location { position: relative; display: inline-block; white-space: nowrap; }
.contact-location::before,
.contact-location::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.contact-location::before { color: #ee75c7; --glitch-shift: -4px; }
.contact-location::after { color: #68c5eb; --glitch-shift: 4px; }
.contact-location.is-glitching { animation: contact-location-glitch .85s steps(1, end) both; }
.contact-location.is-glitching::before,
.contact-location.is-glitching::after { animation: contact-location-rgb .85s steps(1, end) both; }
@keyframes contact-location-glitch {
  0%, 14%, 78%, 100% { opacity: 1; transform: translate(0); filter: none; }
  15%, 28% { opacity: .85; transform: translate(-2px, 1px); }
  29%, 43% { opacity: .7; transform: translate(2px, -1px); }
  44%, 55% { opacity: .18; transform: translate(0); filter: blur(2px); }
  56%, 64% { opacity: .75; transform: translate(2px, 1px); }
  65%, 77% { opacity: .9; transform: translate(-1px, 0); }
}
@keyframes contact-location-rgb {
  0%, 14%, 78%, 100% { opacity: 0; }
  15%, 28% { opacity: .8; transform: translateX(var(--glitch-shift)); clip-path: inset(0 0 52% 0); }
  29%, 43% { opacity: .95; transform: translateX(var(--glitch-shift)); clip-path: inset(48% 0 12% 0); }
  44%, 55% { opacity: .85; transform: translateX(var(--glitch-shift)); clip-path: inset(18% 0 20% 0); }
  56%, 77% { opacity: .7; transform: translateX(var(--glitch-shift)); clip-path: inset(65% 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .contact-location.is-glitching,
  .contact-location.is-glitching::before,
  .contact-location.is-glitching::after { animation: none; }
}
.c-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.c-arrow {
  position: absolute;
  top: 40px; right: 40px;
  font-family: var(--serif-it);
  font-size: 22px;
  color: var(--ink-3);
  transition: transform 0.3s ease;
}
a.contact-card:hover .c-arrow {
  color: var(--ink);
  transform: translate(4px, -4px);
}

/* ============== МАСТЕРСКАЯ ============== */
.workshop {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px var(--pad-x) 80px;
  text-align: center;
}
.workshop.revealed {
  display: block;
  text-align: left;
  padding: 140px var(--pad-x) 120px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
.workshop-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 40px;
}
.workshop-gate {
  position: relative;
  max-width: 640px;
  padding: 90px 40px;
}
.workshop.revealed .workshop-gate { display: none; }

/* Шапка профиля на странице мастерской — чёткая тёмная плашка с розовым акцентом */
body.page-workshop .site-header {
  background: #160510;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1.5px solid #F037A5;
  box-shadow: 0 0 24px rgba(240, 55, 165, 0.25);
}
body.page-workshop .site-header .logo,
body.page-workshop .site-header .logo-anim {
  color: #ffffff;
}
body.page-workshop .site-header .nav a {
  color: #ffb8dc;
  font-weight: 500;
}
body.page-workshop .site-header .nav a.active,
body.page-workshop .site-header .nav a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(240, 55, 165, 0.7);
}

/* === Розовая мишура на всю страницу === */
.tinsel-bg {
  position: fixed;
  top: -8vh;
  left: 0;
  right: 0;
  bottom: -25vh;     /* уезжает за нижний край экрана, чтобы концов нитей не было видно */
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 30%, #1a0612 0%, #08020a 80%);
}

/* Две половинки занавеса — складываются вместе как одна картина,
   а при .opening разъезжаются в стороны */
.tinsel-half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: url('images/workshop-tinsel.jpg') no-repeat;
  background-size: 200% 100%;
  background-position-y: top;
  z-index: 1;
  transition: transform 1.1s cubic-bezier(0.72, 0, 0.28, 1);
  will-change: transform;
  filter: brightness(1.02);
}
.tinsel-left {
  left: 0;
  background-position: left center;
  box-shadow: inset -20px 0 40px -10px rgba(0,0,0,0.45);
}
.tinsel-right {
  right: 0;
  background-position: right center;
  box-shadow: inset 20px 0 40px -10px rgba(0,0,0,0.45);
}

/* Раскрытие занавеса */
body.tinsel-opening .tinsel-left  {
  transform: translateX(-100%);
  transition: transform 1.2s cubic-bezier(0.72, 0, 0.28, 1);
}
body.tinsel-opening .tinsel-right {
  transform: translateX(100%);
  transition: transform 1.2s cubic-bezier(0.72, 0, 0.28, 1);
}
body.tinsel-opening .tinsel-strand,
body.tinsel-opening .tinsel-sparkle {
  opacity: 0 !important;
  transition: opacity 0.4s ease;
}
.workshop.opening .workshop-gate {
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
body.tinsel-done .tinsel-bg { display: none; }
.workshop-gate { position: relative; z-index: 5; }
.gate-buttons { position: relative; z-index: 5; }
.site-header { z-index: 10; }

.tinsel-strand {
  position: absolute;
  top: 0;
  display: block;
  z-index: 2;
  transform-origin: top center;
  transform: translateX(-50%) rotate(var(--tilt, 0deg));
  will-change: transform;
  transition: transform 0.22s ease-out;
  border-radius: 1.5px;
  filter: url(#tinsel-crinkle) contrast(1.18) saturate(1.15);
}

/* Слой случайных блёсток поверх нитей */
.tinsel-sparkle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}
.tspk {
  position: absolute;
  display: block;
  background: radial-gradient(ellipse at center,
    rgba(255,255,255,1) 0%,
    rgba(255,200,230,0.85) 35%,
    rgba(255,120,200,0.0) 80%);
  border-radius: 50%;
  filter: blur(0.4px);
}

.gate-question {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}
.gate-question em {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  color: var(--ink-2);
}
.gate-sub {
  font-family: var(--serif-it);
  font-style: italic;
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--ink-2);
  margin-bottom: 56px;
  line-height: 1.4;
}
.gate-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-peek {
  background: #f0a3b8;
  color: var(--ink);
  padding: 20px 40px;
  border-radius: 100px;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.35s ease;
  box-shadow: 0 10px 30px rgba(240, 163, 184, 0.45);
}
.btn-peek:hover {
  background: #e88aa1;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(232, 138, 161, 0.5);
}

.btn-no-peek {
  display: inline-block;
  padding: 20px 36px;
  border: 1px solid rgba(255, 200, 230, 0.45);
  border-radius: 100px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: #fff5fa;
  font-weight: 500;
  font-family: var(--sans);
  background: rgba(40, 6, 24, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-decoration: none;
  margin-left: 18px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.btn-no-peek:hover {
  background: rgba(60, 10, 40, 0.75);
  border-color: rgba(255, 200, 230, 0.85);
  transform: translateY(-2px);
}

.workshop-content {
  display: none;
  width: 100%;
}
.workshop.revealed .workshop-content { display: block; }

/* === Галерея мастерской — Polaroid-коллаж === */
.studio-grid {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  padding: 40px clamp(20px, 4vw, 60px) 80px;
  margin: 0;
  perspective: 1200px;
}
.sg-item {
  position: relative;
  display: block;
  padding: 14px 14px 50px;
  margin: 12px -22px;
  cursor: zoom-in;
  box-shadow:
    0 16px 30px rgba(0,0,0,0.55),
    0 4px 12px rgba(240, 55, 165, 0.28);
  transform: rotate(var(--rot, 0deg)) translateZ(0);
  transform-origin: center 80%;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s, z-index 0s;
  z-index: 1;
  background-color: #2a0d1a;
  background-blend-mode: normal;
  background-size: 100% 100%;
  animation: holo-shimmer 12s linear infinite;
}

/* Анимируемый угол для конических переливов */
@property --holo-rot {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes holo-shimmer {
  to { --holo-rot: 360deg; }
}

/* Общий слой фрактального шума и искр поверх любой рамки */
.sg-item > img + ::after, .sg-item::after { /* нет */ }

.sg-item {
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.85  0 0 0 0 1  0 0 0 0.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(circle at 18% 22%, rgba(255,255,255,0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 14%, rgba(255,255,255,0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 30% 88%, rgba(255,255,255,0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 76%, rgba(255,255,255,0.6) 0 1px, transparent 2px),
    conic-gradient(from var(--holo-rot, 0deg) at 50% 50%,
      #9b2f7d, #6f4ba8, #347c98, #5b9884, #9b873d, #a34572, #9a1d70, #9b2f7d);
  background-size: 220px 220px, auto, auto, auto, auto, 100% 100%;
  background-blend-mode: overlay, screen, screen, screen, screen, normal;
}

/* ===== ВАРИАНТЫ РАМОК ===== */

/* (2) Чистый розовый металлик — узкие резкие полосы как у шлифованного металла */
.studio-grid .sg-item:nth-child(6n+2) {
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.2 0.4' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.28 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(to right,
      #3b0625 0%, #9c1e68 18%, #b9488c 32%, #d89ab9 42%,
      #a92a78 52%, #7f0f4e 66%, #bd5b8a 80%, #2a0419 100%);
  background-size: 220px 220px, 100% 100%;
  background-blend-mode: overlay, normal;
  animation: none;
}

/* (3) Тёмный сине-фиолетовый металлик */
.studio-grid .sg-item:nth-child(6n+3) {
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3 0.8' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.5  0 0 0 0 0.85  0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(135deg,
      #070a22 0%, #171a4a 18%, #2e2470 34%,
      #4b2a78 50%, #221247 66%, #0c163d 82%, #050612 100%);
  background-size: 220px 220px, 100% 100%;
  background-blend-mode: overlay, normal;
  animation: none;
}

/* (4) Золотой металлик */
.studio-grid .sg-item:nth-child(6n+4) {
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2 0.5' numOctaves='2' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.7  0 0 0 0.24 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(135deg,
      #3f280a 0%, #9b7430 16%, #c6aa56 32%, #d8c389 44%,
      #b98c35 56%, #81581c 72%, #a65b75 90%, #33180c 100%);
  background-size: 220px 220px, 100% 100%;
  background-blend-mode: overlay, normal;
  animation: none;
}

/* (5) Бензиновый разлив (oil spill) — глубокий иридесцент */
.studio-grid .sg-item:nth-child(6n+5) {
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.6  0 0 0 0 1  0 0 0 0.28 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    conic-gradient(from calc(var(--holo-rot, 0deg) * -1) at 30% 70%,
      #160524, #8b1769, #006f8d, #2d0f43, #9d347c, #0d3148, #74104c, #160524);
  background-size: 220px 220px, 100% 100%;
  background-blend-mode: overlay, normal;
  animation: holo-shimmer 14s linear infinite;
}

/* (6) Магента-мята — резкий контраст двух цветов */
.studio-grid .sg-item:nth-child(6n+6) {
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.8' numOctaves='2' seed='17'/%3E%3CfeColorMatrix values='0 0 0 0 0.8  0 0 0 0 1  0 0 0 0 0.9  0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(125deg,
      #9b1b6f 0%, #b75e8e 22%, #8da99d 48%,
      #39997d 62%, #a3347a 80%, #9b1b6f 100%);
  background-size: 220px 220px, 100% 100%;
  background-blend-mode: overlay, normal;
  animation: none;
}
.sg-item img {
  display: block;
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 16px;
  filter: saturate(1.06);
  transition: filter 0.45s, border-radius 0.45s;
}
.studio-grid .sg-item:nth-child(3n+1) img {
  border-radius: 22px 14px 24px 16px / 16px 26px 14px 24px;
}
.studio-grid .sg-item:nth-child(3n+2) img {
  border-radius: 14px 26px 16px 24px / 24px 16px 28px 14px;
}
.studio-grid .sg-item:nth-child(5n) img {
  border-radius: 28px 16px 30px 18px / 18px 30px 16px 28px;
}
/* Подпись-полоска под фото — лёгкий тёмный отлив поверх голо-рамки */
.sg-item::before {
  content: '';
  position: absolute;
  left: 8px; right: 8px;
  bottom: 8px; height: 32px;
  background:
    linear-gradient(to right,
      rgba(255, 80, 200, 0.18) 0%,
      rgba(120, 200, 255, 0.22) 50%,
      rgba(255, 220, 140, 0.20) 100%);
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: 1px;
}
/* Скотч сверху убран — без лишних «креплений» */
.sg-item::after { content: none; }

/* Разные размеры и наклоны для каждого фото */
.studio-grid .sg-item:nth-child(1)  {
  --rot: -6deg;
  margin-top: 8px;
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='2' seed='23'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.38  0 0 0 0 0.75  0 0 0 0.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(135deg,
      #16051f 0%, #3a1458 22%, #5f2770 42%,
      #26306d 62%, #111a42 80%, #090411 100%);
  background-size: 220px 220px, 100% 100%;
  background-blend-mode: overlay, normal;
  animation: none;
}
.studio-grid .sg-item:nth-child(2)  { --rot:  4deg; margin-top: 60px; }
.studio-grid .sg-item:nth-child(3)  { --rot: -3deg; margin-top: 22px; }
.studio-grid .sg-item:nth-child(4)  { --rot:  5deg; margin-top: 80px; }
.studio-grid .sg-item:nth-child(5)  { --rot: -7deg; margin-top: 14px; }
.studio-grid .sg-item:nth-child(6)  { --rot:  3deg; margin-top: 100px; }
.studio-grid .sg-item:nth-child(7)  { --rot: -4deg; margin-top: 40px; }
.studio-grid .sg-item:nth-child(8)  { --rot:  6deg; margin-top: 70px; }
.studio-grid .sg-item:nth-child(9)  { --rot: -2deg; margin-top: 30px; }
.studio-grid .sg-item:nth-child(10) { --rot:  7deg; margin-top: 88px; }
.studio-grid .sg-item:nth-child(11) { --rot: -5deg; margin-top: 24px; }
/* Несколько штук покрупнее для акцента */
.studio-grid .sg-item:nth-child(4) img,
.studio-grid .sg-item:nth-child(7) img { width: 320px; height: 320px; }
.studio-grid .sg-item:nth-child(1) img,
.studio-grid .sg-item:nth-child(9) img { width: 300px; height: 300px; }
/* Одна горизонтальная для разнообразия */
.studio-grid .sg-item:nth-child(6) img { width: 360px; height: 240px; }

.sg-item:hover {
  z-index: 50;
  transform: rotate(0deg) scale(1.06) translateY(-8px);
  box-shadow:
    0 28px 60px rgba(0,0,0,0.75),
    0 8px 24px rgba(240, 55, 165, 0.4);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s, z-index 0s linear 0s;
}
.sg-item:hover img { filter: saturate(1.15) brightness(1.04); }

@media (max-width: 900px) {
  .studio-grid { padding: 30px 12px 60px; }
  .sg-item { margin: 8px -10px; padding: 10px 10px 38px; }
  .sg-item img,
  .studio-grid .sg-item:nth-child(n) img { width: 180px; height: 180px; }
  .studio-grid .sg-item:nth-child(6) img { width: 240px; height: 160px; }
}

/* Постер и вырезанный стикер — без фото-рамок, с исходными пропорциями. */
.studio-grid .sg-item.sg-print {
  padding: 0;
  margin: 40px 12px 12px;
  background: none;
  border: 0;
  animation: none;
  box-shadow: none;
  --rot: -4deg;
}
.studio-grid .sg-item.sg-print::before,
.studio-grid .sg-item.sg-print::after { content: none; }
.studio-grid .sg-item.sg-print img {
  width: 300px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  filter: none;
}
.sg-lightbox.is-print .sg-stage img {
  box-shadow: none;
  border-radius: 0;
  filter: none;
}
.studio-grid .sg-item.sg-sticker { --rot: 7deg; margin-top: 80px; }
.studio-grid .sg-item.sg-sticker img { width: 240px; }
@media (max-width: 900px) {
  .studio-grid .sg-item.sg-print { margin: 24px 8px 8px; }
  .studio-grid .sg-item.sg-print img { width: 180px; height: auto; }
  .studio-grid .sg-item.sg-sticker img { width: 160px; }
}

/* ===== ИГРАЛЬНЫЕ КАРТЫ ===== */
.studio-grid .sg-item.sg-card {
  /* Карта — без полароидной рамки, без голо-фона */
  background: none !important;
  background-image: none !important;
  animation: none !important;
  padding: 0;
  cursor: pointer;
  perspective: 1400px;
  box-shadow: none;
}
.studio-grid .sg-item.sg-card::before,
.studio-grid .sg-item.sg-card::after { content: none; }

.sg-card-inner {
  position: relative;
  width: 260px;
  height: 364px;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.62, 0.03, 0.34, 1);
}
.sg-card.flipped .sg-card-inner { transform: rotateY(180deg); }

.sg-card-front,
.sg-card-back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  border-radius: 12px;
  box-shadow:
    0 14px 32px rgba(0,0,0,0.6),
    0 4px 12px rgba(240, 55, 165, 0.35),
    inset 0 0 0 1px rgba(255,255,255,0.5);
  overflow: hidden;
}
.sg-card-front {
  transform: rotateY(180deg);
  background: #1a0612;
}
.sg-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Рубашка карты — мех, без тонировки и декоративных рамок. */
.sg-card-back {
  background-color: #1a0612;
  background-image: url('images/workshop/card-back-fur.jpg');
  background-size: cover;
  background-position: center;
  filter: none;
}
.sg-card-back::before,
.sg-card-back::after { content: none; }

/* Hover на закрытой карте — лёгкий подъём */
.sg-card:not(.flipped):hover .sg-card-inner {
  transform: translateY(-6px) rotateX(3deg);
}
.sg-card:not(.flipped):hover {
  box-shadow: none;
}

/* Размеры карт переопределяют общие размеры img */
.studio-grid .sg-item.sg-card img { width: 100% !important; height: 100% !important; }

@media (max-width: 900px) {
  .sg-card-inner { width: 180px; height: 252px; }
}

/* === Лайтбокс === */
.sg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 2, 10, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-lightbox[hidden] { display: none; }
.sg-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 8vw 10vh;
}
.sg-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(240, 55, 165, 0.35);
  border-radius: 4px;
  transition: transform 0.55s ease, max-width 0.55s ease;
}
.sg-lightbox.has-caption .sg-stage img {
  max-width: 58vw;
  transform: translateX(14vw);
}
.sg-caption {
  position: absolute;
  left: 7vw;
  top: 50%;
  max-width: min(560px, 42vw);
  color: rgba(255, 225, 240, 0.82);
  font-family: 'Bad Script', 'Caveat', cursive;
  font-size: clamp(20px, 2.7vw, 30px);
  line-height: 1.12;
  transform: translateY(-50%) rotate(-2deg);
  text-shadow:
    0 2px 8px rgba(0,0,0,0.75),
    0 0 18px rgba(240,55,165,0.45);
  white-space: normal;
  z-index: 1;
}
.sg-caption[hidden] { display: none; }
.sg-caption span {
  display: block;
  overflow: hidden;
  padding-right: 0.45em;
  clip-path: inset(0 100% 0 0);
  animation: sg-handwrite-line 1.35s steps(28, end) forwards;
}
.sg-caption span:nth-child(2) { animation-delay: 1.15s; }
.sg-caption span:nth-child(3) { animation-delay: 2.3s; }
@keyframes sg-handwrite-line {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0.25;
  }
  15% { opacity: 1; }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}
.sg-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  background: rgba(20, 8, 14, 0.7);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background 0.2s, transform 0.2s;
}
.sg-close:hover { background: rgba(240,55,165,0.85); transform: scale(1.06); }
.sg-nav {
  position: absolute;
  top: 50%;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  background: rgba(20, 8, 14, 0.7);
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transform: translateY(-50%);
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
}
.sg-prev { left: 24px; }
.sg-next { right: 24px; }
.sg-nav:hover { background: rgba(240,55,165,0.85); }
.sg-prev:hover { transform: translateY(-50%) translateX(-3px); }
.sg-next:hover { transform: translateY(-50%) translateX(3px); }

/* В мастерской — фон контента под цвет страницы, edge-to-edge */
body.page-workshop { background: #0a0408; }
.workshop.revealed {
  padding: 88px 0 40px !important;
  max-width: none !important;
  margin: 0 !important;
}
.workshop.revealed .workshop-content {
  background: transparent;
  color: #fff5fa;
}

.btn-hide {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 28px;
  border: 1px solid rgba(255, 200, 230, 0.4);
  border-radius: 100px;
  background: rgba(40, 6, 24, 0.5);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: #ffd8ea;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-hide:hover {
  background: rgba(60, 10, 40, 0.75);
  border-color: #fff;
  color: #fff;
}

/* ============== ПОДВАЛ (внутренних страниц) ============== */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px var(--pad-x);
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 400;
}
.site-footer a:hover { color: var(--ink); }

/* ============== АДАПТИВ ============== */
@media (max-width: 900px) {
  .nav { gap: 14px; font-size: 10px; letter-spacing: 0.12em; }
  .gallery { columns: 2; column-gap: 14px; }
  .g-item { margin-bottom: 14px; }
  .studio-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-inner { grid-template-columns: 1fr; max-height: 90vh; }
  .modal-image { aspect-ratio: 4 / 3; }
  .modal-text { padding: 32px 24px; }
  .text-cols { columns: 1; }
  .contact-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; gap: 12px; }
}

@media (max-width: 560px) {
  .site-header { padding: 18px var(--pad-x); }
  .nav { gap: 10px; }
  .gallery { columns: 1; }
  .filter { gap: 6px; }
  .filter-btn { padding: 8px 14px; font-size: 11px; }
}
