/* =====================================================================
   RASTIK — стили
   Палитра: бумага / тушь / красный мазок. Ночь для «Жителей».
   ===================================================================== */

/* ---------- Шрифты: свои файлы в assets/fonts (Google Fonts, лицензия OFL) ----------
   Кириллица и латиница отдельными файлами: браузер качает только нужный набор.
   Golos Text и Oswald вариативные, один файл на все веса. */
@font-face { font-family: "Dela Gothic One"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/dela-gothic-one-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Dela Gothic One"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/dela-gothic-one-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(assets/fonts/golos-text-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(assets/fonts/golos-text-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(assets/fonts/oswald-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(assets/fonts/oswald-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/pt-mono-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/pt-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* слово стороны на главной (look-razvertka.js): жирная машинопись */
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(assets/fonts/ibm-plex-mono-700-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* плакат во вкладке «Портфолио» (poster.js): огромные буквы и граффити-теги */
@font-face { font-family: "Sofia Sans Extra Condensed"; font-style: normal; font-weight: 900; font-display: swap;
  src: url(assets/fonts/sofia-sans-extra-condensed-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Sofia Sans Extra Condensed"; font-style: normal; font-weight: 900; font-display: swap;
  src: url(assets/fonts/sofia-sans-extra-condensed-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sedgwick Ave Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/sedgwick-ave-display-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;

  --paper: #dcd8cf;
  --paper-2: #cfcac0;
  --ink: #0f0f0e;
  --ink-2: #161614;
  --ash: #55534d;
  --ash-night: #9b988f;
  --red: #d0261b;
  --red-hot: #ff3b2f;
  --glow: #f1e8cf;

  --concrete: #33322e;
  --concrete-2: #393834;
  --seam: #1d1c1a;
  --frame: #5d5b54;
  --glass: #0e0f11;

  --bg: var(--paper);
  --fg: var(--ink);
  --muted: var(--ash);
  --line: rgba(15, 15, 14, .2);

  --f-display: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --f-body: "Golos Text", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "PT Mono", ui-monospace, Menlo, Consolas, monospace;
  --f-cond: "Oswald", "Arial Narrow", Impact, sans-serif;   /* узкий гротеск для заголовка приветствия */
  --top-h: 59px;                                              /* высота шапки, JS уточняет */

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  --speck-dark: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' seed='3' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 .06  0 0 0 0 .06  0 0 0 0 .05  -.9 0 0 0 .52'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
  --speck-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 .9  0 0 0 0 .88  0 0 0 0 .84  .8 0 0 0 -.42'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #8f8b82 var(--paper);   /* полоса прокрутки страницы в палитре бумаги */
}
/* класс night-on у <html> ставит app.js вместе с night у <body>. Раньше здесь было html:has(body.night): из-за :has() на корне
   браузер пересчитывал стили ВСЕГО документа при любой вставке узла — бегущие буквы, смена главы (01.12, замер styletrace.mjs) */
html.night-on { scrollbar-color: #4a4943 var(--ink); }
::selection { background: var(--red); color: var(--paper); }

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image: var(--speck-dark);
  color: var(--fg);
  font: 400 16px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
body.night {
  color-scheme: dark;
  --bg: var(--ink);
  --fg: var(--paper);
  --muted: var(--ash-night);
  --line: rgba(220, 216, 207, .14);
  background-image: var(--speck-light);
}
body.locked { overflow: hidden; }
main { overflow-x: clip; }

img, video { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute; left: -9999px; top: 12px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 8px 12px;
  font: 13px var(--f-mono); text-decoration: none;
}
.skip:focus { left: 16px; }

.grain {
  position: fixed; inset: 0; z-index: 120; pointer-events: none;
  background-image: var(--noise);
  opacity: .09;
}
body.night .grain { opacity: .06; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  margin: 0;
  font: 400 12px/1.4 var(--f-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono { font-family: var(--f-mono); }

.sec-title {
  margin: 0;
  font: 400 clamp(32px, 4.4vw, 56px)/1 var(--f-display);
  letter-spacing: -.005em;
  text-wrap: balance;
}

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 3vw, 32px);
  padding: 12px var(--gutter);
  background-color: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background-color .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease);
}
/* над приветственным экраном: прозрачная, светлый текст (JS: headerOver) */
.top.over {
  --fg: var(--paper); --muted: rgba(220, 216, 207, .62); --line: rgba(220, 216, 207, .22); --bg: var(--ink);
  background-color: transparent; border-bottom-color: transparent;
}
/* глава на телефоне уехала под шапку: фон тёмный, чтобы текст не просвечивал сквозь вкладки */
.top.over.solid { background-color: var(--ink); border-bottom-color: rgba(220, 216, 207, .12); }
/* 15.11: в шапке остался только язык справа — полосы нет: фон прозрачный, без линии, страница листается под кнопками */
.top, .top.over, .top.over.solid { display: flex; justify-content: flex-end; background-color: transparent; border-bottom-color: transparent; pointer-events: none; }
.top-end { display: flex; align-items: center; justify-content: flex-end; gap: clamp(14px, 2.4vw, 36px); pointer-events: auto; }

/* вкладки: столбиком справа по центру экрана, всегда по-английски. Справа от слова черта,
   у открытой вкладки — длинная красная */
.tabs {
  position: fixed; z-index: 70; right: var(--gutter); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.tabs a {
  display: flex; align-items: center; gap: 12px;
  font: 400 12px/1 var(--f-mono);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: 9px 0 9px 10px;
  transition: color .2s;
}
.tabs a::before {
  content: ""; order: 2; flex: none; width: 16px; height: 2px; background: currentColor; opacity: .55;
  transition: width .25s var(--ease), background-color .25s, opacity .25s;
}
.tabs a:hover { color: var(--fg); }
.tabs a:hover::before { width: 24px; opacity: 1; }
.tabs a[aria-current] { color: var(--fg); }
.tabs a[aria-current]::before { width: 34px; background: var(--red); opacity: 1; }
body.locked .tabs { visibility: hidden; }

.lang { display: flex; background: var(--bg); }
.lang button {
  background: transparent; border: 1px solid var(--line);
  transition: color .4s, background-color .4s, border-color .4s;
  font: 400 12px/1 var(--f-mono); letter-spacing: .08em;
  padding: 9px 9px; cursor: pointer; color: var(--muted);
}
.lang button + button { border-left: 0; }
.lang button[aria-pressed="true"] { color: var(--bg); background: var(--fg); border-color: var(--fg); }

/* звук двора (sound.js): «Звук» и четыре столбика. Играет — столбики пляшут, включён, но браузер
   ещё ждёт первого действия — стоят, выключен — лежат, а слово зачёркнуто */
.snd {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  font: 400 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 8px 10px; color: var(--muted);
  transition: color .4s, border-color .4s;
}
.snd:hover, .snd[aria-pressed="true"] { color: var(--fg); }
.snd-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.snd-bars i { width: 2px; height: 2px; background: currentColor; transition: height .3s; }
.snd[aria-pressed="true"] .snd-bars i { height: 6px; }
.snd.is-live .snd-bars i { animation: snd-eq .9s ease-in-out infinite alternate; }
.snd.is-live .snd-bars i:nth-child(2) { animation-duration: .65s; animation-delay: -.3s; }
.snd.is-live .snd-bars i:nth-child(3) { animation-duration: .8s; animation-delay: -.55s; }
.snd.is-live .snd-bars i:nth-child(4) { animation-duration: .55s; animation-delay: -.15s; }
@keyframes snd-eq { from { height: 2px; } to { height: 11px; } }
.snd[aria-pressed="false"] .snd-word { text-decoration: line-through; text-decoration-thickness: 1px; }
.no-sound .snd { display: none; }

/* зона нажатия не меньше 44 px по высоте, рисунок кнопок прежний */
.tabs a, .lang button, .snd, .corner a, .btn-line, .x, .to-top { position: relative; }
.tabs a::after, .lang button::after, .snd::after, .corner a::after, .btn-line::after, .x::after, .to-top::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%);
}

/* ---------- Placeholder frame (shared) ---------- */
.ph {
  position: absolute; inset: 0; display: block; overflow: hidden;
  background-color: var(--ink);
  background-image: var(--speck-light), radial-gradient(ellipse at 50% 55%, #252521 0%, #0f0f0e 72%);
  color: var(--paper);
  font-family: var(--f-mono);
}
.ph > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-guides, .ph-guides::before, .ph-guides::after { position: absolute; display: block; pointer-events: none; }
.ph-guides {
  inset: 0;
  background:
    linear-gradient(rgba(220,216,207,.22), rgba(220,216,207,.22)) center / 22px 1px no-repeat,
    linear-gradient(rgba(220,216,207,.22), rgba(220,216,207,.22)) center / 1px 22px no-repeat;
}
.ph-guides::before { content: ""; inset: 5%; border: 1px dashed rgba(220, 216, 207, .12); }
.ph-guides::after { content: ""; inset: 10%; border: 1px dashed rgba(220, 216, 207, .08); }
.ph-top, .ph-bot {
  position: absolute; left: 3%; right: 3%;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: clamp(9px, 1vw, 12px); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(220, 216, 207, .62);
  font-variant-numeric: tabular-nums;
}
.ph-top { top: 4%; }
.ph-bot { bottom: 4%; }
.rec {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red-hot); margin-right: 8px; vertical-align: 1px;
  animation: blink 1.2s steps(1, end) infinite;
}
.ph-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 80%; text-align: center;
  font: 400 clamp(14px, 2.4vw, 30px)/1.1 var(--f-display);
  text-transform: uppercase; letter-spacing: .02em;
  color: var(--paper);
}
.ph-ghost {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 88%; text-align: center; text-wrap: balance;
  font: 400 clamp(24px, 4.6vw, 68px)/.95 var(--f-display);
  text-transform: uppercase;
  color: rgba(220, 216, 207, .1);
  transition: color .35s var(--ease);
}
.ph-play {
  position: absolute; left: 50%; top: 50%;
  width: clamp(64px, 9vw, 104px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid var(--paper); border-radius: 50%;
  display: block;
  transition: background-color .25s, border-color .25s;
}
.ph-play::after {
  content: ""; position: absolute; left: 54%; top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid; border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--paper);
}
.ph.has-poster .ph-guides, .ph.has-poster .ph-top, .ph.has-poster .ph-bot, .ph.has-poster .ph-ghost { display: none; }
/* тонкий контур, чтобы светлая обложка не сливалась с бумагой */
.ph.has-poster::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(15, 15, 14, .35); pointer-events: none; }
/* с обложкой play не закрывает её центр: плашка в углу */
.ph-cta {
  position: absolute; left: 3%; bottom: 5%;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 18px 12px 14px;
  background: var(--ink); color: var(--paper);
  font: 400 clamp(11px, 1vw, 13px)/1 var(--f-mono);
  letter-spacing: .14em; text-transform: uppercase;
  transition: background-color .25s;
}
.ph-cta i {
  width: 0; height: 0; border-style: solid;
  border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor;
}
.ph-locked { background-image: var(--speck-light), radial-gradient(ellipse at 50% 55%, #2a0d0a 0%, #0f0f0e 70%); }
.ph-locked .ph-msg { color: var(--red-hot); }

@keyframes blink { 50% { opacity: 0; } }

/* =====================================================================
   WORK VIEW
   ===================================================================== */
/* ---------- приветственный экран (data.js: welcome) ----------
   тёмный, на всю высоту окна, заезжает под прозрачную шапку.
   Раскладка: подпись слева посередине, огромный заголовок внизу слева,
   справа описание, статус и кнопка; низ кнопки на одной линии с низом заголовка.
   Картинка по центру. */
.welcome {
  position: relative; isolation: isolate; overflow: hidden;
  height: 100vh; height: 100svh; min-height: 620px;
  margin-top: calc(-1 * var(--top-h));
  background-color: var(--ink); background-image: var(--speck-light);
  color: var(--paper);
}
.welcome-img {
  position: absolute; z-index: -1;
  left: 53%; bottom: -3%; height: 108%; width: auto; max-width: none;
  transform: translateX(-50%);
  pointer-events: none; user-select: none;
  /* края картинки растворяются в фоне */
  -webkit-mask: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
                linear-gradient(to bottom, transparent, #000 10%);
  -webkit-mask-composite: source-in;
          mask: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
                linear-gradient(to bottom, transparent, #000 10%);
          mask-composite: intersect;
}
.welcome-in {
  position: relative; height: 100%;
  padding: calc(var(--top-h) + 20px) var(--gutter) clamp(22px, 4vh, 44px);
}
.wl-caption {
  position: absolute; left: var(--gutter); top: 44%;
  max-width: 44ch; margin: 0;
  font: 400 13px/1.5 var(--f-mono); letter-spacing: .02em;
}
/* мелкий текст может лечь на светлый череп (узкие экраны): тёмная подложка по контуру букв */
.wl-caption, .wl-text, .wl-status { text-shadow: 0 1px 2px rgba(15, 15, 14, .85), 0 0 14px rgba(15, 15, 14, .75); }
.welcome { --wl-bottom: clamp(26px, 8vh, 96px); }
.wl-title {
  position: absolute; left: var(--gutter); bottom: var(--wl-bottom);
  margin: 0;
  font: 700 clamp(64px, min(12.5vw, 19vh), 230px)/.86 var(--f-cond);
  text-transform: uppercase; letter-spacing: -.01em;
  text-shadow: 0 0 60px rgba(0, 0, 0, .35);
}
.wl-title span { display: block; }
.wl-title span + span { margin-left: 2.35em; }
.wl-side {
  position: absolute; right: var(--gutter); top: 56%; bottom: var(--wl-bottom);
  width: min(390px, 30vw);
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
}
.wl-text {
  margin: 0; max-width: 42ch;
  font: 400 13px/1.5 var(--f-mono); letter-spacing: .02em;
}
.wl-status { margin: 0 0 14px; font: 400 13px/1.45 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.wl-status .dot { margin-right: 10px; }
.wl-cta {
  display: flex; justify-content: center; align-items: center;
  padding: 20px 16px;
  background: var(--paper); color: var(--ink); text-decoration: none;
  font: 400 14px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  transition: background-color .2s, color .2s;
}
.wl-cta:hover, .wl-cta:focus-visible { background: var(--red); color: var(--paper); }
.wl-cta:active { transform: translateY(1px); }

/* ---------- первый экран, вариант «панелька»: дом «Жителей» в 3D (house3d.js) ----------
   сцена на весь экран, дом сдвинут вправо; слева глава рассказа и кнопки сторон.
   Номера на доме — кнопки, они ездят за точками привязки на доме. */
.welcome.hh { background-image: none; --corner-b: clamp(16px, 3vh, 28px); }   /* строка контактов внизу справа, подсказка над ней */
/* текст только для программ чтения с экрана */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hh-stage { position: absolute; inset: 0; overflow: hidden; }
/* небо за домом: притемнено под шапкой и слева под главой, чтобы текст читался (номера и подсказка выше) */
.hh-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(15, 15, 14, .6) 0, rgba(15, 15, 14, 0) 110px),
    linear-gradient(90deg, rgba(15, 15, 14, .86) 0%, rgba(15, 15, 14, .6) 27%, rgba(15, 15, 14, 0) 52%);
}
/* без WebGL: дом нарисован заранее (кадр из сцены) */
.hh-stage.no-3d { background: url(assets/house3d-poster-10.webp) 68% 55% / auto 86% no-repeat; }
.hh-stage.no-3d .hh-dot, .hh-stage.no-3d .hh-hint { display: none; }
.hh-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: pan-y;               /* вертикальный жест прокручивает страницу, горизонтальный крутит дом (пальцем; мышью — колесо и номера) */
}
/* до первого кадра дома в оформлении холст и номера спрятаны (20.11, его правка: при обновлении страницы мелькал «сырой»
   цветной дом на тёмном фоне); класс снимает house3d.js вместе с событием house3d:look */
.hh-canvas.is-wait { visibility: hidden; }
.hh-stage.is-wait .hh-dot { visibility: hidden; }   /* is-wait у сцены ставит и снимает house3d.js вместе с холстом (раньше — :has()) */
/* кубы (класс cubes ставит index.html до отрисовки): на компьютере глава видна, только когда камера у части дома */
@media (min-width: 761px) {
  .cubes .hh-text { transition: opacity .5s var(--ease), transform .5s var(--ease); }
  .cubes:not(.hh-near) .hh-stage:not(.no-3d) ~ .hh-panel .hh-text { opacity: 0; transform: translateX(-24px); pointer-events: none; }   /* без 3D (кадр дома) глава видна всегда */
  .cubes .hh-stage::after { transition: opacity .6s; }
  .cubes:not(.hh-near) .hh-stage:not(.no-3d)::after { opacity: 0; }
  /* уход главы (21.11, app.js eraseOut): пока буквы стираются с конца, глава видна, что бы ни говорили is-spin и hh-near;
     каждая буква гаснет за .1 с. Стёрлась — плашки и кнопки гаснут двумя ступеньками, и до набора новой глава спрятана */
  html.cubes .hh-text.is-out { opacity: 1 !important; transform: none !important; transition: none !important; pointer-events: none; }
  html.cubes .hh-text.is-out .ch { transition: opacity .1s; }
  html.cubes .hh-text.is-gone { opacity: 0 !important; pointer-events: none; transition: opacity .12s steps(2, end) !important; }
  html.cubes .hh-text.is-gone.is-now { transition: none !important; }   /* остаток после линии развёртки — сразу */
  /* версия «глава стоит» (?chap=stay, 22.11, app.js scrambleTo): пока выбрана часть дома, глава видна и когда дом поворачивается */
  html.chap-held.cubes .hh-stage:not(.no-3d) ~ .hh-panel .hh-text { opacity: 1 !important; transform: none !important; pointer-events: auto !important; transition: none !important; }
}
/* табло главы (?chap=stay): буква на время прозрачная и держит место, поверх — случайный знак цветом своего блока (--ch-col) */
.ch.scr { color: transparent !important; position: relative; }
.ch.scr::after { content: attr(data-g); position: absolute; left: 0; top: 0; color: var(--ch-col); }
/* телефон: стрелки шагов дома и подпись главы внизу сцены (22.11, его «на телефоне сложно догадаться — добавить стрелочки, чтобы
   было понятно, что нажимать»): рваные плашки тушью, как нижняя панель; стрелка — шаг, как колесо на компьютере (app.js hhStep).
   Мелкая «Покрути дом» на телефоне спрятана — вместо неё стрелки. Глава под домом не гаснет, пока дом поворачивается: текст меняется
   табло (app.js scrambleTo) */
.hh-nav { display: none; }
@media (max-width: 760px) {
  .hh-nav { position: absolute; z-index: 4; left: var(--gutter); right: var(--gutter); bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
  .hh-nav > * { pointer-events: auto; }
  .hh-nav-b, .hh-nav-t { position: relative; z-index: 0; color: #eee3c6; font: 400 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
  .hh-nav-b::before, .hh-nav-t::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #111319 var(--noise) 0 0 / 180px 180px; background-blend-mode: multiply; filter: url(#cut-s); }
  .hh-nav-b { flex: none; width: 52px; height: 44px; padding: 0; border: 0; background: none; font-size: 22px; letter-spacing: 0; cursor: pointer; transition: opacity .2s; }
  .hh-nav-b:disabled { opacity: .3; cursor: default; }
  .hh-nav-t { min-width: 0; padding: 10px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .welcome .hh-hint:not(.is-big) { display: none; }
  .welcome .hh-text.is-spin { opacity: 1; pointer-events: auto; }   /* вес выше общего .hh-text.is-spin ниже по файлу */
}
/* подъезд на телефоне — стопка конвертов (22.11, его «подъезд на мобильной уёбищно выглядит: сверху конвертики листать, снизу
   описание, сам подъезд убрать»; выбор «стопка конвертов»; app.js deckHtml). 3D-сцена, ящики, слово и подсказки — только на
   компьютере. Конверт — бумага с зерном, рисунок жильца растром в красном (как .me-art в письме), марка «кв. N», «Кому» и кто он;
   у каждого свой лёгкий наклон — стопка. Свайп — scroll-snap, следующий выглядывает; стрелки и «1 / 7 · имя» — как на главной */
.mbx-deck { display: none; }
@media (max-width: 760px) {
  .hall .hall-stage, .hall .hall-spots, .hall .mbx-word, .hall .hall-hint, .hall .hall-status, .hall .hall-deco { display: none !important; }
  .mbx-deck { display: block; position: relative; z-index: 2; padding: calc(var(--top-h, 56px) + 6px) 0 0; }
  .mbx-deck-track {
    display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
    padding: 10px var(--gutter) 18px; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  }
  .mbx-deck-track::-webkit-scrollbar { display: none; }
  .mbx-card {
    flex: none; position: relative; width: 84%; aspect-ratio: 1.55; padding: 0; border: 0; text-align: left; cursor: pointer;
    scroll-snap-align: start; transform: rotate(var(--rot, 0deg)); color: #1b1a17;
    background: #efe7d4 var(--noise) 0 0 / 180px 180px; background-blend-mode: multiply; box-shadow: 0 8px 18px rgba(0, 0, 0, .25), 0 1px 0 rgba(0, 0, 0, .08);
  }
  .mbx-card::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(196, 35, 28, .35); pointer-events: none; }   /* кайма конверта */
  .mc-art { position: absolute; left: 5%; top: 9%; width: 38%; height: 82%; overflow: hidden; background: #d9cdb0; }
  .mc-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.55) brightness(1.08); mix-blend-mode: multiply; }
  .mc-art::before { content: ""; position: absolute; inset: 0; z-index: 2; background: #c4231c; mix-blend-mode: screen; opacity: .9; }
  .mc-art.is-empty { display: grid; place-items: center; background: #c4231c; }
  .mc-art.is-empty::before { display: none; }
  .mc-art.is-empty b { position: relative; z-index: 3; color: #f4ecd8; font: 400 30px/1 var(--f-display); letter-spacing: -.02em; }
  .mc-stamp { position: absolute; right: 6%; top: 10%; width: 20%; aspect-ratio: .82; padding: 3px; background: #f5efdd; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
  .mc-stamp i { position: absolute; inset: 5px; display: grid; place-items: center; background: #c4231c; color: #f5efdd; font-style: normal; }
  .mc-stamp b { font: 400 15px/1 var(--f-display); letter-spacing: -.02em; white-space: nowrap; }
  .mc-addr { position: absolute; left: 48%; right: 6%; bottom: 11%; display: grid; gap: 6px; font: 400 11px/1.25 var(--f-mono); }
  .mc-to { padding-bottom: 4px; border-bottom: 1px solid rgba(27, 26, 23, .45); font-size: 13px; }
  .mc-to em { margin-right: 6px; font-style: normal; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #c4231c; }
  .mc-who { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(27, 26, 23, .7); }
  .mbx-card.is-locked .mc-to, .mbx-card.is-locked .mc-who { opacity: .55; }
  .mbx-deck-nav { position: relative; left: auto; right: auto; bottom: auto; margin: 0 var(--gutter); }
}
.hh-dot {
  position: absolute; left: -17px; top: -17px; z-index: 2;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid rgba(220, 216, 207, .75); border-radius: 50%;
  background: rgba(15, 15, 14, .45); color: var(--paper);
  font: 400 14px/1 var(--f-mono); font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color .25s, border-color .25s, opacity .35s;
}
.hh-dot::after { content: ""; position: absolute; inset: -5px; }   /* зона нажатия 44 px */
.hh-dot:hover { border-color: var(--paper); background: rgba(15, 15, 14, .8); }
.hh-dot.is-on { background: var(--red); border-color: var(--red); }
/* номер на отвёрнутой стороне прячется: главы всё равно видны кнопками слева */
.hh-dot.is-back { opacity: 0; pointer-events: none; }
/* пока дом собирается из разлетевшихся блоков (house3d.js, класс hh-asm на <html>), номера на нём спрятаны */
html.hh-asm .hh-dot.hh-dot { opacity: 0; pointer-events: none; }
.hh-hint {
  position: absolute; z-index: 2; right: var(--gutter); bottom: calc(var(--corner-b) + 28px); margin: 0;   /* над холстом: house3d.js вставляет его последним */
  font: 400 12px/1.4 var(--f-mono); letter-spacing: .08em; color: var(--ash-night);
  pointer-events: none; transition: opacity .6s;
}
.hh-dragged .hh-hint { opacity: 0; }

/* глава: по центру высоты, а если длинная (список работ) — прокручивается внутри, дом стоит */
.hh-panel {
  position: absolute; z-index: 3;
  left: var(--gutter); top: calc(var(--top-h) + 3vh); bottom: clamp(18px, 4vh, 48px);
  width: min(460px, 34vw);
  display: flex; flex-direction: column; justify-content: safe center;
  pointer-events: none;
}
.hh-panel > * { pointer-events: auto; }
.hh-text {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 12px; margin-right: -12px;
  scrollbar-width: thin; scrollbar-color: rgba(220, 216, 207, .25) transparent;
}
.hh-text.has-more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent);
}
/* пока дом крутят (рукой или он сам доворачивает к стороне), главы не видно; встал — она возвращается (JS: hhSpin) */
.hh-text { transition: opacity .3s var(--ease); }
.hh-text.is-spin { opacity: 0; pointer-events: none; transition-duration: .12s; }
/* список работ в первой главе: кадр, заказчик, работа и срок */
.hh-list { list-style: none; margin: 4px 0 16px; padding: 0; border-top: 1px solid rgba(220, 216, 207, .12); }
.hh-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  width: 100%; padding: 8px 4px; margin: 0;
  border: 0; border-bottom: 1px solid rgba(220, 216, 207, .12); background: none;
  color: var(--paper); text-align: left; cursor: pointer;
  transition: background-color .2s;
}
.hh-row:hover, .hh-row:focus-visible { background: rgba(220, 216, 207, .06); }
.hh-wt { position: relative; display: block; width: 40px; height: 56px; overflow: hidden; background: #1b1b19; }
.hh-wt img, .hh-wt video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hh-wt video { opacity: 0; transition: opacity .3s; }
.hh-wt { filter: grayscale(1) brightness(.8); transition: filter .35s var(--ease); }
.hh-work:hover .hh-wt, .hh-work:focus-visible .hh-wt { filter: none; }
.hh-work:hover .hh-wt video { opacity: 1; }
.hh-rt { display: grid; gap: 2px; min-width: 0; }
.hh-rt b { font: 600 15px/1.25 var(--f-body); overflow-wrap: anywhere; }
.hh-rt i { font: 400 12px/1.4 var(--f-mono); font-style: normal; color: var(--ash-night); }
.hh-n { font: 400 12px/1 var(--f-mono); color: var(--ash-night); font-variant-numeric: tabular-nums; }
.hh-work:hover .hh-n { color: var(--red-hot); }
.hh-text p, .hh-text li, .hh-text dd, .hh-text dt { font: 400 14px/1.75 var(--f-mono); }
.hh-text p { margin: 0 0 14px; max-width: 46ch; }
.hh-no { color: var(--ash-night); margin-bottom: 10px !important; }
.hh-h {
  margin: 0 0 18px;
  font: 400 clamp(28px, 2.9vw, 44px)/1 var(--f-display);
  text-transform: uppercase; text-wrap: balance;
}
.hh-muted { color: var(--ash-night); }
.hh-h .hh-k { display: block; margin: 0 0 .32em; font-size: .4em; line-height: 1.05; letter-spacing: .02em; }
.hh-rules { margin: 0 0 14px; padding-left: 1.4em; }
.hh-rules li { max-width: 44ch; }
.hh-facts { margin: 0 0 16px; display: grid; gap: 0; max-width: 46ch; }
.hh-facts > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid rgba(220, 216, 207, .14); }
.hh-facts > div:last-child { border-bottom: 1px solid rgba(220, 216, 207, .14); }
.hh-facts dt { color: var(--ash-night); }
.hh-facts dd { margin: 0; overflow-wrap: anywhere; }
.hh-text a { color: var(--paper); text-decoration-color: rgba(220, 216, 207, .45); }
.hh-text a:hover { text-decoration-color: var(--paper); }
.hh-links button, .hh-copy {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--paper); text-decoration: underline; text-decoration-color: rgba(220, 216, 207, .45); text-underline-offset: .22em;
}
.hh-copy { margin-left: 8px; color: var(--ash-night); }
.hh-links span { color: var(--ash-night); }
.hh-cta {
  display: inline-block; margin-top: 6px; padding: 14px 18px;
  background: var(--paper); color: var(--ink) !important; text-decoration: none !important;
  letter-spacing: .12em; text-transform: uppercase;
  transition: background-color .2s, color .2s;
}
.hh-cta:hover { background: var(--red); color: var(--paper) !important; }
/* буквы главы проявляются по очереди (typeIn в app.js) */
.ch { opacity: 0; }
.ch.on { opacity: 1; transition: opacity .12s; }

.lead {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.5;
  text-wrap: pretty;
}
.facts { margin: 0; display: grid; gap: 0; }
.facts > div {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px;
  padding-block: 10px; border-top: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font: 400 11px/1.6 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; line-height: 1.45; }
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); margin-right: 8px; vertical-align: 1px;
}

/* экран загрузки при входе на сайт (JS: loaderRun) — один в один как у lisa.locomotive.ca (16.11, его «пиздим 1 в 1 реф,
   но текст по смыслу наш»): чистый чёрный, белый гротеск 1,842vw (у них Helvetica Now Display, у нас Golos Text),
   межстрочный 1,2; левая колонка строк — центр − 8,55 em, правая — центр − 4,28 em; в центре знак и RASTIK.
   Выше зерна страницы (120): у LISA чёрный без шума */
.loader {
  position: fixed; inset: 0; z-index: 125; overflow: hidden;
  background: #000; color: #fff;
  font: 400 max(16px, 1.842vw) / 1.2 "Golos Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: opacity .42s cubic-bezier(.45, 0, .55, 1), visibility 0s linear .42s;
  animation: loader-failsafe .01s linear 16s forwards;
}
.loader.done { opacity: 0; visibility: hidden; }
@keyframes loader-failsafe { to { opacity: 0; visibility: hidden; } }
.ld-logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  opacity: 0; animation: ld-in .35s linear forwards;
}
@keyframes ld-in { to { opacity: 1; } }
/* его знак без света (2_LOGO\00_MAIN_ZNAK\bez_sveta, тот же, что в клетке портфолио) — крупно по центру (16.11: «логотип
   гораздо покрупнее, слово RASTIK убрать») */
.ld-mark {
  display: block; height: min(42vh, 50vw); aspect-ratio: 2925 / 3000; background: #fff;
  -webkit-mask: url(assets/znak.png) center / contain no-repeat; mask: url(assets/znak.png) center / contain no-repeat;
}
.ld-ln { position: absolute; white-space: pre; }
.ld-ln.l { left: calc(50% - 8.55em); }
.ld-ln.r { left: calc(50% - 4.28em); }
.ld-c { display: inline-block; white-space: pre; }
/* вид grit (16.11, его правка): загрузка — на той же грязной бумаге, что главная, только без домов (грязь — те же слои
   .hh-tex поверх); текст и знак красные, как слово стороны; пока идёт текст, рывками и рваным краем проявляются красные
   блоки — ровно на местах блоков главной (места — RZ_BLK в app.js, общие с шейдером), потом переход в сайт: бумага и
   блоки совпадают, проявляются дом, провода, слова и меню. Под зерном страницы (120), как сама главная */
html.grit .loader { z-index: 118; background: #efefef; color: #ff3b2f; }
html.grit .loader .ld-mark { background: url(assets/tex/red-grain.png) 0 0 / 192px 192px repeat; image-rendering: pixelated; animation: rb-boil .5s steps(1) infinite; }   /* фактура красных блоков */
.ld-sq {
  position: absolute; visibility: hidden;
  background: url(assets/tex/red-grain.png) 0 0 / 192px 192px repeat; image-rendering: pixelated;
  filter: url(#cut); animation: rb-boil .5s steps(1) infinite;
}

/* муха у курсора (fly.js): холст 132×96, муха в его точке 48,48 */
.cursor-fly {
  position: fixed; left: 0; top: 0; z-index: 140;
  width: 132px; height: 96px; margin: -48px 0 0 -48px;
  pointer-events: none;
  opacity: 0; transition: opacity .3s;
  will-change: transform;
}
.cursor-fly.on { opacity: 1; }
.cursor-fly.light { filter: drop-shadow(0 0 1.2px rgba(239, 239, 236, .85)); }   /* над тёмным — светлая обводка */

.foot {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 24px;
  padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px));
  font: 400 12px/1.4 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.to-top {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: .3em;
  transition: color .2s;
}
.to-top:hover { color: var(--fg); }
.foot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }

/* соцсети и почта мелким строчным текстом (cornerLinks): на доме в правом нижнем углу, в подъезде справа в подвале */
.corner { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; font: 400 12px/1.4 var(--f-mono); letter-spacing: .03em; text-transform: lowercase; }
.corner a { color: var(--muted); text-decoration: none; text-underline-offset: .3em; transition: color .2s; }
.corner a:hover { color: var(--fg); text-decoration: underline; }
.foot .corner { margin-left: auto; }   /* справа и тогда, когда подвал переносится на две строки */
.welcome .corner { position: absolute; z-index: 3; right: var(--gutter); bottom: var(--corner-b); }
.welcome .corner a { color: var(--ash-night); }
.welcome .corner a:hover { color: var(--paper); }

/* =====================================================================
   RESIDENTS VIEW
   ===================================================================== */
.res-intro {
  padding-block: clamp(36px, 6vw, 80px) clamp(24px, 3vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 40px clamp(32px, 5vw, 80px);
  align-items: start;
}
.res-intro-main { container-type: inline-size; }
.res-title {
  --max: 196px; --k: .96;
  margin: .14em 0 .22em;
  font: 400 clamp(52px, 11vw, 196px)/.84 var(--f-display);
  text-transform: uppercase;
  color: var(--paper);
  filter: url(#rough);
  text-wrap: balance;
}
@supports (width: 1cqi) {
  .res-title { font-size: min(var(--max), calc(100cqi / (var(--len) * var(--k)))); }
}
.res-intro .lead { color: var(--paper); }

.notice {
  position: relative; justify-self: end;
  width: 100%; max-width: 360px; margin-top: 18px;
  background-color: var(--paper); background-image: var(--speck-dark);
  color: var(--ink);
  padding: 26px 22px 0;
  transform: rotate(-1.6deg);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .55);
}
.notice::before, .notice::after {
  content: ""; position: absolute; top: -11px;
  width: 74px; height: 24px;
  background: rgba(220, 216, 207, .5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.notice::before { left: 12px; transform: rotate(-9deg); }
.notice::after { right: 14px; transform: rotate(7deg); }
.notice-h { margin: 0; font: 400 30px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.notice-to { margin: 8px 0 14px; font: 400 13px/1.4 var(--f-mono); }
.notice ol { margin: 0; padding-left: 1.35em; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; }
.notice ol li::marker { font-family: var(--f-mono); }
.notice-sign { margin: 16px 0 0; text-align: right; font: 400 13px/1.4 var(--f-mono); }
.tear-row {
  display: flex; margin: 18px -22px 0;
  border-top: 1px dashed rgba(15, 15, 14, .55);
}
.tear {
  flex: 1 1 0; min-width: 0; height: 104px;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 400 11px/1 var(--f-mono); letter-spacing: .06em;
  color: var(--ink); text-decoration: none;
  border-left: 1px dashed rgba(15, 15, 14, .45);
  background-color: var(--paper); background-image: var(--speck-dark);
}
.tear:last-child { border-left: 0; }
.tear.gone { visibility: hidden; }
a.tear:hover { color: var(--red); }

.res-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: end;
  padding-block: clamp(16px, 3vw, 32px) clamp(64px, 9vw, 128px);
}
/* подсказка у дома: обычный регистр, фраза целиком капсом читается тяжело */
.stage-hint { margin: 0 0 14px 40px; font-size: 13px; letter-spacing: .02em; text-transform: none; }

/* ---------- The building (drawn placeholder) ---------- */
.house { position: relative; width: 100%; max-width: 760px; justify-self: center; padding: 58px 0 0 40px; }
.antennas { position: absolute; left: 40px; right: 0; top: 0; height: 60px; width: calc(100% - 40px); color: #4b4a44; }
.house-body { position: relative; }
.house-body::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 34% 26% at 50% 100%, rgba(255, 236, 190, .1), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 45%);
}
.roof { height: 16px; background: #282724; border-top: 3px solid #3b3a35; }

.floors { display: flex; flex-direction: column; }
.floor {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr .72fr 1fr 1fr 1fr;
  width: 100%; aspect-ratio: 7 / 1.12;
  margin: 0; padding: 0; border: 0;
  border-top: 2px solid var(--seam);
  background: transparent;
  cursor: pointer; text-align: left;
}
.floor:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 2px; }
.floor-no {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  font: 400 12px/1 var(--f-mono); letter-spacing: .1em; color: var(--ash-night);
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}
.floor.is-hot .floor-no { color: var(--red-hot); }
.floor.is-hot .floor-no::before { content: "→ "; }

.cell {
  position: relative; display: block;
  background-color: var(--concrete);
  background-image: var(--speck-light);
  border-right: 1px solid var(--seam);
}
.cell:last-child { border-right: 0; }
.cell:nth-child(3n+1) { background-color: var(--concrete-2); }
.cell.s { background-color: #3b3a35; }

.win {
  position: absolute; display: block;
  left: 21%; right: 21%; top: 19%; bottom: 25%;
  background: var(--glass);
  border: 2px solid var(--frame);
  --rest: 0;
}
.win::after, .win::before { content: ""; position: absolute; inset: 0; }
.win::after {
  background: radial-gradient(ellipse at 50% 85%, #fff7e2 0%, #eadcb4 55%, #c8b88e 100%);
  opacity: var(--rest);
  transition: opacity .18s ease-out;
}
.win::before {
  z-index: 1;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), var(--frame) calc(50% - 1px), var(--frame) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(transparent 30%, var(--frame) 30%, var(--frame) calc(30% + 2px), transparent calc(30% + 2px)),
    linear-gradient(90deg, rgba(0,0,0,.28), transparent 18%, transparent 82%, rgba(0,0,0,.28));
}
.win.own { --rest: .62; }
.floor.is-hot .win::after, .floor:focus-visible .win::after {
  opacity: 1;
  transition: opacity .12s ease-out calc(var(--i) * 55ms);
}
.win.tv::after {
  background: radial-gradient(ellipse at 50% 60%, #f1f5ff 0%, #b9c6da 60%, #8595ad 100%);
  animation: tv 2.6s steps(1, end) infinite;
}
.floor.locked .win::after { background: radial-gradient(ellipse at 50% 75%, #ff6a55 0%, #c21d11 60%, #6b0b05 100%); }
.floor.locked .win.own { --rest: .2; }

.fly-dot {
  position: absolute; z-index: 2; left: 30%; top: 55%;
  width: 5px; height: 4px; border-radius: 50%;
  background: #111;
  box-shadow: -2px -2px 0 -1px rgba(17,17,17,.45), 2px -2px 0 -1px rgba(17,17,17,.45);
  animation: fly 5.5s linear infinite;
}

.balc {
  position: absolute; left: 9%; right: 9%; bottom: 9%; height: 38%; z-index: 2;
  border-top: 3px solid #6b6962;
  background:
    repeating-linear-gradient(90deg, rgba(120,118,110,.8) 0 2px, transparent 2px 8px),
    rgba(30, 30, 27, .82);
  box-shadow: 0 6px 8px rgba(0, 0, 0, .35);
}

.stair-win {
  position: absolute; left: 20%; right: 20%; top: -16%; height: 30%; z-index: 2;
  background: radial-gradient(ellipse at 50% 70%, #d9ceac, #a99c78 80%);
  border: 2px solid var(--frame);
  opacity: .55;
}
.stair-win.flick { animation: flick 7s steps(1, end) infinite; }

.door {
  position: absolute; left: 17%; right: 17%; bottom: 0; height: 58%;
  background: linear-gradient(#232320, #171715);
  border: 2px solid #4d4b45; border-bottom: 0;
}
.door-pad {
  position: absolute; right: 12%; top: 34%; width: 20%; height: 18%;
  background: #0b0b0a; border: 1px solid #5d5b54;
}
.door-pad::after { content: ""; position: absolute; left: 30%; top: 30%; width: 3px; height: 3px; border-radius: 50%; background: var(--red-hot); box-shadow: 0 0 5px var(--red-hot); }
.canopy {
  position: absolute; left: -14%; right: -14%; bottom: 58%; height: 7%;
  background: #4a4943; box-shadow: 0 5px 10px rgba(0, 0, 0, .5); z-index: 2;
}
.lamp {
  position: absolute; left: 50%; bottom: calc(58% - 5px); width: 12px; height: 5px; margin-left: -6px; z-index: 3;
  background: #fff4d6; border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 30px 12px rgba(255, 234, 186, .28);
}
.plate {
  position: absolute; left: 50%; bottom: 70%; transform: translateX(-50%);
  padding: 2px 5px; z-index: 2;
  background: #c9c4b8; color: #111;
  font: 400 clamp(7px, .8vw, 10px)/1.2 var(--f-mono); white-space: nowrap;
}

.ground {
  position: relative; height: 34px; margin-left: -40px;
  background: linear-gradient(#1b1b19, #0c0c0b);
  border-top: 3px solid #2d2c28;
}
.ground::after {
  content: ""; position: absolute; left: calc(40px + 50% - 20px); width: 40%; transform: translateX(-50%);
  top: 0; height: 100%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 234, 186, .12), transparent 70%);
}

.house.boot .win.own::after { animation: boot 1.3s both calc(var(--f) * 170ms + 250ms); }
.house.boot .win.own.tv::after { animation: boot 1.3s both calc(var(--f) * 170ms + 250ms), tv 2.6s steps(1, end) infinite 2s; }

@keyframes boot {
  0% { opacity: 0; }
  30% { opacity: var(--rest); }
  36% { opacity: .05; }
  52% { opacity: var(--rest); }
  58% { opacity: .15; }
  100% { opacity: var(--rest); }
}
@keyframes tv {
  0% { filter: brightness(.75); }
  11% { filter: brightness(1.15) hue-rotate(-8deg); }
  23% { filter: brightness(.6); }
  37% { filter: brightness(1); }
  49% { filter: brightness(.82) hue-rotate(10deg); }
  61% { filter: brightness(1.2); }
  78% { filter: brightness(.7); }
  90% { filter: brightness(.95); }
}
@keyframes flick {
  0%, 100% { opacity: .55; }
  71% { opacity: .1; }
  72% { opacity: .55; }
  74% { opacity: .08; }
  76% { opacity: .5; }
}
@keyframes fly {
  0% { transform: translate(0, 0) rotate(0); }
  12% { transform: translate(180%, -120%) rotate(40deg); }
  20% { transform: translate(180%, -120%) rotate(40deg); }
  34% { transform: translate(420%, 40%) rotate(110deg); }
  48% { transform: translate(260%, 180%) rotate(200deg); }
  56% { transform: translate(260%, 180%) rotate(200deg); }
  72% { transform: translate(40%, -200%) rotate(300deg); }
  86% { transform: translate(-60%, 60%) rotate(340deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

/* ---------- The building (your render) ---------- */
.house-img { position: relative; width: 100%; max-width: 760px; justify-self: center; }
.house-img > img { width: 100%; height: auto; }
.house-img .hov { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; pointer-events: none; }
.house-img .hov.on { opacity: 1; }
.band {
  position: absolute; left: 0; right: 0;
  display: block; aspect-ratio: auto; border: 0;
  background: transparent;
  transition: background-color .2s;
}
.band.is-hot { background: linear-gradient(90deg, transparent, rgba(241, 232, 207, .1) 20%, rgba(241, 232, 207, .1) 80%, transparent); }
.band .floor-no { right: auto; left: 8px; color: var(--paper); }

/* ---------- Intercom ---------- */
.domofon {
  position: relative; width: 100%; max-width: 380px; justify-self: start; align-self: center;
  padding: 24px 20px 22px;
  border-radius: 10px;
  background: linear-gradient(160deg, #3b3a36 0%, #262521 55%, #1b1a17 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -2px 0 rgba(0,0,0,.45), 0 26px 50px rgba(0,0,0,.55);
  color: var(--paper);
}
.screw {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 44%, #22211e 44%, #22211e 56%, transparent 56%),
    radial-gradient(circle at 35% 35%, #8d8a81, #3c3b36);
}
.screw.tl { left: 9px; top: 9px; } .screw.tr { right: 9px; top: 9px; }
.screw.bl { left: 9px; bottom: 9px; } .screw.br { right: 9px; bottom: 9px; }
.dm-brand { margin: 0 0 10px; font: 400 11px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: #aaa69c; text-align: center; }
.dm-screen {
  display: block; min-height: 84px; padding: 14px 14px 12px;
  background: #070707; border: 2px solid #0e0e0d; border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .95);
  font: 400 13px/1.35 var(--f-mono); text-transform: uppercase; letter-spacing: .08em;
  color: var(--red-hot);
  text-shadow: 0 0 8px rgba(255, 59, 47, .55);
}
.dm-num { display: block; font-size: 28px; line-height: 1.1; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.dm-name { display: block; margin-top: 6px; font-size: 12px; min-height: 1.35em; overflow-wrap: anywhere; }
.dm-label { margin: 18px 0 8px; color: #aaa69c; }
.dm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dm-row {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; padding: 7px 10px 7px 7px;
  background: linear-gradient(#302f2b, #252420);
  border: 1px solid #0f0f0e; border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  color: var(--paper); text-align: left; cursor: pointer;
  transition: background .2s;
}
.dm-row:hover, .dm-row.is-hot { background: linear-gradient(#3a3934, #2c2b27); }
.dm-apt {
  display: block; padding: 7px 0; border-radius: 3px;
  background: #0c0c0b; text-align: center;
  font: 400 16px/1 var(--f-mono); font-variant-numeric: tabular-nums;
  transition: color .2s, text-shadow .2s;
}
.dm-row.is-hot .dm-apt { color: var(--red-hot); text-shadow: 0 0 8px rgba(255, 59, 47, .6); }
.dm-who { display: block; min-width: 0; }
.dm-who b { display: block; font: 600 15px/1.2 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-who i { display: block; margin-top: 2px; font: 400 11px/1.2 var(--f-mono); font-style: normal; letter-spacing: .03em; color: var(--ash-night); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-st { font: 400 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ash-night); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dm-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4a4943; }
.dm-st.watch::before { background: var(--glow); box-shadow: 0 0 6px var(--glow); }
.dm-st.locked::before { background: var(--red-hot); box-shadow: 0 0 6px var(--red-hot); }
.dm-grill {
  display: block; width: 90px; height: 36px; margin: 18px auto 0;
  background: radial-gradient(circle, #0a0a09 36%, transparent 42%) 0 0 / 9px 9px;
}

/* домофон с кнопками в главе «Жители» на доме (JS: icomPress): тот же металл, экран и винты,
   что у домофона в подъезде, плюс цифры, «С» и звонок */
.icom {
  position: relative; width: 100%; max-width: 290px; margin: 6px 0 18px; padding: 20px 18px 14px;
  border-radius: 10px;
  background: linear-gradient(160deg, #3b3a36 0%, #262521 55%, #1b1a17 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -2px 0 rgba(0,0,0,.45), 0 20px 44px rgba(0,0,0,.5);
  color: var(--paper);
}
.icom .dm-brand { margin: 0 0 10px; max-width: none; font: 400 11px/1 var(--f-mono); }   /* сильнее .hh-text p */
.icom .dm-screen { min-height: 76px; }
.icom .dm-grill { width: 72px; height: 27px; margin-top: 14px; }
.icom-led {
  display: inline-block; width: 6px; height: 6px; margin-right: 8px; vertical-align: 1px; border-radius: 50%;
  background: #4a1714; transition: background-color .2s, box-shadow .2s;
}
.icom.is-ring .icom-led { background: var(--red-hot); box-shadow: 0 0 6px var(--red-hot); animation: icom-blink .6s steps(1) infinite; }
.icom.is-open .icom-led { background: var(--glow); box-shadow: 0 0 8px var(--glow); }
.icom.is-ring .dm-num { animation: icom-blink .6s steps(1) infinite; }
.icom-cur { font-style: normal; animation: icom-blink 1s steps(1) infinite; }
@keyframes icom-blink { 50% { opacity: .15; } }
.icom-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.icom-key {
  display: flex; align-items: center; justify-content: center;
  height: 44px; padding: 0;
  border: 1px solid #0d0d0c; border-radius: 6px;
  background: linear-gradient(#4a4944, #2e2d29);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 0 #0b0b0a, 0 3px 6px rgba(0, 0, 0, .35);
  color: #e9e5db; font: 400 18px/1 var(--f-mono); font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .06s, box-shadow .06s, color .15s;
}
.icom-key:hover { background: linear-gradient(#55544e, #34332e); }
.icom-key:active, .icom-key.is-down {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 #0b0b0a, 0 1px 2px rgba(0, 0, 0, .35);
}
.icom-key:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 2px; }
.icom-key.is-fn { color: #aaa69c; font-size: 15px; }
.icom-key.is-call { color: var(--red-hot); }
.icom-key svg { display: block; width: 19px; height: 19px; }

/* =====================================================================
   OVERLAY (work lightbox + resident card)
   ===================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.overlay-scrim { position: absolute; inset: 0; background: rgba(8, 8, 7, .88); }
.overlay-panel {
  position: relative; width: min(1040px, 100%); max-height: 100%; overflow: auto;
  background-color: var(--ink-2); background-image: var(--speck-light);
  color: var(--paper);
  color-scheme: dark;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: pop .28s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.ov-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px 12px 20px;
  background: var(--ink-2);
  border-bottom: 1px solid rgba(220, 216, 207, .12);
  font: 400 12px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ash-night);
}
.x {
  flex: none;
  background: transparent; color: var(--paper);
  border: 1px solid rgba(220, 216, 207, .35);
  font: 400 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 10px 12px; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.x:hover:not(:disabled) { border-color: var(--paper); background: rgba(220, 216, 207, .08); }
.x:disabled { opacity: .3; cursor: default; }

.ov-media { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
/* карточка жильца с квадратным или вертикальным роликом (video.ratio, --r = ширина / высота):
   плеер слева, текст справа; высота плеера такая, чтобы он занимал не больше ~520 px в ширину */
.rc-vert { --ph: min(74vh, 720px, calc(520px / var(--r, .5625))); display: grid; grid-template-columns: auto minmax(0, 1fr); }
.rc-vplayer { position: relative; height: var(--ph); width: calc(var(--ph) * var(--r, .5625)); background: var(--ink); }
.rc-vert .rc-body { grid-template-columns: minmax(0, 1fr); align-content: start; }
.media-el { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--ink); }

/* ---------- свой плеер (app.js playerHtml / vpMount): тушь, красная полоса, таймкод как у камеры ---------- */
.vp { position: absolute; inset: 0; overflow: hidden; background: #0b0b0a; color: #efefec; outline: none; }
.vp:focus-visible { outline: 2px solid #ff3b2f; outline-offset: -2px; }
.vp-v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0b0a; cursor: pointer; }
.vp.is-idle, .vp.is-idle .vp-v { cursor: none; }
.vp-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px;
  padding: 11px 13px 22px; background: linear-gradient(rgba(11, 11, 10, .72), rgba(11, 11, 10, 0)); pointer-events: none;
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(239, 239, 236, .86);
  font-variant-numeric: tabular-nums; transition: opacity .25s;
}
.vp-top span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-top .rec { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #ff3b2f; vertical-align: 1px; opacity: .35; }
.vp.is-playing .vp-top .rec { opacity: 1; animation: vp-blink 1.2s steps(1, end) infinite; }
@keyframes vp-blink { 50% { opacity: .15; } }
.vp-big {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: none; align-items: center; gap: 12px; padding: 16px 20px; border: 0; background: #ff3b2f; color: #0f0f0e; cursor: pointer;
  font: 400 13px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.vp-big i { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.vp-big:hover, .vp-big:focus-visible { background: #0f0f0e; color: #ff3b2f; outline: none; }
.vp:not(.is-started) .vp-big, .vp.is-ended .vp-big { display: flex; }
.vp-wait {
  position: absolute; z-index: 3; left: 12px; bottom: 58px; display: none; padding: 5px 9px 4px; background: #0f0f0e; color: #efefec;
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
}
.vp.is-wait .vp-wait, .vp.is-err .vp-wait { display: block; }
.vp.is-wait .vp-wait::after { content: " \25AE"; animation: vp-blink .8s steps(1, end) infinite; }
.vp.is-err .vp-wait { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); background: #ff3b2f; color: #0f0f0e; }
.vp-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 22px 12px 11px; background: linear-gradient(rgba(11, 11, 10, 0), rgba(11, 11, 10, .84)); transition: opacity .25s, transform .25s;
}
.vp:not(.is-started) .vp-bar { opacity: 0; pointer-events: none; }
.vp.is-idle .vp-bar { opacity: 0; transform: translateY(6px); }
.vp.is-idle .vp-top { opacity: 0; }
/* «На весь экран» на самом кадре (19.11, его «нет кнопки, чтобы расширить — надо догадаться про двойной щелчок»):
   видна сразу, до запуска; во весь экран — «Свернуть»; пока ролик играет без движения мыши — прячется, как полосы */
.vp-top { padding-right: 214px; }
.vp-max {
  position: absolute; z-index: 4; top: 9px; right: 9px; display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 12px 8px; border: 0; background: #ff3b2f; color: #0f0f0e; cursor: pointer;
  font: 400 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  transition: opacity .25s, background-color .2s, color .2s;
}
.vp-max:hover, .vp-max:focus-visible { background: #0f0f0e; color: #ff3b2f; outline: none; }
.vp-max i {
  width: 14px; height: 11px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 5px 2px no-repeat, linear-gradient(currentColor, currentColor) 0 0 / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 5px 2px no-repeat, linear-gradient(currentColor, currentColor) 100% 0 / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 5px 2px no-repeat, linear-gradient(currentColor, currentColor) 0 100% / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 5px 2px no-repeat, linear-gradient(currentColor, currentColor) 100% 100% / 2px 4px no-repeat;
}
.vp.is-idle .vp-max { opacity: 0; pointer-events: none; }
/* маленький плеер (в письме жильца ~170 px): кнопка остаётся с надписью — верхняя строка (метка и таймкод) уходит */
.vp { container-type: inline-size; }
@container (max-width: 440px) {
  .vp-top { display: none; }
  .vp-max { top: 6px; right: 6px; gap: 6px; padding: 7px 8px 6px; font-size: 10px; letter-spacing: .08em; }
}
@media (max-width: 760px) { .vp-top { padding-right: 52px; } .vp-max { padding: 9px; } .vp-max span { display: none; } }
.vp-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; height: 30px; min-width: 32px; padding: 0 9px;
  border: 1px solid rgba(239, 239, 236, .35); background: transparent; color: #efefec; cursor: pointer;
  font: 400 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.vp-btn:hover, .vp-btn:focus-visible { background: #ff3b2f; border-color: #ff3b2f; color: #0f0f0e; outline: none; }
.vp-pp i { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.vp.is-playing .vp-pp i { width: 10px; height: 12px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.vp-snd[aria-pressed="true"] { color: #ff3b2f; border-color: #ff3b2f; }
.vp-snd[aria-pressed="true"]:hover { color: #0f0f0e; }
.vp-fs i {
  width: 14px; height: 11px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 5px 2px no-repeat, linear-gradient(currentColor, currentColor) 0 0 / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 5px 2px no-repeat, linear-gradient(currentColor, currentColor) 100% 0 / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 5px 2px no-repeat, linear-gradient(currentColor, currentColor) 0 100% / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 5px 2px no-repeat, linear-gradient(currentColor, currentColor) 100% 100% / 2px 4px no-repeat;
}
.vp-track { position: relative; flex: 1 1 auto; min-width: 60px; height: 24px; cursor: pointer; touch-action: none; outline: none; }
.vp-track::before, .vp-buf, .vp-fill { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; transition: height .15s, margin .15s; }
.vp-track::before { content: ""; right: 0; background: rgba(239, 239, 236, .22); }
.vp-buf { width: 0; background: rgba(239, 239, 236, .45); }
.vp-fill { width: 0; background: #ff3b2f; }
.vp-fill::after { content: ""; position: absolute; right: -5px; top: 50%; width: 10px; height: 12px; margin-top: -6px; background: #ff3b2f; }
.vp-track:hover::before, .vp-track:hover .vp-buf, .vp-track:hover .vp-fill,
.vp-track:focus-visible::before, .vp-track:focus-visible .vp-buf, .vp-track:focus-visible .vp-fill { height: 5px; margin-top: -2.5px; }
.vp-track:focus-visible .vp-fill::after { outline: 2px solid #efefec; }
.vp-tip {
  position: absolute; bottom: 100%; left: 0; transform: translateX(-50%); padding: 4px 6px 3px; background: #0f0f0e; color: #efefec;
  font: 400 10px/1 var(--f-mono); letter-spacing: .06em; opacity: 0; pointer-events: none; transition: opacity .15s;
}
.vp-track:hover .vp-tip { opacity: 1; }
.vp-time { flex: none; font: 400 11px/1 var(--f-mono); letter-spacing: .06em; color: rgba(239, 239, 236, .86); font-variant-numeric: tabular-nums; }
.vp:fullscreen { background: #000; }
.vp:fullscreen .vp-v { background: #000; }
@media (max-width: 560px) {
  .vp-time { display: none; }
  .vp-bar { gap: 8px; padding: 18px 8px 8px; }
  .vp-btn { height: 34px; min-width: 34px; }
  .vp-big { padding: 14px 16px; font-size: 12px; }
}
@media (hover: none) { .vp-tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .vp.is-playing .vp-top .rec, .vp.is-wait .vp-wait::after { animation: none; } }

/* карточка кейса: номер и тип над названием проекта, дальше паспорт проекта строками */
.wk-kicker { margin: 0 0 10px; font: 400 12px/1.4 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red-hot, #ff3b2f); }
.wk-name { font-size: clamp(28px, 3.4vw, 46px); line-height: 1.02; }
.wk-facts dd b { font-weight: 600; }
@media (max-width: 560px) {
  /* на телефоне подпись над значением: так текст не жмётся в узкую колонку */
  .wk-facts > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}

.rc-body {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px; padding: 28px 24px 32px;
}
.rc-name { margin: 0 0 .3em; font: 400 clamp(32px, 4.6vw, 58px)/1 var(--f-display); text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.rc-act { margin: 0 0 16px; font: 400 12px/1.4 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red-hot); }
.rc-log { margin: 0; max-width: 52ch; font-size: 18px; line-height: 1.55; }
.rc-lore { margin: 14px 0 0; max-width: 60ch; font-size: 16px; line-height: 1.65; color: var(--ash-night); white-space: pre-line; }
.btn-watch {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px;
  border: 1px solid var(--paper); color: var(--paper); text-decoration: none;
  font: 400 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  padding: 14px 16px;
  transition: background-color .2s, border-color .2s;
}
.btn-watch:hover { background: var(--red); border-color: var(--red); }

.card-paper {
  position: relative; align-self: start;
  padding: 18px 20px 76px;
  background-color: var(--paper); background-image: var(--speck-dark);
  color: var(--ink);
  transform: rotate(.9deg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.card-paper h3 {
  margin: 0 0 6px; padding-bottom: 10px; border-bottom: 2px solid var(--ink);
  font: 400 12px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
}
.card-paper dl { margin: 0; }
.card-paper dl > div {
  display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid rgba(15, 15, 14, .25);
}
.card-paper dt { font: 400 11px/1.4 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ash); }
.card-paper dd { margin: 0; font: 600 15px/1.35 var(--f-body); font-variant-numeric: tabular-nums; }
.senses { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.senses span { font-weight: 400; color: var(--ash); }
.senses s { color: var(--red); text-decoration-thickness: 2px; }
.stamp {
  position: absolute; right: 16px; bottom: 16px;
  padding: 8px 12px 6px;
  border: 3px solid var(--red); border-radius: 3px;
  color: var(--red);
  font: 400 19px/1 var(--f-display); text-transform: uppercase; letter-spacing: .04em;
  transform: rotate(-9deg);
  opacity: .88; mix-blend-mode: multiply;
  filter: url(#rough);
  pointer-events: none;
}

.rc-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid rgba(220, 216, 207, .12);
  font: 400 12px/1.4 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ash-night);
  font-variant-numeric: tabular-nums;
}

.wk-body { padding: 26px 24px 30px; }
.wk-meta { margin: 18px 0 0; font: 400 12px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ash-night); }
/* роль, срок и софт работы (из плашек шоурила): подпись слева, значение справа */
.wk-facts { margin: 22px 0 0; max-width: 680px; }
.wk-facts > div {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid rgba(220, 216, 207, .14);
}
.wk-facts > div:last-child { border-bottom: 1px solid rgba(220, 216, 207, .14); }
.wk-facts dt { font: 400 11px/1.5 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ash-night); }
.wk-facts dd { margin: 0; font-size: 16px; line-height: 1.45; color: var(--paper); }

/* серия роликов в одной работе (SOKOLOV): вертикальный плеер + список */
.series {
  --ph: min(74vh, 720px);
  display: grid; grid-template-columns: auto minmax(0, 1fr);
}
.series-player {
  position: relative; height: var(--ph); width: calc(var(--ph) * 9 / 16);
  background: var(--ink);
}
.series-player .series-vid, .series-player .media-el, .series-player .ph {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--ink); border: 0;
}
.series-side {
  display: flex; flex-direction: column; gap: 22px;
  padding: 26px 24px 24px; min-width: 0;
}
/* описание и выбор роликов одной группой сверху, без пустоты посередине */
.series-h {
  margin: 10px 0 -8px; font: 400 12px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ash-night);
}
.series-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.series-item {
  display: grid; gap: 8px; padding: 0; margin: 0; border: 0;
  background: transparent; color: var(--ash-night); text-align: left; cursor: pointer;
}
.series-thumb {
  position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; background: #0b0b0a;
  outline: 1px solid rgba(220, 216, 207, .14); outline-offset: -1px;
  transition: outline-color .2s, box-shadow .3s;
}
.series-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) brightness(.7); transition: filter .35s var(--ease), transform .6s var(--ease);
}
.series-cap { display: flex; gap: 6px; font: 400 11px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
.series-cap b { font-weight: 400; color: var(--red-hot); }
.series-item:hover .series-thumb img, .series-item:focus-visible .series-thumb img { filter: none; transform: scale(1.04); }
.series-item:hover, .series-item:focus-visible { color: var(--paper); }
.series-item.is-on { color: var(--paper); }
.series-item.is-on .series-thumb { outline: 2px solid var(--red-hot); outline-offset: -2px; box-shadow: 0 0 22px rgba(255, 59, 47, .35); }
.series-item.is-on .series-thumb img { filter: none; }
.series-item:focus-visible { outline: none; }
.series-item:focus-visible .series-thumb { outline: 2px solid var(--paper); outline-offset: -2px; }

/* =====================================================================
   ЖИТЕЛИ: ПОДЪЕЗД С ПОЧТОВЫМИ ЯЩИКАМИ (основной вид; app.js: renderMailboxes)
   Стена подъезда как отпечаток: бумага, тушь, один красный. Тон — растром точек под 45°, как на главной.
   Красное — только живое: лампа, глазки ящиков жильцов, письма, слово
   ===================================================================== */
body.mbx-on { --bg: #efefec; background-color: #efefec; background-image: none; }
body.mbx-on .grain { opacity: .035; }
.mbx {
  --p: #efefec; --pw: #f7f7f4; --i: #0f0f0e; --r: #ff3b2f;
  --i7: rgba(15, 15, 14, .7); --i6: rgba(15, 15, 14, .6); --l: rgba(15, 15, 14, .18);
  /* растр: решётка под 45°, шаг 4,2 px; радиус точки — тон (20, 40, 55, 75, 95 % туши) */
  --d20: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='6' fill='%230f0f0e'><circle r='1'/><circle cx='6' r='1'/><circle cy='6' r='1'/><circle cx='6' cy='6' r='1'/><circle cx='3' cy='3' r='1'/></svg>");
  --d40: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='6' fill='%230f0f0e'><circle r='1.45'/><circle cx='6' r='1.45'/><circle cy='6' r='1.45'/><circle cx='6' cy='6' r='1.45'/><circle cx='3' cy='3' r='1.45'/></svg>");
  --d55: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='6' fill='%230f0f0e'><circle r='1.75'/><circle cx='6' r='1.75'/><circle cy='6' r='1.75'/><circle cx='6' cy='6' r='1.75'/><circle cx='3' cy='3' r='1.75'/></svg>");
  --d75: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='6' fill='%230f0f0e'><circle r='2.08'/><circle cx='6' r='2.08'/><circle cy='6' r='2.08'/><circle cx='6' cy='6' r='2.08'/><circle cx='3' cy='3' r='2.08'/></svg>");
  --d95: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='6' fill='%230f0f0e'><circle r='2.5'/><circle cx='6' r='2.5'/><circle cy='6' r='2.5'/><circle cx='6' cy='6' r='2.5'/><circle cx='3' cy='3' r='2.5'/></svg>");
  --r30: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='6' fill='%23ff3b2f'><circle r='1.25'/><circle cx='6' r='1.25'/><circle cy='6' r='1.25'/><circle cx='6' cy='6' r='1.25'/><circle cx='3' cy='3' r='1.25'/></svg>");
  --r60: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='6' fill='%23ff3b2f'><circle r='1.85'/><circle cx='6' r='1.85'/><circle cy='6' r='1.85'/><circle cx='6' cy='6' r='1.85'/><circle cx='3' cy='3' r='1.85'/></svg>");
  /* царапины по краске: светлый металл */
  --scr: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 125' preserveAspectRatio='none'><g fill='none' stroke='%23f7f7f4' stroke-linecap='round'><path d='M14 96 L58 71' stroke-width='1.4'/><path d='M22 104 L49 88' stroke-width='.9'/><path d='M61 28 L86 17' stroke-width='1.1'/><path d='M30 60 L41 54' stroke-width='.8'/></g></svg>");
  color: var(--i);
}
.mbx-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- стена: слово слева, текст, ящики, объявление; внизу краска панели ---------- */
.mbx-hall { position: relative; overflow: hidden; }
.mbx-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(190px, 240px);
  grid-template-areas: "text wall note";
  align-items: end;
  column-gap: clamp(20px, 2.8vw, 48px);
  min-height: calc(100vh - var(--top-h));
  min-height: calc(100svh - var(--top-h));
  padding: clamp(18px, 3vh, 36px) var(--gutter) clamp(26px, 5vh, 52px);
}
/* красное слово машинописью (app.js рисует его на холсте): за ящиками, первая строка уходит за край */
.mbx-word {
  position: absolute; z-index: 0; left: 0; top: clamp(10px, 2.4vh, 28px);
  width: min(66%, 1040px); height: clamp(150px, 44vh, 400px);
  pointer-events: none;
}
.mbx-text { grid-area: text; position: relative; z-index: 2; padding-bottom: clamp(4px, 2vh, 24px); max-width: 520px; }
.mbx-no {
  display: inline-block; margin: 0 0 14px; padding: 4px 8px;
  background: var(--r); color: var(--i);
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
}
.mbx-title { margin: 0 0 22px; font: 400 clamp(38px, 4.2vw, 68px)/.92 var(--f-display); text-transform: uppercase; color: var(--i); }
.mbx-title::after { content: ""; display: block; width: 64px; height: 1px; margin-top: 18px; background: var(--r); }
.mbx-lead { margin: 0; max-width: 44ch; font: 400 13.5px/1.7 var(--f-mono); }
.mbx-links { margin: 18px 0 0; font: 400 13px/1.5 var(--f-mono); }
.mbx-links a { color: var(--i); text-decoration: underline; text-decoration-color: var(--r); text-decoration-thickness: 1px; text-underline-offset: .22em; }
.mbx-links a:hover { text-decoration-thickness: 2px; }

/* нижняя часть стены — масляная краска (тушь растром), граница — ровная полоса */
.mbx-band {
  position: absolute; z-index: 0; left: 34%; right: 0; bottom: 0; height: 30%;
  border-top: 2px solid var(--i);
  background: var(--d75) 0 0 / 6px 6px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 160px); mask: linear-gradient(90deg, transparent, #000 160px);
  pointer-events: none;
}
.mbx-band b { position: absolute; right: var(--gutter); top: 14%; font: 400 clamp(56px, 7vw, 110px)/1 var(--f-display); color: var(--p); }
.mbx-band i {
  position: absolute; right: calc(var(--gutter) + 4px); top: calc(14% + clamp(62px, 7.6vw, 118px));
  font: 400 11px/1 var(--f-mono); font-style: normal; letter-spacing: .3em; text-transform: uppercase; color: var(--p);
}

/* ---------- блок ящиков ---------- */
.mbx-wall { grid-area: wall; position: relative; z-index: 1; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
/* лампочка над ящиками: живой свет — красный, растр вокруг; изредка моргает */
.mbx-lamp { position: absolute; left: 50%; top: calc(-1 * clamp(18px, 3vh, 36px)); width: 1px; height: clamp(34px, 9vh, 96px); background: var(--i); }
.mbx-lamp::before { content: ""; position: absolute; left: -5px; bottom: -3px; width: 11px; height: 8px; background: var(--i); }
.mbx-lamp i {
  position: absolute; left: -8px; top: calc(100% + 4px); width: 17px; height: 20px;
  border-radius: 46% 46% 50% 50% / 38% 38% 62% 62%;
  background: var(--r); box-shadow: 0 0 0 1px var(--i);
}
.mbx-lamp::after {
  content: ""; position: absolute; left: -140px; top: calc(100% - 126px); width: 280px; height: 280px;
  background: var(--r30) 0 0 / 6px 6px;
  -webkit-mask: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, .55) 52%, transparent 100%);
          mask: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, .55) 52%, transparent 100%);
  animation: mbx-lamp 9s steps(1, end) infinite;
  pointer-events: none;
}
.mbx-lamp i { animation: mbx-lamp 9s steps(1, end) infinite; }
@keyframes mbx-lamp { 0%, 41%, 45%, 72%, 100% { opacity: 1; } 42%, 44%, 73% { opacity: .2; } 43% { opacity: .85; } }

.mbx-unit {
  position: relative; width: clamp(300px, 38vw, 580px);
  padding: 0 10px 10px;
  border: 2px solid var(--i);
  background: #242422;
}
/* тень отпечатком: точки со сдвигом */
.mbx-unit::after { content: ""; position: absolute; z-index: -1; left: 10px; top: 10px; right: -12px; bottom: -12px; background: var(--d20) 0 0 / 6px 6px; pointer-events: none; }
.mbx-sign {
  margin: 0 -10px 10px; padding: 7px 10px 6px;
  background: var(--i); color: var(--p);
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; text-align: center;
}
.mbx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(5px, .55vw, 9px); }

/* ---------- ящик: дверца (лицо — краска растром, номер, щель, табличка, замок, глазки), за ней темнота ---------- */
.mbx-box {
  position: relative; display: block; aspect-ratio: 4 / 5;
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left;
  perspective: 520px; container-type: inline-size;
}
button.mbx-box { cursor: pointer; }
.mbx-box:hover, .mbx-box:focus-visible, .mbx-box.is-open { z-index: 3; }
.mbx-box:focus-visible { outline: 2px solid var(--r); outline-offset: 3px; }
.mbx-in { position: absolute; inset: 0; background: #121211; box-shadow: inset 0 0 0 1px var(--i); }
/* в ящике жильца — живое: красный свет внутри */
.mbx-box.is-watch .mbx-in::after,
.mbx-box.is-wip .mbx-in::after {
  content: ""; position: absolute; inset: 18% 12%;
  background: var(--r60) 0 0 / 6px 6px;
  -webkit-mask: radial-gradient(closest-side, #000 35%, transparent 100%); mask: radial-gradient(closest-side, #000 35%, transparent 100%);
  transition: inset .5s cubic-bezier(.3, .7, .2, 1);
}
.mbx-box.is-open .mbx-in::after { inset: 4% 2%; }
.mbx-door {
  position: absolute; inset: 0; z-index: 1;
  transform-origin: 0 50%;
  transition: transform .45s cubic-bezier(.3, .7, .2, 1);
}
/* дверца: серая краска ровным тоном (как дом на главной — ксерокопия), снизу грязнее, по ней зерно */
.mbx-face {
  position: absolute; inset: 0; overflow: hidden;
  border: 1.5px solid var(--i);
  background: linear-gradient(180deg, rgba(15, 15, 14, 0) 55%, rgba(15, 15, 14, .16)), #a4a49f;
  box-shadow: inset 1px 1px 0 rgba(247, 247, 244, .55), inset -1px -1px 0 rgba(15, 15, 14, .3);
}
.mbx-face::before { content: ""; position: absolute; inset: 5cqi; border: 1px solid rgba(15, 15, 14, .45); pointer-events: none; }
.mbx-face::after { content: ""; position: absolute; inset: 0; background: var(--noise) 0 0 / 180px 180px; mix-blend-mode: multiply; opacity: .5; pointer-events: none; }
.mbx-plate {
  position: absolute; left: 9cqi; top: 9cqi; min-width: 27cqi;
  padding: 2.4cqi 3cqi 1.8cqi;
  background: var(--pw); border: 1px solid var(--i);
  font: 400 11cqi/1 var(--f-display); text-align: center; color: var(--i);
}
.mbx-plate.is-gone { min-height: 15cqi; background: rgba(15, 15, 14, .12); border: 1px dashed rgba(15, 15, 14, .45); }
.mbx-slot { position: absolute; left: 14cqi; right: 14cqi; top: 34%; height: 5.5cqi; background: var(--i); box-shadow: 0 1.6cqi 0 -.5cqi rgba(247, 247, 244, .8); }
.mbx-tag {
  position: absolute; left: 11cqi; right: 11cqi; top: 47%;
  padding: 2.2cqi 2.5cqi 1.8cqi;
  background: var(--pw); border: 1px solid var(--i);
  font: 400 8.6cqi/1.15 var(--f-mono); letter-spacing: .02em; text-transform: uppercase; color: var(--i);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mbx-key {
  position: absolute; right: 11cqi; top: 70%; width: 7.5cqi; height: 7.5cqi; border-radius: 50%;
  background: var(--i); box-shadow: 0 0 0 1.4cqi var(--pw), 0 0 0 calc(1.4cqi + 1px) var(--i);
}
.mbx-key::after { content: ""; position: absolute; left: 50%; top: 42%; width: 1.6cqi; height: 4cqi; margin-left: -.8cqi; background: var(--pw); }
.mbx-holes { position: absolute; left: 0; right: 0; bottom: 8cqi; display: flex; justify-content: center; gap: 5cqi; }
.mbx-holes i { width: 5.5cqi; height: 5.5cqi; border-radius: 50%; background: var(--i); box-shadow: 0 0 0 1px rgba(247, 247, 244, .5); }
/* глазки ящика жильца светятся красным и изредка гаснут */
.mbx-box.is-watch .mbx-holes i,
.mbx-box.is-wip .mbx-holes i { background: var(--r); animation: mbx-live 3.4s steps(1, end) infinite; }
.mbx-box.is-wip .mbx-holes i { animation-delay: -1.3s; }
@keyframes mbx-live { 0%, 62%, 70%, 100% { background: var(--r); } 63%, 69% { background: #5c1410; } }
/* письмо торчит из щели */
.mbx-letter {
  position: absolute; z-index: 2; left: 22cqi; width: 54cqi; height: 24cqi; top: calc(34% - 23cqi);
  background: var(--pw); border: 1px solid var(--i);
  transform: rotate(-5deg); transform-origin: 50% 100%;
  transition: transform .4s cubic-bezier(.3, .7, .2, 1), opacity .35s;
  pointer-events: none;
}
.mbx-letter::before { content: ""; position: absolute; left: 6cqi; right: 17cqi; top: 10cqi; height: 8cqi; background: repeating-linear-gradient(180deg, rgba(15, 15, 14, .6) 0 1px, transparent 1px 3.2cqi); }
.mbx-letter::after { content: ""; position: absolute; right: 4cqi; top: 4cqi; width: 9cqi; height: 11cqi; background: var(--r60) 0 0 / 6px 6px; outline: 1px solid var(--r); }
/* закрытая квартира: заклеено лентой крест-накрест */
.mbx-tape {
  position: absolute; left: -14%; right: -14%; top: 37%; height: 15cqi;
  display: flex; align-items: center; justify-content: center;
  background: rgba(247, 247, 244, .94); border-block: 1px solid rgba(15, 15, 14, .45);
  transform: rotate(-17deg);
}
.mbx-tape.t2 { top: 58%; transform: rotate(12deg); }
.mbx-tape b { font: 400 7.4cqi/1 var(--f-display); letter-spacing: .06em; text-transform: uppercase; color: var(--r); white-space: nowrap; }
/* пустые: реклама в щели, нет таблички, дверца приоткрыта, вмятина, царапины */
.mbx-flyer {
  position: absolute; z-index: 2; left: 26cqi; width: 46cqi; height: 19cqi; top: calc(34% - 18cqi);
  background: var(--d20) 0 0 / 6px 6px var(--pw); border: 1px solid rgba(15, 15, 14, .7);
  transform: rotate(7deg); transform-origin: 50% 100%; pointer-events: none;
}
.mbx-flyer::before { content: ""; position: absolute; left: 5cqi; right: 5cqi; top: 4cqi; height: 6cqi; background: var(--i); }
.v-flyer2 .mbx-flyer { left: 17cqi; width: 60cqi; height: 23cqi; top: calc(34% - 22cqi); transform: rotate(-11deg); }
.v-ajar .mbx-door { transform: rotateY(-22deg); }
.v-dent .mbx-face { transform: skewY(-1.8deg) translateY(1cqi); }
.v-dent .mbx-face::before { inset: 5cqi 5cqi 5cqi 7cqi; transform: skewY(1.2deg); }
.v-dent .mbx-face { background: radial-gradient(ellipse 28% 20% at 62% 58%, rgba(15, 15, 14, .3), transparent 70%), linear-gradient(180deg, rgba(15, 15, 14, 0) 55%, rgba(15, 15, 14, .16)), #a4a49f; }
.mbx-scr { position: absolute; inset: 0; background: var(--scr) center / 100% 100% no-repeat; pointer-events: none; }

/* ---------- живые ящики: наведение приоткрывает дверцу, нажатие распахивает ---------- */
@media (hover: hover) {
  .mbx-box.is-watch:hover .mbx-door,
  .mbx-box.is-wip:hover .mbx-door { transform: rotateY(-16deg); }
  .mbx-box.is-watch:hover .mbx-letter,
  .mbx-box.is-wip:hover .mbx-letter { transform: translate(-1cqi, -4cqi) rotate(-9deg); }
  .mbx-box.is-locked:hover .mbx-tape { animation: mbx-tape .3s steps(3, end) 1; }
  .mbx-box.is-empty:hover .mbx-door { transform: rotateY(-4deg); transition-duration: .12s; }
  .mbx-box.v-ajar:hover .mbx-door { transform: rotateY(-26deg); }
}
.mbx-box.is-watch:focus-visible .mbx-door,
.mbx-box.is-wip:focus-visible .mbx-door { transform: rotateY(-16deg); }
.mbx-box.is-open .mbx-door { transform: rotateY(-104deg) !important; transition-duration: .5s; }
.mbx-box.is-open .mbx-letter { transform: translate(5cqi, -50cqi) rotate(-16deg) scale(1.15); opacity: 0; transition-duration: .5s; }
@keyframes mbx-tape { 0% { transform: rotate(-17deg) translateY(0); } 33% { transform: rotate(-19deg) translateY(-1px); } 66% { transform: rotate(-16deg) translateY(1px); } 100% { transform: rotate(-17deg); } }
.mbx-box.is-locked:hover .mbx-tape.t2 { animation-name: mbx-tape2; }
@keyframes mbx-tape2 { 0% { transform: rotate(12deg); } 33% { transform: rotate(14deg) translateY(1px); } 66% { transform: rotate(11deg); } 100% { transform: rotate(12deg); } }
/* пустой ящик дребезжит */
.mbx-box.rattle .mbx-door { animation: mbx-rattle .34s steps(6, end) 1; }
@keyframes mbx-rattle {
  0% { transform: rotateY(0); } 17% { transform: rotateY(-9deg); } 33% { transform: rotateY(-2deg); }
  50% { transform: rotateY(-7deg); } 67% { transform: rotateY(-1deg); } 83% { transform: rotateY(-4deg); } 100% { transform: rotateY(0); }
}
/* сбой при наведении: лицо дверцы рвётся по строкам, как кадр на главной */
.mbx-face.glitch { animation: mbx-glitch .2s steps(1, end) 1; }
@keyframes mbx-glitch {
  0% { clip-path: inset(0 0 52% 0); transform: translateX(3px); }
  33% { clip-path: inset(36% 0 0 0); transform: translateX(-4px); }
  66% { clip-path: none; transform: translateX(1px); }
  100% { clip-path: none; transform: none; }
}
/* красные штрихи от ящика жильца до края стены */
.mbx-smear { position: absolute; z-index: 3; display: none; pointer-events: none; }
.mbx-smear.on { display: block; }
.mbx-smear i { position: absolute; left: 0; height: 1px; background: var(--r); transform-origin: 0 50%; transform: scaleX(0); }
.mbx-smear.on i { animation: mbx-smear .6s steps(6, end) forwards; }
.mbx-smear.on i:nth-child(2) { height: 2px; animation-delay: .05s; }
.mbx-smear.on i:nth-child(3) { animation-delay: .1s; }
@keyframes mbx-smear { 0% { transform: scaleX(0); opacity: 1; } 34% { transform: scaleX(1); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

/* строка под ящиками: машинопись */
.mbx-status {
  position: relative; align-self: flex-start; max-width: clamp(300px, 38vw, 580px); min-height: 1.7em; margin: 18px 0 0;
  padding: 5px 12px 4px 10px; background: var(--i);
  font: 400 12.5px/1.7 var(--f-mono); letter-spacing: .04em; color: rgba(239, 239, 236, .86);
}
.mbx-status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; background: var(--r); vertical-align: 0; }
.mbx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* объявление на стене */
.mbx-note {
  grid-area: note; align-self: start; justify-self: start;
  position: relative; z-index: 2; width: 100%; max-width: 250px;
  margin-top: clamp(90px, 18vh, 200px); padding: 20px 16px 0;
  background-color: var(--pw); background-image: none; color: var(--i);
  transform: rotate(2.2deg);
  box-shadow: 0 0 0 1px rgba(15, 15, 14, .3), 7px 8px 0 rgba(15, 15, 14, .07);
}
.mbx-note::before, .mbx-note::after { background: rgba(207, 203, 194, .8); box-shadow: none; }
.mbx-note .notice-h { font-size: 24px; }
.mbx-note .notice-to { font-size: 11.5px; }
.mbx-note ol { font: 400 12.5px/1.5 var(--f-mono); gap: 7px; }
.mbx-note .notice-sign { font-size: 11.5px; }
.mbx-note .tear-row { margin: 16px -16px 0; border-top-color: rgba(15, 15, 14, .5); }
.mbx-note .tear { height: 92px; font-size: 10px; background-color: var(--pw); background-image: none; }
.mbx-note a.tear:hover { color: var(--r); }

/* вход в подъезд: красная линия развёртки слева направо проявляет стену */
.mbx-scan { position: absolute; z-index: 5; top: 0; bottom: 0; left: 0; width: 1px; background: #ff3b2f; opacity: 0; pointer-events: none; }
.mbx-hall.is-scan .mbx-scan { animation: mbx-scan .8s cubic-bezier(.65, 0, .35, 1) 1; }
.mbx-hall.is-scan .mbx-inner { animation: mbx-reveal .8s cubic-bezier(.65, 0, .35, 1) backwards; }
@keyframes mbx-scan { 0% { left: 0; opacity: 1; } 98% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes mbx-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* планшет: объявление под текстом */
@media (max-width: 1199px) {
  .mbx-inner { grid-template-columns: minmax(240px, 1fr) auto; grid-template-areas: "text wall" "note note"; }
  .mbx-word { height: clamp(110px, 29vh, 260px); }
  .mbx-note { align-self: start; justify-self: start; margin: 40px 0 0; max-width: 330px; transform: rotate(-1.4deg); }
  .mbx-unit { width: clamp(300px, 46vw, 520px); }
  .mbx-status { max-width: clamp(300px, 46vw, 520px); }
}
/* телефон: слово, текст, ящики четыре в ряд, объявление */
@media (max-width: 760px) {
  .mbx-inner {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
    grid-template-areas: "word" "text" "wall" "note";
    min-height: 0; row-gap: 22px; padding-top: 12px;
  }
  .mbx-word { grid-area: word; position: relative; left: auto; top: auto; margin-left: calc(-1 * var(--gutter)); width: calc(100% + 2 * var(--gutter)); height: clamp(120px, 36vw, 200px); }
  .mbx-text { padding-bottom: 0; }
  .mbx-wall { align-items: stretch; padding-top: 74px; }
  .mbx-lamp { top: 0; height: 40px; }
  .mbx-unit { width: 100%; }
  .mbx-status { max-width: none; }
  .mbx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mbx-band, .mbx-smear { display: none !important; }
  .mbx-note { justify-self: center; margin: 6px 0 26px; max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  .mbx-lamp::after, .mbx-lamp i, .mbx-holes i { animation: none !important; }
}

/* ---------- 3D-подъезд (hall3d.js): кадр на весь экран, текст слева на непроявленной колонке ---------- */
.hall {
  position: relative; overflow: hidden;
  height: calc(100vh - var(--top-h)); height: calc(100svh - var(--top-h)); min-height: 520px;
  background: #efefec;
}
.hall-stage { position: absolute; inset: 0; }
.hall-canvas { display: block; width: 100%; height: 100%; }
/* кнопки ящиков поверх кадра: прозрачные, на месте ящиков */
.hall-spots { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.mbx-box.hall-spot {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  aspect-ratio: auto; container-type: normal; perspective: none;
  pointer-events: auto; background: none;
}
.hall-spot:focus-visible { outline: 2px solid var(--r); outline-offset: 2px; }
/* 19.11, его правка: «слева блок описания какой-то сжатый, пережатый; на главной он центрально отцентрован, красиво» —
   колонка как у главы на главной (.hh-panel): от слова residents до низа, блок по центру этой высоты, ширина и отступы
   как у главы, ссылка на Telegram — чёрной кнопкой, как «Перейти дальше». Слово чуть ниже ростом, чтобы блоку было где
   стоять; строка «Выбери ящик» ушла из блока в плашку внизу (.hall-hint) */
.hall .mbx-word { position: absolute; z-index: 3; left: 0; top: clamp(8px, 2vh, 24px); width: min(48%, 760px); height: clamp(110px, 26vh, 250px); }
.hall-text {
  position: absolute; z-index: 3; left: var(--gutter);
  top: calc(clamp(8px, 2vh, 24px) + clamp(110px, 26vh, 250px) + 2.4vh); bottom: clamp(18px, 4vh, 48px);
  width: min(460px, 34vw);
  display: flex; flex-direction: column; justify-content: safe center; align-items: flex-start;
  pointer-events: none;
}
.hall-text > * { pointer-events: auto; }
.hall .mbx-title { font-size: clamp(34px, 3.6vw, 60px); margin-bottom: 22px; }
.hall .mbx-title::after { margin-top: 18px; }
.hall .mbx-links { margin: 0; }
.hall .mbx-links a {
  display: inline-block; padding: 14px 18px; background: #0f0f0e; color: #efefec;
  font: 400 13px/1.35 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  transition: background-color .2s, color .2s;
}
.hall .mbx-links a::before { content: "[/ "; }
.hall .mbx-links a::after { content: " ]"; }
.hall .mbx-links a:hover, .hall .mbx-links a:focus-visible { background: #e3271b; color: #0f0f0e; }
/* подпись ящика при наведении (кто живёт, что внутри) — машинописью на маленькой чёрной плашке внизу по центру */
.hall-status {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: clamp(26px, 5.5vh, 60px);
  width: max-content; max-width: min(84vw, 780px); margin: 0 auto; padding: 7px 14px 6px 12px;
  font: 400 13px/1.6 var(--f-mono); letter-spacing: .04em; color: rgba(239, 239, 236, .92);
  pointer-events: none; opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .3s ease;
}
.hall-status::after { content: ""; position: absolute; inset: 0; z-index: -1; background: #0f0f0e; filter: url(#cut-s); }
.hall-status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; background: #e3271b; vertical-align: 0; }
.hall-status.is-on { opacity: 1; transform: none; }
/* подсказка: 30 с без действий — чёрная рваная плашка внизу по центру, красный ящик с письмом, крупно «Выбери ящик»,
   под ним мелко «в каждом — история жильца»; появляется прыжком и раз в 3,6 с толкается (как на главной, hh-big-*) */
.hall-hint {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: clamp(26px, 5.5vh, 60px);
  display: flex; align-items: center; gap: .72em; width: max-content; margin: 0 auto; padding: .62em 1.3em .64em 1.1em;
  font: 400 clamp(20px, 1.72vw, 32px)/1.15 var(--f-mono); letter-spacing: .03em; color: #efefec; white-space: nowrap;
  pointer-events: none; opacity: 0; transform: translateY(14px);
  transition: opacity .45s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.hall-hint::after { content: ""; position: absolute; inset: 0; z-index: -1; background: #0f0f0e; filter: url(#cut-s); }
.hall-hint::before {
  content: ""; flex: none; width: 1.05em; height: 1.3em; box-sizing: border-box; border: 3px solid #e3271b; border-radius: 3px;
  background: linear-gradient(#e3271b, #e3271b) 50% 32% / 58% 3px no-repeat;
  transform-origin: 50% 100%;
}
.hall-hint-t { display: grid; justify-items: start; }
.hall-hint b { font-weight: 700; text-transform: uppercase; }
.hall-hint small { margin-top: .5em; font-size: .5em; letter-spacing: .12em; text-transform: uppercase; color: rgba(239, 239, 236, .66); }
.hall-hint.is-on { opacity: 1; transform: none; animation: hh-big-in .85s cubic-bezier(.2, .9, .25, 1.25) both, hh-big-nudge 3.6s ease-in-out 1.6s infinite; }
@media (prefers-reduced-motion: no-preference) { .hall-hint.is-on::before { animation: hall-box 3.6s ease-in-out 1.6s infinite; } }
@keyframes hall-box { 0%, 70%, 100% { transform: none; } 76% { transform: rotate(-7deg); } 82% { transform: rotate(6deg); } 88% { transform: rotate(-3deg); } }
/* вход: текст и слово проявляются вместе с линией развёртки в кадре */
.hall.is-scan .hall-text,
.hall.is-scan .mbx-word { animation: mbx-reveal .45s cubic-bezier(.65, 0, .35, 1) backwards; }
@media (max-width: 760px) {
  .hall { height: auto; min-height: 0; }
  .hall-stage { position: relative; height: 62svh; min-height: 380px; }
  .hall-spots { bottom: auto; height: 62svh; min-height: 380px; }
  .hall .mbx-word { width: 100%; height: clamp(84px, 26vw, 140px); }
  .hall-text { position: static; width: auto; padding: 20px var(--gutter) 30px; }
  /* на телефоне плашки — у низа кадра подъезда */
  .hall-status, .hall-hint { top: calc(max(62svh, 380px) - 66px); bottom: auto; }
  .hall-hint { font-size: 18px; }
  .hall-hint small { display: none; }
  .hall-status { max-width: calc(100vw - 2 * var(--gutter)); white-space: normal; font-size: 12px; }
}

/* =====================================================================
   ПОРТФОЛИО (подъезд 2 · для брендов; app.js: renderPortfolio)
   Шоурил и кейсы — блоки-оттиски: кадр печатается растром точек под 45° (порог контраста по сетке
   точек: тёмное — крупная точка), по углам метки обреза, данные кейса машинописью. Наведение —
   кадр оживает: цветная петля со сбоем, красная рамка и метки, плашка «кейс 01 · срок»
   ===================================================================== */
body.pf-on { --bg: #efefec; background-color: #efefec; background-image: none; }
body.pf-on .grain { opacity: .035; }
.pf {
  --p: #efefec; --pw: #f7f7f4; --i: #0f0f0e; --r: #ff3b2f;
  --i7: rgba(15, 15, 14, .7); --i6: rgba(15, 15, 14, .6); --l: rgba(15, 15, 14, .18);
  --ht: 6px;                                   /* шаг растра: соседние точки через 4,2 px, как на главной */
  position: relative; color: var(--i);
}

/* ---------- шапка: слово машинописью, номер раздела, заголовок, текст, факты ---------- */
.pf-head {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px clamp(28px, 5vw, 80px);
  align-items: end;
  padding-top: clamp(28px, 5vh, 56px); padding-bottom: clamp(26px, 4vw, 48px);
}
.pf-word { position: absolute; z-index: 0; left: 0; top: clamp(4px, 1.5vh, 20px); width: min(76%, 1060px); height: clamp(130px, 30vh, 290px); pointer-events: none; }
.pf-intro { position: relative; z-index: 1; max-width: 560px; }
.pf-no {
  display: inline-block; margin: 0 0 14px; padding: 4px 8px;
  background: var(--r); color: var(--i);
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
}
.pf-title { margin: 0 0 22px; font: 400 clamp(40px, 4.6vw, 76px)/.92 var(--f-display); text-transform: uppercase; }
.pf-title::after { content: ""; display: block; width: 64px; height: 1px; margin-top: 18px; background: var(--r); }
.pf-lead { margin: 0; max-width: 48ch; font: 400 13.5px/1.7 var(--f-mono); }
.pf-links { margin: 22px 0 0; }
.pf-cta {
  display: inline-block; padding: 14px 18px; background: var(--i); color: var(--p); text-decoration: none;
  font: 400 13px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
}
.pf-cta:hover { background: var(--r); color: var(--i); }
.pf-facts { position: relative; z-index: 1; margin: 0; align-self: end; }
.pf-facts > div {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--l);
}
.pf-facts > div:last-child { border-bottom: 1px solid var(--l); }
.pf-facts dt { font: 400 11px/1.5 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--i6); }
.pf-facts dd { margin: 0; font: 400 13px/1.55 var(--f-mono); }

/* ---------- сетка блоков ---------- */
.pf-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(34px, 4vw, 56px) clamp(16px, 1.8vw, 28px);
  padding-bottom: clamp(64px, 9vw, 128px);
}
.pf-sign {
  grid-column: 1 / -1; justify-self: start; margin: 0 0 -10px;
  padding: 6px 12px 5px; background: var(--i); color: var(--p);
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
}
.pf-block {
  grid-column: span var(--c, 6); position: relative;
  display: flex; flex-direction: column; min-width: 0;
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.pf-block:focus-visible { outline: none; }
.pf-block:focus-visible .pf-media { outline: 2px solid var(--r); outline-offset: 4px; }
.pf-media {
  position: relative; display: block; height: clamp(240px, 30vw, 470px);
  background: var(--p); outline: 1px solid rgba(15, 15, 14, .7); outline-offset: 0;
  transition: outline-color .12s;
}
.pf-reel .pf-media { height: auto; aspect-ratio: 16 / 9; max-height: 80vh; }
/* растр: картинка в оттенках серого сжата в светлую половину тонов, поверх — сетка точек (белое → серое
   к центру ячейки), всё вместе через порог контраста: тёмное печатается крупной точкой, светлое — бумагой */
.pf-ht { position: absolute; inset: 0; overflow: hidden; background: #fff; filter: contrast(18); }
.pf-ht > img, .pf-ht > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(.45) brightness(1.31);
}
.pf-ht::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(closest-side, #888, #fff) 0 0 / var(--ht) var(--ht),
    radial-gradient(closest-side, #888, #fff) calc(var(--ht) / 2) calc(var(--ht) / 2) / var(--ht) var(--ht);
  background-blend-mode: darken;
  mix-blend-mode: multiply;
}
/* бумага вместо чистого белого */
.pf-media::after { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--p); mix-blend-mode: darken; pointer-events: none; }
/* петля: поверх оттиска, цветная, появляется при наведении */
.pf-vid { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .18s steps(3, end); }
/* SOKOLOV: пять вертикальных роликов полосой */
.pf-strip { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; background: var(--p); }
.pf-cell { position: relative; overflow: hidden; }
/* метки обреза по углам */
.pf-crop {
  position: absolute; inset: -9px; z-index: 3; pointer-events: none; --k: var(--i);
  background:
    linear-gradient(var(--k), var(--k)) 0 0 / 14px 1px no-repeat, linear-gradient(var(--k), var(--k)) 0 0 / 1px 14px no-repeat,
    linear-gradient(var(--k), var(--k)) 100% 0 / 14px 1px no-repeat, linear-gradient(var(--k), var(--k)) 100% 0 / 1px 14px no-repeat,
    linear-gradient(var(--k), var(--k)) 0 100% / 14px 1px no-repeat, linear-gradient(var(--k), var(--k)) 0 100% / 1px 14px no-repeat,
    linear-gradient(var(--k), var(--k)) 100% 100% / 14px 1px no-repeat, linear-gradient(var(--k), var(--k)) 100% 100% / 1px 14px no-repeat;
}
/* плашка с данными кейса: тушь, красная машинопись */
.pf-plate {
  position: absolute; z-index: 4; left: 10px; top: 10px; padding: 4px 8px 3px;
  background: var(--i); color: var(--r);
  font: 400 10.5px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transition: opacity .12s steps(2, end);
}
/* подпись под кадром */
.pf-cap { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 3px; padding-top: 16px; }
.pf-n { grid-row: span 4; align-self: start; padding: 3px 6px 2px; font: 400 11px/1.2 var(--f-mono); letter-spacing: .08em; color: var(--r); border: 1px solid var(--r); }
.pf-cl { font: 400 clamp(20px, 1.8vw, 28px)/1 var(--f-display); text-transform: uppercase; overflow-wrap: anywhere; }
.pf-meta { margin-top: 4px; font: 400 12.5px/1.55 var(--f-mono); color: var(--i7); }
.pf-role, .pf-tools { font: 400 11.5px/1.55 var(--f-mono); color: var(--i6); }
/* шоурил: метка записи, таймкод, кнопка */
.pf-rec {
  position: absolute; z-index: 4; left: 14px; top: 14px; display: flex; align-items: center; gap: 8px;
  padding: 5px 9px 4px; background: var(--i); color: var(--p);
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .1em; font-variant-numeric: tabular-nums;
}
.pf-rec i { width: 7px; height: 7px; border-radius: 50%; background: var(--r); animation: pf-rec 1.2s steps(1, end) infinite; }
@keyframes pf-rec { 50% { opacity: 0; } }
.pf-play {
  position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  background: var(--r); color: var(--i);
  font: 400 14px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.pf-play i { width: 0; height: 0; border-left: 12px solid var(--i); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.pf-reel .pf-cl { font-size: clamp(26px, 2.6vw, 40px); }

/* ---------- наведение: кадр оживает ---------- */
@media (hover: hover) {
  .pf-block:hover .pf-media { outline-color: var(--r); }
  .pf-block:hover .pf-crop { --k: var(--r); }
  .pf-block:hover .pf-plate { opacity: 1; }
  .pf-block:hover .pf-vid { opacity: 1; }
  .pf-block:hover .pf-n { background: var(--r); color: var(--i); }
  /* шоурил: петля уже играет растром — при наведении в цвете */
  .pf-reel:hover .pf-ht { filter: none; }
  .pf-reel:hover .pf-ht::after { display: none; }
  .pf-reel:hover .pf-ht > video, .pf-reel:hover .pf-ht > img { filter: none; }
  .pf-reel:hover .pf-play { background: var(--i); color: var(--r); }
  .pf-reel:hover .pf-play i { border-left-color: var(--r); }
}
.pf-block:focus-visible .pf-vid, .pf-block.live .pf-vid { opacity: 1; }
.pf-block.live .pf-media { outline-color: var(--r); }
.pf-block.live .pf-crop { --k: var(--r); }
.pf-block.live .pf-plate { opacity: 1; }
/* сбой на входе курсора: кадр рвётся по строкам */
.pf-block.glitch .pf-media > .pf-vid,
.pf-block.glitch .pf-strip,
.pf-block.glitch .pf-ht { animation: pf-glitch .22s steps(1, end) 1; }
@keyframes pf-glitch {
  0% { clip-path: inset(0 0 58% 0); transform: translateX(6px); }
  25% { clip-path: inset(34% 0 22% 0); transform: translateX(-8px); }
  50% { clip-path: inset(70% 0 0 0); transform: translateX(3px); }
  75% { clip-path: none; transform: translateX(-2px); }
  100% { clip-path: none; transform: none; }
}

/* вход: красная линия развёртки слева направо проявляет страницу */
.pf-scan { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 1px; background: #ff3b2f; opacity: 0; pointer-events: none; }
.pf.is-scan .pf-scan { animation: mbx-scan .8s cubic-bezier(.65, 0, .35, 1) 1; }
.pf.is-scan .pf-head, .pf.is-scan .pf-grid { animation: mbx-reveal .8s cubic-bezier(.65, 0, .35, 1) backwards; }

/* планшет: кейсы по два, шоурил во всю ширину */
@media (max-width: 1100px) {
  .pf-head { grid-template-columns: minmax(0, 1fr); padding-top: clamp(24px, 4vh, 44px); }
  .pf-word { width: 92%; height: clamp(110px, 24vh, 220px); }
  .pf-block { grid-column: span 6; }
  .pf-block.pf-reel, .pf-block[data-work="sokolov"] { grid-column: 1 / -1; }
}
/* телефон: столбиком, кадры 16:9 */
@media (max-width: 760px) {
  .pf { --ht: 5px; }
  .pf-head { padding-top: 22px; }
  .pf-word { height: clamp(84px, 28vw, 140px); }
  .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .pf-block, .pf-block.pf-reel, .pf-block[data-work="sokolov"] { grid-column: 1 / -1; }
  .pf-media { height: auto; aspect-ratio: 16 / 9; }
  .pf-block[data-work="sokolov"] .pf-media { aspect-ratio: 4 / 3; }
  .pf-facts > div { grid-template-columns: 96px minmax(0, 1fr); }
  .pf-play { padding: 12px 14px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-rec i { animation: none; }
}

/* ---------- вид вкладки: доска / сетка ---------- */
.pf-bar { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-bottom: clamp(22px, 3vw, 36px); }
.pf-bar .pf-sign { margin: 0; }
.pf-modes { display: flex; gap: 6px; }
.pf-modes button, .pf-reset {
  padding: 6px 12px 5px; border: 1px solid var(--i); background: transparent; color: var(--i); cursor: pointer;
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
}
.pf-modes button:hover, .pf-reset:hover { background: rgba(15, 15, 14, .06); }
.pf-modes button[aria-pressed="true"] { background: var(--r); border-color: var(--r); color: var(--i); }
.pf-reset { border-style: dashed; }
.pf-hint { margin: 0; margin-left: auto; font: 400 11px/1.4 var(--f-mono); letter-spacing: .06em; color: var(--i6); }
.pf-hint::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; background: var(--r); vertical-align: 0; }
.pf-stage { position: relative; z-index: 1; min-height: 40vh; padding-bottom: clamp(56px, 8vw, 110px); }
.pf-stage .pf-grid { padding-bottom: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pf-word { z-index: 1; }
.pf[data-mode="grid"] .pf-word { left: max(0px, calc((100% - var(--maxw)) / 2)); }

/* =====================================================================
   ДОСКА: стена подъезда 2 во всю вкладку (portfolio.js)
   ===================================================================== */
.pf[data-mode="board"] { overflow: hidden; background: #e3e2dc; }
/* побелка: зерно по всей стене; внизу стена уходит в бумагу страницы */
.pf[data-mode="board"]::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--noise) 0 0 / 180px 180px; mix-blend-mode: multiply; opacity: .45;
}
.pf[data-mode="board"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; z-index: 0; pointer-events: none;
  background: linear-gradient(rgba(239, 239, 236, 0), #efefec);
}
.pf[data-mode="board"] .pf-head { display: none; }
/* доска начинается сразу с объявлений: полоса сверху не занимает места, вид («доска / сетка») — плашкой внизу слева */
.pf[data-mode="board"] .pf-bar { display: block; height: 0; padding: 0; }
.pf[data-mode="board"] .pf-sign, .pf[data-mode="board"] .pf-hint { display: none; }
.pf[data-mode="board"] .pf-modes {
  position: fixed; z-index: 60; left: max(14px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom));
  padding: 4px; gap: 4px; background: var(--p); border: 1px solid var(--i); box-shadow: 0 8px 18px rgba(15, 15, 14, .22);
}
/* подвал не уходит под плашку вида, когда долистал до конца */
.pf[data-mode="board"] + .foot { padding-bottom: 78px; }
@media (max-width: 760px) { .pf[data-mode="board"] .pf-modes button { padding: 5px 9px 4px; font-size: 10px; } }
.pf[data-mode="board"] .pf-stage { padding-bottom: 0; }
.pf-reset[hidden] { display: none; }
.pf[data-mode="board"] .pf-reset {
  position: fixed; z-index: 60; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  padding: 11px 16px 10px; background: var(--p); border: 1px dashed var(--i); box-shadow: 0 8px 18px rgba(15, 15, 14, .22);
  transform: translateX(-50%); animation: pf-reset-in .3s cubic-bezier(.2, .8, .3, 1) both;
}
.pf[data-mode="board"] .pf-reset:hover { background: var(--r); border-color: var(--r); }
@keyframes pf-reset-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translateX(-50%); } }

.pb { position: relative; width: 100%; }
.pb-wall { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.pb-svg { position: absolute; left: 0; top: 0; display: block; }
.pb-note {
  position: absolute; left: 0; top: 0; z-index: 1;
  cursor: grab; user-select: none; -webkit-user-select: none;
  transform-origin: 50% 16%; will-change: transform;
  filter: drop-shadow(0 6px 9px rgba(15, 15, 14, .2));
  transition: filter .2s;
}
.pb.is-reset .pb-note { transition: transform .45s cubic-bezier(.3, .7, .2, 1), filter .2s; }
.pb-note.is-drag { cursor: grabbing; filter: drop-shadow(0 22px 28px rgba(15, 15, 14, .32)); }
.pb-note:not([role]) { cursor: grab; }
.pb-note:focus-visible { outline: 2px solid var(--r); outline-offset: 6px; }
.pb-in { position: relative; display: block; }
/* шлёп: объявление прилипает к стене, когда доезжает до экрана */
.pb.js .pb-note:not(.in) .pb-in { opacity: 0; }
.pb-note.in .pb-in { animation: pb-slap .34s steps(4, end) both; }
@keyframes pb-slap {
  0% { opacity: 0; transform: translateY(-14px) scale(1.07) rotate(var(--sr, 3deg)); }
  40% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
/* скотч */
.pb-tape {
  position: absolute; z-index: 3; top: -12px; width: 80px; height: 24px;
  background: rgba(214, 209, 196, .86); box-shadow: 0 1px 2px rgba(15, 15, 14, .12);
  transform: rotate(var(--a, 0deg)); transition: transform .2s;
}
.pb-tape.a { left: 9%; }
.pb-tape.b { right: 9%; }
.pb-tape.c { left: 50%; margin-left: -40px; width: 92px; }
.pb-sheet { position: relative; display: block; padding: 14px 14px 0; background: var(--paper, #f6f5f1); }
/* лёгкая волна бумаги: светлая полоса и тень загиба в углу */
.pb-sheet::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .35) 45%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(135deg, rgba(15, 15, 14, 0) 82%, rgba(15, 15, 14, .07) 100%);
}
.pb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--i); }
.pb-head b { font: 400 clamp(15px, 1.25vw, 21px)/1 var(--f-display); text-transform: uppercase; white-space: nowrap; }
.pb-head i { font: 400 11px/1 var(--f-mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--i6); text-align: right; }
.pb-media { position: relative; display: block; aspect-ratio: 16 / 9; outline: 1px solid rgba(15, 15, 14, .6); }
.pb-media::after { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--paper, #f6f5f1); mix-blend-mode: darken; pointer-events: none; }
.pb-title { display: block; margin: 12px 0 3px; font: 400 clamp(18px, 1.65vw, 27px)/1 var(--f-display); text-transform: uppercase; overflow-wrap: anywhere; }
.pb-meta { display: block; font: 400 12px/1.5 var(--f-mono); color: var(--i7); }
.pb-small { display: block; margin-top: 2px; font: 400 11px/1.5 var(--f-mono); color: var(--i6); }
/* отрывные полоски с контактом */
.pb-tear { display: flex; margin: 12px -14px 0; border-top: 1px dashed rgba(15, 15, 14, .5); }
.pb-t {
  flex: 1 1 0; min-width: 0; height: 70px; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 400 10px/1 var(--f-mono); letter-spacing: .03em; color: var(--i7); text-decoration: none; white-space: nowrap; overflow: hidden;
  border-right: 1px dashed rgba(15, 15, 14, .4); background: var(--paper, #f6f5f1); cursor: pointer;
}
.pb-t:last-child { border-right: 0; }
.pb-t:hover { color: var(--r); }
.pb-t.gone { visibility: hidden; }
.pb-t.torn { animation: pb-tear .62s cubic-bezier(.5, 0, .9, .4) forwards; }
@keyframes pb-tear {
  0% { transform: rotate(180deg); }
  18% { transform: rotate(184deg) translateY(8px); }
  100% { transform: rotate(222deg) translateY(-190px); opacity: 0; }
}
/* наведение: кадр оживает в цвете, рамка красная, скотч приподнимается */
@media (hover: hover) {
  .pb-note:hover { z-index: 999 !important; filter: drop-shadow(0 16px 22px rgba(15, 15, 14, .28)); }
  .pb-note[role]:hover .pf-vid { opacity: 1; }
  .pb-note[role]:hover .pb-media { outline: 2px solid var(--r); }
  .pb-note[role]:hover .pb-head b { color: var(--r); }
  .pb-note:hover .pb-tape { transform: rotate(var(--a, 0deg)) translateY(-2px); }
}
.pb-note.live .pf-vid { opacity: 1; }
.pb-note.live .pb-media { outline: 2px solid var(--r); }

/* первое объявление: «Портфолио» для брендов */
.pb-intro .pb-sheet { padding: 22px 22px 0; }
.pb-tag { display: inline-block; margin: 0 0 14px; padding: 4px 8px; background: var(--r); color: var(--i); font: 400 11px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
.pb-h { margin: 0 0 16px; font: 400 clamp(32px, 3.3vw, 58px)/.92 var(--f-display); text-transform: uppercase; }
.pb-h::after { content: ""; display: block; width: 56px; height: 1px; margin-top: 14px; background: var(--r); }
.pb-lead { display: block; font: 400 13px/1.65 var(--f-mono); }
.pb-cta { display: block; margin: 18px 0 2px; }
.pb-cta a {
  display: inline-block; padding: 12px 16px; background: var(--i); color: var(--p); text-decoration: none;
  font: 400 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
}
.pb-cta a:hover { background: var(--r); color: var(--i); }
.pb-intro .pb-tear { margin: 16px -22px 0; }
/* справка со штампом */
.pb-facts .pb-sheet { padding: 16px 16px 46px; }
.pb-fh { display: block; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 2px solid var(--i); font: 400 12px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
.pb-facts dl { margin: 0; }
.pb-facts dl > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--l); }
.pb-facts dt { font: 400 10px/1.5 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--i6); }
.pb-facts dd { margin: 0; font: 400 12px/1.5 var(--f-mono); }
.pb-stamp {
  position: absolute; right: 12px; bottom: 10px; padding: 6px 10px 4px;
  border: 3px solid var(--r); color: var(--r);
  font: 400 15px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em;
  transform: rotate(-8deg); opacity: .9; mix-blend-mode: multiply; filter: url(#rough); pointer-events: none;
}
/* шоурил — афиша */
.pb-reel .pb-head b { font-size: clamp(22px, 2.2vw, 36px); }
.pb-reel .pb-media { aspect-ratio: 16 / 8.6; }
.pb-rec {
  position: absolute; z-index: 4; left: 10px; top: 10px; display: flex; align-items: center; gap: 7px;
  padding: 4px 8px 3px; background: var(--i); color: var(--p); font: 400 10.5px/1.2 var(--f-mono); letter-spacing: .1em;
}
.pb-rec i { width: 7px; height: 7px; border-radius: 50%; background: var(--r); animation: pf-rec 1.2s steps(1, end) infinite; }
.pb-play {
  position: absolute; z-index: 4; left: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: var(--r); color: var(--i);
  font: 400 12.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.pb-play i { width: 0; height: 0; border-left: 10px solid var(--i); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
@media (hover: hover) { .pb-reel:hover .pb-play { background: var(--i); color: var(--r); } .pb-reel:hover .pb-play i { border-left-color: var(--r); } }
/* свободное место: следующий кейс */
.pb-blank { display: flex; align-items: center; justify-content: center; outline: 1px dashed rgba(15, 15, 14, .55);
  background: repeating-linear-gradient(-45deg, rgba(15, 15, 14, .07) 0 1px, transparent 1px 8px); }
.pb-blank::after { display: none; }
.pb-blank span { padding: 6px 10px 5px; background: var(--paper, #f6f5f1); font: 400 11px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--i6); }
.pb-next .pb-head i { color: var(--r); }
.pb-next .pb-meta { margin-top: 4px; }
.pb-next .pb-cta { margin-top: 14px; }
/* листовки серии */
.pb-mini .pb-sheet { padding: 10px 10px 12px; }
.pb-mini .pb-head { margin-bottom: 8px; padding-bottom: 6px; }
.pb-mini .pb-head b { font-size: clamp(12px, .95vw, 15px); }
.pb-mini .pb-media { aspect-ratio: 9 / 13; }
.pb-mini .pb-title { margin-top: 9px; font-size: clamp(13px, 1.05vw, 17px); }
.pb-mini .pb-small { font-size: 10px; }
.pb-mini .pb-tape { width: 54px; height: 18px; top: -9px; }
.pb-mini .pb-tape.c { margin-left: -27px; width: 58px; }

@media (max-width: 760px) {
  .pf-hint { margin-left: 0; flex-basis: 100%; }
  .pf-word { left: 0; width: 100%; }
  .pb-intro .pb-sheet { padding: 18px 16px 0; }
  .pb-intro .pb-tear { margin: 14px -16px 0; }
  .pb-t { height: 62px; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .res-intro, .res-stage, .rc-body { grid-template-columns: minmax(0, 1fr); }
  /* серия: плеер сверху по центру, миниатюры лентой под ним */
  .series { --ph: min(66vh, calc((100vw - 32px) * 16 / 9)); grid-template-columns: minmax(0, 1fr); }
  .series-player { justify-self: center; }
  /* квадратный или вертикальный ролик жильца: плеер сверху по центру, текст под ним */
  .rc-vert { grid-template-columns: minmax(0, 1fr); }
  .rc-vplayer { justify-self: center; height: auto; width: min(100%, calc(66vh * var(--r, .5625))); aspect-ratio: var(--r, .5625); }
  .series-side { padding: 20px 16px 18px; }
  .series-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84px; overflow-x: auto; padding-bottom: 4px; }
  .notice { justify-self: start; margin-top: 8px; }
  .domofon { justify-self: stretch; max-width: none; }
  .card-paper { transform: rotate(.5deg); }
}
/* приветствие на планшете и телефоне: всё столбиком, картинка за текстом */
@media (max-width: 900px) {
  .welcome { height: auto; min-height: 100vh; min-height: 100svh; }
  .welcome-in {
    display: flex; flex-direction: column; justify-content: flex-end; gap: 22px;
    min-height: inherit;
    padding-top: calc(var(--top-h) + 32px);
  }
  .welcome-img { left: 50%; height: 88%; bottom: 20%; opacity: .75; }
  /* текст лежит поверх черепа: затемняем картинку сверху и снизу, где подпись и описание */
  .welcome::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(rgba(15, 15, 14, .82), rgba(15, 15, 14, 0) 30%, rgba(15, 15, 14, 0) 50%, rgba(15, 15, 14, .78));
  }
  .wl-caption, .wl-title, .wl-side { position: static; }
  .wl-caption { order: 1; margin-bottom: auto; }
  .wl-title { order: 2; font-size: clamp(54px, 17vw, 120px); }
  .wl-title span + span { margin-left: 1.2em; }
  .wl-side { order: 3; width: auto; }
  /* дом: сцена сверху, глава под ней */
  .welcome.hh { display: flex; flex-direction: column; }
  .welcome.hh::after { content: none; }
  .hh-stage { position: relative; inset: auto; flex: none; height: 54svh; min-height: 340px; }
  /* на телефоне глава под сценой: низ неба перетекает в фон страницы */
  .hh-stage::after {
    background:
      linear-gradient(to bottom, rgba(15, 15, 14, .6) 0, rgba(15, 15, 14, 0) 90px),
      linear-gradient(to bottom, rgba(15, 15, 14, 0) 70%, var(--ink));
  }
  .hh-panel { position: static; width: auto; padding: 18px var(--gutter) 28px; justify-content: flex-start; }
  .hh-text { overflow: visible; padding-right: 0; margin-right: 0; }
  .hh-text { min-height: 0; }
  .hh-hint { bottom: 10px; }
  .hh-hint.is-big span { display: none; }
  .icom { max-width: 320px; }
  .icom-key { height: 50px; }   /* под палец */
  /* контакты — в самом низу страницы справа, под главой */
  .welcome .corner { position: static; margin-top: auto; padding: 0 var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  /* на телефоне вкладки — вертикальными словами у правого края, черта над словом */
  .tabs { right: 0; gap: 2px; }
  .tabs a { writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 6px; gap: 9px; font-size: 10px; letter-spacing: .14em; }
  .tabs a::before { width: 2px; height: 12px; }
  .tabs a:hover::before { width: 2px; height: 16px; }
  .tabs a[aria-current]::before { width: 2px; height: 26px; }
  .house { padding-left: 28px; padding-top: 44px; }
  .antennas { left: 28px; width: calc(100% - 28px); height: 46px; }
  .ground { margin-left: -28px; }
  .stage-hint { margin-left: 28px; }
  .floor-no { right: calc(100% + 6px); font-size: 10px; }
  .floor.is-hot .floor-no::before { content: ""; }
  .rc-body, .wk-body { padding: 22px 16px 26px; }
  .card-paper dl > div { grid-template-columns: 96px minmax(0, 1fr); }
  .ov-top { padding-left: 14px; }
  .rc-nav { font-size: 11px; }
  .rc-nav .x { padding: 10px 9px; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   ПОРТФОЛИО — вид «плакат» (poster.js), по умолчанию с 15.11.2026
   Как плакат «ПАНЕЛЬКА»: бордовая бумага, ч/б кадры с зерном, огромные кремовые буквы,
   шахматка из квадратов 1 : 1. Справа место под столбик вкладок
   ===================================================================== */
html body.pf-on.pf-poster:not(.night) {
  color-scheme: dark;
  --pp-red: #ae1b1f; --pp-cream: #eee3c6;   /* средний цвет плитки red-grain.png — красный блоков главной */   /* красный блоков главной (его правка 15.11; был бордовый #6a1416) */
  --bg: var(--pp-red); --fg: var(--pp-cream); --muted: rgba(238, 227, 198, .66); --line: rgba(238, 227, 198, .24);
  background-color: var(--pp-red); background-image: none;
}
html body.pf-poster .grain { opacity: .16; }
body.pf-poster .tabs a[aria-current]::before { background: var(--fg); }
/* на плакате вкладки — вертикальными словами у самого правого края: плакат растянут на весь экран (15.11) */
@media (min-width: 641px) {
  body.pf-poster .tabs { right: 4px; gap: 2px; }
  body.pf-poster .tabs a { writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 7px; gap: 10px; font-size: 11px; }
  body.pf-poster .tabs a::before { width: 2px; height: 14px; }
  body.pf-poster .tabs a:hover::before { width: 2px; height: 20px; }
  body.pf-poster .tabs a[aria-current]::before { width: 2px; height: 30px; }
}
body.pf-poster ::selection { background: var(--pp-cream); color: var(--pp-red); }
.pf[data-mode="poster"] .pf-head, .pf[data-mode="poster"] .pf-bar, .pf[data-mode="poster"] .pf-scan { display: none; }
.pf[data-mode="poster"] .pf-stage { min-height: 0; padding-bottom: 0; }

.pp {
  --pp-cols: 4; --pp-ink: #111319;
  position: relative;
  padding: 0;                                   /* клетки во весь экран, от края до края и от самого верха (его правка 15.11); язык и вкладки — поверх */
  font: 400 13px/1.45 var(--f-mono); letter-spacing: .02em; color: var(--pp-cream);
  background-color: var(--pp-red);              /* фактура бумаги — .pp::before */
}
/* пятна и протёртости бумаги: светлее сверху слева, темнее к краям */
/* бумага — той же фактуры и цвета, что красные блоки главной (его правка 16.11: «с того красного прям повтори»): плитка
   assets/tex/red-grain.png по формуле шейдера блоков (look-razvertka.js) — красный × (.84…1.10) по каждому пикселю,
   6 % клеток 2 × 2 темнее на 40 %, редкие чёрные точки. Пиксель плитки = пиксель страницы, без сглаживания. Лежит под
   клетками: буквы, кадры и надписи она не трогает. Генератор плитки — D:\WORK_RUSLAN\_temp\rastik_og\redgrain.mjs */
.pp::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url(assets/tex/red-grain.png) 0 0 / 192px 192px repeat;
  image-rendering: pixelated;
}
/* пятна и протёртости бумаги: светлее сверху слева, темнее к краям */
.pp::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 28% 18%, rgba(255, 255, 255, .07), transparent 55%),
    radial-gradient(90% 80% at 82% 92%, rgba(0, 0, 0, .34), transparent 60%),
    radial-gradient(140% 120% at 50% 50%, transparent 58%, rgba(0, 0, 0, .42));
}
.pp :focus-visible { outline-color: var(--pp-cream); }
.pp-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* клетки стоят вплотную, без щелей и перекосов: ряд читается «квадрат, квадрат, квадрат» (15.11) */
.pp-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--pp-cols), minmax(0, 1fr)); gap: 0; }
.pp-grid > * { order: var(--od); }
.pp-cell {
  position: relative; display: block; min-width: 0; aspect-ratio: 1 / 1; overflow: hidden;
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none;
}
button.pp-cell, a.pp-cell { cursor: pointer; }

/* кадр: ровный квадрат, ч/б с высоким контрастом и зерном. Наведение — оживает в цвете и играет петлю
   (шоурил играет сам и остаётся ч/б) */
.pp-print { position: absolute; inset: 0; display: block; overflow: hidden; background: #0f0f0e; }
.pp-print img, .pp-print video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.85) brightness(1.06);
  transition: filter .45s var(--ease), opacity .45s var(--ease);
}
.pp-print video { opacity: 0; }
.pp-ph.live .pp-print video { opacity: 1; }
.pp-ph.live:not(.pp-reel) .pp-print img, .pp-ph.live:not(.pp-reel) .pp-print video { filter: contrast(1.08); }
.pp-me .pp-print img { filter: grayscale(1) contrast(1.5) brightness(1.5); }      /* его фото тёмное: светлее, контраст мягче */
.pp-me.live .pp-print img { filter: contrast(1.05) brightness(1.2); }
.pp-print::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 120% at 50% 45%, transparent 55%, rgba(0, 0, 0, .5));
}
.pp-gr { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; mix-blend-mode: overlay; opacity: .95; pointer-events: none; }
.pp-tag { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
/* граффити (19.11 — нарисованные картинки, poster.js: graffiti) — своим цветом: ч/б и контраст кадра их не трогают
   (иначе красный LOUD уходил в серый) */
.pp-print img.pp-tag, .pp-ph.live:not(.pp-reel) .pp-print img.pp-tag { filter: none; transition: none; }
.pp-play {
  position: absolute; right: 10px; top: 10px; z-index: 3; padding: 4px 8px;
  background: var(--pp-red); color: var(--pp-cream); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.pp-who {
  position: absolute; left: 10px; bottom: 10px; z-index: 3; padding: 4px 8px;
  background: var(--pp-cream); color: var(--pp-red); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.pp-btn {
  position: absolute; left: 14px; bottom: 14px; z-index: 3; display: flex; gap: 10px; align-items: center;
  padding: 12px 16px; background: var(--pp-cream); color: var(--pp-red);
  font: 400 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  transition: background-color .2s;
}
.pp-btn::before { content: ""; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.pp-ph:hover .pp-btn { background: #fff; }
/* шоурил при наведении — в цвете (17.11, его «когда на шоурил наводимся, он должен стать цветным»); сам по себе играет ч/б */
.pp-reel:hover .pp-print img, .pp-reel:hover .pp-print video,
.pp-reel:focus-visible .pp-print img, .pp-reel:focus-visible .pp-print video { filter: contrast(1.08); }
/* знак — ссылка на Telegram-канал (17.11): плашка проявляется при наведении, без треугольника «▶» */
.pp-tg { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .3s var(--ease), background-color .2s; }
.pp-tg::before { display: none; }
.pp-glow:hover .pp-tg, .pp-glow:focus-visible .pp-tg { opacity: 1; transform: none; }
@media (hover: none) { .pp-tg { opacity: 1; transform: none; } }
/* вход в подъезд (17.11, его «предпоследний куб — переход во вселенную, посмотреть в подъезд, заход»): кадр двери подъезда
   с главной (растр уже в нём — контраст мягче, чем у кадров), при наведении в цвете и шаг к двери */
.pp-enter .pp-print img { filter: grayscale(1) contrast(1.22) brightness(1.03); transform-origin: 46% 42%; transition: filter .45s var(--ease), transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.pp-enter:hover .pp-print img, .pp-enter:focus-visible .pp-print img { transform: scale(1.08); }
/* он сам в 3D поверх кадра (assets/pf-man.js): холст на всю клетку, при наведении приближается вместе с кадром */
.pp-print .pp-man { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transform-origin: 46% 42%; transition: transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.pp-enter:hover .pp-man, .pp-enter:focus-visible .pp-man { transform: scale(1.08); }
.pp-enter-top {
  position: absolute; left: 14px; top: 14px; z-index: 3; padding: 4px 8px;
  background: var(--pp-red); color: var(--pp-cream); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.pp-enter-plate {
  position: absolute; left: 14px; top: 42px; z-index: 3; padding: 4px 9px; border: 1px solid rgba(228, 227, 221, .55);
  background: #151514; color: #e4e3dd; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
}
@media (max-width: 760px) {   /* клетка узкая: табличку подъезда не ставим, метка — в пределах клетки */
  .pp-enter-plate { display: none; }
  .pp-enter-top { left: 10px; top: 10px; right: 10px; width: max-content; max-width: calc(100% - 20px); font-size: 9px; letter-spacing: .1em; }
}

/* слово: огромные кремовые буквы прямо на бумаге, облезлые (pp-worn — сколы цвета бумаги) */
.pp-fit {
  position: absolute; left: 2.4%; right: 2.4%; top: 2.4%; transform-origin: 0 0; white-space: nowrap;
  font: 900 100px/.8 "Sofia Sans Extra Condensed", "Oswald", sans-serif; text-transform: uppercase; color: var(--pp-cream);
  transition: color .2s;
}
.pp-ln { display: block; width: max-content; }
button.pp-wd:hover .pp-fit { color: #fff; }
.pp-worn { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.pp-meta {
  position: absolute; left: 2.6%; right: 2.6%; bottom: 2.2%; z-index: 2;
  display: flex; justify-content: space-between; gap: 12px; font-size: 11px; line-height: 1.35; color: var(--pp-cream);
}
.pp-meta b { font-weight: 400; background: var(--pp-cream); color: var(--pp-red); padding: 1px 6px; }
.pp-meta span + span { flex: none; opacity: .85; }

/* кадр с мухами: сам по себе светлый ч/б с растром — контраст мягче, чем у кадров, иначе растр рвётся в белое */
.pp-flies .pp-print img { filter: grayscale(1) contrast(1.3) brightness(1.02); }
/* знак со свечением (его фото): ч/б мягче, чем у кадров, — голубой фон иначе уходит в белое и знак теряется */
.pp-glow .pp-print img { filter: grayscale(1) contrast(1.3) brightness(.97); }

/* клетка «о себе»: тот же квадрат, текст подстраивается под его размер */
.pp-tx { container-type: inline-size; padding: 4.4%; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.pp-no {
  display: inline-block; margin: 0 0 12px; padding: 4px 8px; background: var(--pp-cream); color: var(--pp-red);
  font-size: clamp(9px, 3.5cqi, 11px); letter-spacing: .14em; text-transform: uppercase;
}
.pp-lead { margin: 0; max-width: none; font-size: clamp(11px, 4.4cqi, 15px); line-height: 1.32; }   /* кегль подбирает fitLead в poster.js: абзац на всю клетку */
.pp-cta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: clamp(10px, 3.7cqi, 12px); letter-spacing: .12em; text-transform: uppercase; }
.pp-cta a { color: var(--pp-cream); text-decoration: none; border: 1px solid var(--pp-cream); padding: 10px 12px; transition: background-color .2s, color .2s; }
.pp-cta a:hover { background: var(--pp-cream); color: var(--pp-red); }
.pp-down { padding: 0; border: 0; background: none; color: var(--pp-cream); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
/* софт под текстом «о себе» (21.11): три строки — метка 3D / 2D / AI кремовой плашкой, как номер раздела, и программы мелким моно.
   Кегль текста над ними fitLead подбирает с учётом этого блока */
.pp-soft { margin: 14px 0 0; display: grid; gap: 6px; font-size: clamp(9px, 3.3cqi, 11.5px); line-height: 1.35; letter-spacing: .03em; }
.pp-soft div { display: grid; grid-template-columns: 2.7em minmax(0, 1fr); gap: 8px; align-items: baseline; }
.pp-soft dt { justify-self: start; padding: 2px 5px; background: var(--pp-cream); color: var(--pp-red); font-weight: 700; letter-spacing: .08em; }
.pp-soft dd { margin: 0; }

/* кейсы идут сразу за первым экраном той же сеткой (полосы-заголовка нет); «11 кейсов ↓» листает сюда */
.pp-works { scroll-margin-top: 0; }
.pf[data-mode="poster"] + .foot { position: relative; z-index: 1; }

@media (max-width: 1179px) {
  .pp { --pp-cols: 2; }
  .pp-grid > * { order: var(--om); }
}
@media (max-width: 640px) {
  .pp-meta { font-size: 9px; gap: 6px; }
  .pp-btn { left: 8px; bottom: 8px; padding: 8px 10px; font-size: 10px; }
  .pp-play { right: 6px; top: 6px; font-size: 9px; }
  .pp-who { left: 6px; bottom: 6px; font-size: 8px; }
}
/* узкий телефон (20.11, его «всё портфолио блоками — в одном ряду два блока»): «о себе» и «работал с» больше не во всю
   ширину, а рядом в одном ряду; оба вдвое выше ширины — в квадрате 188 px абзац «о себе» сжимался бы до ~8 px.
   Было (16–17.11): «о себе» — квадрат во всю ширину, «работал с» под ним — во всю ширину в два квадрата */
@media (max-width: 520px) {
  .pp-tx { padding: 12px; aspect-ratio: 1 / 2; }
  .pp-cta { flex-direction: column; align-items: stretch; gap: 8px; letter-spacing: .06em; }
  .pp-cta a { text-align: center; white-space: nowrap; padding: 10px 6px; }
  .pp-flies, .pp-clients { aspect-ratio: 1 / 2; }
}

/* =====================================================================
   ТЁМНАЯ ТЕМА — по умолчанию с 15.11.2026 (его «попробуй сделать сайт в тёмных тонах»).
   html.theme-dark ставит скрипт в <head> index.html; ?theme=light — прежняя светлая.
   Дом на главной и подъезд — светлый оттиск на чёрном (look-razvertka.js, hall3d.js), плакат — на тёмной бумаге
   ===================================================================== */
html.theme-dark { color-scheme: dark; }
html.theme-dark body {
  --bg: #0e0e0d; --fg: #dcd8cf; --muted: #8f8c84; --line: rgba(220, 216, 207, .16);
  background-color: var(--bg); background-image: var(--speck-light); color: var(--fg);
}
html.theme-dark.look-razvertka {
  --rz-paper: #0e0e0d; --rz-ink: #e6e3dc; --rz-red: #ff3b2f;
  --rz-ink-7: rgba(230, 227, 220, .7); --rz-ink-6: rgba(230, 227, 220, .6); --rz-line: rgba(230, 227, 220, .16);
}
html.theme-dark .grain { opacity: .06; }
html.theme-dark ::selection { background: var(--red); color: var(--paper); }
/* подъезд «Жители» */
html.theme-dark body.mbx-on { --bg: #0e0e0d; background-color: #0e0e0d; }
html.theme-dark .mbx { --p: #0e0e0d; --pw: #161614; --i: #e6e3dc; --i7: rgba(230, 227, 220, .7); --i6: rgba(230, 227, 220, .6); --l: rgba(230, 227, 220, .18); }
/* плакат портфолио — бумага почти чёрная, с бордовым оттенком */
html.theme-dark body.pf-on.pf-poster:not(.night) { --pp-red: #2b0c0e; }
html.theme-dark body.pf-poster .grain { opacity: .12; }
/* плашки тушью в тёмной теме — светлые, текст на них тёмный: подсказка и ссылки у главы, строка домофона в подъезде */
html.theme-dark.look-razvertka.hh-near .welcome .hh-hint,
html.theme-dark.look-razvertka.hh-near .welcome .corner { color: rgba(14, 14, 13, .85); }
html.theme-dark.look-razvertka.hh-near .welcome .corner a { color: rgba(14, 14, 13, .72); }
html.theme-dark.look-razvertka.hh-near .welcome .corner a:hover { color: #0e0e0d; }
html.theme-dark .mbx-status { color: rgba(14, 14, 13, .86); }

/* Текстуры поверх всей страницы портфолио (его материалы D:\source\tex): пятна бумаги — умножением, царапины и грязь — осветлением (серое в этих файлах срезано в чёрное: остались только светлые царапины и пятна, красная бумага не белеет), сверху зерно. Слой один на всю вкладку — от верхнего края страницы до конца подвала — и едет вместе с ней
   (poster.js вешает .pp-tex на #view-portfolio). Мятой бумаги с тёмными заломами больше нет (он: «чёрные линии — убрать»).
   Файлы — 2560 px в ширину: на его экране (2048 CSS-px × масштаб 125 %) один пиксель текстуры = один пиксель экрана, без размытия.
   Не тайлится: каждая текстура растянута на ширину страницы (по горизонтали один кусок), по вертикали повторяется без шва —
   верх и низ файла сведены при подготовке (assets/tex/*-y.webp, см. README) — и у каждого слоя свой шаг; царапины лежат
   дважды, второй слой зеркальный и крупнее. У .pp-tex нет z-index — иначе слои смешивались бы сами с собой, а не со страницей */
body.pf-poster #view-portfolio { position: relative; margin-top: calc(-1 * var(--top-h)); background-color: var(--pp-red); }   /* сетка — от самого верха, шапка поверх */
.pp-tex { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pp-tex i { position: absolute; z-index: 5; inset: 0; background-repeat: repeat-y; }
.pp-tex .t-st { background-image: url(assets/tex/stains-y.webp); background-size: max(100%, 1100px) auto; background-position: 50% 0; mix-blend-mode: multiply; opacity: .5; }
.pp-tex .t-sc { background-image: url(assets/tex/scratches-y.webp); background-size: max(100%, 1250px) auto; background-position: 50% 0; mix-blend-mode: screen; opacity: .5; }
.pp-tex .t-sc2 { background-image: url(assets/tex/scratches-y2.webp); background-size: max(100%, 1250px) auto; background-position: 50% 900px; mix-blend-mode: screen; opacity: .34; transform: scaleX(-1); }
.pp-tex .t-dt { background-image: url(assets/tex/dirt-y.webp); background-size: max(100%, 1100px) auto; background-position: 50% 420px; mix-blend-mode: screen; opacity: .55; }
/* зерно поверх всего: мелкий шум, плитка 240 px без рисунка — повтора не видно */
.pp-tex .t-ns {
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n' x='0' y='0' width='100%' height='100%' color-interpolation-filters='sRGB'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='.62 .62 .62 0 -.43  .62 .62 .62 0 -.43  .62 .62 .62 0 -.43  0 0 0 0 1'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>") 0 0 / 240px 240px repeat;
  mix-blend-mode: overlay; opacity: .32;
}

/* переход между вкладками (app.js setView): лист бумаги новой вкладки с красной линией развёртки по ведущему краю
   и строками сканера у края; заезжает слева, закрывает страницу, под ним меняется вкладка, уезжает вправо */
.vw-wipe {
  position: fixed; inset: 0; z-index: 115; pointer-events: none; visibility: hidden;
  background-color: var(--wipe-bg, #efefec); background-image: var(--noise);
  transform: translateX(-101%);
}
.vw-wipe::before {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 160px;
  background: repeating-linear-gradient(0deg, rgba(15, 15, 14, .16) 0 1px, transparent 1px 5px);
  -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent);
}
.vw-wipe::after { content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 2px; background: #ff3b2f; box-shadow: 0 0 14px rgba(255, 59, 47, .55); }
.vw-wipe.is-in { visibility: visible; animation: vw-in .42s cubic-bezier(.65, 0, .35, 1) forwards; }
.vw-wipe.is-out { visibility: visible; animation: vw-out .58s cubic-bezier(.65, 0, .35, 1) forwards; }
.vw-wipe.is-out::before { right: auto; left: 0; -webkit-mask-image: linear-gradient(to right, #000, transparent); mask-image: linear-gradient(to right, #000, transparent); }
.vw-wipe.is-out::after { right: auto; left: -1px; }
@keyframes vw-in { from { transform: translateX(-101%); } to { transform: translateX(0); } }
@keyframes vw-out { from { transform: translateX(0); } to { transform: translateX(101%); } }
@media (prefers-reduced-motion: reduce) { .vw-wipe { display: none; } }
/* варианты перехода (18.11, ?tx=dots|cubes|poster — app.js TXS) */
.tx-dots { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 115; pointer-events: none; display: none; }
.tx-cubes { position: fixed; inset: 0; z-index: 115; pointer-events: none; display: none; perspective: 1200px; overflow: hidden; }
.tx-cubes > b { position: absolute; opacity: 0; overflow: hidden; backface-visibility: hidden; will-change: transform, opacity;
  box-shadow: inset 0 0 0 2px rgba(15, 15, 14, .55), inset 0 0 0 4px rgba(255, 255, 255, .08), inset 0 0 80px rgba(15, 15, 14, .3); }
/* общая стена за блоками: бетон панелей дома и трафарет названия вкладки — как «22/1» на торце */
.tx-wall { position: absolute; display: grid; place-items: center;
  background: url(assets/tex/stains.webp) center/cover, url(assets/tex/grunge.webp) 40% 30%/900px, #8f8d88;
  background-blend-mode: multiply, multiply, normal; }
.tx-wall em { font: 900 1em/.82 "Sofia Sans Extra Condensed", "Oswald", sans-serif; font-style: normal; text-transform: uppercase; letter-spacing: .01em;
  color: rgba(238, 233, 220, .9); mix-blend-mode: screen; filter: url(#rough); }
.tx-cubes-glow { position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 59, 47, .95), rgba(208, 38, 27, .5) 42%, rgba(208, 38, 27, 0) 76%); }
.tx-poster { position: fixed; inset: 0; z-index: 115; pointer-events: none; display: none; }
.tx-sheet { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; will-change: transform, opacity;
  background: url(assets/tex/stains.webp) center/cover, url(assets/tex/grunge.webp) 30% 60%/1000px, #ebe4d2; background-blend-mode: multiply, multiply, normal; }
.tx-sheet .tx-red { position: absolute; left: 20%; top: 24%; width: 44%; height: 50%; background: #d0261b url(assets/tex/red-grain.png) center/cover; transform: rotate(-4deg); }
.tx-sheet b { position: relative; z-index: 2; color: #0f0f0e; font: 400 120px/.86 var(--f-display); text-transform: uppercase; letter-spacing: -.02em; white-space: nowrap; mix-blend-mode: multiply; }
.tx-sheet .tx-edge { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; }
.tx-sheet .tx-edge polyline { fill: none; stroke: #f6f2e8; stroke-width: 9; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* плакат — всегда светлая бумага с чёрным названием, и в тёмной теме */
/* кубики шахматкой (основной переход с 18.11): клетки по сетке плаката портфолио — красная бумага плаката и чёрные */
.tx-chess { position: fixed; inset: 0; z-index: 115; pointer-events: none; display: none; overflow: hidden; }
.tx-chess > b { position: absolute; opacity: 0; backface-visibility: hidden; will-change: transform, filter, opacity;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08); }
.tx-chess > b.red { background: linear-gradient(160deg, rgba(255, 255, 255, .07), transparent 42%, rgba(0, 0, 0, .2)),
  url(assets/tex/red-grain.png) 0 0 / 192px 192px repeat, #ae1b1f; image-rendering: pixelated; }
.tx-chess > b.ink { background: linear-gradient(160deg, rgba(255, 255, 255, .07), transparent 42%, rgba(0, 0, 0, .35)), #111319; }   /* чёрные клетки плаката, без светлой фактуры */
@media (prefers-reduced-motion: reduce) { .tx-dots, .tx-cubes, .tx-poster, .tx-chess { display: none !important; } }

/* =====================================================================
   ПРОБА ПО РЕФЕРЕНСАМ 15.11 (?grit=1, класс grit на <html>): фон главной — грязная бумага (его текстуры
   из D:\source\tex: пятна, облака грязи, тёмные царапины — умножением) и красные зернистые блоки с рваным краем;
   дом на них ложится чёрным силуэтом (умножение). Газетный растр дома — uGrit в look-razvertka.js
   ===================================================================== */
.hh-tex { display: none; }
/* под сценой — та же бумага (16.11): пока холст не нарисовал первый кадр (медленная сеть), видна бумага, а не чёрный фон */
html.grit .welcome.hh { background-color: #efefef; }
html.grit .hh-tex { display: block; position: absolute; inset: 0; pointer-events: none; overflow: hidden; }   /* без z-index: слои смешиваются со сценой */
html.grit .hh-tex i { position: absolute; z-index: 2; inset: 0; mix-blend-mode: multiply; }
html.grit .hh-tex .t-gr { background: url(assets/tex/grunge.webp) center / 100% 100% no-repeat; opacity: .16; }
html.grit .hh-tex .t-st { background: url(assets/tex/stains.webp) center / cover no-repeat; opacity: .42; }
html.grit .hh-tex .t-sc { background: url(assets/tex/scratches-dark.webp) center / cover no-repeat; opacity: .2; }
/* красные блоки рисует шейдер в фоне сцены (uBlk, uB1–uB3 в look-razvertka.js): они за домом и проводами */

/* меню вкладок на красном блоке (look-razvertka.js ставит блок под меню и класс rz-menu-red): текст светлый,
   черта у открытой вкладки — белая. У главы дом может закрыть блок — тогда у каждой вкладки своя плашка тушью */
html.rz-menu-red body.home-on .tabs a { color: rgba(255, 255, 255, .8); }
html.rz-menu-red body.home-on .tabs a:hover,
html.rz-menu-red body.home-on .tabs a[aria-current] { color: #fff; }
html.rz-menu-red body.home-on .tabs a::before { opacity: .8; }
html.rz-menu-red body.home-on .tabs a[aria-current]::before { background: #fff; opacity: 1; }
/* 16.11 (его правка): у каждой вкладки на красном блоке — всегда своя чёрная плашка с рваным краем (раньше — только у главы).
   Плашка — ::after (на компьютере он же зона нажатия), рвёт её фильтр #cut-s; текст остаётся ровным */
@media (min-width: 761px) {
  html.rz-menu-red body.home-on .tabs a { z-index: 0; padding: 7px 10px; }
  html.rz-menu-red body.home-on .tabs a::after {
    top: 0; bottom: 0; height: auto; transform: none; z-index: -1;
    background: #0f0f0e; filter: url(#cut-s);
  }
  /* подсказка на главной (17.11, его «надпись „скролль вниз“ уберём, давай лучше прям большую плашку, которую очень хорошо
     видно, где кратко описывается, что делать; после первого скролла она пропадает»): чёрная плашка с рваным краем внизу
     по центру — красный значок мыши (колёсико едет вниз), крупно «Крути колёсико мыши», под ним строка глав «01 Работы →
     02 Жители → 03 Обо мне». Появляется, когда дом собрался; после первого шага колеса (или клика по номеру на доме) гаснет
     до конца сеанса вкладки (look-razvertka.js: hintStep, класс rz-hint-off). Разметка — app.js (.hh-hint.is-big) */
  /* 17.11, следом его правка: строку глав убрали — значок мыши и «Крути колёсико мыши» по центру плашки; плашка зовёт
     внимание: появляется прыжком (hh-big-in, и при каждом возвращении после 30 с без скролла), потом раз в 3,6 с коротко
     толкается вниз, как от прокрутки, с красным свечением вокруг (hh-big-nudge) */
  html.look-razvertka .welcome .hh-stage .hh-hint.is-big {
    position: absolute; left: 0; right: 0; top: auto; bottom: calc(var(--corner-b) + 20px); z-index: 4;
    display: flex; align-items: center; justify-content: center; gap: .72em; width: max-content;
    margin: 0 auto; padding: .62em 1.3em .64em 1.1em; white-space: nowrap; text-align: center;
    font: 400 clamp(20px, 1.72vw, 32px)/1.15 var(--f-mono); letter-spacing: .03em; color: #efefec;
    background: none; transform: none;
    transition: opacity .45s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
    animation: hh-big-in .85s cubic-bezier(.2, .9, .25, 1.25) both, hh-big-nudge 3.6s ease-in-out 1.6s infinite;
  }
  html.look-razvertka .welcome .hh-stage .hh-hint.is-big::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: #0f0f0e; filter: url(#cut-s);
  }
  html.look-razvertka .welcome .hh-stage .hh-hint.is-big::before {
    flex: none; width: .92em; height: 1.46em; margin: 0; border-width: 3px; border-radius: .46em;
    color: var(--rz-red, #e3271b); background-size: 3px .34em;
  }
  html.look-razvertka .welcome .hh-hint.is-big b { font-weight: 700; text-transform: uppercase; }
  html.look-razvertka .welcome .hh-hint.is-big span {
    grid-column: 2; margin-top: .5em; font-size: .5em; letter-spacing: .12em; text-transform: uppercase; color: rgba(239, 239, 236, .66);
  }
  html.rz-hint-off .welcome .hh-stage .hh-hint.is-big { opacity: 0; transform: translateY(14px); animation: none; }   /* с 17.11 видна сразу, не ждёт сборки дома */
  /* маленькая плашка с номером главы (17.11, его «плашечку 1 из 3, 2 из 3 верни на главную»), когда большая подсказка погасла —
     значок мыши и «1/3», у целого дома — один значок (look-razvertka.js: stepPlate). С 22.11 (его «счётчик — в левый верхний угол
     экрана») — слева вверху, на высоте меню и RU/EN; раньше — в правом нижнем углу красного блока под меню */
  .welcome .hh-step {
    position: fixed; z-index: 2; top: 13px; left: var(--gutter); height: 31px; box-sizing: border-box;
    margin: 0; padding: 0 .72em; display: inline-flex; align-items: center; gap: .7em;
    font: 400 12px/1 var(--f-mono); letter-spacing: .1em; color: rgba(239, 239, 236, .92); white-space: nowrap; pointer-events: none;
    opacity: 0; transform: translateY(6px); transition: opacity .4s ease, transform .5s cubic-bezier(.2, .7, .2, 1);
  }
  .welcome .hh-step::after { content: ""; position: absolute; inset: 0; z-index: -1; background: #0f0f0e; filter: url(#cut-s); }
  .welcome .hh-step::before {
    content: ""; flex: none; width: .62em; height: 1em; box-sizing: border-box; border: 2px solid currentColor; border-radius: .31em;
    background: linear-gradient(currentColor, currentColor) 50% 18% / 2px .26em no-repeat;
    animation: hh-wheel 1.6s cubic-bezier(.45, 0, .55, 1) infinite;
  }
  .welcome .hh-step.is-bare { gap: 0; }
  html.rz-menu-red.rz-hint-off body.home-on .welcome .hh-step { opacity: 1; transform: none; transition-delay: .3s; }
}

/* мелкий текст главы — на красной плашке, вырезанной неровно (его «плашечки неровно вырезанные, чтобы маленький текст
   выделялся»): тот же красный с зерном, что у блоков за домом; плашка уходит за левый край экрана */
html.grit .hh-text p.hh-lead {
  position: relative; z-index: 0; margin: 2px 0 24px; padding: 15px 22px 16px 0; max-width: 46ch;
  color: #f8f5ee;
}
html.grit .hh-text p.hh-lead::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; right: 0; left: calc(-1 * var(--gutter) - 30px);
  background-color: #cf2329; background-image: var(--noise); background-size: 180px 180px; background-blend-mode: multiply;
  filter: url(#cut);
  transform: rotate(-.6deg);
}
@media (min-width: 901px) {
  /* колонка главы — от самого левого края экрана: плашке есть куда уйти, развёртка режет её вместе с главой */
  html.grit .hh-panel { left: 0; padding-left: var(--gutter); width: calc(min(460px, 34vw) + var(--gutter)); }
  html.grit .hh-text { padding-left: var(--gutter); margin-left: calc(-1 * var(--gutter)); }
}

/* =====================================================================
   ВКЛАДКА «ЖИТЕЛИ» В ВИДЕ ГЛАВНОЙ (16.11, его «стилизацию как у вкладки 1»; html.grit). Растр на 3D — uGrit в hall3d.js,
   грязная бумага поверх сцены — .hh-tex (стили выше, общие с главной), слово residents — жирная машинопись (inkDraw)
   ===================================================================== */
/* мелкий текст — на красной плашке, вырезанной неровно, как на главной; плашка уходит за левый край экрана */
html.grit .hall .mbx-lead { position: relative; z-index: 0; margin: 2px 0 24px; padding: 15px 22px 16px 0; max-width: min(50ch, 100%); color: #f8f5ee; }
html.grit .hall .mbx-lead::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; right: 0; left: calc(-1 * var(--gutter) - 30px);
  background-color: #cf2329; background-image: var(--noise); background-size: 180px 180px; background-blend-mode: multiply;
  filter: url(#cut);
  transform: rotate(-.6deg);
}
/* меню на красном блоке, как на главной: крупный, с отступом от правого края, текст светлый */
@media (min-width: 761px) {
  html.grit body.mbx-on .tabs::after {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    top: -9vh; bottom: -16.5vh; left: -7.5vw; right: calc(-1 * var(--gutter) + max(24px, 2.2vw));   /* уже, чем на главной: не закрывает почтовые ящики */
    background: url(assets/tex/red-grain.png) 0 0 / 192px 192px repeat; image-rendering: pixelated;
    filter: url(#cut);
  }
  html.grit body.mbx-on .tabs a { color: rgba(255, 255, 255, .8); }
  html.grit body.mbx-on .tabs a:hover, html.grit body.mbx-on .tabs a[aria-current] { color: #fff; }
  html.grit body.mbx-on .tabs a::before { opacity: .8; }
  html.grit body.mbx-on .tabs a[aria-current]::before { background: #fff; opacity: 1; }
}

/* подъезд сильнее в стиле главной (16.11, «стилизуй подъезд побольше»): сцена во всю высоту экрана под шапкой;
   красные зернистые блоки на стенах — умножением: чёрные перила, ящики и провода остаются поверх, будто блоки за ними;
   край блока «кипит» (6 раз в секунду), провода тушью под потолком медленно качаются */
html.grit .hall { margin-top: calc(-1 * var(--top-h)); height: 100vh; height: 100svh; }
.hall-deco { display: none; }
html.grit .hall-deco { display: block; position: absolute; inset: 0; pointer-events: none; overflow: hidden; }   /* без z-index: блоки смешиваются со сценой */
html.grit .hall-deco .rb {
  position: absolute; z-index: 2;
  background: url(assets/tex/red-grain.png) 0 0 / 192px 192px repeat; image-rendering: pixelated;
  mix-blend-mode: multiply; filter: url(#cut);
  animation: rb-boil .5s steps(1) infinite;
}
html.grit .hall-deco .rb1 { left: 50%; top: 9%; width: 14%; height: 22%; }   /* стена над ящиками */
html.grit .hall-deco .rb2 { left: 35.5%; top: 52%; width: 10%; height: 32%; animation-delay: -.17s; }   /* за перилами, правее текста */
html.grit .hall-deco .rb3 { left: 83%; top: 79%; width: 11%; height: 17%; animation-delay: -.33s; }   /* угол под меню */
@keyframes rb-boil { 0% { transform: translate(0, 0); } 33% { transform: translate(1px, -1px); } 66% { transform: translate(-1px, 1px); } }
html.grit .hall-wires { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; }
html.grit .hall-wires path { fill: none; stroke: #0d0d0c; stroke-linecap: round; vector-effect: non-scaling-stroke; transform-origin: 50% 0; animation: wire-sway 6s ease-in-out infinite alternate; }
html.grit .hall-wires .w1 { animation-duration: 7.3s; animation-delay: -2s; }
html.grit .hall-wires .w2 { animation-duration: 5.2s; animation-delay: -4s; }
html.hall-c4d .hall-wires { display: none; }   /* подъезд из C4D (17.11, его «странные провода убираем»): свои провода есть в сцене */
@keyframes wire-sway { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(6px) rotate(.25deg); } }
@media (prefers-reduced-motion: reduce) { html.grit .hall-deco .rb, html.grit .hall-wires path { animation: none; } }
@media (max-width: 760px) { html.grit .hall-deco { display: none; } }

/* =====================================================================
   ПОРТФОЛИО: подложка под вкладками и подвал (16.11, его «рваную подложку под переключатели; полоску внизу —
   другим цветом, серым, с формой, чтобы не красная»)
   ===================================================================== */
/* вкладки справа — на рваной полосе тушью (цвет «Ночь» из бренда), чтобы не терялись на кадрах */
body.pf-poster .tabs::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -22px; bottom: -22px; left: -7px; right: -5px;
  background-color: #111319; background-image: var(--noise); background-size: 180px 180px; background-blend-mode: multiply;
  filter: url(#cut);
}
/* подвал — полоса тушью (как подложка вкладок) с рваным верхним краем, во всю ширину; текст светлый. Текстуры страницы ложатся и на него */
body.pf-poster .pf[data-mode="poster"] + .foot {
  --muted: rgba(238, 227, 198, .78); --fg: #fff; --line: transparent;
  color: var(--muted); border-top: 0; margin-top: -10px; padding-top: 30px;
}
body.pf-poster #view-portfolio { overflow: hidden; }
body.pf-poster .pf[data-mode="poster"] + .foot { z-index: 6; }   /* подвал поверх всех текстур страницы: сплошная тушь, как подложка вкладок */
html body.pf-on.pf-poster:not(.night) { background-color: #111319; }   /* за концом страницы (оттяжка прокрутки) — как подвал   /* низ серой полосы обрезается краем страницы — без красных зубцов снизу */
body.pf-poster .pf[data-mode="poster"] + .foot::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: 0; bottom: -40px; left: calc(50% - 50vw - 20px); right: calc(50% - 50vw - 20px);
  background-color: #111319; background-image: var(--noise); background-size: 180px 180px; background-blend-mode: multiply;
  filter: url(#cut);
}
body.pf-poster .pf[data-mode="poster"] + .foot a:hover, body.pf-poster .pf[data-mode="poster"] + .foot .to-top:hover { color: #fff; }

/* =====================================================================
   КАРТОЧКА РОЛИКА — «МОНИТОР С РАЗВЁРТКОЙ» (16.11, он выбрал вариант 3 из черновиков 5_SITE_mock_card): чёрный экран,
   ролик проявляется красной линией слева направо, строки развёртки, плашка REC, название — красной машинописью (как work
   на главной), факты бегут строкой по красной зернистой полосе, кнопки — кремовой рамкой
   ===================================================================== */
html.grit.look-razvertka .overlay-scrim { background: #0a0a0b; }
html.grit.look-razvertka .overlay-panel {
  width: min(1320px, 100%); background: #0a0a0b; color: #eee3c6; color-scheme: dark; border: 0; box-shadow: none;
  padding: 0 clamp(16px, 3vw, 48px) 26px; animation: none;
}
html.grit.look-razvertka .ov-top { background: #0a0a0b; color: rgba(238, 227, 198, .7); border-bottom: 0; padding: 18px 0; margin: 0; }
html.grit.look-razvertka .ov-top .x, html.grit.look-razvertka .rc-nav .x { color: #eee3c6; border-color: rgba(238, 227, 198, .55); }
html.grit.look-razvertka .ov-top .x:hover:not(:disabled), html.grit.look-razvertka .rc-nav .x:hover:not(:disabled) { background: #eee3c6; border-color: #eee3c6; color: #0a0a0b; }
html.grit.look-razvertka .ov-media { overflow: hidden; }
/* строки развёртки поверх кадра */
html.grit.look-razvertka .ov-media::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .32) 0 1px, transparent 1px 3px);
}
/* при открытии кадр проявляется: тёмная непроявленная часть уходит вправо, по её краю — красная линия */
html.grit.look-razvertka .ov-media::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; left: 0; z-index: 3; pointer-events: none;
  background: rgba(10, 10, 11, .9); border-left: 2px solid #ff3b2f; box-shadow: -12px 0 22px -8px rgba(255, 59, 47, .7);
  animation: mon-reveal 1.2s cubic-bezier(.65, 0, .35, 1) .15s both;
}
@keyframes mon-reveal { 0% { left: 0; opacity: 1; } 92% { left: 100%; opacity: 1; } 100% { left: 100%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html.grit.look-razvertka .ov-media::after { display: none; } }
html.grit.look-razvertka .vp-top { z-index: 4; }
html.grit.look-razvertka .vp-top::before { content: "● REC"; margin-right: 12px; color: #ff3b2f; letter-spacing: .14em; }
/* название — красная машинопись поверх нижнего края кадра */
html.grit.look-razvertka .rc-name, html.grit.look-razvertka .wk-name {
  position: relative; z-index: 4; margin: .12em 0 0; color: #ff3b2f;
  font: 700 clamp(56px, 8.6vw, 128px)/.92 "IBM Plex Mono", "PT Mono", monospace; text-transform: lowercase; letter-spacing: -.03em;
}
html.grit.look-razvertka .wk-kicker { display: block; margin-top: 18px; color: rgba(238, 227, 198, .7); font: 400 12px/1.4 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
html.grit.look-razvertka .wk-meta { color: rgba(238, 227, 198, .7); }
/* факты — бегущей строкой по красной зернистой полосе во всю ширину */
html.grit.look-razvertka .wk-facts {
  display: block; max-width: none; margin: 22px calc(-1 * clamp(16px, 3vw, 48px)) 0; padding: 18px 0; overflow: hidden; white-space: nowrap;
  background: #ae1b1f url(assets/tex/red-grain.png) 0 0 / 192px 192px repeat; image-rendering: pixelated;
  animation: mon-ticker 42s linear infinite;
}
html.grit.look-razvertka .wk-facts > div, html.grit.look-razvertka .wk-facts > div:last-child { display: inline; border: 0; padding: 0; }
html.grit.look-razvertka .wk-facts dt, html.grit.look-razvertka .wk-facts dd { display: inline; color: #eee3c6; font: 400 15px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
html.grit.look-razvertka .wk-facts dt { color: rgba(238, 227, 198, .7); margin-right: 10px; }
html.grit.look-razvertka .wk-facts dd::after { content: "  ◆  "; white-space: pre; color: #fff; }
html.grit.look-razvertka .wk-facts dd b { color: #fff; }
@keyframes mon-ticker { from { text-indent: 40vw; } to { text-indent: -320vw; } }
@media (prefers-reduced-motion: reduce) { html.grit.look-razvertka .wk-facts { animation: none; white-space: normal; } }
html.grit.look-razvertka .rc-nav { border-top: 0; color: rgba(238, 227, 198, .7); }
/* карточка жильца (18.11, его «стилизовать карточку ролика; экран не полностью чёрный — прозрачно, чтобы ящик на фоне
   виднелся»): фон полупрозрачный — за карточкой подъезд с открытым ящиком (камера уже подъехала); карточка — письмо из
   ящика: лист бумаги чуть набок, текст тушью, имя красной машинописью, ролик в чёрной рамке; реестр с печатью — как был */
html.grit.look-razvertka .overlay[data-kind="floor"] .overlay-scrim { background: rgba(10, 10, 11, .5); }
html.grit.look-razvertka .overlay[data-kind="floor"] .overlay-panel {
  width: min(1060px, 94vw); max-height: 92vh; padding: 0 clamp(16px, 2.4vw, 34px) 20px;
  background-color: #ebe3cc; background-image: var(--speck-dark); color: #141412; color-scheme: light;
  transform: rotate(-.6deg); box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
  animation: rc-letter .55s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rc-letter { from { opacity: 0; transform: translateY(46px) rotate(-3deg) scale(.96); } }
@media (prefers-reduced-motion: reduce) { html.grit.look-razvertka .overlay[data-kind="floor"] .overlay-panel { animation: none; } }
html.grit.look-razvertka .overlay[data-kind="floor"] .ov-top { background: transparent; color: rgba(20, 20, 18, .62); }
html.grit.look-razvertka .overlay[data-kind="floor"] .ov-top .x,
html.grit.look-razvertka .overlay[data-kind="floor"] .rc-nav .x { color: #141412; border-color: rgba(20, 20, 18, .55); }
html.grit.look-razvertka .overlay[data-kind="floor"] .ov-top .x:hover:not(:disabled),
html.grit.look-razvertka .overlay[data-kind="floor"] .rc-nav .x:hover:not(:disabled) { background: #141412; border-color: #141412; color: #ebe3cc; }
html.grit.look-razvertka .overlay[data-kind="floor"] .rc-nav { color: rgba(20, 20, 18, .62); }
html.grit.look-razvertka .overlay[data-kind="floor"] .ov-media,
html.grit.look-razvertka .overlay[data-kind="floor"] .rc-vplayer { box-shadow: 0 0 0 6px #141412, 0 14px 30px rgba(0, 0, 0, .35); }
html.grit.look-razvertka .overlay[data-kind="floor"] .rc-name {
  color: #c4231c; font-size: clamp(40px, 5vw, 84px); overflow-wrap: normal; word-break: keep-all; hyphens: none;   /* имя не ломать посреди слова */
}
html.grit.look-razvertka .overlay[data-kind="floor"] .rc-act { color: #f4ecd8; }   /* светлым по красной плашке */
html.grit.look-razvertka .overlay[data-kind="floor"] .rc-log { color: #1b1b19; }
html.grit.look-razvertka .overlay[data-kind="floor"] .rc-lore { color: rgba(20, 20, 18, .7); }
html.grit.look-razvertka .overlay[data-kind="floor"] .btn-watch { color: #141412; border-color: #141412; }
html.grit.look-razvertka .overlay[data-kind="floor"] .btn-watch:hover { color: #ebe3cc; background: #c4231c; border-color: #c4231c; }
html.grit.look-razvertka .overlay[data-kind="floor"] .card-paper { background-color: #f6f1e4; transform: rotate(1.6deg); box-shadow: 0 10px 24px rgba(0, 0, 0, .22); }
/* карточка кейса (18.11, его «название продукта и блоками: что делал, для кого, каким софтом, каким пайплайном — сейчас не
   читается»): на компьютере видео слева, справа бренд и неподвижные блоки; софт — плашками цепочкой (порядок = пайплайн) */
@media (min-width: 1000px) {
  html.grit.look-razvertka .wk-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: clamp(22px, 2.4vw, 40px); align-items: start; }
  html.grit.look-razvertka .wk-layout .wk-body { padding: 0; }
  html.grit.look-razvertka .wk-layout .wk-kicker { margin-top: 0; }
}
html.grit.look-razvertka .wk-body .wk-name, html.grit.look-razvertka .series-side .wk-name {
  font-size: clamp(30px, 3.2vw, 58px); text-transform: none; letter-spacing: -.02em; overflow-wrap: normal; word-break: keep-all; hyphens: none;   /* длинный бренд (ULTRASUPPS) не ломать посреди слова */
}
html.grit.look-razvertka .wk-blocks { margin-top: 18px; border-top: 1px solid rgba(238, 227, 198, .2); }
html.grit.look-razvertka .wk-b { padding: 12px 0 13px; border-bottom: 1px solid rgba(238, 227, 198, .2); }
html.grit.look-razvertka .wk-b h3 { margin: 0 0 6px; font: 400 11px/1.3 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: #ff3b2f; }
html.grit.look-razvertka .wk-b div { font: 400 15px/1.5 var(--f-mono); color: #eee3c6; }
html.grit.look-razvertka .wk-b b { display: block; font-weight: 700; color: #fff; letter-spacing: .02em; }
html.grit.look-razvertka .wk-b span { display: block; margin-top: 2px; font-size: 13px; color: rgba(238, 227, 198, .66); }
html.grit.look-razvertka .wk-b-product div { font-size: 17px; color: #fff; }
html.grit.look-razvertka .wk-b-pipe div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 7px; }
html.grit.look-razvertka .wk-b-pipe i {
  font: 400 12px/1 var(--f-mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: #eee3c6;
  padding: 6px 9px 5px; background: #ae1b1f url(assets/tex/red-grain.png) 0 0 / 192px 192px repeat;
}
html.grit.look-razvertka .wk-b-pipe s { text-decoration: none; color: rgba(238, 227, 198, .55); }


/* подъезд без прокрутки вниз и без полосы подвала (16.11, он: «убери свайп вниз и эту линию — оформление как на главной»):
   сцена во весь экран, от подвала остаются только ссылки мелким текстом в правом нижнем углу поверх сцены, как на главной */
@media (min-width: 761px) {
  html.grit body.mbx-on { overflow: hidden; }
  html.grit body.mbx-on #view-residents .foot {
    position: fixed; z-index: 5; right: var(--gutter); bottom: clamp(16px, 3vh, 28px); left: auto; width: auto; max-width: none;
    margin: 0; padding: 0; border: 0; background: none;
  }
  html.grit body.mbx-on #view-residents .foot .foot-meta { display: none; }
  html.grit body.mbx-on #view-residents .foot .corner a { color: rgba(15, 15, 14, .6); }
  html.grit body.mbx-on #view-residents .foot .corner a:hover { color: #0f0f0e; }
}

/* =====================================================================
   РАЗДЕЛЫ ПОРТФОЛИО (16.11, его выбор — вариант 1 из 5_SITE\_mock_cats): работы идут группами AI / 3D / 2D / VFX, перед каждой —
   два чёрных квадрата: слово раздела во всю клетку (как POR / TFO / LIO, кремовые буквы) и сколько в нём кейсов. Сетка остаётся
   «квадрат, квадрат, квадрат»: квадраты раздела — тоже пара и держат шахматку. Текстуры страницы (.pp-tex) лежат и на них
   ===================================================================== */
.pp-cell.pp-cat, .pp-cell.pp-cat-info { background: var(--pp-ink, #111319); }
.pp-cat-info {
  display: flex; flex-direction: column; box-sizing: border-box; padding: clamp(14px, 1.7vw, 30px);
  color: var(--pp-cream); text-align: left;
}
.pp-ci-top { position: relative; z-index: 1; font: 400 12px/1.5 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.pp-ci-n { position: relative; z-index: 1; margin-top: auto; font: 900 10.5vw/.8 "Sofia Sans Extra Condensed", "Oswald", sans-serif; }
.pp-ci-note { position: relative; z-index: 1; margin-top: clamp(8px, 1vw, 16px); max-width: 32ch; font: 400 clamp(12px, .95vw, 15px)/1.5 "PT Mono", var(--f-mono); opacity: .9; }
@media (max-width: 760px) {
  .pp-ci-n { font-size: 21vw; }
  .pp-ci-note { font-size: 12px; }
  .pp-ci-top { font-size: 10px; }
}

/* конец сетки портфолио (16.11): пара «ваш проект» — красное слово YOUR / PROJECT и чёрная клетка-«кадр»: «здесь будет ваш кадр»,
   строка про ТЗ и ссылка «обсудить проект»; обе ведут на контакт. Появляется, только когда пар в сетке нечётно */
.pp-next .pp-ci-note { margin-top: auto; font-size: clamp(14px, 1.15vw, 19px); }
.pp-next-btn {
  position: relative; z-index: 1; align-self: flex-start; margin-top: clamp(12px, 1.4vw, 22px); padding: 9px 14px;
  border: 1px solid currentColor; font: 400 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  transition: background-color .2s, color .2s;
}
a.pp-next:hover .pp-next-btn { background: var(--pp-cream); color: var(--pp-ink, #111319); }
a.pp-next-w:hover .pp-fit { color: #fff; }
/* последняя клетка (17.11, его выбор): слово ENTER — пара ко входу в подъезд */
a.pp-enter-w:hover .pp-fit, a.pp-enter-w:focus-visible .pp-fit { color: #fff; }
/* клиенты вместо кадра с мухами (17.11, его выбор): «работал с» и имена кремовыми буквами столбиком на чёрной клетке;
   кегль подбирает poster.js (fitClients); имя с кейсом — кнопка, при наведении белеет */
.pp-cell.pp-cat-info.pp-clients { justify-content: space-between; background: var(--pp-cream); color: #111319; }   /* светлая, как кадр: шахматка держится (над ней POR, под ней чёрный раздел) */
.pp-clients .pp-ci-top { color: var(--pp-red); opacity: 1; }
.pp-cl-list { position: relative; z-index: 1; display: block; transform-origin: 0 100%; }
.pp-cl {
  display: block; width: max-content; max-width: 100%; margin: 0; padding: 0; border: 0; background: none; text-align: left;
  font: 900 1em/.86 "Sofia Sans Extra Condensed", "Oswald", sans-serif; letter-spacing: .005em; text-transform: uppercase;
  color: #111319; white-space: nowrap;
}
button.pp-cl { cursor: pointer; transition: color .2s; }
button.pp-cl:hover, button.pp-cl:focus-visible { color: var(--pp-red); }
@media (max-width: 760px) { .pp-next .pp-ci-note { font-size: 12px; } .pp-next-btn { padding: 7px 10px; font-size: 10px; } }

/* подсказка на главной (16.11, его идея: «микро-гифка, как мы скроллим, и микро-подпись „скролль вниз“»): вместо красного
   квадратика — значок мыши, в нём колёсико едет вниз и гаснет, 1,6 с по кругу. Только на компьютере (там подсказка про колесо) */
@media (pointer: fine) {
  html.look-razvertka .welcome .hh-hint::before {
    width: .62em; height: 1em; margin-right: .6em; vertical-align: -.18em; box-sizing: border-box;
    background: linear-gradient(currentColor, currentColor) 50% 18% / 2px .26em no-repeat;
    border: 2px solid currentColor; border-radius: .31em;
    animation: hh-wheel 1.6s cubic-bezier(.45, 0, .55, 1) infinite;
  }
}
@keyframes hh-wheel {
  0% { background-position: 50% 18%; background-size: 2px .26em; }
  60% { background-position: 50% 62%; background-size: 2px .26em; }
  80%, 100% { background-position: 50% 70%; background-size: 2px 0; }
}
@keyframes hh-big-in {
  0% { opacity: 0; transform: translateY(24px) scale(.9); }
  55% { opacity: 1; transform: translateY(-6px) scale(1.045); }
  100% { opacity: 1; transform: none; }
}
@keyframes hh-big-nudge {
  0%, 60%, 100% { transform: none; filter: drop-shadow(0 0 0 rgba(227, 39, 27, 0)); }
  70% { transform: translateY(7px); filter: drop-shadow(0 0 18px rgba(227, 39, 27, .6)); }
  80% { transform: translateY(-2px); }
  90% { transform: none; filter: drop-shadow(0 0 0 rgba(227, 39, 27, 0)); }
}
@media (prefers-reduced-motion: reduce) { html.look-razvertka .welcome .hh-stage .hh-hint.is-big { animation: none; } }
@keyframes hh-wheel-big {
  0% { background-position: 50% 18%; background-size: 3px .34em; }
  60% { background-position: 50% 62%; background-size: 3px .34em; }
  80%, 100% { background-position: 50% 70%; background-size: 3px 0; }
}
@media (pointer: fine) and (prefers-reduced-motion: no-preference) { html.look-razvertka .welcome .hh-stage .hh-hint.is-big::before { animation-name: hh-wheel-big; } }
/* тёмная тема (?theme=dark): плашка подсказки светлая, как остальные плашки тушью */
html.theme-dark.look-razvertka .welcome .hh-stage .hh-hint.is-big { color: #0e0e0d; }
html.theme-dark.look-razvertka .welcome .hh-stage .hh-hint.is-big::after { background: #e9e6df; }
html.theme-dark.look-razvertka .welcome .hh-hint.is-big span { color: rgba(14, 14, 13, .66); }
@media (prefers-reduced-motion: reduce) { html.look-razvertka .welcome .hh-hint::before, .welcome .hh-step::before { animation: none; } }
@media (max-width: 760px) { .welcome .hh-step { display: none; } }

/* «Жители» (16.11, его правка «такую же чёрную плашечку, как на портфолио»): меню как на портфолио — вертикальными словами
   у правого края на рваной полосе тушью вместо красного блока */
@media (min-width: 761px) {
  html.grit body.mbx-on .tabs { right: 4px; gap: 2px; }
  html.grit body.mbx-on .tabs a { writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 7px; gap: 10px; font-size: 11px; color: rgba(238, 227, 198, .66); }
  html.grit body.mbx-on .tabs a::before { width: 2px; height: 14px; opacity: .55; }
  html.grit body.mbx-on .tabs a:hover::before { width: 2px; height: 20px; opacity: 1; }
  html.grit body.mbx-on .tabs a[aria-current]::before { width: 2px; height: 30px; background: #eee3c6; opacity: 1; }
  html.grit body.mbx-on .tabs a:hover, html.grit body.mbx-on .tabs a[aria-current] { color: #eee3c6; }
  html.grit body.mbx-on .tabs::after {
    top: -22px; bottom: -22px; left: -7px; right: -5px;
    background: #111319 var(--noise) 0 0 / 180px 180px; background-blend-mode: multiply; image-rendering: auto;
  }
}

/* клетка-анимация на плакате (16.11): его полигональный аватар заперт в квадрате — видео видно всегда (играет, пока клетка на экране),
   ч/б с зерном, как остальные кадры; при наведении — в цвете */
/* 16.11 (его «дай ему стилистику сайта»): ролик уже в печати сайта — растр точками, бумага, красное, рваные блоки за ним
   (4_CREATIVITY/AVATAR/cube/stylize_print.mjs), поэтому без фильтров; при наведении — тот же ролик в цвете поверх */
.pp-anim .pp-print video { opacity: 1; }
.pp-anim .pp-print img, .pp-anim .pp-print .pp-vid, .pp-anim.live .pp-print img, .pp-anim.live .pp-print .pp-vid { filter: none; }
.pp-anim .pp-print .pp-vid2 { opacity: 0; filter: none; }
.pp-anim.live .pp-print .pp-vid2 { opacity: 1; }
/* аватар при наведении (16.11): цветной ролик — тот же кадр печати, только он в цвете; без контраста наведения — фон не меняется */
.pp-me.pp-anim.live .pp-print video { filter: none; }
/* аватар с мышью (21.11): один ролик pf-avatar-duo — ч/б печать сверху, тот же кадр в цвете снизу; видна верхняя половина,
   при наведении проявляется холст с нижней половиной того же кадра (poster.js duoDraw) — меняется только цвет */
.pp-duo .pp-print .pp-vid { object-position: 50% 0; }
.pp-duo-c { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .45s var(--ease); pointer-events: none; }
.pp-duo.live .pp-duo-c { opacity: 1; }
/* клетка-анимация с цветным роликом (знак «Мерцание», 16.11): ч/б, как прежнее фото знака, при наведении — цвет */
.pp-anim.pp-bw .pp-print img, .pp-anim.pp-bw .pp-print .pp-vid { filter: grayscale(1) contrast(1.3) brightness(.97); }
.pp-anim.pp-bw.live .pp-print img, .pp-anim.pp-bw.live .pp-print .pp-vid { filter: contrast(1.05); }
/* знак RASTIK (18.11, его «усилить анимацию, чтобы больше бросался в глаз: сильнее моргал, гораздо сильнее переливался»): ч/б кадр
   дышит контрастом и яркостью, а раз в 3,2 с — серия резких вспышек: сбой сигнала, кадр дёргается и на мгновение вспыхивает
   в цвете. Наведение — как было: цветной и плашка Telegram */
@media (prefers-reduced-motion: no-preference) {
  .pp-glow.pp-anim.pp-bw:not(.live) .pp-print img, .pp-glow.pp-anim.pp-bw:not(.live) .pp-print .pp-vid { animation: pp-sign 3.2s linear infinite; }
}
/* клетка знака или аватара ушла с экрана (poster.js ставит .is-off) — мерцание на паузе: за экраном его не видно, а считалось каждый кадр */
.pp-glow.pp-anim.pp-bw.is-off:not(.live) .pp-print img, .pp-glow.pp-anim.pp-bw.is-off:not(.live) .pp-print .pp-vid { animation-play-state: paused; }
/* ролик знака играет — картинка под ним не видна: не мерцаем ею (22.11, облегчение телефона; poster.js ставит .is-vid) */
.pp-glow.pp-anim.is-vid .pp-print img:not(.pp-tag) { animation: none; visibility: hidden; }
@keyframes pp-sign {
  0%, 62%, 100% { filter: grayscale(1) contrast(1.3) brightness(.9); transform: scale(1.04); }
  31% { filter: grayscale(1) contrast(1.7) brightness(1.32); transform: scale(1.06); }
  70% { filter: grayscale(1) contrast(1.3) brightness(.9); transform: scale(1.04); }
  71% { filter: grayscale(0) contrast(1.35) brightness(2.1); transform: scale(1.04) translateX(-7px) skewX(-3deg); }
  73% { filter: grayscale(1) contrast(2.2) brightness(.32); transform: scale(1.04) translateX(6px); }
  75% { filter: grayscale(.25) contrast(1.3) brightness(1.85); transform: scale(1.05) translateX(-3px); }
  77% { filter: grayscale(1) contrast(1.4) brightness(.55); transform: scale(1.04) translateX(2px); }
  79% { filter: grayscale(0) contrast(1.2) brightness(1.5); transform: scale(1.04); }
  82% { filter: grayscale(1) contrast(1.3) brightness(.9); transform: scale(1.04); }
}
/* клиенты-табло: перещёлкнутое имя на миг красное (poster.js: scramble) */
.pp-cl { transition: color .35s; }
.pp-cl.is-hot { color: var(--pp-red); transition: none; }

/* =====================================================================
   КАРТОЧКА ЖИЛЬЦА — ПИСЬМО ИЗ ЯЩИКА (18.11, его выбранный макет 5_SITE\_mock_hint\envelope; разметка — mailHtml в app.js).
   Сцена 1600 × 1000 по макету, масштаб под экран (--k); в узком окне и на телефоне — .mail-compact: письмо столбиком
   ===================================================================== */
html.grit.look-razvertka .overlay.is-mail { padding: 0; }
html.grit.look-razvertka .overlay.is-mail .overlay-scrim { background: rgba(10, 10, 11, .68); }
html.grit.look-razvertka .overlay.is-mail .overlay-panel {
  position: absolute; inset: 0; width: auto; max-width: none; max-height: none; height: auto; padding: 0; margin: 0;
  background: none; box-shadow: none; transform: none; animation: none; overflow: hidden; pointer-events: none;
}
html.grit.look-razvertka .overlay.is-mail .mail {
  position: absolute; left: 50%; top: 50%; width: 1600px; height: 1000px; transform: translate(-50%, -50%) scale(var(--k, 1));
  font: 400 16px/1.45 var(--f-mono); color: #141412; color-scheme: light; pointer-events: none;
}
html.grit.look-razvertka .overlay.is-mail .mail > * { pointer-events: auto; }
/* бумага: пятна, грязь и царапины сайта умножением (ролик — поверх, чистый) */
html.grit.look-razvertka .overlay.is-mail .mail .mail-env::after, html.grit.look-razvertka .overlay.is-mail .mail .mail-letter::after, html.grit.look-razvertka .overlay.is-mail .mail .mp-e::after {
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; mix-blend-mode: multiply; opacity: .55;
  background: url(assets/tex/stains.webp) center / cover, url(assets/tex/grunge.webp) 30% 40% / 700px;
}
html.grit.look-razvertka .overlay.is-mail .mail .mail-env::before, html.grit.look-razvertka .overlay.is-mail .mail .mail-letter::before {
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; mix-blend-mode: multiply; opacity: .35;
  background: url(assets/tex/scratches-dark.webp) center / 900px;
}
/* верх: счётчик писем и «Закрыть» */
html.grit.look-razvertka .overlay.is-mail .mail .mail-top { position: absolute; left: 56px; right: 56px; top: 30px; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  color: rgba(238, 227, 198, .72); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; pointer-events: none; }
html.grit.look-razvertka .overlay.is-mail .mail .mail-top b { color: #eee3c6; font-weight: 400; }
html.grit.look-razvertka .overlay.is-mail .mail .mail-top .x { pointer-events: auto; padding: 11px 14px 9px; border: 1px solid rgba(238, 227, 198, .6); background: transparent; color: #eee3c6;
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
html.grit.look-razvertka .overlay.is-mail .mail .mail-top .x:hover, html.grit.look-razvertka .overlay.is-mail .mail .mail-top .x:focus-visible { background: #eee3c6; border-color: #eee3c6; color: #141412; outline: none; }
/* конверт: советский художественный */
html.grit.look-razvertka .overlay.is-mail .mail .mail-env { position: absolute; left: 34px; top: 318px; width: 620px; height: 392px; z-index: 5; overflow: hidden;
  background: #e8dfc6; transform: rotate(-5deg); box-shadow: 0 34px 70px rgba(0, 0, 0, .6), 0 2px 0 rgba(0, 0, 0, .25);
  animation: ml-env .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ml-env { from { opacity: 0; transform: translate(-90px, 170px) rotate(-17deg); } }
html.grit.look-razvertka .overlay.is-mail .mail .me-art { position: absolute; left: 20px; top: 20px; width: 236px; height: 290px; overflow: hidden; background: #d9cdb0; }
html.grit.look-razvertka .overlay.is-mail .mail .me-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.55) brightness(1.08); mix-blend-mode: multiply; }
html.grit.look-razvertka .overlay.is-mail .mail .me-art::before { content: ""; position: absolute; inset: 0; z-index: 2; background: #c4231c; mix-blend-mode: screen; opacity: .9; }
html.grit.look-razvertka .overlay.is-mail .mail .me-art::after { content: ""; position: absolute; inset: -40%; z-index: 3; transform: rotate(45deg); mix-blend-mode: multiply; opacity: .55;
  background: radial-gradient(circle, rgba(20, 0, 0, .95) 0 1.3px, transparent 1.9px) 0 0 / 5px 5px; }
html.grit.look-razvertka .overlay.is-mail .mail .me-art.is-empty { display: grid; place-items: center; background: #c4231c; }
html.grit.look-razvertka .overlay.is-mail .mail .me-art.is-empty::before { display: none; }
html.grit.look-razvertka .overlay.is-mail .mail .me-art.is-empty b { position: relative; z-index: 4; color: #f4ecd8; font: 400 58px/1 var(--f-display); letter-spacing: -.02em; }
html.grit.look-razvertka .overlay.is-mail .mail .me-cap { position: absolute; left: 20px; top: 322px; width: 236px; font-size: 10.5px; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; color: rgba(20, 20, 18, .62); }
html.grit.look-razvertka .overlay.is-mail .mail .me-stamp { position: absolute; right: 26px; top: 22px; width: 96px; height: 116px; padding: 4px; background: #f5efdd; box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 4px at 4px 4px, transparent 97%, #000) -4px -4px / 9.6px 9.6px;
          mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 4px at 4px 4px, transparent 97%, #000) -4px -4px / 9.6px 9.6px; }
html.grit.look-razvertka .overlay.is-mail .mail .me-stamp i { position: absolute; inset: 10px; display: grid; place-items: center; background: #c4231c; color: #f5efdd; font-style: normal; }
html.grit.look-razvertka .overlay.is-mail .mail .me-stamp b { font: 400 30px/1 var(--f-display); letter-spacing: -.02em; }
html.grit.look-razvertka .overlay.is-mail .mail .me-stamp u, html.grit.look-razvertka .overlay.is-mail .mail .me-stamp s { position: absolute; left: 6px; right: 6px; font-size: 8.5px; letter-spacing: .14em; text-align: center; text-decoration: none; }
html.grit.look-razvertka .overlay.is-mail .mail .me-stamp u { top: 6px; }
html.grit.look-razvertka .overlay.is-mail .mail .me-stamp s { bottom: 6px; }
html.grit.look-razvertka .overlay.is-mail .mail .me-pm { position: absolute; right: 78px; top: 44px; width: 104px; height: 104px; display: grid; place-items: center; border: 2.5px solid rgba(20, 20, 18, .78);
  border-radius: 50%; font-size: 10px; line-height: 1.35; letter-spacing: .1em; text-align: center; color: rgba(20, 20, 18, .82); transform: rotate(-14deg); mix-blend-mode: multiply; }
html.grit.look-razvertka .overlay.is-mail .mail .me-pm::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(20, 20, 18, .7); border-radius: 50%; }
html.grit.look-razvertka .overlay.is-mail .mail .me-waves { position: absolute; right: -18px; top: 60px; width: 150px; height: 60px; transform: rotate(-14deg); mix-blend-mode: multiply; }
html.grit.look-razvertka .overlay.is-mail .mail .me-waves path { fill: none; stroke: rgba(20, 20, 18, .75); stroke-width: 2.2; }
html.grit.look-razvertka .overlay.is-mail .mail .me-rub { position: absolute; left: 286px; top: 100px; padding: 6px 10px 4px; border: 2.5px solid #c4231c; color: #c4231c;
  font: 400 15px/1 var(--f-display); letter-spacing: .06em; transform: rotate(-7deg); mix-blend-mode: multiply; opacity: .85; }
html.grit.look-razvertka .overlay.is-mail .mail .me-addr { position: absolute; left: 282px; right: 24px; top: 168px; }
html.grit.look-razvertka .overlay.is-mail .mail .me-addr .ln { display: flex; align-items: baseline; gap: 12px; height: 46px; border-bottom: 1.5px solid rgba(20, 20, 18, .55); }
html.grit.look-razvertka .overlay.is-mail .mail .me-addr em { font-style: normal; font-size: 12px; letter-spacing: .06em; color: rgba(20, 20, 18, .62); }
html.grit.look-razvertka .overlay.is-mail .mail .me-addr span { font-size: 16px; letter-spacing: .02em; white-space: nowrap; }
html.grit.look-razvertka .overlay.is-mail .mail .me-addr .to { color: #c4231c; font: 700 30px/1 "IBM Plex Mono", var(--f-mono); letter-spacing: -.02em; text-transform: lowercase; }
html.grit.look-razvertka .overlay.is-mail .mail .me-idx { position: absolute; left: 282px; bottom: 22px; display: flex; gap: 9px; }
html.grit.look-razvertka .overlay.is-mail .mail .me-idx svg { width: 26px; height: 46px; overflow: visible; }
html.grit.look-razvertka .overlay.is-mail .mail .me-idx .t { fill: none; stroke: rgba(20, 20, 18, .3); stroke-width: 1.2; stroke-dasharray: 1.5 2.5; }
html.grit.look-razvertka .overlay.is-mail .mail .me-idx .d { fill: none; stroke: #141412; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
/* письмо: сложено втрое, ролик — фотокарточкой на скотче, карточка машинописью */
html.grit.look-razvertka .overlay.is-mail .mail .mail-letter { position: absolute; left: 640px; top: 58px; width: 620px; height: 880px; padding: 32px 36px 30px; z-index: 8;
  background: #f2ecdc; transform: rotate(2deg); box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  animation: ml-letter .85s .2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ml-letter { from { opacity: 0; transform: translate(-300px, 330px) rotate(-9deg) scale(.5); } }
html.grit.look-razvertka .overlay.is-mail .mail .ml-fold { position: absolute; left: 0; right: 0; height: 26px; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .075) 48%, rgba(255, 255, 255, .55) 52%, rgba(0, 0, 0, 0)); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-fold.f1 { top: calc(33.3% - 13px); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-fold.f2 { top: calc(66.6% - 13px); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-hd { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid #141412;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: rgba(20, 20, 18, .66); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-row { position: relative; z-index: 7; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 26px; align-items: start; margin-top: 30px; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-photo { position: relative; width: calc(290px * min(var(--r, 1), 1)); aspect-ratio: var(--r, 1); padding: 9px; box-sizing: content-box;
  background: #fbf8ef; transform: rotate(-2.4deg); box-shadow: 0 8px 18px rgba(0, 0, 0, .28); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-v { position: relative; width: 100%; height: 100%; overflow: hidden; background: #0b0b0a; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-v > .ph { position: absolute; inset: 0; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-tape { position: absolute; z-index: 4; width: 104px; height: 30px; background: rgba(226, 214, 168, .82); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); pointer-events: none; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-tape.t1 { left: -32px; top: -10px; transform: rotate(-38deg); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-tape.t2 { right: -34px; top: -6px; transform: rotate(34deg); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-who { padding-top: 4px; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-who .rc-act { display: inline-block; margin: 0; padding: 6px 10px 5px; background: #c4231c; color: #f4ecd8; font-size: 12px; letter-spacing: .14em; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-who .rc-name { margin: 10px 0; color: #c4231c; font: 700 60px/.92 "IBM Plex Mono", var(--f-mono); letter-spacing: -.03em; text-transform: lowercase;
  font-size: min(60px, calc(360px / var(--nl, 6))); white-space: nowrap; overflow-wrap: normal; word-break: keep-all; hyphens: none; }   /* длинное имя — мельче, в строку */
html.grit.look-razvertka .overlay.is-mail .mail .ml-who .rc-log { margin: 14px 0 0; max-width: none; color: #141412; font-size: 16px; line-height: 1.55; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-who .rc-lore { margin: 10px 0 0; color: rgba(20, 20, 18, .7); font-size: 14px; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-who .btn-watch { display: inline-block; margin-top: 14px; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-sign { margin: 26px 0 0; white-space: nowrap; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(20, 20, 18, .6); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-form { position: relative; z-index: 2; margin: 44px 0 0; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-form > div { display: grid; grid-template-columns: 170px 1fr; align-items: baseline; height: 44px; border-bottom: 1px solid rgba(20, 20, 18, .35); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-form dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(20, 20, 18, .55); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-form dd { margin: 0; font-size: 18px; color: #141412; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-form .senses s { margin-right: .5em; color: #c4231c; text-decoration-thickness: 2px; }
html.grit.look-razvertka .overlay.is-mail .mail .ml-form .senses span { margin-right: .5em; color: rgba(20, 20, 18, .5); }
html.grit.look-razvertka .overlay.is-mail .mail .ml-stamp { position: absolute; left: auto; top: auto; right: 40px; bottom: 54px; z-index: 3; padding: 10px 16px 8px; border: 4px solid #c4231c; color: #c4231c;
  font: 400 30px/1 var(--f-display); letter-spacing: .04em; transform: rotate(-9deg); opacity: .88; mix-blend-mode: multiply; }
/* стопка писем других квартир: следующее сверху, наведение — письмо выдвигается */
html.grit.look-razvertka .overlay.is-mail .mail .mail-pile { position: absolute; left: 1286px; top: 330px; width: 420px; height: 640px; z-index: 3; }
html.grit.look-razvertka .overlay.is-mail .mail .mp-next { position: absolute; left: 10px; top: -40px; color: #eee3c6; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
html.grit.look-razvertka .overlay.is-mail .mail .mp-next::after { content: " \2192"; color: #e2382b; }
html.grit.look-razvertka .overlay.is-mail .mail .mp-e { position: absolute; left: 0; top: calc(var(--i) * 120px); width: 380px; height: 240px; padding: 0; border: 0; overflow: hidden; cursor: pointer;
  background: #ded4b8; color: #141412; font: inherit; text-align: left; box-shadow: 0 18px 34px rgba(0, 0, 0, .5);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; animation: ml-pile .55s calc(.4s + var(--i) * .07s) cubic-bezier(.2, .8, .2, 1) both; }
html.grit.look-razvertka .overlay.is-mail .mail .mp-e:nth-of-type(1) { left: 6px; transform: rotate(5deg); }
html.grit.look-razvertka .overlay.is-mail .mail .mp-e:nth-of-type(2) { left: 24px; transform: rotate(-3deg); }
html.grit.look-razvertka .overlay.is-mail .mail .mp-e:nth-of-type(3) { left: 0; transform: rotate(4deg); }
html.grit.look-razvertka .overlay.is-mail .mail .mp-e:nth-of-type(4) { left: 30px; transform: rotate(-5deg); }
html.grit.look-razvertka .overlay.is-mail .mail .mp-e:hover, html.grit.look-razvertka .overlay.is-mail .mail .mp-e:focus-visible { z-index: 5; transform: translateX(-28px) rotate(0deg); box-shadow: 0 26px 44px rgba(0, 0, 0, .62); outline: none; }
@keyframes ml-pile { from { opacity: 0; translate: 140px 0; } }
html.grit.look-razvertka .overlay.is-mail .mail .mp-sp { position: absolute; right: 22px; top: 18px; width: 54px; height: 66px; padding: 3px; background: #c4231c;
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 3px at 3px 3px, transparent 97%, #000) -3px -3px / 7.4px 7.4px;
          mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 3px at 3px 3px, transparent 97%, #000) -3px -3px / 7.4px 7.4px; }
html.grit.look-razvertka .overlay.is-mail .mail .mp-sp.dark { background: #2a2826; }
html.grit.look-razvertka .overlay.is-mail .mail .mp-who { position: absolute; left: 24px; top: 24px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: rgba(20, 20, 18, .62); }
html.grit.look-razvertka .overlay.is-mail .mail .mp-who b { display: block; margin-top: 6px; color: #141412; font: 700 30px/1 "IBM Plex Mono", var(--f-mono); letter-spacing: -.02em; text-transform: lowercase; }
html.grit.look-razvertka .overlay.is-mail .mail .mp-seal { position: absolute; left: 110px; top: 120px; padding: 7px 12px 5px; background: #c4231c; color: #f4ecd8; font: 400 14px/1 var(--f-display); letter-spacing: .06em; transform: rotate(-8deg); }
html.grit.look-razvertka .overlay.is-mail .mail .mail-nav { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { html.grit.look-razvertka .overlay.is-mail .mail .mail-env, html.grit.look-razvertka .overlay.is-mail .mail .mail-letter, html.grit.look-razvertka .overlay.is-mail .mail .mp-e { animation: none; } }
/* узкое окно и телефон: письмо столбиком, конверт прячем, стопка — строкой под письмом */
html.grit.look-razvertka .overlay.is-mail.mail-compact .overlay-panel { overflow: auto; pointer-events: auto; overscroll-behavior: contain; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail { position: relative; left: auto; top: auto; width: auto; height: auto; transform: none; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 14px calc(env(safe-area-inset-bottom, 0px) + 84px); }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mail-top { position: relative; left: auto; right: auto; top: auto; order: 0; margin: 0 0 18px; font-size: 10.5px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mail-top .x { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); z-index: 30; padding: 13px 16px 11px; border-color: #c4231c; background: #c4231c; color: #f4ecd8; box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mail-env { display: none; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mail-letter { order: 1; position: relative; left: auto; top: auto; width: auto; height: auto; padding: 22px 18px 30px;
  transform: rotate(.6deg); animation-name: ml-letter-c; }
@keyframes ml-letter-c { from { opacity: 0; transform: translateY(60px) rotate(-3deg) scale(.94); } }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .ml-hd { font-size: 10px; letter-spacing: .1em; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .ml-row { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 24px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .ml-photo { width: calc(100% - 18px); margin: 0; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .ml-who .rc-name { font-size: min(46px, calc(84vw / var(--nl, 6) * 1.6)); }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .ml-form { margin-top: 26px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .ml-form > div { grid-template-columns: 112px minmax(0, 1fr); height: auto; min-height: 40px; padding: 8px 0; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .ml-form dd { font-size: 15px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .ml-stamp { right: 16px; bottom: 16px; font-size: 22px; border-width: 3px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mail-pile { order: 2; position: relative; left: auto; top: auto; width: auto; height: auto; margin-top: 46px;
  display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 12px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mp-next { left: 2px; top: -22px; font-size: 10.5px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mp-e { position: relative; left: auto; top: auto; flex: 0 0 210px; height: 132px; transform: none; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mp-e:hover { transform: translateY(-4px); }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mp-who { left: 16px; top: 16px; font-size: 10.5px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mp-who b { font-size: 22px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mp-sp { right: 14px; top: 14px; width: 34px; height: 42px; }
html.grit.look-razvertka .overlay.is-mail.mail-compact .mail .mp-seal { left: 54px; top: 86px; font-size: 11px; }
/* подъезд: его реплика — пиксельный пузырь слева от головы (hall3d.js say), 19.11 по его рефу: белый, чёрная пиксельная
   кайма со ступенчатыми углами (border-image 7×7, пиксель — 3 px), хвостик внизу справа — к губам; размер сразу под всю фразу */
.hall-say { position: absolute; left: 0; top: 0; z-index: 6; max-width: min(300px, 44vw); pointer-events: none;
  padding: 6px 9px 5px; border: 9px solid transparent; border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' d='M2 1h3v1h1v3h-1v1h-3v-1h-1v-3h1z'/%3E%3Cpath fill='%23111' d='M2 0h3v1h-3zM1 1h1v1h-1zM5 1h1v1h-1zM0 2h1v3h-1zM6 2h1v3h-1zM1 5h1v1h-1zM5 5h1v1h-1zM2 6h3v1h-3z'/%3E%3C/svg%3E") 3 fill / 9px stretch;
  color: #111; font: 400 14px/1.4 var(--f-mono); letter-spacing: .02em; text-align: left;
  opacity: 0; transition: opacity .16s steps(2, end); will-change: transform, opacity; }
.hall-say.on { opacity: 1; }
.hall-say::after { content: ""; position: absolute; right: 3px; top: calc(100% + 6px); width: 15px; height: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='5' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' d='M1 0h3v1h-3zM2 1h2v1h-2zM3 2h1v1h-1z'/%3E%3Cpath fill='%23111' d='M0 0h1v1h-1zM4 0h1v5h-1zM1 1h1v1h-1zM2 2h1v1h-1zM3 3h1v1h-1z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.hall-say span { visibility: hidden; }
.hall-say b { position: relative; display: inline-block; width: 0; height: 1em; vertical-align: -.12em; }
.hall-say b::after { content: ""; position: absolute; left: 1px; top: 0; width: .55em; height: 1.1em; background: #111; animation: vp-blink .8s steps(1, end) infinite; }
@media (prefers-reduced-motion: reduce) { .hall-say { transition: none; } }

/* =====================================================================
   НАВИГАЦИЯ (20.11, отзыв друга с бета-теста: «кнопку хоум или назад хочется», «зашёл в подъезд — выйти назад не могу»,
   «меню справа с краю — не читается»)
   ===================================================================== */
/* «← Назад» в «Жителях» и в портфолио (портфолио — 20.11, его «в портфолио тоже в том же месте кнопочка „Назад“,
   чтобы откатиться на Home»): в шапке слева от RU/EN, на рваной плашке тушью (как подложка меню), светлый текст.
   Куда ведёт — app.js (data-back). Слева вверху она закрывала заголовок сцены */
.go-back { display: none; }
body.mbx-on .go-back, body.night .go-back, body.pf-poster .go-back {
  display: inline-flex; align-items: center; gap: 8px; position: relative; z-index: 0;
  padding: 9px 14px; font: 400 13px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: #eee3c6; text-decoration: none;
}
body.mbx-on .go-back::before, body.night .go-back::before, body.pf-poster .go-back::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: #111319 var(--noise) 0 0 / 180px 180px; background-blend-mode: multiply; filter: url(#cut-s);
}
body.mbx-on .go-back:hover, body.night .go-back:hover, body.pf-poster .go-back:hover { color: #fff; }

/* компьютер: вкладки крупнее и ярче (было 11–12 px и полупрозрачные): на главной — на своих плашках, на портфолио
   и в «Жителях» — вертикальными словами на полосе тушью, как и было */
@media (min-width: 761px) {
  .tabs a { font-size: 13px; }
  body.pf-poster .tabs a, html.grit body.mbx-on .tabs a { font-size: 13px; padding: 12px 9px; color: rgba(238, 227, 198, .92); }
  body.pf-poster .tabs a[aria-current], html.grit body.mbx-on .tabs a[aria-current],
  body.pf-poster .tabs a:hover, html.grit body.mbx-on .tabs a:hover { color: #fff; }
  body.pf-poster .tabs::after, html.grit body.mbx-on .tabs::after { left: -9px; right: -7px; }
  html.rz-menu-red body.home-on .tabs a { color: rgba(255, 255, 255, .94); }
  /* полоса прокрутки страницы скрыта (20.11, бета-тест на MacBook): на Маке она рисуется поверх страницы — всплывала
     при прокрутке ленты и при подводе курсора к краю и ложилась на полосу вкладок у правого края. Листается как прежде:
     тачпадом, колесом, клавишами. Телефон (до 760 px) не трогаем — там вкладки внизу */
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { display: none; }
}

/* телефон: вкладки — строкой НАВЕРХУ, в одной полосе тушью с RU/EN (22.11 вечер, его скрины с айфона: «снизу у панели всё равно
   выглядывает текст… на айфоне снизу кнопки браузера будут мешать — давай перенесём наверх: слева Home, Portfolio, Residents,
   справа RU/EN, в одном баре»). На iOS 26 нижняя строка Safari плавает поверх страницы, а прибитое к низу окна браузер ставит
   над ней и обрезает по её краю — под панелью просвечивала сама страница. До 22.11 вечера панель была внизу (метки по -22-housem).
   Полоса: сплошной тёмный фон (его же Safari берёт для строки состояния) и рваный нижний край — тушь ::after чуть ниже полосы.
   RU/EN — в шапке (.top) поверх полосы; высота шапки = высоте полосы (--bar-h). Открытая вкладка — белая с красной чертой снизу */
@media (max-width: 760px) {
  :root { --bar-h: 48px; }
  html body .tabs, html.grit body.mbx-on .tabs, html body.pf-poster .tabs {
    top: 0; bottom: auto; left: 0; right: 0; transform: none;
    display: flex; flex-direction: row; align-items: stretch; justify-content: flex-start; gap: clamp(10px, 3.4vw, 18px);
    height: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
    background: #111319;
  }
  /* тушь — за края экрана сверху и по бокам; рваным остаётся только нижний край, на 7 px ниже сплошного фона */
  html body .tabs::after, html.grit body.mbx-on .tabs::after, html body.pf-poster .tabs::after {
    content: ""; position: absolute; z-index: -1; pointer-events: none; inset: -40px -14px -7px -14px;
    background: #111319 var(--noise) 0 0 / 180px 180px; background-blend-mode: multiply; image-rendering: auto;
    filter: url(#cut);
  }
  html body .tabs a, html.grit body.mbx-on .tabs a, html body.pf-poster .tabs a, html.rz-menu-red body.home-on .tabs a {
    writing-mode: horizontal-tb; transform: none; position: relative;
    flex-direction: row; justify-content: center; align-items: center; gap: 0;
    padding: 0; font-size: 12px; letter-spacing: .12em; color: rgba(238, 227, 198, .8);
  }
  html body .tabs a::before, html.grit body.mbx-on .tabs a::before, html body.pf-poster .tabs a::before,
  html.rz-menu-red body.home-on .tabs a::before {
    position: absolute; left: 0; right: .12em; bottom: 9px; width: auto; height: 2px; background: currentColor; opacity: 0;
  }
  html body .tabs a:hover, html body .tabs a[aria-current], html.grit body.mbx-on .tabs a[aria-current], html body.pf-poster .tabs a[aria-current],
  html.rz-menu-red body.home-on .tabs a[aria-current] { color: #fff; }
  /* черта — во всю ширину слова: старые правила до 640 px (вертикальные слова) ставили ей 2 px, касание оставляло «наведение» */
  html body .tabs a:hover::before { width: auto; height: 2px; opacity: 0; }
  html body .tabs a[aria-current]::before, html.grit body.mbx-on .tabs a[aria-current]::before,
  html body.pf-poster .tabs a[aria-current]::before, html.rz-menu-red body.home-on .tabs a[aria-current]::before {
    width: auto; height: 3px; background: var(--red); opacity: 1;
  }
  /* шапка с RU/EN — над полосой и той же высоты (кнопки языка 32 px + 8 + 8); язык — светлый на туши, открытый — кремовый */
  .top { z-index: 72; padding-block: 8px; }
  html body .top .lang { background: transparent; }
  html body .top .lang button { color: rgba(238, 227, 198, .78); border-color: rgba(238, 227, 198, .38); }
  html body .top .lang button[aria-pressed="true"] { color: #111319; background: #eee3c6; border-color: #eee3c6; }
  /* портфолио — от полосы вниз: сетка шла от самого верха под прозрачной шапкой, сплошная полоса закрыла бы верх первых клеток */
  body.pf-poster #view-portfolio { margin-top: 0; }
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  /* «← Назад» в «Жителях» и портфолио на телефоне не нужен: выход — вкладки и жест «назад»; кнопка закрывала заголовок сцены */
  body.mbx-on .go-back, body.night .go-back, body.pf-poster .go-back { display: none; }
}

/* пока идёт экран загрузки, страницы под ним нет (22.11 вечер, его скрин с айфона: «при загрузке снизу эта красная хуйня —
   нахуя; загрузка — наш экран и наши текстуры, снизу не должно выглядывать ничего»). На iOS 26 экран загрузки (fixed) браузер
   обрезает по верхнему краю плавающей строки Safari, а под строкой рисует саму страницу — была видна красная плашка главы.
   Теперь страница под экраном загрузки спрятана, под строкой — бумага того же цвета, что экран загрузки; экран начал таять
   (.done) — страница сразу на месте. Без экрана загрузки (повторный заход, прямая ссылка) правило не действует */
/* 01.12: вместо html:has(#loader:not(.done)) — класс ld-on у <html> (ставит скрипт сразу за экраном загрузки в index.html,
   снимает app.js в ту же секунду, что ставит .done). С :has() на корне любая вставка узла на странице (буквы табло, смена главы,
   холст в клетке портфолио) пересчитывала стили всего документа: на телефоне это рывки при прокрутке и на анимациях */
html.ld-on #main, html.ld-on .tabs, html.ld-on .top { visibility: hidden; }
html.grit.ld-on, html.grit.ld-on body { background-color: #efefef; background-image: none; }

/* меню вкладок на компьютере — наверху по центру, строкой (21.11 ночь, его «как разворачивается — не нравится, го её наверх
   по центру, уже без разворачивания; там как раз они станут по горизонтали»; до того в тот же день — полоса тушью справа
   с разворотом при наведении, метка -21-strip). Рваная плашка тушью, как у «← Назад», на одной высоте с ней и RU/EN;
   открытая вкладка белая с красной чертой снизу, наведение — светлее. На всех страницах.
   :not(#_) — вес выше прежних правил вкладок главной, портфолио и «Жителей», их не трогаем. Телефон — нижняя панель (выше) */
@media (min-width: 761px) {
  nav.tabs:not(#_) {
    top: 13px; right: auto; left: 50%; transform: translateX(-50%);
    flex-direction: row; align-items: center; gap: clamp(14px, 1.8vw, 26px);
    height: 31px; padding: 0 18px;
  }
  nav.tabs:not(#_)::before { content: none; }
  nav.tabs:not(#_)::after {
    content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none;
    background: #111319 var(--noise) 0 0 / 180px 180px; background-blend-mode: multiply; image-rendering: auto; filter: url(#cut-s);
  }
  nav.tabs:not(#_) a {
    display: block; position: relative; z-index: auto; writing-mode: horizontal-tb; transform: none;
    padding: 9px 0 8px; font: 400 13px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
    color: rgba(238, 227, 198, .85); text-decoration: none; transition: color .2s;
  }
  nav.tabs:not(#_) a:hover, nav.tabs:not(#_) a[aria-current] { color: #fff; }
  nav.tabs:not(#_) a::before {
    content: ""; position: absolute; left: 0; right: .14em; bottom: 1px; width: auto; height: 2px; order: 0;
    background: currentColor; opacity: 0; transform: scaleX(.3); transform-origin: left; transition: opacity .2s, transform .25s var(--ease);
  }
  nav.tabs:not(#_) a:hover::before { opacity: .6; transform: scaleX(.6); }
  nav.tabs:not(#_) a[aria-current]::before { opacity: 1; transform: none; height: 3px; background: var(--red); }
  nav.tabs:not(#_) a::after { background: none; filter: none; }   /* на главной это была плашка у каждой вкладки; теперь — зона нажатия */
}

/* =====================================================================
   ТЕЛЕФОН БЕЗ СМЕШЕНИЯ СЛОЁВ И SVG-ФИЛЬТРОВ (01.12, его «на мобильной версии он жёстко лагает»). Класс tex-flat у <html> —
   экран до 760 px, ставит скрипт в <head>. Safari на айфоне смешение (mix-blend-mode) слоёв во весь экран поверх 3D и роликов
   и шум через feTurbulence считает дорого и при каждой отрисовке. Здесь то же самое посчитано заранее — файлы assets/tex/m
   (deploy/bake-tex.mjs → bake-tex.py → bake-tex-encode.mjs, там же арифметика). Вид тот же. ?tex=old — как на компьютере,
   ?tex=flat — так и на компьютере
   ===================================================================== */
/* общий шум: плитка-картинка вместо SVG (плашки, полоса вкладок, конверты, слой .grain на весь экран) */
html.tex-flat { --noise: url(assets/tex/m/noise.webp); }
/* главная и «Жители»: три слоя умножением → один обычный чёрный слой */
html.tex-flat.grit .hh-tex .t-gr { background: url(assets/tex/m/hh-dark.webp) center / cover no-repeat; opacity: 1; mix-blend-mode: normal; }
html.tex-flat.grit .hh-tex .t-st, html.tex-flat.grit .hh-tex .t-sc { display: none; }
/* портфолио: пятна — обычный чёрный слой, царапины дважды и грязь — один белый. Мелкое зерно .t-ns на экране телефона
   не различить (сверено снимками), а слой на всю страницу со смешением — самый дорогой: убрано */
html.tex-flat .pp-tex .t-st { background-image: url(assets/tex/m/pf-dark.webp); background-size: 760px auto; background-position: 50% 0; mix-blend-mode: normal; opacity: 1; }
html.tex-flat .pp-tex .t-sc { background-image: url(assets/tex/m/pf-light.webp); background-size: 760px auto; background-position: 50% 0; mix-blend-mode: normal; opacity: 1; }
html.tex-flat .pp-tex .t-sc2, html.tex-flat .pp-tex .t-dt, html.tex-flat .pp-tex .t-ns { display: none; }
/* красные плашки с рваным краем (фильтр #cut) — своим слоем: буквы главы меняются поверх, а край заново не считается */
html.tex-flat.grit .hh-text p.hh-lead::before, html.tex-flat.grit .hall .mbx-lead::before { will-change: transform; }
/* клетки портфолио: зерно кадра и сколы на словах — плитками (poster.js ставит их вместо SVG-фильтров, когда у <html> есть tex-flat).
   Зерно — непрозрачное серое под то же наложение overlay; сколы — маска, цвет бумаги даёт фон */
.pp-gr-i { background: url(assets/tex/m/grain-2x.webp) 0 0 / 192px 192px; }
@media (-webkit-min-device-pixel-ratio: 2.5), (min-resolution: 2.5dppx) { .pp-gr-i { background-image: url(assets/tex/m/grain-3x.webp); } }
.pp-worn-i { background-color: var(--pp-red); -webkit-mask: url(assets/tex/m/worn0.webp) 0 0 / 384px 384px; mask: url(assets/tex/m/worn0.webp) 0 0 / 384px 384px; }
.pp-worn-i.pp-w1 { -webkit-mask-image: url(assets/tex/m/worn1.webp); mask-image: url(assets/tex/m/worn1.webp); }
.pp-worn-i.pp-w2 { -webkit-mask-image: url(assets/tex/m/worn2.webp); mask-image: url(assets/tex/m/worn2.webp); }
.pp-worn-i.pp-w3 { -webkit-mask-image: url(assets/tex/m/worn3.webp); mask-image: url(assets/tex/m/worn3.webp); }
