/* ============ Культурное Бюро — токены ============ */
:root {
  --paper: #f6f6f6;
  --red: #ff3131;
  --red-deep: #ce372e;
  --yellow: #f3d048;
  --ink: #111110;
  --font-display: "20db", "Arial Black", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --pad: clamp(20px, 5vw, 72px);
  --page-max: 1300px; /* на широких мониторах не размазываемся */
}

@font-face {
  font-family: "20db";
  src: url("../assets/fonts/20db.woff2") format("woff2"),
       url("../assets/fonts/20db.otf") format("opentype");
  font-weight: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2 { font-family: var(--font-display); font-weight: normal; margin: 0; }
.mono { font-family: var(--font-mono); }

/* сквозная красная нить */
#red-thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
#red-thread path {
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
}
#red-thread .thread-a { stroke-width: 3; }
#red-thread .thread-b { stroke-width: 6; }
#red-thread .thread-c { stroke-width: 6; stroke: var(--ink); } /* на жёлтом фесте нить чугунная */
/* узлы: местами нить набухает до толстой (ширина задаётся из JS) */
#red-thread .thread-swell { stroke: var(--red); }
#red-thread .thread-swell--ink { stroke: var(--ink); }
/* иголка на кончике нити; на стыках сегментов ныряет в ткань */
#red-thread .thread-needle { transition: opacity 0.35s; }
#red-thread .thread-needle.off { opacity: 0; }
#red-thread .thread-needle path { fill: var(--ink); stroke: none; }
#red-thread .thread-needle circle { fill: var(--paper); stroke: none; }
/* стежки поперёк нити: появляются, когда элемент «пришит» */
#red-thread .thread-stitch { opacity: 0; transition: opacity 0.4s 0.12s; }
#red-thread .thread-stitch.on { opacity: 1; }
#red-thread .thread-stitch line { stroke: var(--ink); stroke-width: 2.5; }

/* ограничитель ширины: красные/жёлтые пласты остаются во весь экран */
.masthead, .hero, .verbs, .about, .fest__body, .docs, .contact, .footer {
  max-width: var(--page-max);
  margin-inline: auto;
}

/* ============ шапка ============ */
.masthead { padding: clamp(16px, 3vw, 40px) var(--pad) 0; }
.masthead__logo {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.masthead__city {
  margin: 0.5em 0 0;
  text-align: right;
  font-size: 12px;
  letter-spacing: 0.28em;
  opacity: 0.6;
}
.masthead__nav {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  margin-top: 3em; /* меню дышит: воздух и сверху, и снизу */
  padding-bottom: 2.2em;
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
}
.masthead__nav a { text-decoration: none; }
.masthead__nav a:hover { color: var(--red); }
.masthead__nav span { color: var(--red); }

/* ============ герой с тумбой ============ */
.hero { position: relative; padding: 0 var(--pad); }
.hero__vertical {
  position: absolute;
  left: 10px;
  top: 42vh;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--ink);
  opacity: 0.75;
}
.hero__stage {
  position: relative;
  /* драг тумбы не должен выделять текст вокруг (и автоскроллить страницу) */
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden; /* фолбэк; современные браузеры перекроют клипом ниже */
  /* svh: высота не дёргается, когда мобильный браузер прячет адресную строку */
  height: min(88vh, 820px);
  height: min(88svh, 820px);
  margin-top: 8px;
}
/* клип ТОЛЬКО по горизонтали (вращающееся кольцо не раздувает ширину страницы).
   по вертикали visible: нижняя половина тени выходит за сцену, и обычный
   overflow:hidden рубил её градиент горизонтальной «белой плашкой» */
@supports (overflow: clip) {
  .hero__stage { overflow-x: clip; overflow-y: visible; }
}
/* тень тумбы: тёмный мягкий эллипс на «полу» сцены.
   --floor-y ставит JS (initTumba/resize): это проекция передней кромки низа
   базы на экран, поэтому центр эллипса лежит ровно на точке касания при
   любом аспекте камеры. края растворяются в белое без жёстких границ */
