/* Лаб 2 · реф mateca.agency — весь сайт в тёмном стекле
   Чёрный фон, гигантское имя (Anton) с «металлическим» градиентом, свет ведёт курсор (lab2.js).
   Всё едет поверх имени: плашки — стекло с градиентом и backdrop-blur.
   Версия плашек кейсов — класс на <html>: .v1 рамка, .v2 плашка из Figma (Основа, 2965:6596).
   Меню, шоты, лайтбокс, ленивые видео и появление — /assets/app.js основного сайта. */
:root {
  --bg: #000; --ink: #fff; --muted: rgba(255,255,255,.5); --line: rgba(255,255,255,.1);
  --house: cubic-bezier(.22,1,.36,1); --exit: cubic-bezier(.55,0,.55,.2);
  --standard: cubic-bezier(.2,0,0,1); --spring: cubic-bezier(.22,1,.36,1);
  --pad: 32px; --col: 960px;
  /* стекло: градиент сверху-слева светлее, тонкая обводка, блик по верхнему краю */
  --glass: linear-gradient(140deg, rgba(255,255,255,.10), rgba(255,255,255,.03) 45%, rgba(255,255,255,.015));
  --glass-hover: linear-gradient(140deg, rgba(255,255,255,.14), rgba(255,255,255,.05) 45%, rgba(255,255,255,.025));
  --glass-blur: blur(22px);   /* легче для Safari: большой радиус и saturate пересчитываются на каждом кадре скролла */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.4 Inter, 'Inter Fallback', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
.wrap { width: min(var(--col), 100% - 2 * var(--pad)); margin: 0 auto; }

.glass { background: var(--glass); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }

/* шапка основного сайта в тёмном: стекло с плавным размытием у края, колонка 708px — keep in sync с assets/style.css (.hdr, .edge, .me, .seg, .hc) */
:root { --hdr: 64px; --hcol: 708px; }
.hdr { position: fixed; inset: 0 0 auto; z-index: 30; height: var(--hdr); }
.hdr-in { position: relative; z-index: 2; height: 100%; width: min(var(--hcol), 100% - 40px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.edge { position: absolute; inset: 0 0 -28px; pointer-events: none; }
.edge i { position: absolute; inset: 0; }
.edge i:nth-child(1) { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); -webkit-mask: linear-gradient(#000 70%, transparent); mask: linear-gradient(#000 70%, transparent); }
.edge i:nth-child(2) { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); -webkit-mask: linear-gradient(#000 50%, transparent 80%); mask: linear-gradient(#000 50%, transparent 80%); }
.edge i:nth-child(3) { -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.4) 60%, rgba(0,0,0,0)); -webkit-mask: linear-gradient(#000 40%, transparent); mask: linear-gradient(#000 40%, transparent); }
.me { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; }
.me img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.hdr-r { display: flex; align-items: center; gap: 14px; font-size: 16px; }
.link-op { color: var(--muted); transition: color .18s var(--standard); }
.link-op:hover { color: #fff; }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 13px; font-weight: 600; }
.seg a { position: relative; z-index: 1; width: 38px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--muted); transition: color .18s var(--standard); }
.seg a.on { color: #fff; }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 38px; border-radius: 7px; background: rgba(255,255,255,.2); transition: transform .4s var(--spring); }
.seg.flip .seg-thumb { transform: translateX(38px); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 15px; border-radius: 22px; font-weight: 500; font-size: 16px; letter-spacing: -.015em; }
.btn-dark { background: #fff; color: #000; transition: background .18s, transform .18s var(--spring); }
.btn-dark:hover { background: #e6e6e6; }
.press:active { transform: scale(.96); }
.hc { position: relative; }
.hc-pop { position: absolute; top: 100%; right: 0; padding-top: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.hc-b { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 20px; white-space: nowrap; background: rgba(30,30,34,.9); color: #fff; font-size: 15px; font-weight: 500;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 8px 24px rgba(0,0,0,.5); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(-6px) scale(.96); transform-origin: top right; transition: opacity .3s var(--exit), transform .3s var(--exit), background-color .18s; }
.hc-b:first-child { border-top-right-radius: 6px; }
.hc-b:hover { background: rgba(50,50,56,.95); }
.hc.open .hc-pop { pointer-events: auto; }
.hc.open .hc-b { opacity: 1; transform: none; transition: opacity .4s var(--house), transform .78s var(--house), background-color .18s; }
.hc.open .hc-b:nth-child(2) { transition-delay: .07s, .07s, 0s; }
@media (hover: hover) {
  .hc:hover .hc-pop { pointer-events: auto; }
  .hc:hover .hc-b { opacity: 1; transform: none; transition: opacity .4s var(--house), transform .78s var(--house), background-color .18s; }
  .hc:hover .hc-b:nth-child(2) { transition-delay: .07s, .07s, 0s; }
}

/* имя стоит на месте, всё едет поверх */
.name { position: fixed; z-index: 0; left: 0; right: 0; top: 50%; transform: translateY(calc(-58% - var(--name-up, 0px)));   /* --name-up пишет lab2.js nameLift(): имя не заходит на текст первого экрана */
  pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.anton-ok .name { opacity: 1; }   /* класс ставит lab2.js, когда Anton загружен: до этого имя рисовалось запасным шрифтом, растянутым на всю ширину */
.name svg { display: block; width: 100%; height: auto; overflow: visible; }

/* первый экран */
.hero { position: relative; z-index: 2; height: 100svh; display: flex; align-items: flex-end; padding: 0 0 40px; }
@media (min-width: 821px) {   /* правка дизайн-директора 24.11: имя и текст о себе выше — keep in sync с lab2.js nameLift (NAME_TOP) */
  .name { top: 42%; }
  .hero { padding-bottom: clamp(40px, 13vh, 150px); }
}
.hero-in { width: min(var(--hcol), 100% - 40px); margin: 0 auto; }   /* та же колонка, что у шапки */
.about small { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,.18); }
.about p { font-size: 24px; line-height: 1.22; letter-spacing: -.01em; }
.nums { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 28px; width: max-content; max-width: calc(100vw - 2 * var(--pad)); }
.nums b { display: block; font-size: 26px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; }
.nums s { color: rgba(255,255,255,.3); text-decoration-thickness: 2px; font-weight: 600; }
.nums span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); max-width: 270px; }   /* длинные подписи — в две строки, а не в одну длинную */
.fade { will-change: opacity; }
.down { position: absolute; left: 50%; bottom: 36px; width: 18px; height: 18px; margin-left: -9px; border-right: 1.5px solid rgba(255,255,255,.5); border-bottom: 1.5px solid rgba(255,255,255,.5); transform: rotate(45deg) scale(.6); }

/* кнопки: старт внизу справа, едут со страницей и залипают у верха (lab2.js) */
.pill { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 24px; border-radius: 99px; font-size: 16px; background: rgba(40,40,44,.72); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: background .3s, transform .3s var(--house); }
.pill:hover { background: rgba(60,60,66,.8); }
.pill.w { background: #fff; color: #000; }
.pill.w:hover { background: #e9e9e9; }
.pill:active { transform: scale(.97); }
.pill i { font-size: 18px; }

/* разделы */
main { position: relative; z-index: 3; }
[data-name] { scroll-margin-top: calc(var(--hdr) + 16px); }
.sec { padding-top: 140px; }
.h2 { font-size: 36px; line-height: 1.05; font-weight: 600; letter-spacing: -.03em; margin-bottom: 28px; }

/* ── кейсы: по одному, просто листаются ── */
.work { display: flex; flex-direction: column; align-items: center; gap: 72px; padding: 8vh var(--pad) 0; }
.case { display: block; color: inherit; }
.media { position: relative; overflow: hidden; background: rgba(255,255,255,.04); }
.media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* v1: стеклянная рамка, видео с отступом 12px, подпись снизу, теги справа */
.v1 .case { width: min(var(--col), 100%); padding: 12px; border-radius: 32px; background: var(--glass); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); transition: border-color .4s; }
.v1 .case:hover { background: var(--glass-hover); border-color: rgba(255,255,255,.18); }
.v1 .media { aspect-ratio: 16 / 9; border-radius: 22px; }
.v1 .chip, .v1 .count { display: none; }
.v1 .body { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; padding: 20px 12px 10px; }
.v1 .body h3 { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.015em; }
.v1 .body p { grid-column: 1; color: var(--muted); font-size: 16px; line-height: 1.4; }
.v1 .tags { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; align-self: start; }
.tags li { font-size: 12px; line-height: 26px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); color: rgba(255,255,255,.7); white-space: nowrap; }

/* v2: плашка из Figma — 673×566, углы 100 со сглаживанием, заливка #D9D9D9 1% + blur 179 (CSS ≈ 89.5px),
   медиа сверху 365 из 566, чипы rgba(217,217,217,.1) радиус 50, текст по центру, счётчик.
   Единица --u = 1 пиксель макета от ширины плашки (cqw). */
.v2 .case { --w: min(880px, 100vw - 2 * var(--pad)); --cu: calc(var(--w) / 673);
  position: relative; display: flex; flex-direction: column; width: var(--w); aspect-ratio: 673 / 566; overflow: hidden; container-type: inline-size;
  border-radius: calc(64 * var(--cu)); background: rgba(217,217,217,.01);
  -webkit-backdrop-filter: blur(89.5px); backdrop-filter: blur(89.5px); transition: background .5s var(--house); }
@supports (corner-shape: squircle) { .v2 .case { border-radius: calc(100 * var(--cu)); corner-shape: squircle; } }
.v2 .case:hover { background: rgba(217,217,217,.05); }
.v2 .case > * { --u: calc(100cqw / 673); }
.v2 .media { width: 100%; aspect-ratio: 673 / 365; flex: none; border-radius: calc(50 * var(--u)) calc(50 * var(--u)) 0 0; }
.v2 .chip { position: absolute; top: calc(25 * var(--u)); padding: calc(10 * var(--u)); border-radius: 50px;
  background: rgba(24,24,26,.32); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: calc(11 * var(--u)); line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; }
.v2 .chip span { opacity: .85; }   /* в макете .4 на сером фото; на светлом видео не читается */
.v2 .chip.l { left: calc(25 * var(--u)); }
.v2 .chip.r { right: calc(25 * var(--u)); }
.v2 .body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.v2 .tags { display: none; }
.v2 .body h3 { margin-top: calc(44 * var(--u)); width: calc(533 * var(--u)); font-size: calc(25 * var(--u)); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.v2 .body p { margin-top: calc(12 * var(--u)); width: calc(533 * var(--u)); font-size: calc(14 * var(--u)); line-height: 1.3; letter-spacing: .01em; }
.v2 .count { margin-top: auto; margin-bottom: calc(30 * var(--u)); font-size: calc(11 * var(--u)); line-height: 1.2; opacity: .4; }

/* ── ещё проекты: стеклянные плитки 2×2 ── */
.mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mp { display: flex; flex-direction: column; gap: 14px; padding: 10px 10px 16px; border-radius: 26px; transition: border-color .4s; }
.mp:hover { background: var(--glass-hover); border-color: rgba(255,255,255,.18); }
.mp-m { display: block; aspect-ratio: 16 / 10.5; border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.04); }
.mp-m video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--spring); }
.mp:hover .mp-m video { transform: scale(1.03); }
.mp-tx { padding: 0 8px; }
.mp-tx b { display: block; font-weight: 600; font-size: 17px; letter-spacing: -.015em; }
.mp-tx span { display: block; margin-top: 3px; font-size: 15px; color: var(--muted); }

/* ── как я работаю: блок в колонке → по клику растёт вширь (размер пишет lab2.js пружиной), внутри схема board.js ── */
.proc { position: relative; width: min(var(--col), 100% - 2 * var(--pad)); margin: 0 auto; border-radius: 32px; padding: 34px 36px 36px; overflow: clip; transition: box-shadow .6s; }
.proc.ai { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 1px rgba(95,227,154,.14), 0 0 140px rgba(95,227,154,.05); }
/* переключатель и «свернуть»: липкая строка нулевой высоты — при длинной схеме едут вместе с экраном (overflow: clip, не hidden, иначе sticky не работает) */
.proc-ctl { position: sticky; top: 100px; z-index: 6; height: 0; }   /* ниже размытого края шапки (64 + 28) */
.proc:not(.open) .proc-ctl { position: relative; top: 0; }   /* липнет только раскрытая схема, в свёрнутом блоке стоит в углу */
.proc-ctl-in { position: absolute; top: 0; right: 0; display: flex; align-items: center; gap: 8px; }
.proc-ctl .pb-sw { background: #1f1f23; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.proc-x { width: 46px; height: 46px; border-radius: 14px; display: none; align-items: center; justify-content: center; font-size: 20px; background: #1f1f23; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: background .2s; }
.proc-x:hover { background: #2c2c31; }
.proc.open .proc-x { display: flex; }
.proc-head { padding-right: 250px; }
.proc-head .h2 { margin-bottom: 0; }
.proc-head p { margin-top: 12px; max-width: 520px; color: var(--muted); font-size: 16px; line-height: 1.45; }

/* мини-схема: этапы со стрелками; наведение — столбик этапа */
.proc-mini { position: relative; margin-top: 32px; transition: opacity .3s var(--exit); }
.pm { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 0; }
.pm li { position: relative; display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 13px; border-radius: 13px; background: rgba(255,255,255,.07); border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .25s, border-color .25s; }
.pm li:hover, .pm li.on { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.pm li + li { margin-left: 24px; }
.pm li + li::before { content: "\ea6c"; font: 16px/1 remixicon; font-weight: 400; position: absolute; left: -20px; color: rgba(255,255,255,.35); }   /* ri-arrow-right-line */
.pm b { display: none; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 500; color: #5FE39A; }
.proc.ai .pm b { display: inline-flex; }
.pm-pop { position: fixed; z-index: 45; top: 0; left: 0; width: 300px; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .25s var(--exit), transform .3s var(--exit); }
.pm-pop.on { pointer-events: auto; opacity: 1; transform: none; transition: opacity .35s var(--house), transform .6s var(--house); }
.pm-pop .pb-l { position: static; width: 100%; overflow-y: auto; scrollbar-width: none; background: rgba(28,28,32,.94); box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.pm-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }   /* мостик: курсор не теряет карточку по пути от этапа */
.pm-pop.up::before { top: auto; bottom: -14px; }
.pm-more { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 16px; border-top: 1px solid rgba(255,255,255,.06);
  font-size: 15px; color: rgba(255,255,255,.6); cursor: pointer; transition: background .2s, color .2s; }
.pm-more:hover { background: rgba(255,255,255,.06); color: #fff; }
.pm-more i { font-size: 17px; }
.proc-open { display: flex; margin: 30px auto 0; height: 48px; font-size: 15px; }
.proc-open i { font-size: 18px; }

/* раскрытие и закрытие */
.proc-full { display: none; margin-top: 28px; transition: opacity .22s var(--exit); }
.proc.open .proc-full { display: block; }
.proc.open .proc-mini { position: absolute; left: 36px; right: 36px; opacity: 0; pointer-events: none; transition: none; }
.proc.fading .proc-full { opacity: 0; }
.proc.mini-wait .proc-mini { opacity: 0; transition: none; }
.proc.mini-in .proc-mini { opacity: 1; transition: opacity .5s var(--house) .12s; }

/* ── опыт: одна стеклянная плашка со строками ── */
.exp { border-radius: 26px; padding: 6px; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 20px; transition: background .25s var(--standard); }
.row:hover { background: rgba(255,255,255,.06); }
.exp li + li .row { box-shadow: 0 -1px 0 rgba(255,255,255,.06); }
.row img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; background: #fff; }
.row-tx { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-tx b { font-weight: 600; font-size: 16px; }
.row-tx span { font-size: 14px; color: var(--muted); }
.row-r { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row i { font-size: 18px; color: rgba(255,255,255,.35); transition: color .25s, transform .3s var(--spring); }
.row:hover i { color: #fff; transform: translate(2px, -2px); }

/* ── UI-шоты: лента (дрейф и перетаскивание — lab2.js, лайтбокс — app.js) ── */
.rib { overflow: hidden; display: grid; gap: 12px; padding: 6px 0; }
.rib-row { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.rib-row.grab { cursor: grabbing; }
.rib-row.grab .shot-c { pointer-events: none; }
.rib-track { display: flex; gap: 12px; width: max-content; will-change: transform; }
.shot-c img { pointer-events: none; -webkit-user-drag: none; }
.rib .shot-c { scale: var(--s, 1); border-radius: calc(var(--rr, 18px) + var(--hr)); }   /* ряд: --s и --rr пишет lab2.js от скорости; наведение: --hr */
@property --hr { syntax: '<length>'; inherits: false; initial-value: 0px; }
.rib .shot-c { transition: transform .32s var(--spring), --hr .5s var(--house); }
.rib .shot-c:hover { --hr: 14px; }   /* тактильность: при перетаскивании и броске шоты чуть сжимаются к своему центру (lab2.js) */
.shot-c { flex: none; width: clamp(180px, 19vw, 280px); aspect-ratio: 900 / 1257; border-radius: 18px; overflow: hidden; background: #111; cursor: inherit; transition: transform .32s var(--spring); }
.shot-c img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-c:hover { transform: scale(1.025); }
.shot-c:active { transform: scale(.97); }
.shot-c.ghost { visibility: hidden; }
.shots-cap { display: flex; justify-content: flex-end; margin-top: 14px; }
.shots-cap:not(:has(.rib-edit:not([hidden]))) { display: none; }
.rib-edit { white-space: nowrap; height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: #fff; font-size: 13px; transition: background .2s; }
.rib-edit:hover { background: rgba(255,255,255,.12); }

/* редактор ленты (локалка): три зоны — ряд 1, ряд 2, скрытые */
.ed2 { position: fixed; inset: 0; z-index: 80; background: rgba(8,8,10,.94); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); display: flex; flex-direction: column; }
.ed2-bar { display: flex; align-items: center; gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--line); font-size: 15px; }
.ed2-hint { color: var(--muted); font-size: 13px; }
.ed2-sp { flex: 1; }
.ed2-bar button { height: 38px; padding: 0 18px; border-radius: 99px; background: rgba(255,255,255,.08); font-size: 14px; }
.ed2-bar .ed2-save { background: #fff; color: #000; font-weight: 600; }
.ed2-body { flex: 1; overflow: auto; padding: 8px 28px 40px; }
.ed2 h4 { margin: 22px 0 10px; font-size: 14px; font-weight: 600; }
.ed2 h4 i { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 6px; }
.ed2-zone { display: flex; flex-wrap: wrap; gap: 8px; min-height: 120px; padding: 8px; border-radius: 16px; border: 1px dashed rgba(255,255,255,.14); }
.ed2-t { width: 96px; cursor: grab; border-radius: 10px; padding: 3px; transition: opacity .2s, transform .2s; }
.ed2-t img { width: 100%; aspect-ratio: 900 / 1257; object-fit: cover; border-radius: 8px; display: block; pointer-events: none; }
.ed2-t span { display: block; margin-top: 4px; font-size: 10px; line-height: 1.2; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed2-t:hover { background: rgba(255,255,255,.08); }
.ed2-t.drag { opacity: .3; }
.ed2-hid .ed2-t img { opacity: .35; filter: grayscale(1); }

.lb { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.lb.on { pointer-events: auto; cursor: zoom-out; }
.lb-bg { position: absolute; inset: 0; background: rgba(0,0,0,.72); -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); opacity: 0; transition: opacity .32s var(--standard); }
.lb.on .lb-bg { opacity: 1; }
.lb-img { position: absolute; left: 0; top: 0; width: auto; max-width: none; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); transform-origin: 0 0; opacity: 0; will-change: transform; }

/* ── финал: отдельный экран, плашка по центру поверх имени — шоты уехали, остаётся призыв ── */
.fin { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 110px var(--pad); margin-top: 60px; }
.end { width: min(760px, 100%); translate: 0 var(--fin-dy, 0px); border-radius: 36px; padding: 64px 48px 56px; text-align: center; }
.end h2 { font-size: 56px; line-height: 1.02; letter-spacing: -.035em; font-weight: 600; }
.end p { margin-top: 18px; color: var(--muted); font-size: 16px; }
.end-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
/* подвал прижат к низу финального экрана, строка на одной линии с центром таблетки (низ 20 + 48/2 = 44px) — keep in sync с .jm bottom */
.foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 16px; padding-bottom: 34px; line-height: 20px; font-size: 14px; color: var(--muted); }
.foot a:hover { color: #fff; }

/* появление (app.js добавляет .in) */
.rise { opacity: 0; transform: translateY(40px); transition: opacity .78s var(--house), transform .78s var(--house); }
.rise.in { opacity: 1; transform: none; }

/* ── меню-таблетка основного сайта, тёмное стекло. Размер и радиус пишет app.js пружиной ── */
.jm { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%);
  width: 96px; height: 48px; border-radius: 48px; overflow: hidden; color: #fff;
  background-color: rgba(30,30,34,.62) !important;   /* app.js красит фон в белый — на тёмном сайте держим своё стекло */
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--standard); }
.jm.show { opacity: 1; pointer-events: auto; }
.jm.open { background-color: rgba(30,30,34,.82) !important; }
.jm-closed { position: absolute; left: 0; top: 0; width: 100%; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 20px; border-radius: 48px; white-space: nowrap; font-size: 16px; font-weight: 500; transition: opacity .15s var(--standard); }
.jm-label { flex: 1; text-align: left; display: inline-block; transition: opacity .2s var(--standard), filter .2s var(--standard); }
.jm-label.swap { opacity: 0; filter: blur(3px); }
.jm-plus { flex: none; width: 28px; height: 28px; margin-right: -4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(255,255,255,.1); }
.jm-open { position: absolute; left: 0; top: 0; width: 360px; padding: 26px 24px 24px; opacity: 0; visibility: hidden; transition: opacity .2s var(--standard); }
.jm.open .jm-closed { opacity: 0; pointer-events: none; }
.jm.open .jm-open { opacity: 1; visibility: visible; transition: opacity .32s var(--spring) .08s; }
.jm-top { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 18px; font-size: 16px; font-weight: 500; }
.jm-x { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(255,255,255,.1); transition: background .18s; }
.jm-x:hover { background: rgba(255,255,255,.18); }
.al { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.al-chip { margin: 6px 0 2px; padding: 3px 11px; border-radius: 20px; background: rgba(120,140,170,.35); color: #fff; font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; }
.al-card { width: 100%; border-radius: 18px; background: rgba(255,255,255,.07); padding: 14px 16px; display: flex; align-items: center; gap: 12px; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); transition: transform .18s var(--standard), background .18s; }
.al-card:hover { background: rgba(255,255,255,.11); }
.al-card:active { transform: scale(.98); }
.al-card > div { flex: 1; min-width: 0; }
.al-card time { display: block; font: 11.5px/1.3 ui-monospace, "SF Mono", Menlo, monospace; color: rgba(255,255,255,.4); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-card strong { display: block; font-weight: 500; font-size: 16px; line-height: 1.2; }
.al-card > img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; }
.al-dots { width: 48px; height: 48px; flex: none; background: radial-gradient(circle, #fff 1.6px, transparent 2px) 0 0/12px 12px;
  -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px, #000 20px, transparent 21px); mask: radial-gradient(circle, transparent 9px, #000 10px, #000 20px, transparent 21px); }

.ed-bar { display: none; }   /* режим правки основного сайта здесь не нужен */

@media (max-width: 820px) {
  :root { --pad: 16px; }
  .hero { padding-bottom: 32px; }
  .me span { display: none; }
  .hide-s { display: none; }
  .about p { font-size: 19px; }
  .nums { gap: 12px 24px; }
  .nums b { font-size: 22px; }
  .work { gap: 40px; }
  .v1 .body { grid-template-columns: 1fr; }
  .v1 .tags { grid-column: 1; grid-row: auto; order: -1; flex-wrap: wrap; }
  .v1 .body h3 { font-size: 21px; }
  .v2 .case { aspect-ratio: auto; }
  .v2 .chip, .v2 .count { font-size: max(11px, calc(11 * var(--u))); padding: 8px 10px; }
  .v2 .body h3 { font-size: max(20px, calc(25 * var(--u))); width: auto; padding: 0 20px; margin-top: 24px; }
  .v2 .body p { font-size: max(14px, calc(14 * var(--u))); width: auto; padding: 0 20px; }
  .v2 .count { margin: 24px 0 20px; }
  .sec { padding-top: 96px; }
  .h2 { font-size: 28px; }
  .mp-grid { grid-template-columns: 1fr; }
  .proc { padding: 24px 20px; border-radius: 26px; display: flex; flex-direction: column; }
  .proc-head { order: 1; padding-right: 0; }
  .proc-ctl { order: 2; position: static; height: auto; margin-top: 18px; }
  .proc-ctl-in { position: static; }
  .proc-mini { order: 3; } .proc-full { order: 4; }
  .proc.open .proc-mini { left: 20px; right: 20px; }
  .proc .proc-full { margin-left: -20px; margin-right: -20px; }
  .pm { gap: 8px; }
  .pm li + li { margin-left: 0; }
  .pm li + li::before { display: none; }   /* на узком экране стрелки попадают в начало строки — убираем */
  .pm-pop { display: none; }
  .shot-c { width: 216px; }
  .end { padding: 40px 20px; }
  .end h2 { font-size: 34px; }
  .fin { padding-bottom: 150px; }
  .foot { flex-direction: column; gap: 4px; padding-bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; transition: none; } }

/* полоса «где я на карте» (board.js) на телефоне держится над меню-таблеткой, пока листаешь схему */
.proc .pb-bar { position: sticky; z-index: 5; bottom: calc(84px + env(safe-area-inset-bottom)); margin: 14px 24px 0; height: 5px;
  background: rgba(255,255,255,.14); box-shadow: 0 0 0 4px rgba(0,0,0,.35); }

/* видео проявляются только прозрачностью, когда первый кадр готов (lab2.js .vis) */
.case .media video, .mp-m video { opacity: 0; transition: opacity .9s cubic-bezier(.22,1,.36,1); }
.case .media video.vis, .mp-m video.vis { opacity: 1; }

/* Safari: видео без анимации прозрачности (на ней Safari на миг рисует видео в натуральном размере — «прыжок» в 3–4 раза); виден постер, потом кадры */
.is-safari .case .media video, .is-safari .mp-m video { opacity: 1; transition: none; }
.is-safari .case .media, .is-safari .mp-m { transform: translateZ(0); isolation: isolate; }

/* телефон: на первом экране имя по центру и текст о себе внизу; цифры — стеклянной плашкой сразу под первым экраном */
@media (max-width: 820px) {
  .hero { margin-bottom: 300px; }
  .hero .nums { position: absolute; top: 100%; left: 16px; right: 16px; width: auto; max-width: none; margin-top: 12px; display: grid; gap: 18px; padding: 22px 20px;
    border-radius: 26px; background: var(--glass); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
  .hero .nums span { max-width: none; }
  .work { padding-top: 0; }
}
/* Safari: блоки не «проявляются» — он не успевает показать анимацию на стекле, и контент выскакивал рывком. Просто стоят на месте. */
.is-safari .rise { opacity: 1; transform: none; transition: none; }
