:root {
  --ink: #0a0a0b;
  --steel-1: #2b2c2f;
  --steel-2: #17181a;
  --text: #ece9e2;
  --muted: #8d8b86;
  --amber: #ffb547;
  --glow: #ffffff;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --brushed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .012' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--ink); color-scheme: dark; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: 'Inter Tight', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }

/* ---------- Сцена ---------- */
#track { height: 320vh; height: 320svh; }
#stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: #000;
}
#wall {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: clamp(16px, 3vh, 40px) clamp(16px, 3vw, 48px);
  background: var(--brushed), linear-gradient(180deg, #1d1e20, #0e0e10 70%, #09090a);
  transform: scale(var(--wall-scale, .92));
  transform-origin: 50% 50%;
  will-change: transform;
}
#spot {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 45% at 50% 0%, rgba(255, 244, 225, .2), transparent 70%);
}
#ambient {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 70% at 50% 50%, var(--glow), transparent 72%);
  opacity: var(--ambient, 0);
  transition: opacity .6s var(--ease), background .4s;
}
#dim {
  position: absolute; inset: 0; pointer-events: none;
  background: #000;
  opacity: var(--dim, 0);
  mix-blend-mode: multiply;
}

/* ---------- Панель ---------- */
#panel {
  position: relative; z-index: 2;
  width: min(100%, 1240px);
  display: flex; flex-direction: column;
  gap: clamp(10px, 2vh, 22px);
  max-height: 100%;
  opacity: var(--panel, 0);
  pointer-events: none;
}
body.ready #panel { pointer-events: auto; }

#display {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: clamp(10px, 1.4vw, 20px);
  padding: 10px 16px;
  background: #050505;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 2px 12px #000;
  font-family: 'Inter Tight', system-ui, sans-serif;
  color: var(--amber);
  text-shadow: 0 0 12px color-mix(in srgb, var(--amber) 60%, transparent);
}
#floorNo { font-size: clamp(20px, 2.2vw, 30px); }
#floorName { font-size: clamp(14px, 1.4vw, 18px); white-space: nowrap; }
#floorKind {
  justify-self: end; text-align: right;
  font-size: clamp(11px, 1vw, 13px);
  opacity: .7;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0;
}

#floors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 1.3vw, 18px);
}
.floor {
  --lit: 0;
  position: relative; display: block; padding: 0;
  aspect-ratio: 16 / 9;
  border-radius: clamp(8px, 1vw, 14px);
  background: #000;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .1),
    0 0 0 calc(var(--lit) * 2px) var(--c),
    0 0 calc(var(--lit) * 34px) calc(var(--lit) * -4px) var(--c),
    0 10px 24px rgba(0, 0, 0, .55);
  transition: transform .5s var(--ease), box-shadow .35s;
}
.floor img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
  filter: brightness(calc(.14 + var(--lit) * .66)) saturate(calc(.2 + var(--lit) * .7));
  transition: filter .35s;
}
.floor::after { /* стекло кнопки */
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), transparent 34%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 0 26px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.floor .no {
  position: absolute; z-index: 1; right: 8px; bottom: 8px;
  min-width: 26px; padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .72);
  font: 500 11px 'Inter Tight', system-ui, sans-serif;
  color: #fff;
  opacity: calc(.35 + var(--lit) * .65);
}
.floor:hover, .floor:focus-visible, .floor.on {
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 0 0 2px var(--c),
    0 0 60px 2px var(--c),
    0 14px 30px rgba(0, 0, 0, .6);
}
.floor:hover img, .floor:focus-visible img, .floor.on img { filter: brightness(1.06) saturate(1.05); }
.floor:active, .floor.pressed { transform: translateY(1px) scale(.975); transition-duration: .08s; }

#service { display: flex; gap: clamp(8px, 1.3vw, 18px); justify-content: center; }
.svc {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 20px 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2c2d30, #17181a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 1px rgba(255, 255, 255, .07), 0 6px 14px rgba(0, 0, 0, .5);
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.svc i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}
.svc:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 1px var(--amber), 0 0 22px -6px var(--amber); }
.svc:active { transform: translateY(1px) scale(.98); }

/* ---------- Двери ---------- */
.door {
  position: absolute; top: 0; bottom: 0; width: 50.2%;
  z-index: 5;
  background: var(--brushed), linear-gradient(90deg, var(--steel-1), var(--steel-2));
  will-change: transform;
}
.door.left {
  left: 0;
  transform: translateX(calc(var(--open, 0) * -100%));
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .22), 12px 0 50px rgba(0, 0, 0, .85);
}
.door.right {
  right: 0;
  transform: translateX(calc(var(--open, 0) * 100%));
  background: var(--brushed), linear-gradient(270deg, var(--steel-1), var(--steel-2));
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, .22), -12px 0 50px rgba(0, 0, 0, .85);
}
.plate {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .35em;
}
.door.left .plate { right: clamp(14px, 2vw, 32px); text-align: right; }
.door.right .plate { left: clamp(14px, 2vw, 32px); }
.plate strong {
  font-size: clamp(30px, 6.8vw, 112px);
  font-weight: 600; line-height: .95; letter-spacing: -.035em;
  color: transparent;
  background: linear-gradient(180deg, #f3f1eb, #8a8a88);
  -webkit-background-clip: text; background-clip: text;
}
.plate span { font-size: clamp(11px, 1.05vw, 15px); color: var(--muted); }

#seam {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; z-index: 6;
  background: rgba(255, 255, 255, .25);
  opacity: calc(1 - var(--open, 0) * 12);
  pointer-events: none;
}
#hint {
  position: absolute; z-index: 7; left: 0; right: 0; bottom: clamp(24px, 6vh, 56px);
  text-align: center; font-size: 13px; color: #d6d3cc;
  opacity: calc(1 - var(--open, 0) * 5);
  pointer-events: none;
  animation: nudge 2.2s ease-in-out infinite;
}
@keyframes nudge { 50% { translate: 0 6px; } }

/* ---------- Вспышка ---------- */
#flash {
  position: fixed; inset: 0; z-index: 30;
  pointer-events: none;
  visibility: hidden;
}

/* ---------- Кейс ---------- */
#case {
  position: fixed; inset: 0; z-index: 20;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ground, #000);
}
#case[hidden] { display: none; }
#caseBar {
  position: sticky; top: 0; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 10px clamp(12px, 2vw, 24px);
  background: rgba(8, 8, 9, .82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: #fff;
  font-size: 14px;
}
#toPanel { justify-self: start; min-height: 44px; font-weight: 500; }
#toPanel::before { content: '←  '; }
#caseTitle { font-weight: 600; }
#caseFloor { justify-self: end; font: 500 13px 'Inter Tight', system-ui, sans-serif; color: var(--amber); }
#slides { display: flex; flex-direction: column; gap: clamp(6px, 1vw, 14px); }
#slides > img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: rgba(127, 127, 127, .08);
  opacity: 0; transform: translateY(36px);
  transition: opacity .9s var(--ease), transform 1.1s var(--ease);
}
#slides > img.in { opacity: 1; transform: none; }
#caseEnd {
  display: grid; place-items: center;
  padding: clamp(48px, 10vh, 120px) 16px;
}
#nextFloor {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 44px;
  color: var(--end-ink, #fff);
  font-size: 14px;
}
#nextFloor b {
  font-size: clamp(36px, 8vw, 120px); font-weight: 600; letter-spacing: -.03em; line-height: 1;
  transition: color .3s;
}
#nextFloor:hover b { color: var(--c); }

/* ---------- Переезд между этажами ---------- */
#transit { position: fixed; inset: 0; z-index: 25; background: #000; }
#transit[hidden] { display: none; }
#transit .door { --open: 0; z-index: 1; transition: transform .75s cubic-bezier(.76, 0, .24, 1); }
#transit.open .door.left { transform: translateX(-100%); }
#transit.open .door.right { transform: translateX(100%); }
#transit.shut .door { transform: translateX(0); }
#transitNo {
  position: absolute; z-index: 2; top: 50%; left: 50%;
  translate: -50% -50%;
  padding: 10px 18px; border-radius: 6px;
  background: #050505;
  font: 500 clamp(28px, 4vw, 48px) 'Inter Tight', system-ui, sans-serif;
  color: var(--amber);
  text-shadow: 0 0 14px var(--amber);
}