.hero__shadow {
  position: absolute;
  left: 50%;
  top: var(--floor-y, 94%);
  translate: -50% -50%;
  width: min(86svh, 740px);
  aspect-ratio: 5 / 1;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(17, 17, 16, 0.55) 0%,
    rgba(17, 17, 16, 0.3) 38%,
    rgba(17, 17, 16, 0.12) 62%,
    rgba(17, 17, 16, 0) 85%);
  z-index: 1;
  pointer-events: none;
}
#tumba {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
  z-index: 2;
}
#tumba.dragging { cursor: grabbing; }
.hero__doodles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
/* шурешки живут: бусины ездят по линиям, линии дышат */
.dood-dot {
  fill: var(--yellow);
  transform-box: fill-box;
  transform-origin: center;
  animation: dood-slide 11s ease-in-out infinite alternate;
}
.dood-dot:nth-of-type(2) { animation-duration: 15s; animation-delay: -6s; }
.dood-line {
  stroke: var(--ink);
  stroke-width: 1;
  opacity: 0.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: dood-breathe 9s ease-in-out infinite alternate;
}
.dood-line--red { stroke: var(--red); stroke-width: 2; opacity: 1; animation: none; }
@keyframes dood-slide {
  from { translate: -70px 0; }
  to { translate: 120px 0; }
}
@keyframes dood-breathe {
  from { scale: 1 1; }
  to { scale: 1.12 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dood-dot, .dood-line { animation: none; }
}

/* кольцевая надпись «тяните чтобы вращать» */
.hero__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(74vh, 620px);
  width: min(74svh, 620px);
  aspect-ratio: 1;
  translate: -50% -50%;
  z-index: 1;
  animation: ring-spin 40s linear infinite;
}
.hero__ring svg { width: 100%; height: 100%; overflow: visible; }
.hero__ring text {
  font-family: var(--font-mono);
  font-size: 4.4px; /* в единицах viewBox 100×100 */
  letter-spacing: 0.16em;
  fill: var(--red);
  text-transform: lowercase;
}
@keyframes ring-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) {
  .hero__ring { animation: none; }
}

.hero__aside {
  position: absolute;
  right: 0;
  bottom: 18%;
  width: 12em;
  text-align: left;
  font-size: 13px;
  color: var(--red);
  z-index: 2;
}

.hero__statement {
  position: relative;
  z-index: 3;
  /* никакой подложки: тумба отбрасывает тень на чистый фон,
     заголовок начинается ниже, не наезжая на сцену */
  margin-top: 0;
  padding-top: 4svh;
  font-size: clamp(30px, 7.2vw, 108px);
  line-height: 1.06;
  text-transform: none;
}
.hero__statement span { display: block; }
/* «культурные смыслы» чернильные, пока иголка не прошла мимо —
   потом РЕЗКО, по очереди, желтеют (transition нулевой длины = переключение) */
.hero__statement em { font-style: normal; color: inherit; }
.hero__statement.lit em { color: var(--yellow); transition: color 0s 0.1s; }
.hero__statement.lit em:nth-of-type(2) { transition-delay: 0.34s; }
.hero__statement span:nth-child(2) { margin-left: 1.2em; }
.hero__statement span:nth-child(3) { margin-left: 2.6em; }
.hero__sub {
  position: relative;
  z-index: 4; /* нить проходит под текстом */
  margin: 2.4em 0 0 0.2em;
  max-width: 34em;
  font-size: 14px;
}

/* меню наискосок */
.skew-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em 2.5em;
  margin: 8em 0 0; /* чистый воздух после слогана, блоки не липнут */
  padding: 2em 0 3em;
  transform: rotate(-6deg);
  transform-origin: left center;
}
.skew-menu a {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 34px);
  text-decoration: none;
  color: var(--ink);
  border-bottom: 3px solid transparent;
}
.skew-menu a:hover { color: var(--red); border-bottom-color: var(--yellow); }

/* ============ лесенка глаголов ============ */
.verbs {
  position: relative;
  padding: 6em var(--pad) 7em;
}
.verbs__items { position: relative; z-index: 1; }
/* нить проходит прямо ЗА буквами — без подложек */
.verbs__item {
  max-width: 22em;
  position: relative;
  z-index: 4;
  width: fit-content;
}
.verbs__word {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 58px);
  color: var(--ink);
  line-height: 1;
  transition: color 0.45s, translate 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.verbs__caption {
  margin: 0.5em 0 0;
  font-size: 13.5px;
  opacity: 0.45;
  transition: opacity 0.45s;
}
/* глагол «включается», когда до него дотягивается красная нить */
.verbs__item.lit .verbs__word { color: var(--red); translate: 0.18em 0; }
.verbs__item.lit .verbs__caption { opacity: 1; }
.verbs__item:nth-child(1) { margin-left: 0; }
.verbs__item:nth-child(2) { margin-left: 14%; margin-top: 2.4em; }
.verbs__item:nth-child(3) { margin-left: 30%; margin-top: 2.4em; }
.verbs__item:nth-child(4) { margin-left: 48%; margin-top: 2.4em; }

/* ============ общие индексы разделов ============ */
.section-index {
  position: relative;
  z-index: 4;
  font-size: 13px;
  color: var(--red);
  margin: 0 0 1.2em;
}
.section-index--onred { color: var(--paper); }

