/* ==========================================================
   FUCKSWAT // TRUEADAM — интерфейс поверх 3D
   Всё, что не сцена: панель сверху и экран загрузки.
   Один тёмный мир, светлой темы нет — это осознанно.
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --void:  #000000;   /* фон под сценой */
  --bone:  #E6EDEA;   /* текст */
  --ash:   #7C8985;   /* второстепенный текст */
  --edge:  rgba(230,237,234,.16);
  --edge2: rgba(230,237,234,.34);
  --rec:   #D81F2A;   /* красный индикатор кассеты */
  --crt:   #8FE3CE;   /* холодный свет экрана */

  --mono: "Cascadia Mono", Consolas, "SF Mono", ui-monospace, "Courier New", monospace;

  color-scheme: dark;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--bone);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

:focus-visible { outline: 1px solid var(--crt); outline-offset: 3px; }


/* ---------- панель сверху ---------------------------------- */

.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(12px, 2.4vw, 22px) clamp(12px, 3vw, 30px);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .7s ease .1s, transform .7s ease .1s;
  pointer-events: none;
}

.hud.is-live { opacity: 1; transform: none; }
.hud.is-live .btn { pointer-events: auto; }

.hud__side { display: flex; align-items: center; gap: 10px; }
.hud__side--end { gap: 6px; }

.hud__note {
  font-size: 9.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(124,137,133,.7);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px 6px;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: rgba(8,10,10,.42);
  backdrop-filter: blur(3px);
  color: var(--ash);
  font: inherit;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: color .22s ease, border-color .22s ease, background .22s ease;
}

.btn:hover { color: var(--bone); border-color: var(--edge2); }
.btn.is-on { color: var(--bone); border-color: var(--edge2); background: rgba(20,24,23,.6); }

.btn--lang { padding-inline: 11px; min-width: 44px; justify-content: center; }

.led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #2a2f2e;
  box-shadow: none;
  transition: background .22s ease, box-shadow .22s ease;
}

.btn--vhs.is-on .led {
  background: var(--rec);
  box-shadow: 0 0 7px rgba(216,31,42,.85);
  animation: pulse 2.1s steps(1) infinite;
}

@keyframes pulse { 0%, 62% { opacity: 1 } 63%, 100% { opacity: .35 } }


/* ---------- нижняя палуба: переходы между сторонами -------- */

.deck {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 0 16px clamp(20px, 4vh, 40px);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}

.deck.is-live { opacity: 1; }

.act {
  appearance: none;
  display: none;               /* показывается тем экраном, которому принадлежит */
  margin: 0;
  padding: 13px 26px 12px;
  border: 1px solid var(--edge2);
  border-radius: 2px;
  background: rgba(8,11,11,.55);
  backdrop-filter: blur(4px);
  color: var(--bone);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: color .22s ease, border-color .22s ease, background .22s ease, letter-spacing .3s ease;
}

.deck.is-live .act.is-shown { display: inline-flex; pointer-events: auto; }

.act:hover {
  border-color: var(--crt);
  background: rgba(20,30,28,.72);
  letter-spacing: .3em;
}

.act::after {
  content: "→";
  margin-left: 14px;
  color: var(--crt);
  letter-spacing: 0;
}

.dots { display: flex; gap: 7px; }

.dots i {
  width: 22px; height: 2px;
  background: rgba(230,237,234,.2);
  transition: background .3s ease;
}

.dots i.is-on { background: var(--crt); }


/* ---------- экран загрузки --------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(14px, 3vw, 30px);
  background: #000;
  transition: opacity .55s ease .1s;
}

.boot.is-gone { opacity: 0; pointer-events: none; }

/* полосы развёртки и зерно — рисуем на самом экране загрузки,
   потому что WebGL в этот момент ещё не показывает кадр */
.boot__lines {
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.055) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

.boot__grain {
  position: absolute; inset: -30%;
  pointer-events: none;
  opacity: .3;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.55'/></svg>");
  animation: drift .28s steps(3) infinite;
}

@keyframes drift {
  0%   { transform: translate3d(0,0,0) }
  33%  { transform: translate3d(-2.2%, 1.6%, 0) }
  66%  { transform: translate3d(1.9%, -1.4%, 0) }
  100% { transform: translate3d(-1.1%, -2.1%, 0) }
}

.boot__head,
.boot__foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ash);
}

.boot__foot { justify-content: flex-end; color: rgba(124,137,133,.55); }