/* ---------- Окно «обо мне» и контакты ---------- */
dialog {
  margin: auto;
  width: min(92vw, 640px);
  padding: clamp(24px, 4vw, 44px);
  border: 0; border-radius: 16px;
  background: linear-gradient(180deg, #232427, #121315);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 30px 80px #000;
}
dialog::backdrop { background: rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin-bottom: 20px; }
dialog p { font-size: 16px; line-height: 1.5; margin-bottom: 14px; color: #cfccc5; }
dialog a { display: block; color: var(--text); font-size: clamp(18px, 3vw, 24px); font-weight: 500; padding: 8px 0; text-underline-offset: 4px; overflow-wrap: anywhere; }
#sheetClose { float: right; min-height: 44px; margin: -10px -6px 0 12px; color: var(--muted); font-size: 14px; }
#sheetClose:hover { color: var(--text); }
.tag { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--amber); font-size: 14px; }
.tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }

/* ---------- Телефон ---------- */
@media (max-width: 720px) {
  #floors { grid-template-columns: repeat(2, 1fr); }
  #display { grid-template-columns: auto 1fr; padding: 8px 12px; }
  #floorKind { display: none; }
  .svc { padding: 8px 14px 8px 10px; font-size: 13px; gap: 8px; }
  #service { gap: 6px; }
  .door.left .plate, .door.right .plate { top: 50%; }
}

/* На сенсорных экранах нет наведения, поэтому кнопки горят ярче */
@media (hover: none) {
  .floor img { filter: brightness(calc(.14 + var(--lit) * .9)) saturate(calc(.2 + var(--lit) * .85)); }
}

/* ---------- Если посетитель отключил анимации ---------- */
@media (prefers-reduced-motion: reduce) {
  #track { height: 100vh; height: 100svh; }
  .door, #seam, #hint { display: none; }
  #wall { transform: none; }
  #panel { opacity: 1; pointer-events: auto; }
  .floor { --lit: 1 !important; transition: none; }
  #slides img { opacity: 1; transform: none; transition: none; }
  #hint { animation: none; }
}

/* ---------- 3D-режим: сцену рисует WebGL, а настоящие кнопки невидимо лежат поверх ---------- */
#gl { position: absolute; inset: 0; z-index: 0; visibility: hidden; }
#gl canvas { display: block; width: 100%; height: 100%; }
body.has3d #gl { visibility: visible; }
body.has3d #stage > .door, body.has3d #seam { display: none; }
body.has3d #wall { background: none; transform: none; padding: 0; display: block; z-index: 1; }
body.has3d #spot, body.has3d #ambient, body.has3d #dim { display: none; }
body.has3d #panel { position: absolute; inset: 0; display: block; width: 100%; max-height: none; opacity: 1; }
body.has3d #display {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); box-shadow: none; background: none;
}
body.has3d #floors, body.has3d #service { display: block; position: absolute; inset: 0; pointer-events: none; }
body.has3d .floor, body.has3d .svc {
  position: absolute; left: 0; top: 0; padding: 0; min-height: 0;
  aspect-ratio: auto;
  background: none; box-shadow: none !important;
  color: transparent;
  transition: none;
  pointer-events: none;
}
body.has3d.ready .floor, body.has3d.ready .svc { pointer-events: auto; }
body.has3d .floor img, body.has3d .floor .no, body.has3d .floor::after, body.has3d .svc i { display: none; }