/* ============ кто мы такие ============ */
.about {
  position: relative;
  padding: 5em var(--pad) 7em;
  overflow: hidden;
}
.about__title { font-size: clamp(34px, 5vw, 64px); }
.about__text {
  max-width: 34em;
  margin-top: 1.6em;
  font-size: 15.5px;
  position: relative;
  z-index: 4;
  background: rgba(246, 246, 246, 0.72);
  padding: 0.6em 0.8em;
}
.about__names { color: var(--red); font-weight: 500; }
.about__sun {
  position: absolute;
  right: -6vw;
  bottom: -14vw;
  width: 32vw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
}
/* живое фото команды, вырезанное вертикальной волной */
.about__team {
  position: absolute;
  right: clamp(16px, 6vw, 110px);
  top: 3.5em;
  width: min(320px, 26vw);
  margin: 0;
  z-index: 1;
}
/* маска и ЧБ живут на обёртке: iOS не любит clip-path+filter прямо на video */
.about__team-mask {
  width: 100%;
  aspect-ratio: 3 / 4;
  clip-path: url(#wave-clip);
  filter: grayscale(1);
  transition: filter 1s;
  overflow: hidden;
}
.about__team-mask video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* нить дотянулась — фото окрашивается, «вдыхает» и оживает */
.about__team.alive .about__team-mask {
  filter: none;
  animation: team-wake 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes team-wake {
  0% { scale: 1; rotate: 0deg; }
  40% { scale: 1.05; rotate: -1.4deg; }
  100% { scale: 1; rotate: 0deg; }
}
@media (prefers-reduced-motion: reduce) {
  .about__team.alive .about__team-mask { animation: none; }
}
.about__team figcaption {
  position: relative;
  z-index: 4; /* подпись ПОВЕРХ нити, нить не режет буквы */
  margin-top: 0.8em;
  font-size: 12px;
  opacity: 0.65;
  text-align: right;
}

/* ============ что натворили: раскол → корешок + карточка ============ */
.done {
  display: grid;
  grid-template-columns: 2fr 3fr 0fr;
  min-height: 80vh;
  transition: grid-template-columns 0.65s cubic-bezier(0.65, 0, 0.35, 1);
  overflow: hidden;
}
.done.expanded { grid-template-columns: 0.22fr 1.9fr 2.6fr; }
.done__red {
  background: var(--red);
  color: var(--paper);
  padding: 4em var(--pad);
  position: relative;
  z-index: 4; /* нить ныряет за красный пласт */
  overflow: hidden;
  min-width: 52px;
}
.done__red h2 {
  font-size: clamp(34px, 4.6vw, 62px);
  line-height: 1.02;
  position: sticky;
  top: 1.2em;
  transition: opacity 0.4s, translate 0.5s;
}
.done.expanded .done__red h2 { opacity: 0; translate: -0.8em 0; }
.done.expanded .done__red .section-index { opacity: 0; transition: opacity 0.3s; }
.done__spine {
  position: absolute;
  top: 2em;
  left: 50%;
  translate: 100% 0;
  writing-mode: vertical-rl;
  font-size: 13px;
  letter-spacing: 0.22em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s 0.25s, translate 0.55s cubic-bezier(0.65, 0, 0.35, 1) 0.15s;
}
.done.expanded .done__spine { opacity: 1; translate: -50% 0; }
.done__list-wrap { padding: 4em clamp(16px, 3vw, 48px); }
.done__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.done__list li { border-bottom: 1px solid rgba(17, 17, 16, 0.25); }
.done__item-btn {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: 1.4em;
  width: 100%;
  padding: 1.05em 0.4em;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.done__item-btn:hover { background: rgba(243, 208, 72, 0.35); }
.done__list li.active .done__item-btn { background: var(--ink); color: var(--paper); }
.done__list li.active .done__year { color: var(--yellow); }
.done__year {
  color: var(--red);
  transition: background 0.45s, color 0.45s;
  padding: 0.15em 0.4em;
  margin-left: -0.4em;
  align-self: start;
}
/* нить перелилась в столбец годов: он заполняется красным по мере скролла */
.done__list li.filled .done__year { background: var(--red); color: #fff; }
.done__where { display: block; opacity: 0.6; font-size: 13px; margin-top: 0.2em; }

.done__panel {
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--ink);
  background: var(--paper);
  opacity: 0;
  transform: translateX(48px);
  transition: opacity 0.45s 0.2s, transform 0.6s cubic-bezier(0.65, 0, 0.35, 1) 0.1s;
  pointer-events: none;
  min-width: 0;
}
.done.expanded .done__panel { opacity: 1; transform: none; pointer-events: auto; }
.done__back {
  position: absolute;
  top: 1em;
  right: 1em;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 20px;
  line-height: 1;
  padding: 0.3em 0.55em;
  cursor: pointer;
}
.done__back:hover { background: var(--yellow); }
.done__panel-inner { padding: 4em clamp(18px, 2.6vw, 44px) 3em; }
.done__panel-inner h3 {
  font-family: var(--font-display);
  font-weight: normal;
  font-size: clamp(24px, 2.6vw, 40px);
  margin: 0 0 0.3em;
  line-height: 1.05;
}
.done__panel-meta { color: var(--red); font-size: 13px; margin: 0 0 1.4em; }
.done__panel-text { max-width: 36em; }
.done__panel-text a { text-decoration-color: var(--red); text-underline-offset: 4px; }
.done__panel-text a:hover { color: var(--red); }
.done__panel-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.6em;
}
.done__panel-photos img {
  width: calc(50% - 5px);
  max-width: 280px;
  border: 2px solid var(--ink);
}
.done__panel-video { margin-top: 1.6em; }
.done__panel-video iframe,
.done__panel-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--ink);
  background: #000;
}