.boot__rec {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 8px rgba(216,31,42,.7);
  animation: blink 1.15s steps(1) infinite;
}

@keyframes blink { 0%, 55% { opacity: 1 } 56%, 100% { opacity: .12 } }

.boot__tc { margin-left: auto; font-variant-numeric: tabular-nums; letter-spacing: .16em; }

.boot__mid {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  width: min(520px, 82vw);
  text-align: center;
}

.boot__word {
  margin: 0 0 18px;
  font-size: clamp(22px, 5.4vw, 36px);
  letter-spacing: .5em;
  text-indent: .5em;          /* компенсация трекинга справа */
  color: var(--bone);
  text-shadow: 1.4px 0 0 rgba(216,31,42,.5), -1.4px 0 0 rgba(80,190,255,.4);
  animation: wobble 4.5s ease-in-out infinite;
}

@keyframes wobble {
  0%, 100% { transform: translateX(0) }
  47%      { transform: translateX(-1px) }
  49%      { transform: translateX(3px) }
  51%      { transform: translateX(-2px) }
  53%      { transform: translateX(0) }
}

.boot__meter {
  height: 5px;
  border: 1px solid var(--edge);
  background: rgba(255,255,255,.03);
}

.boot__meter > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(143,227,206,.35), var(--crt));
  box-shadow: 0 0 10px rgba(143,227,206,.35);
  transition: width .18s linear;
}

.boot__pct {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}

.boot__pct em { font-style: normal; opacity: .55; }

/* финальный кадр перед показом сцены */
.boot.is-ready .boot__word { animation: none; letter-spacing: .62em; }
.boot.is-ready .boot__meter > i { background: var(--crt); }

@media (max-width: 520px) {
  .hud { padding-top: max(12px, env(safe-area-inset-top)); }
  .hud__note { display: none; }
  .btn { font-size: 10px; letter-spacing: .16em; padding: 6px 9px 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .boot__grain, .boot__word, .boot__rec, .btn--vhs.is-on .led { animation: none; }
}

/* ---------- кнопки на полу (пятая сторона) ----------------- */
/* Лежат в плоскости пола: контейнеру перспектива, колоде — наклон по X.
   Поэтому они читаются как часть сцены, а не как панель поверх неё. */

.floor {
  position: fixed;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity .55s ease;
  perspective: 640px;
}
.floor.is-live { opacity: 1; pointer-events: auto; }

.floor__deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
  transform: rotateX(22deg);
  transform-origin: 50% 100%;
}

.fbtn {
  font: 600 12px/1 var(--mono);
  letter-spacing: .18em;
  color: var(--bone);
  background: rgba(6, 10, 9, .52);
  border: 1px solid var(--edge2);
  padding: 17px 28px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .25s ease, border-color .25s ease,
              color .25s ease, transform .25s ease;
}
.fbtn:hover,
.fbtn:focus-visible {
  background: rgba(216, 31, 42, .18);
  border-color: var(--rec);
  color: #fff;
  transform: translateY(-7px);
  outline: none;
}

@media (max-width: 720px) {
  .floor { top: 56%; width: min(92vw, 420px); }
  .floor__deck { grid-template-columns: 1fr; gap: 9px; transform: rotateX(16deg); }
  .fbtn { padding: 14px 18px; font-size: 11px; letter-spacing: .14em; }
}

/* ---------- плоский раздел поверх сцены -------------------- */