/* ---------- CGI-сцена из сгенерированных кадров ---------- */
#gl.cgi { overflow: hidden; background: #000; }
.cg-scene { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; background-size: 100% 100%; }
.cg-window { position: absolute; overflow: hidden; background: #000; }
.cg-cabin {
  position: absolute; left: 50%; top: 50%;
  background-size: 100% 100%;
  will-change: transform;
}
.cg-dim { position: absolute; inset: 0; background: #000; pointer-events: none; }
.cg-wash { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity .4s ease; }
.cg-tile {
  --lit: 0;
  position: absolute;
  border-radius: calc(var(--u) * 6);
  background-size: cover; background-position: center;
  filter: brightness(calc(.1 + var(--lit) * .78)) saturate(calc(.25 + var(--lit) * .75));
  box-shadow: 0 0 calc(var(--u) * 15 * var(--lit)) calc(var(--u) * 1) color-mix(in srgb, var(--c) calc(var(--lit) * 85%), transparent);
  transition: filter .3s ease, box-shadow .3s ease, transform .35s cubic-bezier(.16,1,.3,1);
}
.cg-tile.on {
  filter: brightness(1.08) saturate(1.05);
  box-shadow: 0 0 calc(var(--u) * 30) calc(var(--u) * 4) var(--c);
  transform: scale(1.035);
}
.cg-tile.pressed { transform: scale(.97); transition-duration: .08s; }
.cg-disp {
  position: absolute; display: flex; align-items: center; gap: calc(var(--u) * 20);
  padding: 0 calc(var(--u) * 22);
  font-family: 'Inter Tight', system-ui, sans-serif; font-weight: 500;
  color: #bfeaff; text-shadow: 0 0 calc(var(--u) * 10) #5fc8ff;
  white-space: nowrap; overflow: hidden;
}
.cg-disp b { font-weight: 500; font-size: calc(var(--u) * 38); }
.cg-disp span { font-size: calc(var(--u) * 22); }
.cg-disp em { margin-left: auto; font-style: normal; font-size: calc(var(--u) * 13); opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.cg-svc {
  position: absolute; display: grid; place-items: center;
  font-size: calc(var(--u) * 13); font-weight: 600;
  color: #0b1014; text-shadow: 0 1px 0 rgba(255,255,255,.35);
  white-space: nowrap;
  border-radius: 99px;
  transition: box-shadow .3s ease;
}
.cg-svc.on { box-shadow: 0 0 calc(var(--u) * 16) calc(var(--u) * 2) #bfeaff; }
.cg-leaf { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; will-change: transform; }
.cg-leaf img { position: absolute; max-width: none; display: block; }
.cg-name {
  position: absolute; display: flex; align-items: center;
  font-weight: 600; letter-spacing: .14em;
  color: #0a0d10; text-shadow: 0 1px 0 rgba(255,255,255,.45);
}
.cg-role {
  position: absolute; z-index: 7; left: 0; right: 0; bottom: clamp(52px, 10vh, 92px);
  text-align: center; font-size: 15px; color: #e7ebee;
  text-shadow: 0 1px 12px #000;
  opacity: calc(1 - var(--open, 0) * 5);
  pointer-events: none;
}

/* Переезд между этажами: те же CGI-двери, разрезанные по шву */
body.cgi #transit .door {
  --img-w: max(100vw, 179.2vh);
  background: #000 url(assets/cgi/doors.jpg) no-repeat;
  background-size: var(--img-w) auto;
  box-shadow: none;
}
body.cgi #transit .door.left { background-position: calc(50vw - var(--img-w) / 2) center; }
body.cgi #transit .door.right { background-position: calc(var(--img-w) / -2) center; }

/* ---------- Вау-слой: живой свет, поездка, блики ---------- */
.cg-seam {
  position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; z-index: 3;
  background-color: var(--seam, #fff);
  box-shadow: 0 0 14px 3px var(--seam, #fff), 0 0 70px 16px var(--seam, #fff);
  transition: background-color 1.1s ease, box-shadow 1.1s ease;
  animation: seamBreath 3.4s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}
@keyframes seamBreath { 50% { filter: brightness(1.7); } }
.cg-sheen {
  position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none;
  mix-blend-mode: overlay;
}
.cg-sheen::before {
  content: ''; position: absolute; top: -15%; bottom: -15%; width: 26%; left: -40%;
  transform: skewX(-14deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
  animation: sheenRun 7s cubic-bezier(.6,0,.3,1) infinite;
}
@keyframes sheenRun { 0%, 45% { left: -40%; } 100% { left: 120%; } }
.cg-spill {
  background: radial-gradient(50% 90% at 50% 0%, var(--seam, #fff), transparent 72%);
  transition: background 1.1s ease; mix-blend-mode: screen; pointer-events: none;
  position: absolute; filter: saturate(1.2); opacity: 1;
}
.cg-sign {
  position: absolute; display: grid; place-items: center;
  font: 500 calc(var(--u) * 40) 'Inter Tight', system-ui, sans-serif;
  color: #0a2230; letter-spacing: .06em;
  pointer-events: none;
}
.cg-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.cg-glint {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: radial-gradient(circle 34vmax at var(--mx, 50%) var(--my, 40%), rgba(205,232,255,.62), transparent 70%);
}
.cg-power {
  position: absolute; inset: 0; background: #000; pointer-events: none;
  animation: powerOn 1.7s steps(1) 0s forwards, powerFade 1.1s ease .62s forwards;
}
@keyframes powerOn { 0% { opacity: 1; } 12% { opacity: .62; } 18% { opacity: 1; } 27% { opacity: .42; } 33% { opacity: .9; } }
@keyframes powerFade { to { opacity: 0; visibility: hidden; } }

/* Плитка: отражение в чёрном стекле и пробегающий блик */
.cg-tile {
  overflow: hidden;
  -webkit-box-reflect: below calc(var(--u) * 2) linear-gradient(transparent 72%, rgba(255,255,255,.2));
}
.cg-tile::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  opacity: 0;
}
.cg-tile.on::after { opacity: 1; animation: tileSweep .9s cubic-bezier(.3,0,.2,1) forwards; }
@keyframes tileSweep { to { left: 125%; } }

/* Большое табло показывает кейс */
.cg-disp { isolation: isolate; border-radius: calc(var(--u) * 5); }
.cg-disp-bg {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center 30%;
  opacity: 0; transition: opacity .45s ease;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 45%, #000);
  mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 45%, #000);
}
.cg-disp b, .cg-disp span, .cg-disp em { position: relative; text-shadow: 0 0 calc(var(--u) * 10) #5fc8ff, 0 1px calc(var(--u) * 6) #000; }

/* Поездка: двери дрожат, а по шву и стенам бегут полосы света цвета кейса */
#transit.instant .door { transition: none !important; }
#transit::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 11vh, color-mix(in srgb, var(--c, #fff) 65%, transparent) 11vh 11.5vh, transparent 11.5vh 26vh);
  mix-blend-mode: screen; opacity: 0;
}
#transit::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; z-index: 2;
  background: var(--c, #fff);
  box-shadow: 0 0 22px 5px var(--c, #fff), 0 0 120px 34px var(--c, #fff);
  mix-blend-mode: screen; opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
#transit.travel::before { opacity: .55; animation: rideLight .34s linear infinite; }
#transit.travel::after { opacity: 1; }
#transit.travel .door { animation: rideShake .16s linear infinite; }
#transit.travel.shut .door { transform: translateX(0); }
#transit #transitNo { z-index: 3; transition: opacity .25s ease; }
@keyframes rideLight { to { background-position: 0 26vh; } }
@keyframes rideShake { 25% { translate: 0 1px; } 75% { translate: 0 -1px; } }
.cg-disp::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.6), transparent 34%, transparent 58%, rgba(0,0,0,.78));
}

/* ---------- Плавность: при скролле меняется только прозрачность, без перерисовки ---------- */
@media (prefers-reduced-motion: no-preference) {
  #track { height: 460vh; height: 460svh; }
}
.cg-tile {
  filter: none !important;
  box-shadow: none !important;
  -webkit-box-reflect: unset !important;
  transform: perspective(calc(var(--u) * 520)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.cg-tile.on { transform: perspective(calc(var(--u) * 520)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.06); z-index: 3; transition: transform .12s linear; }
.cg-tile.pressed { transform: perspective(calc(var(--u) * 520)) scale(.96); transition: transform .08s linear; }
.cg-dark { position: absolute; inset: 0; background: #020406; }
.cg-tile.on .cg-dark { opacity: 0 !important; transition: opacity .25s ease; }
.cg-glow {
  position: absolute; border-radius: calc(var(--u) * 6);
  box-shadow: 0 0 calc(var(--u) * 22) calc(var(--u) * 3) var(--c);
  pointer-events: none; will-change: opacity;
}
.cg-glow.on {
  opacity: 1 !important;
  box-shadow: 0 0 calc(var(--u) * 38) calc(var(--u) * 7) var(--c);
  transition: box-shadow .3s ease;
}
.cg-ref {
  position: absolute; background-size: 100% 238%; background-position: bottom center;
  transform: scaleY(-1);
  -webkit-mask-image: linear-gradient(0deg, #000, transparent);
  mask-image: linear-gradient(0deg, #000, transparent);
  pointer-events: none; will-change: opacity;
}
/* отказ от тяжёлых режимов наложения на весь экран */
.cg-dust { mix-blend-mode: normal; }
.cg-glint {
  mix-blend-mode: normal;
  background: radial-gradient(circle 30vmax at var(--mx, 50%) var(--my, 40%), rgba(190,225,255,.1), transparent 70%);
}
.cg-wash { mix-blend-mode: normal; }

/* ---------- Страницы кейсов: закреплённая сцена, переход на каждый жест ---------- */
#caseBar { height: 56px; padding-block: 0; }
#case.fx-paged { overflow: hidden; }
.fx-host { position: relative; display: block !important; }
.fx-stage {
  position: relative;
  height: calc(100vh - 56px); height: calc(100svh - 56px);
  overflow: hidden;
  background: var(--ground, #000);
}
#slides .fx-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: var(--ground, #000);
  aspect-ratio: auto; opacity: 1; transform: none; transition: none;
  will-change: transform, clip-path;
  visibility: hidden;
}
.fx-root { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.fx-temp { visibility: hidden; }
.fx-rail {
  position: absolute; z-index: 5; right: 18px; top: 50%; translate: 0 -50%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  pointer-events: none; mix-blend-mode: difference;
}
.fx-rail-value { font: 500 12px 'Inter Tight', system-ui, sans-serif; color: #fff; white-space: nowrap; writing-mode: vertical-rl; }
.fx-rail-track { position: relative; width: 2px; height: min(34vh, 280px); background: rgba(255,255,255,.28); overflow: hidden; border-radius: 2px; }
.fx-rail-thumb { position: absolute; left: 0; width: 100%; height: 14%; background: #fff; }

/* AERON-03 */
.fx-line { position: absolute; left: 0; right: 0; height: 2px; background: #e8f6ff; box-shadow: 0 0 24px 6px var(--c), 0 0 90px 20px var(--c); }
.fx-vline { position: absolute; top: 0; bottom: 0; width: 2px; background: #e8f6ff; box-shadow: 0 0 24px 6px #7fc8ff, 0 0 90px 20px #7fc8ff; }
.fx-ice { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, #fff, #cfeaff 55%, #7fb6e6); }
.fx-snow { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ZAM! */
.fx-zambar { position: absolute; inset: 0 -14%; }

/* RAW//SIGNAL */
.fx-strip { position: absolute; inset: 0; background: var(--ground, #000) center / contain no-repeat; }
.fx-bar { position: absolute; left: 0; right: 0; height: 12%; background: var(--c); mix-blend-mode: multiply; }
.fx-tear { position: absolute; inset: 0; background: var(--ground, #000) center / contain no-repeat; }
.fx-red { position: absolute; inset: 0; background: var(--c); mix-blend-mode: multiply; opacity: 0; }

/* ALTER */
.fx-panel { position: absolute; top: -2%; bottom: -2%; left: 0; width: 34%; background: linear-gradient(90deg, #d93f18, var(--c) 45%, #ff7a4d); }
.fx-hem { position: absolute; left: 0; right: 0; height: 16%; background: linear-gradient(180deg, #ff7a4d, var(--c) 50%, #d93f18); box-shadow: 0 -12px 40px rgba(0,0,0,.35); }

/* LOBBY */
.fx-join { position: absolute; top: -2%; bottom: -2%; width: 52%; }
.fx-join-l { left: 0; background: #F22246; border-radius: 0 clamp(60px, 12vw, 180px) clamp(60px, 12vw, 180px) 0; }
.fx-join-r { right: 0; background: #B5E1F9; border-radius: clamp(60px, 12vw, 180px) 0 0 clamp(60px, 12vw, 180px); }

/* NOVA */
.fx-sheen { position: absolute; top: -10%; bottom: -10%; left: 20%; width: 60%; background: linear-gradient(90deg, transparent, rgba(190,245,255,.55), transparent); }
.fx-horizon { position: absolute; left: 0; right: 0; height: 1px; background: #eafcff; box-shadow: 0 0 16px 3px #a5f5fa, 0 0 70px 14px #a5f5fa; }

/* VAULTA */
.fx-ring {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(235,244,255,.95), 0 0 0 10px rgba(18,81,253,.5), 0 0 70px 26px rgba(18,81,253,.75), inset 0 0 50px 8px rgba(120,170,255,.45);
}
.fx-facet { box-shadow: none; }
.fx-bluebox { position: absolute; border: 4px solid #1251FD; box-shadow: 0 0 40px 6px rgba(18,81,253,.65); }

/* OFFSCRIPT */
.fx-frame { position: absolute; }
.fx-c { position: absolute; width: 56px; height: 56px; border: 4px solid #fff; filter: drop-shadow(0 0 10px var(--c)); }
.fx-tl { left: -2px; top: -2px; border-right: 0; border-bottom: 0; }
.fx-tr { right: -2px; top: -2px; border-left: 0; border-bottom: 0; }
.fx-bl { left: -2px; bottom: -2px; border-right: 0; border-top: 0; }
.fx-br { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
.fx-slab { position: absolute; inset: 0; background: #64011C; }

/* ---------- Дорогая версия: меньше эффектов, чище кромки ---------- */
.grow-clone { position: fixed; z-index: 31; object-fit: cover; transform-origin: 0 0; will-change: transform; pointer-events: none; }
#flash { background: #000; }
#caseBar {
  background: var(--ground, #000);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  color: var(--end-ink, #fff);
  font-size: 13px;
}
#caseTitle { font-weight: 500; letter-spacing: .02em; }
#caseFloor { color: var(--end-sub, rgba(255,255,255,.6)); font: 500 12px 'Inter Tight', system-ui, sans-serif; }
#toPanel { font-weight: 400; color: var(--end-sub, rgba(255,255,255,.6)); transition: color .25s; }
#toPanel:hover { color: var(--end-ink, #fff); }
#nextFloor span { color: var(--end-sub, rgba(255,255,255,.6)); }
#nextFloor:hover b { color: var(--end-ink, #fff); opacity: .72; }

/* AERON-03: тонкая линия вместо широкого неона */
.fx-line { height: 1px; box-shadow: 0 0 10px 1px var(--c), 0 0 34px 3px var(--c); }
/* ALTER: ровный цвет подкладки */
.fx-panel { background: var(--c); }
/* VAULTA: кольцо как стекло, без неона */
.fx-ring { box-shadow: 0 0 0 1px rgba(235,244,255,.9), 0 0 0 7px rgba(255,255,255,.1), 0 0 26px 4px rgba(18,81,253,.5); }
/* OFFSCRIPT: чистые белые углы */
.fx-c { width: 44px; height: 44px; border-width: 2px; filter: none; }
/* NOVA: хромированные кромки */
.fx-blade-edge { position: absolute; top: -6%; bottom: -6%; width: 1px; background: linear-gradient(180deg, transparent, #fff 20%, #eaf6ff 80%, transparent); box-shadow: 0 0 10px rgba(205,235,255,.75); }

/* Двери: ровный холодный шов и никакой смены цветов */
.cg-seam { width: 1px; left: 50%; background-color: #e6f4ff; box-shadow: 0 0 8px 1px rgba(205,235,255,.75), 0 0 34px 4px rgba(170,215,255,.28); animation: none; mix-blend-mode: normal; opacity: .9; }
.cg-spill { background: radial-gradient(38% 80% at 50% 0%, rgba(200,230,255,.3), transparent 72%); }

/* ---------- Двери при открытии кейса ---------- */
#transit { background: none !important; }
#transit::before, #transit::after, #transit #transitNo { display: none !important; }
#transit .door { transition: transform .85s cubic-bezier(.76,0,.22,1) !important; box-shadow: none !important; animation: none !important; }
#transit.instant .door { transition: none !important; }
#transit .door.left::after, #transit .door.right::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(205,230,255,.6);
}
#transit .door.left::after { right: 0; }
#transit .door.right::after { left: 0; }
.door-name {
  position: absolute; display: flex; align-items: center;
  font-weight: 600; letter-spacing: .14em; color: #0a0d10;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
}
/* NOVA: растушёвка света без кромок */
.fx-bloom {
  position: absolute; top: -10%; bottom: -10%; left: 0; width: 100%;
  background: linear-gradient(100deg, transparent 20%, rgba(215,240,255,.5) 48%, rgba(240,250,255,.65) 54%, transparent 80%);
}
.fx-sheen { background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); }

/* ---------- NOVA: шейдер и временная панель выбора ---------- */
.fx-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fx-picker {
  position: absolute; z-index: 6; left: 50%; bottom: 18px; translate: -50% 0;
  display: flex; gap: 4px; padding: 5px;
  background: rgba(8,11,16,.78); border-radius: 12px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1);
}
.fx-picker button {
  padding: 9px 14px; border-radius: 8px; color: #cfd8e2; font-size: 13px; white-space: nowrap;
  transition: background .2s, color .2s;
}
.fx-picker button:hover { color: #fff; background: rgba(255,255,255,.08); }
.fx-picker button.on { color: #071019; background: #dff1ff; }

/* ================= МАСШТАБНАЯ ДОРАБОТКА ================= */
/* Загрузка */
#loader {
  position: fixed; inset: 0; z-index: 60; background: #050608; color: #dfe6ec;
  display: grid; grid-template-columns: 1fr auto; align-content: end; gap: 14px;
  padding: clamp(20px, 3vw, 44px);
  transition: opacity .9s ease;
}
#loader.gone { opacity: 0; pointer-events: none; }
.ld-name { font-size: 15px; letter-spacing: .02em; align-self: end; }
.ld-no { font-size: clamp(56px, 9vw, 132px); font-weight: 500; line-height: .8; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ld-line { grid-column: 1 / -1; height: 1px; background: rgba(255,255,255,.14); }
.ld-line b { display: block; height: 100%; background: #dfe6ec; transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s ease; }
/* старая плоская версия больше не мелькает при загрузке */
html.lift-js #stage > .door, html.lift-js #seam { visibility: hidden; }
html.lift-js #wall { visibility: hidden; }
body.has3d #wall { visibility: visible !important; }

/* Киношная фактура */
#grain {
  position: fixed; inset: -50%; z-index: 40; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainMove 1.1s steps(6) infinite;
}
@keyframes grainMove {
  0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-4%); }
  60% { transform: translate(-2%,3%); } 80% { transform: translate(4%,-1%); } 100% { transform: translate(0,0); }
}
.cg-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(75% 75% at 50% 48%, transparent 55%, rgba(0,0,0,.5)); }
#gl.cgi .cg-scene { animation: none; }
#gl.cgi { animation: camBreath 11s ease-in-out infinite; }
@keyframes camBreath { 0%,100% { transform: scale(1.012) translate(0,0); } 50% { transform: scale(1.012) translate(.28%,-.22%); } }

/* Свет из кабины на пол холла */
.cg-openlight {
  position: absolute; pointer-events: none; opacity: 0;
  background: radial-gradient(46% 100% at 50% 0%, rgba(205,232,255,.62), rgba(170,210,255,.14) 55%, transparent 76%);
}

/* Кнопка: чистый арт под своим лучом, остальные уходят в тень */
.cg-tile { border-radius: calc(var(--u) * 4); }
.cg-cap {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: calc(var(--u) * 5); align-items: baseline;
  padding: calc(var(--u) * 12) calc(var(--u) * 6) calc(var(--u) * 5);
  background: linear-gradient(transparent, rgba(0,0,0,.66));
  color: #fff; font-size: calc(var(--u) * 6.4); font-weight: 500; letter-spacing: .03em; white-space: nowrap;
}
.cg-cap b { font: 500 calc(var(--u) * 5.2) 'Inter Tight', system-ui, sans-serif; opacity: .62; }
.cg-dark { transition: none; z-index: 2; }
.cg-cap { z-index: 1; }
.has-hover .cg-tile:not(.on) .cg-dark { opacity: .62 !important; transition: opacity .35s ease; }
.has-hover .cg-glow:not(.on), .has-hover .cg-ref { opacity: .12 !important; transition: opacity .35s ease; }
.cg-glow { box-shadow: 0 0 calc(var(--u) * 14) calc(var(--u) * 1) var(--c); }
.cg-glow.on { box-shadow: 0 0 calc(var(--u) * 26) calc(var(--u) * 3) var(--c); }
.cg-beam {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .4s ease;
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  background: linear-gradient(0deg, color-mix(in srgb, var(--c) 45%, white 18%), transparent 92%);
}
.cg-beam.on { opacity: .42; }
.cg-wash { opacity: 0 !important; }
.cg-disp b { font-size: calc(var(--u) * 30); }
.cg-disp span { font-size: calc(var(--u) * 19); }
.cg-disp em { font-size: calc(var(--u) * 11); }
.cg-svc { font-weight: 500; font-size: calc(var(--u) * 11.5); letter-spacing: .01em; }

/* Тихий интерфейс по углам */
#hud {
  position: absolute; z-index: 7; left: 0; right: 0; top: 0; pointer-events: none;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px;
  padding: clamp(14px, 1.6vw, 22px) clamp(16px, 2vw, 28px);
  color: rgba(234,241,247,.82); font-size: 13px; letter-spacing: .01em; text-shadow: 0 1px 10px rgba(0,0,0,.8);
}
#hud span:last-child { text-align: right; }
html:not(.lift-js) #hud { display: none; }
.cg-role { display: none; }
#hint {
  display: flex; flex-direction: column; align-items: center; gap: 10px; bottom: clamp(16px, 3vh, 30px);
  animation: none; color: rgba(234,241,247,.8); font-size: 12px; letter-spacing: .03em; text-shadow: 0 1px 10px #000;
}
#hint i { position: relative; width: 1px; height: 34px; background: rgba(255,255,255,.22); overflow: hidden; }
#hint i::after, .fx-cue::after {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: #fff;
  animation: cueRun 1.9s cubic-bezier(.76,0,.24,1) infinite;
}
@keyframes cueRun { 0% { transform: translateY(-100%); } 100% { transform: translateY(260%); } }

/* Свой курсор */
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor dialog, html.has-cursor dialog * { cursor: auto !important; }
html.has-cursor dialog a, html.has-cursor dialog button { cursor: pointer !important; }
#cursor {
  position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; width: 0; height: 0; opacity: 0; transition: opacity .25s;
  mix-blend-mode: difference;
}
#cursor.on { opacity: 1; }
#cursor i {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
#cursor.act i { transform: scale(2.6); }
#cursor.big i { transform: scale(.45); }
#cursor.down i { transform: scale(.7); }
#cursor span {
  position: absolute; left: 16px; top: 12px; white-space: nowrap; color: #fff; font-size: 13px; font-weight: 500;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .3s cubic-bezier(.16,1,.3,1);
}
#cursor.big span { opacity: 1; transform: none; }

/* Кейс: спокойная подсказка и большой выход на следующий этаж */
.fx-cue {
  position: absolute; z-index: 6; left: 50%; bottom: 18px; width: 1px; height: 34px; overflow: hidden;
  background: rgba(127,127,127,.35); mix-blend-mode: difference; transition: opacity .4s ease; pointer-events: none;
}
#caseEnd { padding: 0; background: #050608; }
#nextFloor {
  position: relative; width: 100%; height: min(58vh, 620px); overflow: hidden; color: #fff; gap: 12px;
  justify-content: center; align-items: center;
}
#nextFloor i {
  position: absolute; inset: -2%; background-size: cover; background-position: center;
  filter: brightness(.42) saturate(.9); transition: transform 1.3s cubic-bezier(.16,1,.3,1), filter .6s ease;
}
#nextFloor:hover i { transform: scale(1.045); filter: brightness(.62); }
#nextFloor span, #nextFloor b { position: relative; }
#nextFloor span { font-size: 13px; color: rgba(255,255,255,.75) !important; letter-spacing: .02em; }
#nextFloor b { color: #fff !important; opacity: 1 !important; font-size: clamp(44px, 9vw, 148px); font-weight: 500; letter-spacing: -.035em; }

/* Обо мне и контакты: полный экран, большая типографика */
dialog#sheet {
  width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; border-radius: 0;
  background: #06080b; box-shadow: none; padding: clamp(24px, 5vw, 76px);
}
dialog#sheet[open] { display: flex; flex-direction: column; justify-content: flex-end; animation: sheetIn .7s cubic-bezier(.16,1,.3,1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: #000; }
#sheetClose { position: absolute; float: none; margin: 0; top: clamp(16px, 2vw, 28px); right: clamp(16px, 2.4vw, 34px); color: #aab4bd; }
.sh-kicker { font-size: 14px !important; color: #8f9aa4 !important; margin-bottom: clamp(16px, 2.4vh, 28px) !important; }
dialog#sheet h2 {
  font-size: clamp(30px, 5.1vw, 84px); font-weight: 500; letter-spacing: -.03em; line-height: 1.04; max-width: 21ch; margin-bottom: clamp(24px, 5vh, 60px); color: #eef2f5;
}
.sh-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(20px, 3vw, 56px); max-width: 1040px; margin-bottom: 22px; }
.sh-cols p { font-size: clamp(15px, 1.15vw, 18px); line-height: 1.5; color: #b6bfc7; margin: 0; }
.sh-links a {
  display: block; width: max-content; max-width: 100%; font-size: clamp(30px, 5.6vw, 92px); font-weight: 500; letter-spacing: -.03em; line-height: 1.12;
  color: #eef2f5; text-decoration: none; padding: 0; transition: opacity .25s;
}
.sh-links a:hover { opacity: .55; }
.sh-links { margin-bottom: 26px; }
#sheet .tag { color: #a9c9e3; }
#sheet .tag::before { background: #a9c9e3; box-shadow: 0 0 10px #a9c9e3; }

/* ---------- Лёгкость: только то, что браузер двигает без перерисовки ---------- */
#grain { inset: 0; animation: none; opacity: .04; }
#gl.cgi { animation: none; }
html.has-cursor, html.has-cursor * { cursor: auto; }
.cg-glint {
  inset: auto; left: -30vmax; top: -30vmax; width: 60vmax; height: 60vmax;
  background: radial-gradient(circle, rgba(190,225,255,.1), transparent 70%);
  will-change: transform;
}
.cg-sheen { mix-blend-mode: normal; }
.cg-sheen::before {
  left: 0; width: 26%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  will-change: transform;
  animation: sheenRun2 7s cubic-bezier(.6,0,.3,1) infinite;
}
@keyframes sheenRun2 { 0%, 45% { transform: translateX(-160%) skewX(-14deg); } 100% { transform: translateX(460%) skewX(-14deg); } }
.cg-spill { mix-blend-mode: normal; transition: none; filter: none; }
.cg-seam { transition: none; }
.fx-bar, .fx-red { mix-blend-mode: normal; }
.cg-tile { will-change: auto; }
.cg-disp-bg { transition: opacity .3s ease; }

/* ---------- Вводный экран кейса ---------- */
.fx-intro {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end;
  background: linear-gradient(0deg, rgba(4,6,9,.94), rgba(4,6,9,.74) 48%, rgba(4,6,9,.5));
  color: #eef2f5;
  transition: opacity .7s ease, transform .9s cubic-bezier(.16,1,.3,1);
  padding: clamp(24px, 4vw, 68px);
}
.fx-intro.hide { opacity: 0; transform: translateY(-3%); pointer-events: none; }
.fx-in-inner { width: 100%; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: clamp(24px, 6vw, 110px); align-items: end; }
.fx-in-kind { grid-column: 1 / -1; font-size: 14px; color: #aeb9c3; margin-bottom: 12px; }
.fx-intro h2 { grid-column: 1 / -1; font-size: clamp(56px, 12vw, 190px); font-weight: 500; letter-spacing: -.045em; line-height: .92; margin-bottom: clamp(20px, 3.4vh, 42px); }
.fx-in-lead { font-size: clamp(17px, 1.6vw, 25px); line-height: 1.36; max-width: 34ch; color: #e1e7ec; }
.fx-in-done span { display: block; font-size: 13px; color: #aeb9c3; margin-bottom: 10px; }
.fx-in-done ul { list-style: none; padding: 0; margin: 0; font-size: 15px; line-height: 1.55; color: #dfe5ea; }
.case-intro { padding: 40px 18px 34px; background: var(--ground); color: var(--end-ink, #fff); }
.case-intro h2 { font-size: 52px; font-weight: 500; letter-spacing: -.035em; line-height: 1; margin: 8px 0 16px; }
.case-intro p { font-size: 16px; line-height: 1.42; }
.case-intro div { margin-top: 20px; font-size: 14px; }
.case-intro span { color: var(--end-sub); }
.case-intro ul { list-style: none; padding: 0; margin: 8px 0 0; line-height: 1.5; }
#slides.fx-host .fx-cue { z-index: 6; }

/* ---------- Сразу к работам и звук ---------- */
#quick {
  position: absolute; z-index: 8; right: clamp(16px, 2vw, 28px); bottom: clamp(16px, 3vh, 30px);
  display: inline-flex; gap: 10px; align-items: center; min-height: 44px; padding: 0 2px;
  color: #eaf1f7; font-size: 13px; text-shadow: 0 1px 10px #000;
  opacity: calc(1 - var(--open, 0) * 7);
  transition: color .2s;
}
#quick em { font-style: normal; transition: transform .35s cubic-bezier(.16,1,.3,1); }
#quick:hover em { transform: translateX(5px); }
body.ready #quick { pointer-events: none; }
html:not(.lift-js) #quick { display: none; }
#soundBtn {
  position: fixed; z-index: 35; left: clamp(16px, 2vw, 28px); bottom: clamp(14px, 3vh, 26px);
  display: inline-flex; gap: 9px; align-items: center; min-height: 44px; padding: 0 2px;
  color: #dfe6ec; font-size: 13px; text-shadow: 0 1px 8px #000;
}
#soundBtn i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.38); transition: background .25s, box-shadow .25s; }
#soundBtn.on i { background: #bfe4ff; box-shadow: 0 0 9px #8fcfff; }
#soundBtn:hover { color: #fff; }

/* Вводный экран: чистая страница, никакого наложения на текст слайда */
.fx-intro { background: #06080b; align-items: flex-end; overflow: hidden; }
.fx-in-art {
  position: absolute; top: 0; right: 0; bottom: 0; width: 54%;
  background-size: auto 175%; background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 34%);
  mask-image: linear-gradient(90deg, transparent, #000 34%);
}
.fx-in-inner { position: relative; z-index: 1; display: block; max-width: 62%; }
.fx-intro h2 { font-size: clamp(52px, 9vw, 150px); line-height: .94; text-shadow: 0 4px 40px rgba(0,0,0,.45); }
.fx-in-lead { max-width: 38ch; margin-bottom: clamp(20px, 3vh, 34px); }
.fx-in-done { max-width: 48ch; }
.fx-in-done ul { display: flex; flex-wrap: wrap; column-gap: 8px; }
.fx-in-done li:not(:last-child)::after { content: ','; }
.fx-intro { padding-bottom: clamp(72px, 10vh, 96px); }

/* ---------- Видео заезда ---------- */
.cg-video {
  position: absolute; left: 50%; top: 50%; z-index: 1; object-fit: cover;
  transform: translate(-50%,-50%); opacity: 0; visibility: hidden;
  background: #000; pointer-events: none; will-change: opacity;
}
.cg-vignette { z-index: 3; }
.cg-power { z-index: 4; }
.cg-dust { z-index: 3; }
.cg-glint { z-index: 3; }

/* ---------- Кадры заезда ---------- */
.cg-video { z-index: 1; will-change: auto; }
#grain { contain: strict; }
#hint, #quick { transition: none; animation: none; }
#quick { opacity: 1; }

/* ---------- Заезд без прокрутки страницы ---------- */
body.cgi { overflow: hidden; }
body.cgi #track { height: 100vh; height: 100svh; }
body.riding #grain { visibility: hidden; }
.cg-scene { will-change: transform, opacity; }
.cg-lastframe { position: absolute; inset: 0; background-size: 100% 100%; pointer-events: none; }

/* ===== v28: имя с дверей, нули, затемнение, кнопки ===== */
.cg-name { visibility: hidden; }
.cg-title {
  position: fixed; left: 0; top: 0; z-index: 8; pointer-events: none; white-space: nowrap;
  display: flex; transform-origin: 0 0; will-change: transform;
  font-weight: 600; letter-spacing: .14em; line-height: 1.2;
  color: #0a0d10; text-shadow: 0 1px 0 rgba(255,255,255,.45);
  transition: color .6s ease, text-shadow .6s ease, filter .6s ease;
}
.cg-title.lit { color: rgba(234,241,247,.9); text-shadow: 0 1px 14px rgba(0,0,0,.8); }
body.locked .cg-title, html:not(.lift-js) .cg-title, html:not(.lift-js) .cg-signo { display: none; }
.cg-sign { visibility: hidden; }
.cg-signo { line-height: 1; font-weight: 500; letter-spacing: .06em; color: #0a2230; text-shadow: none; font-variant-numeric: tabular-nums; }
.cg-title.lit { filter: drop-shadow(0 0 18px rgba(170,215,255,.35)); }
.cg-disp, .ld-no { font-family: 'Inter Tight', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.cg-disp b { font-weight: 500; letter-spacing: -.02em; }

/* затемнение вокруг кнопки под курсором */
.cg-hdim { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: radial-gradient(70% 70% at 50% 50%, rgba(0,0,0,.55), rgba(0,0,0,.86));
  transition: opacity .45s cubic-bezier(.2,.7,.2,1); }
.has-hover .cg-hdim { opacity: 1; }
.cg-tile.on, .has-hover .cg-glow.on, .has-hover .cg-beam.on, .has-hover .cg-disp { z-index: 3; }
.has-hover .cg-tile:not(.on) .cg-dark { opacity: .8 !important; }

/* кнопка под курсором: свет её цвета и рамка фокуса */
.cg-tile.on { box-shadow: 0 0 0 1px rgba(255,255,255,.55), 0 calc(var(--u) * 14) calc(var(--u) * 46) calc(var(--u) * -6) var(--c), 0 0 calc(var(--u) * 70) calc(var(--u) * -10) var(--c); }
.cg-lock { position: absolute; inset: calc(var(--u) * 7); pointer-events: none; opacity: 0;
  --b: calc(var(--u) * 12); --w: max(1px, calc(var(--u) * 1.4));
  background:
    linear-gradient(#fff,#fff) 0 0 / var(--b) var(--w), linear-gradient(#fff,#fff) 0 0 / var(--w) var(--b),
    linear-gradient(#fff,#fff) 100% 0 / var(--b) var(--w), linear-gradient(#fff,#fff) 100% 0 / var(--w) var(--b),
    linear-gradient(#fff,#fff) 0 100% / var(--b) var(--w), linear-gradient(#fff,#fff) 0 100% / var(--w) var(--b),
    linear-gradient(#fff,#fff) 100% 100% / var(--b) var(--w), linear-gradient(#fff,#fff) 100% 100% / var(--w) var(--b);
  background-repeat: no-repeat; }
.cg-tile.on .cg-lock { animation: lockIn .55s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes lockIn { from { opacity: 0; transform: scale(1.18); } 60% { opacity: 1; } to { opacity: .9; transform: scale(1); } }
.cg-tile.on .cg-cap b { color: var(--c); transition: color .3s ease; }
/* v30: «Обо мне» не упирается в верх */
dialog#sheet { overflow-y: auto; padding-top: clamp(80px, 11vh, 120px); }
dialog#sheet[open] { justify-content: safe flex-end; }
dialog#sheet h2 { font-size: clamp(28px, 3.7vw, 62px); max-width: 24ch; }
.sh-cols { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); max-width: 1100px; row-gap: clamp(18px, 3vh, 32px); }

/* ================= v43: типографика, прелоадер, тексты, указатель работ ================= */
:root { --ease-out: cubic-bezier(.16,1,.3,1); --label: 11px; }
.sh-kicker, .ix-no, .ix-k, .fx-in-no, .ld-top, .sh-services > span, .sh-stats span, .pill span {
  font-size: var(--label); letter-spacing: .14em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.sh-kicker em, .fx-in-no em { font-style: normal; opacity: .5; }

/* Прелоадер */
#loader {
  position: fixed; inset: 0; z-index: 60; background: #050608; color: #e9eef2;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto auto; gap: 18px 24px;
  padding: clamp(18px, 2.4vw, 34px); clip-path: inset(0 0 0 0); align-content: stretch;
  transition: clip-path 1s cubic-bezier(.76,0,.24,1) .25s, opacity .01s 1.3s;
}
.ld-top { grid-column: 1 / -1; display: flex; justify-content: space-between; color: #8c98a3; }
.ld-name { grid-row: 3; align-self: end; display: flex; font-size: clamp(30px, 4.6vw, 76px); font-weight: 500; letter-spacing: -.035em; line-height: 1; overflow: hidden; padding-bottom: .06em; }
.ld-name i { font-style: normal; display: inline-block; transform: translateY(110%); animation: ldIn .9s var(--ease-out) calc(.15s + var(--c) * .035s) forwards; }
@keyframes ldIn { to { transform: none; } }
.ld-no { grid-row: 3; grid-column: 2; align-self: end; font-size: clamp(30px, 4.6vw, 76px); font-weight: 300; letter-spacing: -.02em; line-height: 1; color: #8c98a3; font-variant-numeric: tabular-nums; }
.ld-line { grid-row: 4; grid-column: 1 / -1; height: 1px; background: rgba(255,255,255,.12); }
.ld-line b { display: block; height: 100%; background: #e9eef2; transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--ease-out); }
#loader.gone { opacity: 1; clip-path: inset(0 0 100% 0); pointer-events: none; }
#loader.gone .ld-name i { animation: ldOut .5s cubic-bezier(.7,0,.84,0) calc(var(--c) * .015s) forwards; }
@keyframes ldOut { from { transform: none; } to { transform: translateY(-110%); } }

/* Появление текста по строкам и словам */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .02em .1em; margin: 0 -.02em -.1em; }
.w > span { display: inline-block; transform: translateY(108%); transition: transform 1s var(--ease-out) calc(var(--rd, 0s) + var(--l, 0) * .09s); }
.w .ch { display: inline-block; transform: translateY(108%); transition: transform 1s var(--ease-out) calc(var(--rd, 0s) + var(--c, 0) * .035s); }
[data-chars] .w > span { transform: none; }
.rv-on .w > span, .rv-on .w .ch { transform: none; }
[data-fade] { opacity: 0; transform: translateY(18px); transition: opacity .9s ease calc(var(--rd, 0s) + .25s + var(--f, 0) * .07s), transform 1s var(--ease-out) calc(var(--rd, 0s) + .25s + var(--f, 0) * .07s); }
.rv-on [data-fade] { opacity: 1; transform: none; }
html.calm .w > span, html.calm .w .ch, html.calm [data-fade] { transform: none !important; opacity: 1 !important; transition: none !important; }

/* Полноэкранные листы: «Обо мне», контакты, все работы */
dialog#sheet { padding: clamp(84px, 11vh, 120px) clamp(20px, 5vw, 76px) clamp(28px, 5vh, 56px); }
dialog#sheet[open] { justify-content: flex-start; }
dialog#sheet .sh-kicker { margin-bottom: clamp(18px, 3vh, 34px) !important; color: #8f9aa4 !important; font-size: var(--label) !important; }
dialog#sheet h2 { font-size: clamp(30px, 3.9vw, 66px); line-height: 1.04; letter-spacing: -.035em; max-width: 22ch; margin-bottom: clamp(26px, 5vh, 56px); }
.sh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1100px; padding: clamp(18px, 3vh, 28px) 0; border-top: 1px solid rgba(255,255,255,.12); border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: clamp(24px, 4vh, 44px); }
.sh-stats b { display: block; font-size: clamp(38px, 4.4vw, 72px); font-weight: 400; letter-spacing: -.04em; line-height: 1; color: #eef2f5; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.sh-stats span { color: #8f9aa4; display: block; max-width: 24ch; line-height: 1.5; }
.sh-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 90px); max-width: 1100px; margin-bottom: clamp(28px, 5vh, 52px); }
.sh-grid .sh-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 36px); max-width: none; margin: 0; }
.sh-services > span { display: block; color: #8f9aa4; margin-bottom: 14px; }
.sh-services ul { list-style: none; margin: 0; padding: 0; }
.sh-services li { display: flex; gap: 14px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.09); color: #dfe5ea; font-size: clamp(15px, 1.1vw, 17px); }
.sh-services li em { font-style: normal; font-size: var(--label); color: #6f7a84; font-variant-numeric: tabular-nums; }
.sh-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: clamp(30px, 5vh, 56px); }
.sh-cta .tag { margin: 0 0 0 10px; }
.pill {
  position: relative; display: inline-flex; flex-direction: column; gap: 4px; padding: 13px 22px 14px; min-height: 44px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #eef2f5; text-decoration: none; overflow: hidden; isolation: isolate;
  transition: color .45s var(--ease-out), border-color .45s;
}
.pill::before { content: ''; position: absolute; inset: 0; z-index: -1; background: #eef2f5; border-radius: inherit; transform: translateY(101%); transition: transform .55s var(--ease-out); }
.pill:hover { color: #06080b; border-color: #eef2f5; }
.pill:hover::before { transform: none; }
.pill span { color: inherit; opacity: .6; font-size: 10px; }
.pill b { font-weight: 500; font-size: 15px; }
#sheet .sh-links { margin-bottom: clamp(26px, 5vh, 52px); }
#sheet .sh-links a { font-size: clamp(34px, 6.4vw, 110px); line-height: 1.06; padding: 0; }
#sheet .sh-links a .w > span { transition-property: transform, opacity; }
#sheet .sh-links a:hover { opacity: 1; }
#sheet .sh-links a:hover .w > span { opacity: .55; }

/* Бегущая строка */
.mq { overflow: hidden; border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0; margin: 0 calc(clamp(20px, 5vw, 76px) * -1); white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mq > div { display: inline-flex; animation: mq 38s linear infinite; }
.mq span { font-size: clamp(22px, 2.6vw, 40px); font-weight: 400; letter-spacing: -.02em; color: #cfd6dc; padding-right: .9em; }
.mq span::after { content: '✳'; display: inline-block; margin-left: .9em; font-size: .55em; vertical-align: middle; color: #6f7a84; }
@keyframes mq { to { transform: translateX(-50%); } }
html.calm .mq > div { animation: none; }
#caseEnd .mq { margin: 0; border-top: 0; border-bottom: 1px solid rgba(255,255,255,.1); background: #050608; }

/* Все работы */
.ix { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid rgba(255,255,255,.12); }
.ix-row {
  width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 340px) 40px; align-items: center; gap: 20px;
  padding: clamp(10px, 1.6vh, 18px) 0; border-bottom: 1px solid rgba(255,255,255,.12); color: #eef2f5; text-align: left;
  transition: opacity .4s, padding .5s var(--ease-out);
}
.ix-no { color: #6f7a84; }
.ix-t { font-size: clamp(28px, 4.1vw, 70px); font-weight: 500; letter-spacing: -.04em; line-height: 1.02; transition: transform .6s var(--ease-out), color .3s; }
.ix-k { color: #8f9aa4; line-height: 1.5; }
.ix-go { font-size: 22px; opacity: 0; transform: translateX(-10px); transition: opacity .3s, transform .5s var(--ease-out); }
.ix.has-hover .ix-row { opacity: .28; }
.ix.has-hover .ix-row:hover { opacity: 1; }
.ix-row:hover .ix-t { transform: translateX(18px); color: var(--c); }
.ix-row:hover .ix-go { opacity: 1; transform: none; }
.ix-prev { position: fixed; left: 0; top: 0; z-index: 3; width: clamp(240px, 26vw, 420px); aspect-ratio: 16 / 9; pointer-events: none; border-radius: 6px; overflow: hidden;
  clip-path: inset(50% 50% 50% 50% round 6px); transition: clip-path .6s var(--ease-out); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.ix-prev.on { clip-path: inset(0 0 0 0 round 6px); }
.ix-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: none) { .ix-prev { display: none; } }

/* Кнопки «Все работы» и «Анимации» */
#indexBtn {
  position: absolute; z-index: 8; right: clamp(16px, 2vw, 28px); bottom: clamp(16px, 3vh, 30px);
  display: inline-flex; gap: 10px; align-items: center; min-height: 44px; padding: 0 2px;
  color: #eaf1f7; font-size: 13px; text-shadow: 0 1px 10px #000; opacity: 0; pointer-events: none; transition: opacity .6s;
}
body.ready #indexBtn { opacity: 1; pointer-events: auto; }
#indexBtn em { font-style: normal; transition: transform .35s var(--ease-out); }
#indexBtn:hover em { transform: translate(3px, -3px); }
html:not(.lift-js) #indexBtn { opacity: 1; pointer-events: auto; position: fixed; top: 14px; bottom: auto; z-index: 36; }
#calmBtn {
  position: fixed; z-index: 35; left: calc(clamp(16px, 2vw, 28px) + 150px); bottom: clamp(14px, 3vh, 26px);
  display: inline-flex; gap: 9px; align-items: center; min-height: 44px; padding: 0 2px; color: #dfe6ec; font-size: 13px; text-shadow: 0 1px 8px #000; opacity: .75;
}
#calmBtn:hover { opacity: 1; }
#calmBtn i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.38); }
#calmBtn.on i { background: #bfe4ff; box-shadow: 0 0 9px #8fcfff; }
body.locked #calmBtn { display: none; }

/* Вступление кейса: крупный заголовок по буквам */
.fx-in-no { color: #8f9aa4; margin-bottom: 14px; }
.fx-in-no b { color: #eef2f5; font-weight: 500; }
.fx-intro h2 { font-size: clamp(60px, 10.5vw, 190px); letter-spacing: -.05em; }

@media (max-width: 760px) {
  .sh-stats, .sh-grid, .sh-grid .sh-cols { grid-template-columns: 1fr; }
  .ix-row { grid-template-columns: 40px minmax(0, 1fr) 24px; }
  .ix-k { display: none; }
  #calmBtn { left: auto; right: clamp(16px, 2vw, 28px); }
}
dialog#sheet.sh-contacts[open] { justify-content: safe flex-end; }
#sheetClose:focus:not(:focus-visible) { outline: none; }
#sheetClose { border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 0 18px; transition: background .3s, color .3s; }
#sheetClose:hover { background: #eef2f5; color: #06080b; }
/* v45: без шаблонных приёмов — подписи обычным регистром, факты крупным текстом */
.sh-kicker, .ix-no, .ix-k, .fx-in-no, .ld-top, .sh-services > span, .pill span { text-transform: none; letter-spacing: .01em; font-size: 13px; }
dialog#sheet .sh-kicker { font-size: 13px !important; }
.sh-facts { list-style: none; margin: 0 0 clamp(28px, 5vh, 52px); padding: 0; max-width: 1100px; border-top: 1px solid rgba(255,255,255,.12); }
.sh-facts li { font-size: clamp(20px, 2.1vw, 34px); font-weight: 400; letter-spacing: -.02em; line-height: 1.2; color: #e6ebef; padding: clamp(12px, 2vh, 18px) 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.sh-services li { gap: 0; }
/* v47: «Обо мне» помещается в один экран */
dialog#sheet.sh-about { padding-top: clamp(64px, 9vh, 96px); }
.sh-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 90px); align-items: end; max-width: 1400px; margin-bottom: clamp(24px, 4vh, 44px); }
dialog#sheet .sh-hero h2 { font-size: clamp(28px, 3.1vw, 54px); margin: 0; max-width: 20ch; }
.sh-hero .sh-facts { margin: 0; max-width: none; }
.sh-hero .sh-facts li { font-size: clamp(16px, 1.35vw, 22px); padding: clamp(9px, 1.5vh, 14px) 0; }
dialog#sheet.sh-about .sh-grid { max-width: 1400px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); margin-bottom: clamp(20px, 3.5vh, 40px); }
dialog#sheet.sh-about .sh-cta { margin-bottom: clamp(20px, 3.5vh, 40px); }
dialog#sheet.sh-about .sh-services li { padding: 7px 0; }
@media (max-width: 900px) { .sh-hero, dialog#sheet.sh-about .sh-grid { grid-template-columns: 1fr; } }
/* v49: полоса прогресса кейса под верхней панелью */
#caseBar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--c, #fff); transform: scaleX(var(--prog, 0)); transform-origin: 0 50%; opacity: .9; }

body.locked #lift { visibility: hidden; }
/* v50: шторка листов, магнит, счётчик, наклон строк */
dialog#sheet[open] { animation: sheetWipe .8s cubic-bezier(.76,0,.24,1) both; }
@keyframes sheetWipe { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
dialog#sheet.closing { animation: sheetOut .55s cubic-bezier(.76,0,.24,1) both; }
@keyframes sheetOut { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); } }
dialog#sheet::backdrop { background: transparent; }
html.calm dialog#sheet[open], html.calm dialog#sheet.closing { animation: none; }
#soundBtn, #quick, #indexBtn, #sheetClose, .pill, #toPanel { transition: translate .6s cubic-bezier(.34,1.56,.64,1), color .3s, background .3s, border-color .3s; }
#caseFloor { display: inline-block; overflow: hidden; vertical-align: top; }
#caseFloor .roll { display: inline-block; animation: roll .45s cubic-bezier(.16,1,.3,1); }
@keyframes roll { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.w > span { transform: translateY(108%) rotate(3deg); transform-origin: 0 100%; }
#nextFloor b .w { padding-bottom: .12em; margin-bottom: -.12em; }
#case:not(.fx-paged) #nextFloor .w .ch, #case:not(.fx-paged) #nextFloor .w > span { transform: none; }
/* табло: смена кадров трейлера */
.cg-disp-bg.flick { animation: flick .5s ease; }
@keyframes flick { from { filter: brightness(1.8) blur(3px); } to { filter: none; } }
/* «Дыхание» слайда */
.fx-stage { transition: transform .5s cubic-bezier(.2,.7,.2,1); transform-origin: 50% 50%; }
.fx-stage.breathe { transform: scale(1.025); transition: transform 12s cubic-bezier(.3,.1,.3,1); }
html.calm .fx-stage.breathe { transform: none; }
/* слово не разрывается по буквам */
.w { white-space: nowrap; }
.fx-intro h2 { white-space: nowrap; font-size: clamp(56px, 8.4vw, 160px); }

/* ================= Телефон: лёгкий CGI-лифт на CSS ================= */
html.lift-js body.mflat #stage > .door, html.lift-js body.mflat #seam, html.lift-js body.mflat #wall { visibility: visible; }
body.mflat #stage { background: #040507; }
body.mflat .door {
  --H: 162svh;
  background: #111 url(assets/cgi/doors.jpg) no-repeat; background-size: auto var(--H);
  box-shadow: none;
}
body.mflat .door.left { background-position: calc(50vw - var(--H) * .8957) calc(50svh - var(--H) * .5376); box-shadow: 14px 0 50px rgba(0,0,0,.8); }
body.mflat .door.right { background-position: calc(var(--H) * -.8957) calc(50svh - var(--H) * .5376); box-shadow: -14px 0 50px rgba(0,0,0,.8); }
body.mflat .plate { top: calc(50svh + var(--H, 162svh) * .043); bottom: auto; transform: translateY(-50%); }
body.mflat .door.left .plate { right: 14px; } body.mflat .door.right .plate { left: 14px; }
body.mflat .plate strong { font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #0a0d10; text-shadow: 0 1px 0 rgba(255,255,255,.45); }
body.mflat .plate span { display: none; }
body.mflat #seam { background: #dcefff; box-shadow: 0 0 14px 2px rgba(190,228,255,.7); opacity: calc(1 - var(--open, 0) * 3); }
body.mflat #wall { background: #05070a; overflow: hidden; padding: 72px 16px 84px; }
body.mflat #wall::before { content: ''; position: absolute; inset: -40px; background: url(assets/cgi/panel.jpg) center / cover; filter: blur(22px) brightness(.45) saturate(1.1); }
body.mflat #wall::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 40%, transparent, rgba(4,5,7,.85)); }
body.mflat #panel { width: 100%; max-width: 460px; gap: 14px; }
body.mflat #display {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: baseline; padding: 14px 16px;
  border-radius: 10px; background: rgba(8,12,16,.72); box-shadow: inset 0 0 0 1px rgba(170,215,255,.18), 0 0 30px rgba(95,200,255,.08);
  color: #bfeaff; font-family: 'Inter Tight', system-ui, sans-serif;
}
body.mflat #floorNo { grid-row: span 2; font-size: 34px; font-weight: 500; letter-spacing: -.02em; color: #bfeaff; text-shadow: 0 0 12px #5fc8ff; font-variant-numeric: tabular-nums; }
body.mflat #floorName { font-size: 17px; font-weight: 500; color: #e6f6ff; }
body.mflat #floorKind { font-size: 12px; color: #8fb4c8; }
body.mflat #floors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.mflat .floor { border-radius: 8px; overflow: hidden; }
body.mflat .floor img { filter: brightness(calc(.35 + var(--lit) * .65)); transition: filter .4s; }
body.mflat .floor .no { position: absolute; left: 8px; bottom: 6px; z-index: 2; font-size: 11px; color: #fff; text-shadow: 0 1px 6px #000; }
body.mflat .floor::after { content: attr(aria-label); position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px 30px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); text-indent: -1.7em; white-space: nowrap; overflow: hidden; }
body.mflat #service { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
body.mflat .svc { min-height: 44px; border-radius: 999px; background: rgba(12,16,20,.7); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); color: #dfe6ec; font-size: 13px; justify-content: center; }
body.mflat .svc i { display: none; }
body.mflat #hint { z-index: 8; }
body.mflat .plate { top: 57.2svh !important; }
body.mflat #hud { grid-template-columns: 1fr auto; }
body.mflat #hud span:nth-child(2) { display: none; }
body.mflat .floor::before { display: none !important; }
body.mflat .floor .no { display: none; }
body.mflat .floor::after { inset: auto 0 0 0 !important; top: auto !important; padding: 22px 10px 8px !important; text-indent: 0 !important; transform: none !important; opacity: 1 !important; font-size: 12px; text-align: left; }
body.mflat.ready #quick { opacity: 0 !important; pointer-events: none; }
body.mflat #indexBtn { position: fixed; bottom: clamp(14px, 3vh, 26px); right: 16px; top: auto; }
/* телефон: исправления */
html { overflow-x: clip; }
#case { overflow-x: hidden; }
.mq { max-width: 100vw; }
#caseEnd .mq { margin: 0; }
body.mflat #display { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
body.mflat #floorNo { flex: none; line-height: 1; }
body.mflat #floorName { flex: 1; min-width: 0; }
body.mflat #floorKind { flex-basis: 100%; padding-left: 0; }
body.mflat #floorKind:empty { display: none; }
/* ленточные слайды на телефоне: мягкое раскрытие при прокрутке */
#case:not(.fx-paged) #slides > img { opacity: 0; transform: translateY(28px) scale(1.04); clip-path: inset(8% 0 0 0); background: #111;
  transition: opacity .7s ease, transform 1.1s cubic-bezier(.16,1,.3,1), clip-path 1.1s cubic-bezier(.16,1,.3,1); }
#case:not(.fx-paged) #slides > img.in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