/* ============ красный пласт-резолюция ============ */
.slogan {
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 1.6em var(--pad) 2.4em;
  position: relative;
  z-index: 4; /* нить проходит под резолюцией и выныривает толще */
}
.slogan__word {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(52px, 11vw, 170px);
  line-height: 0.95;
  cursor: pointer;
  padding: 0;
}
.slogan__word:hover { color: var(--yellow); }
.slogan__footnote { margin: 0.6em 0 0; opacity: 0.9; font-size: 13px; }
.slogan__stamp {
  position: absolute;
  right: 6%;
  top: 14%;
  padding: 0.5em 0.9em;
  border: 2px solid #fff;
  transform: rotate(-8deg);
  font-size: 12px;
  letter-spacing: 0.12em;
  opacity: 0.85;
}

/* ============ фест: целиком жёлтый пласт ============ */
.fest { background: var(--yellow); padding-bottom: 6em; }
/* жёлтая перекладина с чайками феста — мост между двумя сайтами */
.fest__band {
  position: relative;
  z-index: 4; /* красная нить ныряет за неё */
  height: 118px;
  background: var(--yellow);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}
.fest__bird {
  position: absolute;
  height: 175px;
  top: -34px;
  user-select: none;
  -webkit-user-drag: none;
}
.fest__bird--logo { left: 6%; rotate: -4deg; }
.fest__bird--dates { right: 8%; height: 150px; top: -18px; rotate: 5deg; }
/* прилёт: до появления секции птицы ждут за левым краем; сначала дальняя
   (с датами) пролетает весь экран, следом ближняя садится у левого края.
   Влетают быстро и мягко тормозят, дальше — парение с большим ходом */