.page {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(130% 95% at 50% -10%, #0c1211 0%, #050807 55%, #000 100%);
  animation: pageIn .42s cubic-bezier(.2, .8, .3, 1) both;
}
.page[hidden] { display: none; }

@keyframes pageIn {
  from { opacity: 0; transform: scale(1.015); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* тракт плёнки для плоских страниц: зерно, строки, полоса трекинга */
.page__grain,
.page__lines,
.page__track {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.page__grain {
  opacity: .16;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift .7s steps(4) infinite;
}
@keyframes grainShift {
  0%   { background-position: 0 0; }
  25%  { background-position: -40px 30px; }
  50%  { background-position: 25px -35px; }
  75%  { background-position: -20px -15px; }
  100% { background-position: 0 0; }
}

.page__lines {
  opacity: .5;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0 2px,
    rgba(0, 0, 0, .40) 3px 4px);
}

.page__track {
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(200, 230, 225, .06) 42%,
    rgba(230, 245, 240, .13) 50%,
    rgba(200, 230, 225, .06) 58%,
    rgba(255, 255, 255, 0) 100%);
  height: 16vh;
  inset: auto 0 auto 0;
  animation: trackRoll 7.5s linear infinite;
}
@keyframes trackRoll {
  from { top: -18vh; }
  to   { top: 108vh; }
}

/* плёнку можно выключить тем же тумблером, что и в сцене */
.page.no-vhs .page__grain,
.page.no-vhs .page__lines,
.page.no-vhs .page__track { display: none; }

.page__wrap {
  position: relative;
  z-index: 3;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(72px, 12vh, 130px) clamp(20px, 6vw, 48px) 80px;
}

.page__back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 600 11px/1 var(--mono);
  letter-spacing: .2em;
  color: var(--ash);
  background: transparent;
  border: 1px solid var(--edge);
  padding: 11px 18px;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.page__back:hover,
.page__back:focus-visible {
  color: var(--bone);
  border-color: var(--edge2);
  background: rgba(230, 237, 234, .06);
  outline: none;
}

.page__tag {
  margin: clamp(34px, 7vh, 64px) 0 10px;
  font-size: 10.5px;
  letter-spacing: .34em;
  color: var(--rec);
}

.page__title {
  margin: 0;
  font-size: clamp(30px, 6.4vw, 62px);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.02;
  text-wrap: balance;
  /* разбег каналов, как у ленты */
  text-shadow: -1.5px 0 rgba(216, 31, 42, .55), 1.5px 0 rgba(120, 220, 205, .38);
}

.page__body {
  margin-top: clamp(30px, 6vh, 58px);
  border-top: 1px solid var(--edge);
  padding-top: 26px;
}

.page__stub {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--crt);
}

.page__note {
  margin: 0;
  max-width: 62ch;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: .02em;
  color: var(--ash);
}

@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
  .page__grain, .page__track { animation: none; }
  .page__track { display: none; }
}

/* ссылки в нижней палубе выглядят как кнопки */
a.act { text-decoration: none; }
a.act:visited { color: inherit; }
/* пара ссылок в один ряд: столбиком из трёх кнопок палуба выглядит грудой */
.deck__row { display: none; gap: 12px; flex-wrap: wrap; justify-content: center; }
.deck.is-live .deck__row.is-shown { display: flex; pointer-events: auto; }
.deck.is-live .deck__row.is-shown .act.is-shown { display: inline-flex; pointer-events: auto; }
@media (max-width: 620px) { .deck__row { flex-direction: column; } }
/* ---------- надпись на полу: конец кассеты ----------------- */

.floortext {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s ease;
}
.floortext.is-live { opacity: 1; pointer-events: auto; }

.floortext__tag {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: .38em;
  color: var(--rec);
}
.floortext__lead {
  margin: 0;
  font-size: clamp(15px, 2.4vw, 22px);
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--bone);
}
.floortext__hint {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 600 11px/1 var(--mono);
  letter-spacing: .24em;
  color: var(--ash);
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 12px 22px;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.floortext__hint:hover,
.floortext__hint:focus-visible {
  color: var(--bone);
  border-color: var(--edge2);
  background: rgba(230, 237, 234, .06);
  outline: none;
}
.floortext__arrow { animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ---------- плоский сайт под сценой ------------------------ */

.site {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background:
    radial-gradient(120% 80% at 50% -10%, #0b100f 0%, #050807 55%, #000 100%);
  transform: translateY(100%);
  transition: transform .75s cubic-bezier(.22, .8, .28, 1);
}
.site.is-open { transform: none; }
.site[hidden] { display: none; }

.site__inner {
  position: relative;
  z-index: 3;
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(70px, 13vh, 130px) clamp(20px, 6vw, 46px) clamp(60px, 12vh, 110px);
  display: flex;
  flex-direction: column;
  gap: clamp(44px, 8vh, 82px);
}

.site__head { display: flex; flex-direction: column; gap: 10px; }
.site__eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: .32em;
  color: var(--rec);
}
.site__title {
  margin: 0;
  font-size: clamp(34px, 7vw, 68px);
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--ash);
  text-shadow: -1.5px 0 rgba(216, 31, 42, .45), 1.5px 0 rgba(120, 220, 205, .3);
}
.site__title b { font-weight: 700; color: var(--bone); }

.site__block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--edge);
  padding-top: 22px;
}
.site__h {
  margin: 0;
  font-size: clamp(17px, 3vw, 24px);
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--bone);
}
.site__stub {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: .3em;
  color: var(--crt);
}
.site__body {
  margin: 0;
  max-width: 62ch;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ash);
}

.site__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.site__links .act { display: inline-flex; pointer-events: auto; }

.site__up {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 600 11px/1 var(--mono);
  letter-spacing: .2em;
  color: var(--ash);
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 12px 20px;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.site__up:hover,
.site__up:focus-visible {
  color: var(--bone);
  border-color: var(--edge2);
  background: rgba(230, 237, 234, .06);
  outline: none;
}

.site.no-vhs .page__grain,
.site.no-vhs .page__lines,
.site.no-vhs .page__track { display: none; }

@media (prefers-reduced-motion: reduce) {
  .site { transition: none; }
  .floortext__arrow { animation: none; }
}

/* ---------- панель правки текста --------------------------- */

.site__foot { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }

.editbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.editbar[hidden] { display: none; }
.editbar__note {
  flex-basis: 100%;
  margin: 4px 0 0;
  max-width: 60ch;
  font-size: 12px;
  line-height: 1.6;
  color: var(--crt);
}

/* редактируемые блоки подсвечиваем пунктиром, чтобы видеть границы */
body.is-edit [data-i18n] {
  outline: 1px dashed rgba(143, 227, 206, .45);
  outline-offset: 4px;
  border-radius: 2px;
  cursor: text;
}
body.is-edit [data-i18n]:focus {
  outline: 1px solid var(--crt);
  background: rgba(143, 227, 206, .06);
}
/* плавающая панель правки: висит поверх всего, её видно всегда */
.editbar {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  max-width: min(94vw, 760px);
  padding: 10px 12px;
  background: rgba(4, 7, 6, .88);
  border: 1px solid var(--edge2);
  border-radius: 3px;
  backdrop-filter: blur(6px);
}
.editbar[hidden] { display: none; }

.ebtn {
  font: 600 10.5px/1 var(--mono);
  letter-spacing: .18em;
  color: var(--ash);
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 10px 14px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.ebtn:hover, .ebtn:focus-visible {
  color: var(--bone);
  border-color: var(--edge2);
  background: rgba(230, 237, 234, .07);
  outline: none;
}
.ebtn--main { color: var(--crt); border-color: rgba(143, 227, 206, .45); }
.editbar.is-live .ebtn--main { color: #04100d; background: var(--crt); border-color: var(--crt); }
.ebtn--off { color: rgba(216, 31, 42, .8); }

.editbar__note {
  flex-basis: 100%;
  margin: 2px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.55;
  color: var(--crt);
}
.editbar__note:empty { display: none; }
/* ---------- работы: слой уезжает вправо -------------------- */

.works {
  position: fixed;
  inset: 0;
  z-index: 55;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: radial-gradient(120% 80% at 50% -10%, #0b100f 0%, #050807 55%, #000 100%);
  transform: translateX(100%);
  transition: transform .7s cubic-bezier(.22, .8, .28, 1);
}
.works.is-open { transform: none; }
.works[hidden] { display: none; }
.works.no-vhs .page__grain,
.works.no-vhs .page__lines,
.works.no-vhs .page__track { display: none; }

.works__inner {
  position: relative;
  z-index: 3;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(60px, 10vh, 110px) clamp(18px, 5vw, 46px) clamp(60px, 12vh, 110px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.works__title {
  margin: 0 0 clamp(26px, 5vh, 52px);
  font-size: clamp(30px, 6vw, 58px);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--bone);
  text-shadow: -1.5px 0 rgba(216, 31, 42, .45), 1.5px 0 rgba(120, 220, 205, .3);
}

.works__list { display: flex; flex-direction: column; gap: clamp(52px, 10vh, 96px); }

.work { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.work__no {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: .3em;
  color: var(--rec);
}
.work__name {
  margin: 0 0 14px;
  font-size: clamp(26px, 5.4vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: .02em;
  color: var(--bone);
  text-wrap: balance;
}
.work__img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: #0a0d0c;
}

/* Кнопка «посмотреть работы» стоит в потоке блока, а не в нижней палубе,
   поэтому правила .act к ней не применяются — рисуем её отдельно. */
.site__cta {
  align-self: flex-start;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 11.5px/1 var(--mono);
  letter-spacing: .22em;
  color: var(--bone);
  background: rgba(8, 11, 11, .55);
  border: 1px solid var(--edge2);
  border-radius: 2px;
  padding: 14px 26px 13px;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease,
              background .25s ease, transform .25s ease;
}
.site__cta::after { content: '\2192'; }
.site__cta:hover,
.site__cta:focus-visible {
  color: #fff;
  border-color: var(--rec);
  background: rgba(216, 31, 42, .16);
  transform: translateY(-2px);
  outline: none;
}
/* ---------- заметки на полях кадра ------------------------- */
/* Высота строки и шаг линеек совпадают, поэтому текст ложится
   ровно по разлиновке, как в блокноте. */

.marg {
  /* --rule задаёт сразу три вещи: высоту строки, шаг линеек и кегль,
     поэтому текст всегда садится ровно по разлиновке */
  --rule: clamp(22px, 2.3vw, 36px);
  position: fixed;
  top: 13%;
  width: clamp(132px, 15.5vw, 268px);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}
.marg.is-live { opacity: 1; }
.marg--l { left: clamp(14px, 3vw, 46px); }
.marg--r { right: clamp(14px, 3vw, 46px); }

.marg__txt {
  margin: 0;
  min-height: var(--rule);
  padding-left: 14px;
  font-size: calc(var(--rule) * 0.72);
  line-height: var(--rule);
  letter-spacing: .01em;
  color: rgba(198, 214, 209, .62);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 calc(var(--rule) - 1px),
    rgba(230, 237, 234, .10) calc(var(--rule) - 1px) var(--rule));
  border-left: 1px solid rgba(216, 31, 42, .38);
}
.marg--r .marg__txt {
  padding-left: 0;
  padding-right: 10px;
  text-align: right;
  border-left: 0;
  border-right: 1px solid rgba(216, 31, 42, .38);
}

.marg.is-typing .marg__txt::after {
  content: '\258C';
  color: var(--crt);
  animation: margCaret 1s steps(1) infinite;
}
@keyframes margCaret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* на узком экране колонки лезут на ноутбук — убираем */
/* На телефоне заметки остаются, но ужимаются: в полный кегль две колонки
   закрыли бы саму маску. Кегль, высота строки и шаг линеек по-прежнему
   считаются от одного числа, поэтому разлиновка не разъезжается. */
@media (max-width: 840px) {
  .marg { --rule: 15px; width: clamp(92px, 27vw, 124px); top: 11%; }
  .marg--l { left: 6px; }
  .marg--r { right: 6px; }
  .marg__txt { padding-left: 8px; letter-spacing: 0; }
  .marg--r .marg__txt { padding-left: 0; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .marg.is-typing .marg__txt::after { animation: none; }
}
/* ---------- телефон ---------------------------------------- */

#gl { touch-action: none; }          /* жесты по кадру наши, не браузера */

@media (max-width: 820px) {
  .hud { padding: 10px 12px; }
  .btn { font-size: 10px; letter-spacing: .14em; padding: 8px 10px; }
  .hud__note { display: none; }

  .deck { bottom: 18px; gap: 8px; }
  .act { font-size: 10.5px; letter-spacing: .16em; padding: 12px 18px 11px; }

  .floortext__lead { font-size: 15px; letter-spacing: .14em; }
  .floortext__hint { font-size: 10px; padding: 11px 16px; }

  .site__inner, .works__inner { padding-left: 18px; padding-right: 18px; }
  .site__links { flex-direction: column; align-items: stretch; }
  .site__links .act { justify-content: center; }
  .site__cta { width: 100%; justify-content: center; }

  .editbar { left: 8px; right: 8px; max-width: none; }
  .ebtn { flex: 1 1 auto; padding: 11px 8px; letter-spacing: .1em; }
}
/* ---------- поверх сцены только язык и плёнка --------------- */
/* Кнопки перехода убраны: стороны листаются колесом, свайпом и стрелками.
   Точки-указатели оставлены — они не кнопка, а отметка места. */

.deck .act,
.deck .deck__row { display: none !important; }
.deck { pointer-events: none; }
.deck .dots { pointer-events: none; }

/* приглашение на полу перестаёт быть кнопкой, но остаётся нажимаемым */
.floortext__hint {
  border: 0;
  background: none;
  padding: 4px 0 0;
  letter-spacing: .3em;
  pointer-events: auto;
}
.floortext__hint:hover,
.floortext__hint:focus-visible { background: none; border: 0; }