body.js .fest__band:not(.fly) .fest__bird { opacity: 0; }
.fest__band.fly .fest__bird--dates {
  animation: bird-arrive-far 1.8s cubic-bezier(0.16, 1, 0.3, 1) both,
             bird-float 5.6s ease-in-out 1.8s infinite;
}
.fest__band.fly .fest__bird--logo {
  animation: bird-arrive-near 1.35s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both,
             bird-float 6.8s ease-in-out 1.9s infinite;
}
@keyframes bird-arrive-far {
  from { transform: translateX(-95vw) translateY(14px) rotate(7deg); }
  to { transform: none; }
}
@keyframes bird-arrive-near {
  from { transform: translateX(-45vw) translateY(10px) rotate(5deg); }
  to { transform: none; }
}
/* встречный ветер: короткие штрихи проносятся навстречу птицам */
.fest__wind {
  position: absolute;
  top: var(--wt, 40%);
  right: -100px;
  width: var(--ww, 64px);
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
}
.fest__band.fly .fest__wind { animation: wind-streak 0.85s ease-out var(--wdl, 0s) 2; }
@keyframes wind-streak {
  0% { opacity: 0; transform: translateX(0) scaleX(0.4); }
  12% { opacity: 0.5; transform: translateX(-14vw) scaleX(1.3); }
  100% { opacity: 0; transform: translateX(-105vw) scaleX(0.7); }
}
/* реплики чаек — от руки, у клювов */
.fest__say {
  position: absolute;
  font-family: "Caveat", cursive;
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
}
.fest__say--left { left: calc(6% + 205px); top: 50%; translate: 0 -58%; rotate: -6deg; }
.fest__say--right { right: calc(8% + 210px); top: 50%; translate: 0 -42%; rotate: 4deg; }
/* реплики вылетают после посадки птиц */
body.js .fest__band:not(.fly) .fest__say { opacity: 0; }
.fest__band.fly .fest__say--right { animation: say-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 1.9s both; }
.fest__band.fly .fest__say--left { animation: say-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 2.15s both; }
@keyframes say-pop {
  from { opacity: 0; scale: 0.55; }
  to { opacity: 1; scale: 1; }
}
/* парение стартует с нуля — птица не дёргается, встав на место после прилёта */
@keyframes bird-float {
  0%, 100% { translate: 0 0; }
  30% { translate: 0 -9px; }
  70% { translate: 0 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .fest__band.fly .fest__bird--dates,
  .fest__band.fly .fest__bird--logo,
  .fest__band.fly .fest__say--left,
  .fest__band.fly .fest__say--right,
  .fest__band.fly .fest__wind { animation: none; }
  body.js .fest__band:not(.fly) .fest__bird,
  body.js .fest__band:not(.fly) .fest__say,
  .fest__band.fly .fest__say--left,
  .fest__band.fly .fest__say--right { opacity: 1; }
}
.fest__body { padding: 4.5em var(--pad) 0; }
.fest h2 { font-size: clamp(36px, 5.4vw, 74px); max-width: 12em; line-height: 1.02; }
.fest__text {
  max-width: 36em;
  margin-top: 1.5em;
  position: relative;
  z-index: 4;
  background: rgba(246, 246, 246, 0.72);
  padding: 0.5em 0.7em;
  width: fit-content;
}
.fest__stats, .fest h2, .fest__link, .contact__grid, .contact h2 { position: relative; z-index: 4; }
.fest__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5em;
  max-width: 46em;
  margin: 2.4em 0 0;
}
.fest__stats div { border-top: 3px solid var(--ink); padding-top: 0.7em; }
/* годы-статы выезжают по очереди, когда иголка доходит до феста */
body.js .fest__stats > div { opacity: 0; translate: 0 1.1em; }
.fest__stats.lit > div {
  animation: stat-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fest__stats.lit > div:nth-child(2) { animation-delay: 0.16s; }
.fest__stats.lit > div:nth-child(3) { animation-delay: 0.32s; }
@keyframes stat-in {
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.js .fest__stats > div { opacity: 1; translate: 0 0; animation: none; }
}
.fest__stats dt { color: var(--red); font-size: 22px; }
.fest__stats dd { margin: 0.3em 0 0; font-size: 13.5px; }
/* стена старых теликов: в экранах — прелести феста. Сдержанно, без жести:
   расширенная версия инсталляции живёт на сайте самого феста */
.fest__tvs {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 8px;
  max-width: 620px;
  margin-top: 3em;
}
.fest__tvs i {
  width: var(--tvw, 120px);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
  box-sizing: border-box;
  text-align: center;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.25;
  background: #2b2b27; /* корпус-чугун */
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: inset 0 0 0 5px #2b2b27, inset 0 0 0 7px rgba(246, 246, 246, 0.18);
  animation: tv-flick 6s steps(2, jump-none) infinite;
}
.fest__tvs i:nth-child(odd) { rotate: -1.3deg; }
.fest__tvs i:nth-child(3n) { rotate: 1.1deg; animation-delay: -2.1s; }
.fest__tvs i:nth-child(2n) { animation-delay: -3.7s; }
/* экраны: бумажный, жёлтый, тёмный и «прямой эфир» */
.fest__tvs .tv--paper { background: #efece4; color: var(--ink); box-shadow: inset 0 0 0 5px #efece4, inset 0 0 26px rgba(17, 17, 16, 0.25); }
.fest__tvs .tv--yellow { background: var(--yellow); color: var(--ink); box-shadow: inset 0 0 0 5px var(--yellow), inset 0 0 26px rgba(17, 17, 16, 0.3); border-color: var(--ink); }
.fest__tvs .tv--dark { background: #1a1a1c; color: var(--yellow); box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.9); }
.fest__tvs .tv--live { background: #2a0f0e; color: #ff6b5e; box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.85); flex-direction: column; gap: 3px; }
.fest__tvs .tv--live::before { content: "• прямой эфир"; font-size: 9px; letter-spacing: 0.1em; opacity: 0.8; }
@keyframes tv-flick {
  0%, 100% { filter: brightness(1); }
  47% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
  53% { filter: brightness(0.97); }
  56% { filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  .fest__tvs i { animation: none; }
}
.fest__link {
  display: inline-block;
  margin-top: 2.6em;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  color: var(--ink);
  text-decoration-color: var(--red);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.fest__link:hover { color: var(--red); }

/* ============ документы: ящик ============ */
.docs { position: relative; padding: 3em var(--pad) 7em; }
/* фон канцелярии: лёгкая штриховка-«гофра» и красная печать-круг за ящиком */
.docs::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 5em;
  bottom: 3.5em;
  background: repeating-linear-gradient(-45deg,
    rgba(17, 17, 16, 0.055) 0 3px, transparent 3px 24px);
  pointer-events: none;
}
.docs::after {
  content: "";
  position: absolute;
  right: -4%;
  top: -2em;
  width: clamp(140px, 18vw, 250px);
  aspect-ratio: 1;
  border: 14px solid var(--red);
  border-radius: 50%;
  opacity: 0.85;
  pointer-events: none;
}
.docs__drawer {
  position: relative;
  z-index: 4; /* нить проходит ПОД ящиком */
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 6px 0 rgba(17, 17, 16, 0.9);
}
.docs__drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 1.6em 1.8em 1.8em;
  position: relative;
}
.docs__drawer summary::-webkit-details-marker { display: none; }
.docs__handle {
  position: absolute;
  top: 0.9em;
  left: 50%;
  translate: -50%;
  width: 72px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
}
.docs__drawer h2 { font-size: clamp(30px, 4vw, 52px); margin-top: 0.4em; }
.docs__drawer summary p { margin: 0.5em 0 0; opacity: 0.7; font-size: 13.5px; }
.docs__drawer[open] summary { border-bottom: 1px dashed var(--ink); }
.docs__items { margin: 0; padding: 1.8em; display: grid; gap: 1.6em; }
.docs__items dt {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--red);
}
.docs__items dd { margin: 0.4em 0 0; max-width: 42em; }
/* презентация: большой PDF на дне ящика */
.docs__pdf {
  display: flex;
  align-items: center;
  gap: 1.4em;
  margin: 0.4em 1.8em 1.8em;
  padding: 1.2em 1.4em;
  border: 2px dashed var(--ink);
  text-decoration: none;
  transition: background 0.25s, rotate 0.25s;
}
.docs__pdf:hover { background: var(--yellow); rotate: -0.6deg; }
.docs__pdf-icon {
  width: 72px;
  height: 88px;
  flex: none;
  filter: drop-shadow(3px 3px 0 rgba(17, 17, 16, 0.85));
  transition: rotate 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.docs__pdf:hover .docs__pdf-icon { rotate: -5deg; }
.docs__pdf-text b {
  display: block;
  font-family: var(--font-display);
  font-weight: normal;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.05;
}
.docs__pdf-text .mono { display: block; margin-top: 0.4em; font-size: 12.5px; opacity: 0.65; }

/* ============ контакты ============ */
.contact { padding: 2em var(--pad) 3em; }
.contact h2 {
  font-size: clamp(34px, 5vw, 64px);
  transition: rotate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.5s;
}
/* нить проехала мимо — контакты просыпаются */
.contact.lit h2 { rotate: -2deg; color: var(--red); }
.contact.lit .contact__grid > * {
  animation: contact-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.contact.lit .contact__grid > *:nth-child(2) { animation-delay: 0.12s; }
.contact.lit .contact__grid > *:nth-child(3) { animation-delay: 0.24s; }
@keyframes contact-pop {
  from { opacity: 0; translate: -1.2em 0; }
  to { opacity: 1; translate: 0 0; }
}
.contact__grid {
  display: grid;
  gap: 0.7em;
  margin-top: 1.6em;
  font-size: 16px;
}
.contact__grid a { text-decoration-color: var(--red); text-underline-offset: 4px; }
.contact__grid a:hover { color: var(--red); }

/* ============ подвал ============ */
.footer {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 1.2em var(--pad) 1.6em;
  border-top: 1px solid var(--ink);
  font-size: 12px;
}
.footer__square { width: 14px; height: 14px; background: var(--red); }
.footer a { text-decoration: none; opacity: 0.75; }
.footer a:hover { opacity: 1; color: var(--red); }
/* финал: нить ушла вниз — квадратик мигает и раскрывает подпись */
body.js .footer a { opacity: 0; translate: -12px 0; transition: opacity 0.5s 0.35s, translate 0.5s 0.35s; }
body.js .footer.reveal a { opacity: 0.85; translate: 0 0; }
.footer.reveal .footer__square { animation: sq-blink 0.7s steps(2, jump-none) 2; }
@keyframes sq-blink {
  50% { background: var(--yellow); scale: 1.5; }
}

/* ============ вахтёрша и записка о новой тумбе ============ */
.babushka {
  position: fixed;
  z-index: 70;
  right: 3vw;
  bottom: 0;
  width: min(280px, 38vw);
  transform: translateY(103%);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.babushka.in { transform: translateY(10%); }
.babushka__stage {
  position: relative;
  aspect-ratio: 2 / 3;
  filter: drop-shadow(0 6px 18px rgba(17, 17, 16, 0.35));
}
.babushka__stage img,
.b-arm-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  display: block;
}
/* рука: рычаг от точки за нижним краем слоя (анкор 516×1230 на холсте 768×1152)
   + горизонтальный пинг-понг с отставанием по фазе */
.b-arm {
  translate: 26% 0;
  transform-origin: 67.2% 106.8%;
}
.babushka.in .b-arm { animation: arm-wag 0.76s ease-in-out 0.6s 5; }
.babushka.in .b-arm-wrap { animation: arm-pan 1.9s ease-in-out 0.7s 2; }
@keyframes arm-wag {
  0%, 100% { rotate: 0deg; }
  30% { rotate: -6deg; }
  72% { rotate: 4.5deg; }
}
@keyframes arm-pan {
  0%, 100% { translate: 0 0; }
  30% { translate: -2.5% 0; }
  72% { translate: 2.5% 0; }
}
/* палец отмахал — потом ПОВЕРХ появляется прищуренная голова, качает
   «нельзя!» и исчезает — остаётся родная голова тела */
.b-head { display: none; transform-origin: 50% 50%; }
.babushka.nod .b-head { display: block; animation: head-no 0.85s ease-in-out 2; }
@keyframes head-no {
  0%, 100% { rotate: 0deg; }
  30% { rotate: -3deg; }
  72% { rotate: 2.6deg; }
}
.babushka__bubble {
  position: absolute;
  top: 1%;
  left: auto;
  right: 38%;
  z-index: 2;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--red);
  padding: 0.45em 0.7em;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 30px);
  color: var(--ink);
  rotate: -7deg;
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.25s 0.5s, scale 0.35s 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
.babushka.in .babushka__bubble { scale: 1; }
.babushka.in .babushka__bubble { opacity: 1; }
.tumba-note {
  position: absolute;
  left: 50%;
  bottom: 17%;
  translate: -50%;
  z-index: 5;
  background: var(--paper);
  border: 2px solid var(--red);
  color: var(--red);
  padding: 0.5em 1em;
  font-size: 12px;
  letter-spacing: 0.08em;
  rotate: -3deg;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.tumba-note.show { opacity: 1; }

/* ============ служебный вход: чёрная дверь в админку ============ */
.service-door {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  text-align: center;
  opacity: 0;
  /* дверь гаснет с задержкой: сначала видно, как камера влетает в кольцо */
  transition: opacity 0.7s ease 0.5s;
  pointer-events: none;
}
.service-door.in { opacity: 1; pointer-events: auto; }
.service-door__over {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.3em;
  opacity: 0.55;
}
.service-door__title {
  margin: 0;
  font-family: var(--font-display);
  /* «СЛУЖЕБНЫЙ» — 9 знаков, должен влезать целиком на любом экране */
  font-size: clamp(34px, 8.4vw, 118px);
  line-height: 0.95;
  color: var(--red);
  translate: 0 12px;
  scale: 0.94;
  transition: translate 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.6s, scale 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}
.service-door.in .service-door__title { translate: 0 0; scale: 1; }
.service-door__foot {
  margin: 1.2em 0 0;
  font-size: 13px;
  color: var(--yellow);
  opacity: 0;
  transition: opacity 0.4s 1.1s;
}
.service-door.in .service-door__foot { opacity: 1; }

/* ============ модалка афиши ============ */
.poster-modal {
  position: fixed;
  z-index: 60;
  overflow: hidden;
  border: 3px solid var(--ink);
  transition: top 0.5s cubic-bezier(0.65, 0, 0.35, 1),
              left 0.5s cubic-bezier(0.65, 0, 0.35, 1),
              width 0.5s cubic-bezier(0.65, 0, 0.35, 1),
              height 0.5s cubic-bezier(0.65, 0, 0.35, 1),
              border-radius 0.5s;
}
.poster-modal.open { overflow: auto; }
/* скроллбар модалки — в цвет афиши, а не системной белой полосой */
.poster-modal { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, currentColor 45%, transparent) transparent; }
.poster-modal::-webkit-scrollbar { width: 7px; }
.poster-modal::-webkit-scrollbar-track { background: transparent; }
.poster-modal::-webkit-scrollbar-thumb { background: color-mix(in srgb, currentColor 45%, transparent); border-radius: 4px; }
/* фото события — обесцвеченным фоном, чтению не мешает */
.poster-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pm-photo, none) center / cover no-repeat;
  filter: grayscale(1);
  opacity: 0.14;
  pointer-events: none;
}
.poster-modal.p-dark::before { opacity: 0.26; }
.poster-modal__inner {
  position: relative;
  min-height: 100%;
  padding: clamp(20px, 6vw, 80px);
  opacity: 0;
  transition: opacity 0.3s 0.25s;
}
.poster-modal.open .poster-modal__inner { opacity: 1; }
.poster-modal__back {
  position: sticky;
  top: 14px;
  float: left;
  margin: 14px 0 0 14px;
  z-index: 2;
  border: 2px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  padding: 0.25em 0.5em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s 0.3s;
}
.poster-modal.open .poster-modal__back { opacity: 1; }
.poster-modal__back:hover { background: rgba(0, 0, 0, 0.12); }
/* палитры модалки = палитры афиш */
.poster-modal.p-paper  { background: #efece4; color: #161614; }
.poster-modal.p-dark   { background: #1a1a1c; color: #f2f2ee; }
.poster-modal.p-yellow { background: #f3d048; color: #161614; }
.poster-modal.p-red    { background: #e03430; color: #ffffff; }
.pm-brand {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.04em;
  opacity: 0.75;
  margin-bottom: 1.6em;
}
.pm-place { font-family: var(--font-mono); font-size: 14px; border-bottom: 2px solid currentColor; padding-bottom: 0.8em; }
.pm-foot {
  display: block;
  margin-top: 3.5em;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font-size: 12px;
  opacity: 0.55;
  cursor: pointer;
}
.pm-foot:hover { opacity: 1; }
.pm-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 9vw, 120px);
  line-height: 0.98;
  margin: 0.35em 0 0.2em;
  overflow-wrap: anywhere; /* «Петр_Ушка_иностранец» влезает на любом телефоне */
}
.poster-modal.p-paper .pm-title { color: var(--red); }
.poster-modal.p-dark .pm-title { color: var(--yellow); }
.pm-sub { font-family: var(--font-mono); font-size: 16px; max-width: 34em; }
.pm-details { max-width: 38em; margin-top: 1.8em; font-size: 15.5px; }
/* полноценное фото — как в раскрытой статье */
.pm-photo {
  display: block;
  width: 100%;
  max-width: 42em;
  margin-top: 2.2em;
  border: 3px solid currentColor;
}
.pm-date { font-family: var(--font-mono); margin-top: 2.2em; font-size: 14px; }
.pm-date::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--yellow);
  margin-left: 0.7em;
  vertical-align: middle;
}
.poster-modal.p-yellow .pm-date::after { background: var(--red); }
.pm-link {
  display: inline-block;
  margin-top: 1.6em;
  font-family: var(--font-display);
  font-size: 22px;
  color: inherit;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

/* ============ мобильный ============ */
@media (max-width: 760px) {
  html { scrollbar-gutter: auto; } /* полоса-жёлоб справа не нужна на телефоне */
  .hero__vertical { display: none; }
  .hero__stage { height: 72vh; height: 72svh; }
  .hero__statement {
    margin-top: 3svh;
    padding-top: 7svh;
    line-height: 1.12;
  }
  .hero__ring { width: min(88vw, 480px); }
  .hero__aside { display: none; }
  /* красная диагональ на телефоне была ПОД основанием тумбы — поднимаем
     за корпус, чтобы работал объём «линия за тумбой» */
  .dood-line--red { translate: 0 -265px; }
  /* тумба на телефоне крупнее — тень шире; линию пола ставит JS (--floor-y) */
  .hero__shadow { width: min(96vw, 560px); }
  .hero__statement span:nth-child(2) { margin-left: 0.6em; }
  .hero__statement span:nth-child(3) { margin-left: 1.3em; }
  .skew-menu { gap: 0.8em 1.6em; transform: rotate(-4deg); }
  .verbs__item:nth-child(n) { margin-left: 0; }
  .verbs__item:nth-child(even) { margin-left: 12%; }
  /* мобильная схема: заголовок прилипает сверху, при выборе события
     список ужимается в узкую колонку слева, справа — карточка события */
  .done {
    grid-template-areas: "head head" "list panel";
    grid-template-columns: 1fr 0fr;
    grid-template-rows: auto 1fr;
    min-height: auto;
  }
  .done.expanded { grid-template-columns: 96px 1fr; }
  .done__red {
    grid-area: head;
    position: sticky;
    top: 0;
    min-height: 0;
    min-width: 0;
    padding: 1em var(--pad) 1.1em;
  }
  .done__red h2 { position: static; font-size: 26px; }
  .done.expanded .done__red h2 { opacity: 1; translate: none; }
  .done__red .section-index { display: none; }
  .done__spine { display: none; }
  .done__list-wrap { grid-area: list; padding: 1.5em 1em; }
  .done.expanded .done__list-wrap { padding: 1em 0.4em; }
  .done.expanded .done__item-btn {
    grid-template-columns: 1fr;
    gap: 0;
    font-size: 10.5px;
    line-height: 1.3;
    padding: 0.55em 0.35em;
  }
  .done.expanded .done__year,
  .done.expanded .done__where { display: none; }
  .done__panel { grid-area: panel; border-left: 2px solid var(--ink); }
  .done__panel-inner { padding: 3.2em 1em 2em; }
  .done__back { top: 0.6em; right: 0.6em; }
  .about__sun { right: -30vw; bottom: -40vw; width: 70vw; }
  .about__team { position: static; width: 72%; margin: 2.5em auto 0; }
  .about__team figcaption { text-align: left; }
  .slogan__stamp {
    position: static;
    display: inline-block;
    margin-top: 1.2em;
    font-size: 10px;
    transform: rotate(-4deg);
  }
  .fest__band { height: 96px; }
  .fest__bird { height: 120px; top: -20px; }
  .fest__bird--dates { height: 104px; }
  .fest__say { font-size: 17px; }
  /* на узком экране реплики разносим по вертикали, чтобы не сталкивались */
  .fest__say--left { left: calc(6% + 128px); top: 27%; }
  .fest__say--right { right: calc(8% + 112px); top: 73%; }
}
