/* ==========================================================================
   Портфолио Максима — общие стили
   Брейкпоинты как во Framer: Desktop ≥1920, 1200–1919, Tablet 810–1199, Phone <810
   ========================================================================== */

:root {
  --ink: #000;
  --paper: #fff;
  --blue: #2c40c7;
  --blue-phone: #324bcf;
  --blue-btn: rgb(52, 78, 209);
  --accent: #c77df3;
  --line: rgb(210, 218, 255);
  --muted: rgb(107, 107, 107);
  --font: "Fira Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --hdr-h: 77px;
}
@media (max-width: 1199.98px) { :root { --hdr-h: 92px; } }
@media (max-width: 809.98px)  { :root { --hdr-h: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3 { margin: 0; font-weight: 400; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- кнопки с ASCII-эффектом ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 16px 32px;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.2;
  white-space: pre;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.btn--light { background: #fff; color: #000; }
.btn--ghost { background: var(--blue-btn); color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.btn--dark  { background: #000; color: #fff; }

/* ==========================================================================
   Шапка
   ========================================================================== */
.hdr {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.hdr__bar {
  height: calc(var(--hdr-h) - 1px);
  padding: 0 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1920px;
  margin: 0 auto;
}
.logo { display: flex; align-items: flex-end; gap: 2px; }
.logo img { width: 39px; height: 29px; }
.logo span { font-size: 16px; line-height: 12.8px; padding: 0 5px; }
.hdr__contacts { font-size: 20px; line-height: 24px; transition: color .2s; }
.hdr__contacts:hover { color: #666; }
.hdr__burger, .hdr__close { width: 36px; height: 36px; padding: 6px; display: none; }
.hdr__burger svg, .hdr__close svg { width: 100%; height: 100%; }
.hdr__close { display: none; padding: 2px; }
.hdr.is-open .hdr__contacts, .hdr.is-open .hdr__burger { display: none !important; }
.hdr.is-open .hdr__close { display: block; }

@media (max-width: 1199.98px) {
  .hdr__bar { padding: 0 42px; }
  .hdr__contacts { display: none; }
  .hdr__burger { display: block; }
}
@media (max-width: 809.98px) {
  .hdr__bar { padding: 0 16px; }
}

/* меню контактов */
.contacts {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: calc(var(--hdr-h) + 24px) 16px 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .25s var(--ease), visibility 0s linear .25s;
}
.contacts.is-open { visibility: visible; opacity: 1; transition: opacity .25s var(--ease); }
.contacts__item {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1.2;
  white-space: pre;
  transition: color .2s;
}
.contacts__item:hover { color: #666; }
@media (max-width: 809.98px) { .contacts { gap: 16px; } }

/* подсказка «копировать» у почты */
.copy-tip {
  position: fixed;
  left: 0; top: 0;
  z-index: 1000;
  padding: 6px 10px;
  background: #fff;
  color: #000;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
  pointer-events: none;
  opacity: 0;
  transform: scale(.95);
  transition: opacity .15s, transform .15s;
}
.copy-tip.is-on { opacity: 1; transform: none; }
.copy-tip i {
  position: absolute; left: 50%; top: 50%;
  width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px;
  background: #000;
  animation: pxBurst .5s ease-out forwards;
}
@keyframes pxBurst { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

/* ==========================================================================
   Первый экран страницы портфолио (hero)
   ========================================================================== */
.hero { padding-top: 104px; }
.hero__frame {
  position: relative;
  height: 936px;
  margin: 0 40px;
  max-width: 1840px;
}
@media (min-width: 1920px) { .hero__frame { margin: 0 auto; width: calc(100% - 80px); } }
.hero__box {
  position: absolute;
  inset: -27px 0 0 0;
  overflow: hidden;
  background: var(--blue);
  color: #fff;
  contain: layout paint;
  container-type: size;
}
.hero__portrait { position: absolute; inset: 0; }
.hero__portrait canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__label {
  position: absolute; left: 41px; top: 61px;
  font-size: 38px; line-height: 1;
  text-transform: lowercase;
  white-space: pre;
}
.hero__uxui { position: absolute; left: 45px; top: 111px; width: 363px; height: auto; }
.hero__dizain { position: absolute; left: 41px; top: 227px; width: 371px; height: auto; }
.hero__text {
  position: absolute; right: 37px; top: 59px;
  width: 392px;
  font-size: 24px; line-height: 1.3;
  white-space: pre-line;
}
.hero__btns {
  position: absolute; left: 50%; bottom: 63px;
  transform: translateX(-50%);
  display: flex; gap: 23px;
}
.hero__btns .btn { width: 227px; height: 51px; padding: 0; }

/* HUD поверх портрета (раньше рисовался на canvas — теперь обычный DOM, не нагружает отрисовку) */
.hud { position: absolute; inset: 0; pointer-events: none; --m: clamp(14px, 2.1cqw, 40px); --arm: clamp(14px, 2cqw, 38px); }
.hud i { position: absolute; width: var(--arm); height: var(--arm); border: 0 solid var(--accent); }
.hud i:nth-child(1) { left: var(--m); top: var(--m); border-left-width: 2px; border-top-width: 2px; }
.hud i:nth-child(2) { right: var(--m); top: var(--m); border-right-width: 2px; border-top-width: 2px; }
.hud i:nth-child(3) { left: var(--m); bottom: var(--m); border-left-width: 2px; border-bottom-width: 2px; }
.hud i:nth-child(4) { right: var(--m); bottom: var(--m); border-right-width: 2px; border-bottom-width: 2px; }
.hud span {
  position: absolute; bottom: calc(var(--m) + 6px);
  font-size: clamp(9px, .65cqw, 12px); font-weight: 500; line-height: 1;
  color: rgba(210, 218, 255, .9);
  white-space: pre;
  transform: translateY(.2em);
}
.hud .hud__l { left: var(--m); }
.hud .hud__r { right: var(--m); }
@container (max-width: 639px) { .hud .hud__l { display: none; } }
@container (max-width: 479px) { .hud .hud__r { display: none; } }

/* 1200–1919 */
@media (max-width: 1919.98px) {
  .hero__frame { height: 699px; }
  .hero__label { left: 36px; top: 41px; font-size: 28px; }
  .hero__uxui { left: 38px; top: 76px; width: 269px; }
  .hero__dizain { left: 38px; top: 163px; width: 275px; }
  .hero__text { right: 22px; top: 41px; width: 327px; font-size: 18px; white-space: normal; }
  .hero__btns { bottom: 43px; }
}
/* Tablet 810–1199 */
@media (max-width: 1199.98px) {
  .hero { padding-top: 85px; }
  .hero__frame { height: 719px; margin: 0 24px; }
  .hero__label { left: 21px; top: 50px; font-size: 20px; }
  .hero__uxui { left: 23px; top: 77px; width: 196px; }
  .hero__dizain { left: 21px; top: 139px; width: 200px; }
  .hero__text { right: 17px; top: 52px; width: 208px; font-size: 14px; }
  .hero__btns { bottom: 33px; gap: 21px; }
}
/* Phone <810 */
@media (max-width: 809.98px) {
  .hero { padding-top: 56px; }
  .hero__frame { height: 641px; margin: 0 16px; }
  .hero__box { top: 0; background: var(--blue-phone); }
  .hero__label { left: 15px; top: 15px; font-size: 13px; }
  .hero__uxui { left: 17px; top: 33px; width: 134px; }
  .hero__dizain { left: 15px; top: 76px; width: 137px; }
  .hero__text { right: 9px; top: 13px; width: 157px; font-size: 12px; }
  .hero__btns { left: 16px; bottom: 17px; transform: none; flex-direction: column; gap: 13px; }
  .hero__btns .btn { width: 201px; height: 50px; }
}

/* ==========================================================================
   Блок «мои работы»: закреплённые карточки, следующая «стирает» предыдущую
   ========================================================================== */
.ps { position: relative; width: 100%; background: #fff; color: #000; scroll-margin-top: var(--hdr-h); }
.ps__sticky { position: sticky; top: var(--hdr-off, var(--hdr-h)); height: var(--inner-h, calc(100svh - var(--hdr-h))); width: 100%; overflow: hidden; }
.ps__panel {
  position: absolute; inset: 0;
  background: #fff;
  clip-path: inset(100% 0 0 0);
  visibility: hidden;
}
.ps__panel:first-child { clip-path: inset(0 0 0 0); visibility: visible; }
.ps__inner { position: absolute; }
.ps__media { overflow: hidden; background: #ededed; display: block; }
.ps__media img, .ps__soon {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform-origin: 50% 60%;
}
.ps__soon { display: flex; align-items: center; justify-content: center; opacity: .45; }
.ps__row { display: flex; align-items: flex-end; overflow: hidden; }
.ps__num { display: block; line-height: .7; }
.ps__tag { display: block; flex: 1; text-align: right; line-height: 1.2; opacity: .5; }
.ps__tw, .ps__sw { overflow: hidden; }
.ps__title { line-height: 1.05; letter-spacing: -.01em; }
.ps__sphere { line-height: 1.2; opacity: .5; }
.ps__cta { display: flex; justify-content: flex-end; }
.ps__nav { position: absolute; z-index: 10; display: flex; }
.ps__nav button {
  display: flex; align-items: flex-end; justify-content: space-between;
  line-height: .7; opacity: .3; transition: opacity .4s;
}
.ps__nav button[aria-current="true"] { opacity: 1; }
.ps__nav b { display: block; background: #000; transform: scale(0); opacity: 0; transition: transform .5s var(--ease), opacity .4s; }
.ps__nav button[aria-current="true"] b { transform: scale(1); opacity: 1; }

/* широкая раскладка — как в макете 1920×1080, масштаб --s */
.ps--wide .ps__inner { left: calc(var(--s) * 40px); right: calc(var(--s) * 40px); top: 0; bottom: calc(var(--s) * 40px); }
.ps--wide .ps__media { position: absolute; right: 0; bottom: 0; width: 57.88%; height: 82.66%; }
.ps--wide .ps__top { position: absolute; left: 0; top: 17.34%; width: 32.61%; padding-left: calc(var(--s) * 40px); }
.ps--wide .ps__row { gap: calc(var(--s) * 24px); padding-top: calc(var(--s) * 6px); }
.ps--wide .ps__num { font-size: calc(var(--s) * 40px); }
.ps--wide .ps__tag { font-size: calc(var(--s) * 20px); }
.ps--wide .ps__tw { margin-top: calc(var(--s) * 112px); padding-bottom: calc(var(--s) * 6px); }
.ps--wide .ps__title { font-size: calc(var(--s) * 72px); }
.ps--wide .ps__sw { margin-top: calc(var(--s) * 10px); padding-bottom: calc(var(--s) * 4px); }
.ps--wide .ps__sphere { font-size: calc(var(--s) * 20px); max-width: calc(var(--s) * 520px); }
.ps--wide .ps__cta { position: absolute; left: 0; bottom: 0; width: 32.61%; }
.ps--wide .ps__cta .btn { padding: calc(var(--s) * 16px) calc(var(--s) * 32px); font-size: calc(var(--s) * 16px); }
.ps--wide .ps__soon { font-size: calc(var(--s) * 20px); }
.ps--wide .ps__nav { left: calc(var(--s) * 80px); bottom: calc(var(--s) * 40px); flex-direction: column; gap: calc(var(--s) * 32px); }
.ps--wide .ps__nav button { width: calc(var(--s) * 40px); font-size: calc(var(--s) * 20px); }
.ps--wide .ps__nav b { width: calc(var(--s) * 6px); height: calc(var(--s) * 6px); }

/* вертикальная раскладка — планшет и телефон: текст, картинка на всё оставшееся место, индекс и кнопка */
.ps--stack { --pad: 32px; --top: 32px; --gap: 24px; --fs: 18px; --num: 36px; --row: 52px; }
.ps--stack.ps--phone { --pad: 16px; --top: 20px; --gap: 16px; --fs: 14px; --num: 28px; --row: 44px; }
.ps--stack .ps__inner { left: var(--pad); right: var(--pad); top: var(--top); bottom: var(--pad); display: flex; flex-direction: column; }
.ps--stack .ps__top { flex: none; order: 0; }
.ps--stack .ps__row { gap: 16px; padding-top: 4px; }
.ps--stack .ps__num { font-size: var(--num); line-height: .75; }
.ps--stack .ps__tag { font-size: var(--fs); }
.ps--stack .ps__tw { margin-top: calc(var(--gap) + 4px); padding-bottom: 4px; }
.ps--stack.ps--phone .ps__tw { margin-top: 20px; }
.ps--stack .ps__title { font-size: var(--title, 56px); }
.ps--stack .ps__sw { margin-top: 6px; padding-bottom: 2px; }
.ps--stack .ps__sphere {
  font-size: var(--fs); line-height: 1.25; max-width: 560px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ps--stack .ps__media { position: relative; flex: 1 1 0; min-height: 0; margin-top: var(--gap); order: 1; }
.ps--stack .ps__cta { flex: none; height: var(--row); margin-top: var(--gap); align-items: center; order: 2; }
.ps--stack .ps__cta .btn { height: var(--row); padding: 0 32px; font-size: 16px; }
.ps--stack.ps--phone .ps__cta .btn { padding: 0 24px; font-size: 14px; }
.ps--stack .ps__soon { font-size: var(--fs); }
.ps--stack .ps__nav { left: var(--pad); bottom: var(--pad); height: var(--row); align-items: center; gap: 24px; }
.ps--stack.ps--phone .ps__nav { gap: 16px; }
.ps--stack .ps__nav button { gap: 6px; padding: 10px 0; font-size: var(--fs); }
.ps--stack .ps__nav b { width: 5px; height: 5px; }

/* появление первой карточки при входе блока в экран */
.ps-pre [data-rise], .ps-pre.ps-r5 { opacity: 0; transform: translate3d(0, 60%, 0); }
.ps-in [data-rise], .ps-in.ps-r5 { transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.ps-in .ps__tag { transition-delay: .08s; }
.ps-in .ps__title { transition-delay: .16s; }
.ps-in .ps__sphere { transition-delay: .26s; }
.ps-in.ps-r5 { transition-delay: .34s; }

/* ==========================================================================
   ASCII-слой переходов (поверх всего)
   ========================================================================== */
.ascii-layer { position: fixed; inset: 0; z-index: 2147483000; pointer-events: auto; }
.ascii-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ps-pre [data-rise], .ps-pre.ps-r5 { opacity: 1; transform: none; }
}

/* пока страница открывается после ASCII-перехода — экран закрыт серым, чтобы ничего не мелькнуло */
html.ascii-pending::after { content: ""; position: fixed; inset: 0; z-index: 2147483001; background: #ededed; }

/* ---------- появление первого экрана (по мотивам ownitt.fr) ---------- */
html.fx-pre .hdr { transform: translateY(-100%); }
html.fx-pre [data-intro]:not(.hero__portrait) { clip-path: inset(0 0 100% 0); translate: 0 40px; }
html.fx-pre .hero__portrait { scale: 1.06; }
html.fx-in .hdr { transform: none; transition: transform 1s var(--ease); }
html.fx-in [data-intro]:not(.hero__portrait) {
  clip-path: inset(-10% -10% -10% -10%); translate: 0 0;
  transition: clip-path 1.1s var(--ease) var(--d, .15s), translate 1.1s var(--ease) var(--d, .15s);
}
html.fx-in .hero__portrait { scale: 1; transition: scale 1.8s var(--ease); }
html.no-scroll { overflow: hidden; }

/* ==========================================================================
   Первый экран сайта: вопрос + «да / нет» и пиксельный прелоадер
   ========================================================================== */
.fs {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  container-type: inline-size;
  container-name: fs;
  overflow: hidden;
}
.fs-wrap {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 5vh, 56px);
  padding: clamp(40px, 8vh, 96px) clamp(16px, 4vw, 48px);
  max-width: 1240px;
  width: 100%;
}
.fs-eyebrow { font-size: 14px; color: var(--muted); letter-spacing: .04em; }
.fs-h1 { font-size: clamp(28px, 4.2vw, 56px); line-height: 1.25; text-transform: lowercase; text-wrap: balance; }
.fs-h1 .t { color: rgb(45, 67, 200); white-space: nowrap; }
.fs-caret { color: rgb(45, 67, 200); animation: fsBlink 1s steps(1) infinite; }
@keyframes fsBlink { 50% { opacity: 0; } }
.fs-btns { display: flex; flex-wrap: wrap; gap: 16px; }
.fs-btn {
  min-width: 160px; height: 56px; padding: 0 32px;
  font-size: 18px; text-transform: lowercase;
  background: #000; color: #fff; border: 1px solid #000;
}
.fs-btn:focus-visible { outline: 2px solid rgb(45, 67, 200); outline-offset: 3px; }
@container fs (max-width: 1199px) {
  .fs-h1 { font-size: 40px; }
  .fs-wrap { padding: 64px 40px; }
}
@container fs (max-width: 809px) {
  .fs-wrap { padding: 40px 20px; gap: 28px; }
  .fs-h1 { font-size: 28px; line-height: 1.3; }
  .fs-eyebrow { font-size: 12px; }
  .fs-btns { flex-direction: column; align-items: stretch; }
  .fs-btns .fs-btn { width: 100%; min-width: 0; height: 52px; }
}
/* появление текстов после прелоадера — «пиксельная» шторка слева направо */
html.fs-loading .fs [data-rv] { opacity: 0; }
html.fs-reveal .fs [data-rv] { animation: fsPxIn .7s steps(10) both; }
html.fs-reveal .fs [data-rv="1"] { animation-delay: .05s; }
html.fs-reveal .fs [data-rv="2"] { animation-delay: .35s; }
html.fs-reveal .fs [data-rv="3"] { animation-delay: .6s; }
@keyframes fsPxIn { 0% { clip-path: inset(0 100% 0 0); opacity: 1; } 100% { clip-path: inset(0 0 0 0); opacity: 1; } }

.fs-loader { position: fixed; inset: 0; z-index: 9999; display: none; background: #ededed; }
html.fs-loading .fs-loader { display: block; }
.fs-loader canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fs-card {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 28px;
  background: #fff; color: #000;
  white-space: pre;
}
.fs-card__label { font-size: 13px; color: #6b6b6b; }
.fs-card__bar { font-size: clamp(13px, 2.2vw, 18px); }
@container fs (max-width: 809px) { .fs-card { padding: 16px 20px; } }
@media (max-width: 809.98px) { .fs-card { padding: 16px 20px; } }

/* ==========================================================================
   Страницы кейсов (/projects/...)
   Desktop: текст слева 600px, картинки справа 1065px; 1200–1919: текст 479px, картинки — остальное;
   планшет и телефон: одна колонка, картинки встают в текст.
   ========================================================================== */
.hdr--case .hdr__bar { display: grid; grid-template-columns: 1fr auto 1fr; }
.hdr__back { display: inline-flex; align-items: center; gap: 20px; justify-self: start; font-size: 20px; line-height: 24px; white-space: pre; transition: color .2s; }
.hdr__back:hover { color: #666; }
.hdr__back svg { width: 11px; height: 18px; flex-shrink: 0; }
.hdr__right { display: flex; align-items: center; justify-content: flex-end; }

.cs {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 130px 40px 40px;
}
.cs-text {
  width: 600px;
  flex-shrink: 0;
  padding-left: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 48px;
  align-self: stretch;
}
.cs-flow { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 72px; }
.cs-flow > *, .cs-list > * { width: 100%; }
.cs-list { display: flex; flex-direction: column; gap: 56px; }
.cs-grp { display: flex; flex-direction: column; gap: 16px; }
.cs-grp--pb { padding-bottom: 48px; }
.cs-media { width: 1065px; flex-shrink: 0; display: flex; flex-direction: column; }
.cs-media:empty { display: none; }

/* тексты */
.rt p, .rt h2, .rt h3, .rt h4, .rt ol, .rt ul { margin: 0; }
.rt ol, .rt ul { padding: 0; }
.rt ol { list-style: none; counter-reset: li; }
.rt ol[start="2"] { counter-reset: li 1; }
.rt ol[start="3"] { counter-reset: li 2; }
.rt ol[start="4"] { counter-reset: li 3; }
.rt ol[start="5"] { counter-reset: li 4; }
.rt ol[start="6"] { counter-reset: li 5; }
.rt ol[start="7"] { counter-reset: li 6; }
.rt ol[start="8"] { counter-reset: li 7; }
.rt ol[start="9"] { counter-reset: li 8; }
.rt ol > li { counter-increment: li; position: relative; padding-left: 3ch; }
.rt ol > li::before { content: counter(li) "."; position: absolute; left: 0; top: 0; }
.rt ul { list-style: disc; }
.rt ul > li { margin-left: 1.2em; }
.rt strong { font-weight: 700; }
.rt a { text-decoration: underline; text-underline-offset: 3px; }
.cs-title { margin: 0; font-size: 48px; line-height: 1; font-weight: 400; text-transform: lowercase; }
.rt--body { font-family: "Fira Code", var(--font); font-size: 17px; line-height: 1.4; color: rgba(0, 0, 0, .7); --ps: 18px; }
.rt--h3 { font-size: 32px; line-height: 1.4; font-weight: 500; }
.rt--h3 h3 { font-weight: 500; font-size: inherit; }
.rt--h4 h4 { font-size: 24px; line-height: 1.3; font-weight: 500; color: rgba(0, 0, 0, .69); }
.rt--hook { font-size: 16px; line-height: 1.6; letter-spacing: -.02em; --ps: 20px; }
.rt--note { padding-left: 32px; font-size: 14px; line-height: 1.6; letter-spacing: -.02em; --ps: 20px; }
.rt > :not(:first-child), .rt li + li, .rt li > * + * { margin-top: var(--ps, 0); }

.cs-hooks { background: #f2f2f2; padding: 24px; display: flex; flex-direction: column; justify-content: center; gap: 120px; }

/* картинки: блок 4:3, внутри картинка на 80% ширины (обложка на десктопе — на всю) */
.cs-fig { margin: 0; width: 100%; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.cs-fig__box { position: relative; width: 80%; aspect-ratio: 4 / 3; background: #bfbfbf; }
.cs-fig__box img { width: 100%; height: 100%; object-fit: cover; }
.cs-media .cs-fig--cover .cs-fig__box { width: 100%; }
.cs-fig__tag { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 20px; line-height: 1; text-transform: lowercase; }
.cs-media .cs-fig__tag { top: 36px; right: 36px; }
html.cs-anim .cs-fig__box { opacity: 0; transform: translateY(100px) scale(.8); transition: opacity .7s var(--ease), transform 1.1s cubic-bezier(.3, 1.25, .5, 1); }
html.cs-anim .cs-fig__box.is-in { opacity: 1; transform: none; }

/* кнопки внизу текста */
.cs-btns { position: sticky; top: 200px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cs-btns .btn { min-width: 160px; }

/* кнопка «наверх» */
.totop {
  position: fixed; left: 22px; bottom: 56px; z-index: 50;
  width: 24px; height: 48px; background: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.totop.is-on { opacity: 1; pointer-events: auto; }
.totop svg { width: 13px; height: 8px; }

/* блок «если вы решите сделать в нейросети» */
.aic { background: #f2f2f2; padding: 40px; display: flex; flex-direction: column; gap: 24px; color: #000; }
.aic p { margin: 0; }
.aic__title { font-size: 22px; line-height: 1.3; font-weight: 500; }
.aic__shot { display: flex; flex-direction: column; gap: 10px; }
.aic__prompt { font-size: 12px; line-height: 1.5; color: #6b6b6b; }
.aic__frame { position: relative; overflow: hidden; background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); }
.aic__mock { transform-origin: left top; pointer-events: none; width: max-content; }
.aic__intro { font-size: 15px; line-height: 1.6; }
.aic__issues { display: flex; flex-direction: column; gap: 10px; }
.aic__issues-title { font-size: 15px; font-weight: 700; }
.aic ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.aic li { display: flex; gap: 10px; font-size: 14px; line-height: 1.55; }
.aic li::before { content: "✕"; flex-shrink: 0; }
.aic--small { padding: 24px; }
.aic--small .aic__title { font-size: 18px; }

@media (max-width: 1919.98px) {
  .cs-text { width: 479px; padding-bottom: 700px; }
  .cs-media { width: auto; flex: 1; min-width: 0; padding-left: 72px; }
}
@media (max-width: 1199.98px) {
  .cs { display: block; padding: 130px 42px 180px; }
  .cs-text { width: auto; padding: 0; align-items: flex-start; }
  .cs-media { display: none; }
  .rt:not(.rt--title), .cs-grp { max-width: 564px; }
  .cs-hooks .rt { max-width: none; }
  .cs-btns { position: static; }
  .totop { left: auto; right: 56px; bottom: 136px; }
}
@media (max-width: 809.98px) {
  .cs { padding: 100px 16px 150px; }
  .totop { right: 24px; }
  .hdr__back { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html.cs-anim .cs-fig__box { opacity: 1; transform: none; }
}

/* при прокрутке синий фрейм раздвигается до краёв экрана: --gl/--gr задаёт page.js.
   Портрет остаётся прежнего размера (canvas не пересоздаётся), раздвигается только фон. */
.hero__box { left: calc(-1 * var(--gl, 0px)); right: calc(-1 * var(--gr, 0px)); }
.hero__portrait { left: var(--gl, 0px); right: var(--gr, 0px); }
html { overflow-x: clip; }


/* первый экран: весь контент по центру, в колонке не шире 1000px */
.fs-wrap { max-width: 1000px; margin: 0 auto; align-items: center; text-align: center; }
.fs-btns { justify-content: center; }
@container fs (max-width: 809px) { .fs-btns { width: 100%; } }

/* ASCII-след за курсором */
.ascii-cursor { position: fixed; inset: 0; z-index: 2147482000; pointer-events: none; overflow: hidden; mix-blend-mode: difference; }
.ascii-cursor span { position: absolute; left: 0; top: 0; opacity: 0; color: #fff; font: 500 13px/1 var(--font); will-change: transform, opacity; }

/* десктоп: в правой колонке все картинки во всю ширину колонки (как обложка), вплотную друг к другу */
.cs-media .cs-fig { aspect-ratio: auto; display: block; }
.cs-media .cs-fig__box { width: 100%; }

/* кейсы: те же эффекты, что на главной.
   1) при загрузке шапка выезжает, заголовок, вступление, «в этом кейсе» и обложка поднимаются из-под маски (fx-pre/fx-in);
   2) тексты и блоки поднимаются при прокрутке, как тексты карточек проектов;
   3) картинки внутри рамки слегка смещаются при прокрутке (параллакс, как портрет на первом экране). */
.cs-fig__box { overflow: hidden; }
.cs-fig__box img { will-change: transform; }
html.cs-anim .cs-fig--cover .cs-fig__box { opacity: 1; transform: none; }
html.fx-pre .cs-fig--cover img { scale: 1.08; }
html.fx-in .cs-fig--cover img { scale: 1; transition: scale 1.8s var(--ease) var(--d, .15s); }
html.cs-anim .cs-rise { opacity: 0; transform: translate3d(0, 48px, 0); }
html.cs-anim .cs-rise.is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease) var(--rd, 0s), transform 1.1s var(--ease) var(--rd, 0s); }
@media (prefers-reduced-motion: reduce) {
  html.cs-anim .cs-rise { opacity: 1; transform: none; }
}

/* переключатель языка ru / en (в шапке рядом с «контактами», на первом экране — в правом верхнем углу) */
.lang { display: flex; align-items: center; gap: 6px; font-size: 20px; line-height: 24px; margin-right: 40px; white-space: pre; }
.lang a { color: #a3a3a3; transition: color .2s; }
.lang a:hover { color: #000; }
.lang [aria-current] { color: #000; }
.lang i { font-style: normal; color: #a3a3a3; }
.hdr__bar > .hdr__right { justify-self: end; }
@media (max-width: 1199.98px) { .lang { margin-right: 20px; } }
@media (max-width: 809.98px) { .lang { font-size: 16px; margin-right: 12px; } }
.fs-lang { position: fixed; top: 26px; right: 76px; z-index: 10; margin: 0; }
@media (max-width: 1199.98px) { .fs-lang { top: 32px; right: 42px; } }
@media (max-width: 809.98px) { .fs-lang { top: 16px; right: 16px; } }

/* «design» для английской версии первого экрана — временный шрифт вместо рисованной надписи «дизайн» */
.hero__dizain--en { overflow: visible; }
.hero__dizain--en text { font-family: "Sedgwick Ave Display", var(--font); }
/* телефон, страница кейса: в шапке «назад», логотип, язык и меню — подпись «portfolio» прячем, чтобы не было тесно */
@media (max-width: 809.98px) { .hdr--case .logo span { display: none; } }

/* картинки кейсов показываем целиком: без масштабирования внутри рамки, высота — по самой картинке */
.cs-fig__box img { will-change: auto; }
.cs-media .cs-fig__box { aspect-ratio: auto; }
.cs-media .cs-fig__box img { height: auto; }
.cs-media { will-change: transform; }

/* возврат из кейса: пока страница не прокручена к проектам, её не видно */
html.rw body { visibility: hidden; }

/* заглушка вместо картинки кейса (пока нет изображения) */
.cs-fig__box--ph {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, #ece7df 0 18px, #f4f0ea 18px 36px);
}
.cs-media .cs-fig__box--ph { aspect-ratio: 4 / 3; }
.cs-fig__ph { padding: 8px 14px; background: #fff; color: #6b6b6b; font-size: 14px; line-height: 1.3; text-align: center; max-width: 80%; }
.cs-fig__ph::before { content: "[ "; }
.cs-fig__ph::after { content: " ]"; }
.cs-fig__box--ph .cs-fig__tag { color: #000; }

/* ==========================================================================
   «в этом кейсе» (макет Figma 1886:6196): серый блок, заголовок 24px,
   справа нумерованный список шириной 400px — серая фраза-крючок и подчёркнутая ссылка на раздел с ответом
   ========================================================================== */
.cs-hooks { display: flex; flex-direction: column; align-items: flex-end; gap: 120px; padding: 0; background: #f2f2f2; color: #000; }
.hk__title { align-self: stretch; margin: 0; font-size: 24px; line-height: normal; font-weight: 400; }
.hk__list { width: min(400px, calc(100% - 26px)); margin: 0; padding: 0; list-style: none; counter-reset: hk; display: flex; flex-direction: column; gap: 30px; }
.hk__item { position: relative; display: flex; flex-direction: column; gap: 5px; counter-increment: hk; font-size: 16px; line-height: normal; }
.hk__item::before { content: counter(hk) "."; position: absolute; left: -26px; top: 0; width: 20px; text-align: right; }
.hk__lead { margin: 0; opacity: .5; }
.hk__go { text-decoration: underline; text-underline-position: from-font; overflow-wrap: anywhere; transition: color .2s; }
.hk__go:hover { color: #666; }

/* кейсы-истории: картинки в правой колонке стоят на уровне своих абзацев */
.cs-slot { display: block; height: 0; }
.cs-media--story { position: relative; display: block; }
.cs-media--story > * { position: absolute; left: 72px; right: 0; }
@media (min-width: 1920px) { .cs-media--story > * { left: 0; } }
.cs--story { overflow: clip; }

/* заглушка, вместо которой загрузили картинку в папку кейса */
.cs-fig__box--ph img { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; }
.cs-fig__box--ph.is-loaded img { opacity: 1; }
.cs-fig__box--ph.is-loaded .cs-fig__ph { display: none; }
.ps__media.is-loaded .ps__soon { display: none; }

/* картинки кейсов показываем целиком, загруженная вместо заглушки — тоже со своими пропорциями */
.cs-fig__box--ph.is-loaded { aspect-ratio: auto !important; background: none; }
.cs-fig__box--ph.is-loaded img { position: static; height: auto; }

/* планшет и телефон: картинки кейса во всю ширину экрана, без обрезки */
@media (max-width: 1199.98px) {
  .cs .cs-fig { width: calc(100% + 84px); margin-inline: -42px; aspect-ratio: auto; display: block; }
  .cs .cs-fig__box { width: 100%; aspect-ratio: auto; }
  .cs .cs-fig__box img { height: auto; display: block; }
  .cs .cs-fig__box--ph:not(.is-loaded) { aspect-ratio: 4 / 3; }
}
@media (max-width: 809.98px) {
  .cs .cs-fig { width: calc(100% + 32px); margin-inline: -16px; }
  .cs-fig__tag { top: 16px; right: 16px; font-size: 16px; }
}

/* просмотр картинки на весь экран (lightbox.js) */
.cs-fig img { cursor: zoom-in; }
.cs-fig img:focus-visible { outline: 2px solid #000; outline-offset: 4px; }
.lb {
  position: fixed; inset: 0; z-index: 2147481000;
  background: rgba(12, 12, 12, .94); color: #fff;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s;
  touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: contain;
}
.lb.is-open { opacity: 1; visibility: visible; transition: opacity .3s; }
.lb__img {
  position: absolute; left: 50%; top: 50%; max-width: none;
  transform: translate(-50%, -50%); transform-origin: center; will-change: transform;
  cursor: zoom-in; -webkit-user-drag: none; transition: opacity .25s;
}
.lb__img.is-anim { transition: transform .3s var(--ease), opacity .25s; }
.lb.is-zoomed .lb__img { cursor: grab; }
.lb.is-zoomed .lb__img:active { cursor: grabbing; }
.lb__btn {
  position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 0;
  background: rgba(0, 0, 0, .55); color: #fff; font: 400 26px/1 var(--font); cursor: pointer; transition: background .2s;
}
.lb__btn:hover { background: #000; }
.lb__btn:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.lb__btn svg { width: 18px; height: 18px; }
.lb__close { top: 16px; right: 16px; }
.lb__prev, .lb__next { top: 50%; margin-top: -24px; }
.lb__prev { left: 16px; }
.lb__next { right: 16px; }
.lb__zoom { position: absolute; z-index: 1; right: 16px; bottom: 16px; display: flex; gap: 2px; }
.lb__zoom .lb__btn { position: static; }
.lb__count { position: absolute; left: 16px; top: 16px; height: 48px; display: flex; align-items: center; font-size: 16px; color: rgba(255, 255, 255, .7); pointer-events: none; }
.lb.is-zoomed .lb__prev, .lb.is-zoomed .lb__next { opacity: 0; pointer-events: none; }
@media (pointer: coarse) {
  .lb__prev, .lb__next { display: none; }
}
html.lb-open .ascii-cursor { display: none; }

/* десктоп: правая колонка с картинками доходит до правого края экрана; ширина картинки = колонка без левого отступа */
.cs-media--story > * { width: auto; }
@media (min-width: 1200px) { .cs-media { margin-right: -40px; } }
.lb__btn[hidden] { display: none; }
.cs-fig__box--ph.is-loaded .cs-fig__tag { color: #fff; }

/* телефон, блок «мои работы» (макет Figma 22:5393): номер и подпись, заголовок с описанием — по центру свободного места;
   внизу горизонтальная картинка 358×266, под ней через 32px — навигация 01–04 слева и «подробнее» справа */
.ps--stack.ps--phone .ps__inner { justify-content: space-between; }
.ps--stack.ps--phone .ps__top { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.ps--stack.ps--phone .ps__tw { margin-top: 53px; padding-bottom: 5px; }
.ps--stack.ps--phone .ps__sw { margin-top: 0; }
.ps--stack.ps--phone .ps__media { flex: none; width: 100%; aspect-ratio: 358 / 266; max-height: 50%; margin-top: 0; }
.ps--stack.ps--phone .ps__cta { margin-top: 32px; }

/* первый экран: вода сверху — тёмно-синий фрейм, canvas шире фрейма (на всю ширину экрана) и по центру */
:root { --deep: #2c40c7; }
.hero__box { background: var(--deep); }
@media (max-width: 809.98px) { .hero__box { background: var(--deep); } }
.hero__portrait canvas.water { left: 50%; right: auto; width: auto; transform: translateX(-50%); }
/* первый экран: по клику по воде можно бросить корм карпу */
.hero__box.can-feed { cursor: pointer; }

/* ==========================================================================
   Новый главный экран (Figma 1897:743): синий фрейм на всю ширину и на 120% высоты экрана,
   внизу — подпись слева и текст справа, по центру — подсказка покормить карпа
   ========================================================================== */
.hero { padding-top: 0; }
.hero .hero__frame { height: 120svh; min-height: 640px; margin: 0; width: 100%; max-width: none; }
.hero .hero__box { inset: 0; background: #2c40c7; }
.hero__hint {
  position: absolute; left: 50%; top: 50svh; z-index: 1; margin: 0;
  transform: translate(-50%, -50%);
  font-size: 12px; line-height: 1.2; text-transform: lowercase; white-space: nowrap;
  pointer-events: none; transition: opacity .6s;
}
.hero__box.fed .hero__hint { opacity: 0; }
/* низ первого экрана — у нижнего края окна (фрейм выше окна на 20%) */
.hero__foot {
  position: absolute; left: 0; right: 0; bottom: calc(20svh + 80px); z-index: 1;
  padding: 0 79px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px;
  pointer-events: none;
}
.hero .hero__foot .hero__label { position: static; margin: 0; font-size: 38px; line-height: 38px; text-transform: lowercase; white-space: normal; }
.hero .hero__foot .hero__text { position: static; margin: 0; width: 426px; font-size: 20px; line-height: 1.2; white-space: normal; }
@media (max-width: 1199.98px) {
  .hero__foot { padding: 0 42px; bottom: calc(20svh + 48px); }
  .hero .hero__foot .hero__label { font-size: 28px; line-height: 30px; }
  .hero .hero__foot .hero__text { width: 340px; font-size: 16px; }
}
@media (max-width: 809.98px) {
  .hero__foot { padding: 0 16px; bottom: calc(20svh + 24px); flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero .hero__foot .hero__label { font-size: 22px; line-height: 24px; }
  .hero .hero__foot .hero__text { width: auto; max-width: 340px; font-size: 14px; }
}

/* шапка главной: два состояния — над первым экраном прозрачная, всё по центру и белым;
   ниже первого экрана — обычная белая шапка */
.hdr--home { transition: background-color .35s, border-color .35s, color .35s; }
.hdr--home .hdr__bar { transition: transform .35s var(--ease); }
.logo__light { display: none; }
.hdr--home.is-hero:not(.is-open) { background: transparent; border-bottom-color: transparent; color: #fff; }
.hdr--home.is-hero:not(.is-open) .hdr__bar { justify-content: center; gap: 40px; transform: translateY(15px); }
.hdr--home.is-hero:not(.is-open) .hdr__right { display: contents; }
.hdr--home.is-hero:not(.is-open) .logo img:first-child, .hdr--home.is-hero:not(.is-open) .logo span { display: none; }
.hdr--home.is-hero:not(.is-open) .logo .logo__light { display: block; }
.hdr--home.is-hero:not(.is-open) .hdr__contacts, .hdr--home.is-hero:not(.is-open) .hdr__burger { order: 1; }
.hdr--home.is-hero:not(.is-open) .lang { order: 2; margin-right: 0; }
.hdr--home.is-hero:not(.is-open) .lang [aria-current] { color: #fff; }
.hdr--home.is-hero:not(.is-open) .lang a:hover, .hdr--home.is-hero:not(.is-open) .hdr__contacts:hover { color: #fff; opacity: .7; }
.hdr--home.is-hero:not(.is-open) .hdr__burger svg { stroke: #fff; }
@media (max-width: 1199.98px) { .hdr--home.is-hero:not(.is-open) .hdr__bar { gap: 32px; transform: translateY(8px); } }
@media (max-width: 809.98px) { .hdr--home.is-hero:not(.is-open) .hdr__bar { gap: 24px; transform: translateY(4px); } }

/* подсказка про корм — под текстом справа (Figma 1899:1243) */
.hero__note { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hero .hero__note .hero__hint { position: static; transform: none; left: auto; top: auto; margin: 0; font-size: 12px; line-height: 1.2; text-transform: lowercase; white-space: normal; }
@media (max-width: 809.98px) { .hero__note { gap: 8px; } }

/* планшет и телефон: выбор языка — в открытом меню, в шапке его нет */
.contacts__lang { display: none; margin-top: 8px; font-size: 24px; line-height: 1.2; }
@media (max-width: 1199.98px) {
  .hdr .lang { display: none; }
  .contacts .contacts__lang { display: flex; margin-right: 0; }
}

/* главный экран ещё выше: 130% окна; низ с текстами — у нижнего края окна */
.hero .hero__frame { height: 120svh; min-height: 700px; }
.hero__foot { bottom: calc(20svh + 80px); }
@media (max-width: 1199.98px) { .hero__foot { bottom: calc(20svh + 48px); } }
@media (max-width: 809.98px) { .hero__foot { bottom: calc(20svh + 24px); } }
/* плавный параллакс: двигаются только transform/opacity, на отдельных слоях */
.hero__portrait, .hero__label, .hero__note { will-change: translate, opacity; }

/* первый экран (макет 1899:1246): «привет!» + две карточки выбора версии портфолио */
.fs-choice { max-width: none; width: auto; gap: 56px; padding: 96px 16px; align-items: stretch; text-align: left; }
.fs-head { display: flex; flex-direction: column; align-items: center; text-align: center; letter-spacing: .56px; }
.fs-hi { font-size: 40px; line-height: normal; font-weight: 400; color: #000; }
.fs-sub { font-size: 24px; line-height: normal; color: #6b6b6b; text-wrap: balance; }
.fs-cards { display: flex; gap: 24px; align-items: stretch; }
.fs-opt {
  display: flex; flex-direction: column; justify-content: space-between; gap: 160px;
  width: 528px; background: #f2f2f2; color: #000; text-decoration: none;
  transition: background-color .2s;
}
.fs-opt:hover { background: #e8e8e8; }
.fs-opt:focus-visible { outline: 2px solid rgb(45, 67, 200); outline-offset: 3px; }
.fs-opt__txt { width: 384px; max-width: 100%; font-size: 24px; line-height: 1.2; text-transform: lowercase; text-wrap: balance; }
.fs-opt__btn { align-self: flex-end; min-width: 0; height: 56px; padding: 0 32px; font-size: 18px; line-height: 21.6px; }
@container fs (max-width: 1199px) {
  .fs-choice { gap: 48px; padding: 64px 40px; }
  .fs-cards { width: 100%; }
  .fs-opt { width: auto; flex: 1 1 0; gap: 120px; }
  .fs-opt__txt { font-size: 20px; }
}
@container fs (max-width: 809px) {
  .fs-choice { gap: 32px; padding: 72px 16px 32px; }
  .fs-hi { font-size: 32px; }
  .fs-sub { font-size: 18px; }
  .fs-cards { flex-direction: column; gap: 16px; }
  .fs-opt { gap: 48px; }
  .fs-opt__txt { width: auto; font-size: 18px; }
  .fs-opt__btn { height: 52px; font-size: 16px; }
}

/* шапка: «скачать cv» — контакты — язык (язык всегда правее контактов) */
.hdr__right { gap: 40px; }
.hdr__right .lang { margin-right: 0; }
.hdr__cv { font-size: 20px; line-height: 24px; white-space: pre; transition: color .2s; }
.hdr__cv:hover { color: #666; }
.hdr--home.is-hero:not(.is-open) .hdr__cv { order: 1; }
.hdr--home.is-hero:not(.is-open) .hdr__cv:hover { color: #fff; opacity: .7; }
.contacts__cv { display: none; }
@media (max-width: 1199.98px) {
  .hdr__right { gap: 20px; }
  .hdr__cv { display: none; }
  .contacts .contacts__cv { display: flex; }
}

/* главный экран (макет 1897:746): подпись — текст — «связаться со мной» */
.hero .hero__foot .hero__text { width: 553px; text-transform: lowercase; }
.hero__act { display: flex; align-items: flex-end; align-self: stretch; }
.hero__cta {
  pointer-events: auto;
  font-size: 24px; line-height: 1.2; color: #fff; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
  transition: opacity .2s;
}
.hero__cta:hover { opacity: .7; }
.hero__cta:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
@media (max-width: 1199.98px) {
  .hero .hero__foot .hero__text { width: 300px; }
  .hero__cta { font-size: 18px; }
}
@media (max-width: 809.98px) {
  .hero .hero__foot .hero__text { width: auto; }
  .hero__act { align-self: flex-start; }
  .hero__cta { font-size: 16px; }
}

/* модальное окно «связаться со мной» */
.cmodal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cmodal[hidden] { display: none; }
.cmodal__bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .25s var(--ease); }
.cmodal__box {
  position: relative; width: 100%; max-width: 520px;
  background: #fff; color: #000; padding: 48px 40px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  opacity: 0; transform: translateY(16px); transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.cmodal.is-open .cmodal__bg { opacity: 1; }
.cmodal.is-open .cmodal__box { opacity: 1; transform: none; }
.cmodal__close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; padding: 6px; color: #000; }
.cmodal__close svg { width: 100%; height: 100%; display: block; }
.cmodal__close:hover { color: #666; }
.cmodal__t { margin: 0; font-size: 16px; font-weight: 400; line-height: 1.2; color: #6b6b6b; text-transform: lowercase; }
.cmodal__list { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cmodal__item { min-height: 48px; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1.2; white-space: pre; color: #000; transition: color .2s; }
.cmodal__item:hover { color: #666; }
@media (max-width: 809.98px) {
  .cmodal { align-items: flex-end; padding: 0; }
  .cmodal__box { max-width: none; padding: 40px 16px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); }
  .cmodal__item { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .cmodal__bg, .cmodal__box { transition: none; } }

/* ---------- «другие проекты» (веб-версия, пока только десктоп) ----------
   Блок закрепляется под шапкой: фото выезжает, заголовок вырастает в крупный (состояние 2)
   и остаётся на месте, дальше карточки листаются по горизонтали вслед за прокруткой. */
.op { display: block; position: relative; background: #fff; height: var(--op-h, 500vh); --s: 1; }
.op__stage { position: sticky; top: var(--hdr-off, var(--hdr-h)); height: var(--inner-h, calc(100vh - var(--hdr-h))); overflow: hidden; background: #fff; }
.op__view { position: absolute; left: 0; right: 0; top: 0; height: var(--ch, 100%); overflow: hidden; transform: translate3d(0, var(--band, 0px), 0); will-change: transform, clip-path; }
.op__track { display: flex; height: 100%; will-change: transform; }
.op__card { flex: none; position: relative; width: var(--op-cw, 75vw); height: 100%; margin: 0; overflow: hidden; background: #0d0d14; }
.op__card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* подпись: внизу слева; в состоянии 1 — 71.49px, в состоянии 2 — 48px (при ширине 1920 / высоте 1080) */
.op__cap {
  position: absolute; left: 0; bottom: 0; width: max(calc(var(--k, 1) * 964px), 72%);
  padding: max(calc(var(--k, 1) * 79px), 14px); font-size: var(--cap, 48px); line-height: .8;
  text-transform: lowercase; color: #fff; mix-blend-mode: color-dodge;
}
.op__title, .op__big {
  position: absolute; left: 0; right: 0; margin: 0; color: #fff; mix-blend-mode: difference;
  pointer-events: none; white-space: nowrap; text-transform: lowercase; z-index: 2;
}
.op__title { top: var(--t1y, 140px); display: flex; justify-content: center; gap: .3em; font-size: max(calc(var(--s) * 71.49px), 22px); line-height: .8; font-weight: 400; }
.op__big { top: calc(var(--strip-top, 0px) - .236em); height: 1.695em; font-size: max(calc(var(--s) * 266.667px), 64px); line-height: 1.2; font-weight: 700; letter-spacing: -.0773em; }
.op__big span { position: absolute; top: 0; left: 0; }
.op__big span + span { left: auto; right: 0; top: .495em; }
.op__w { display: block; transform-origin: 0 0; will-change: transform, opacity; }
/* карточка «добавить проект»: белая, пунктирная рамка 938×670 по центру, клик — окно с контактами */
.op__card--add { background: #fff; }
.op__add {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 64.87%; height: 62.04%;
  display: flex; align-items: center; justify-content: center; gap: max(calc(var(--k, 1) * 24px), 10px);
  border: 1px dashed rgba(0, 0, 0, .34); color: #000; cursor: pointer;
  font-size: max(calc(var(--k, 1) * 32px), 15px); line-height: .8; text-transform: lowercase; white-space: nowrap;
  transition: border-color .25s var(--ease);
}
.op__add:hover, .op__add:focus-visible { border-color: rgba(0, 0, 0, .7); outline: none; }
.op__plus { width: 1em; height: 1em; flex: none; }

/* ---------- финальный экран: «обсудить проект» + подвал ---------- */
.end { position: relative; display: flex; flex-direction: column; align-items: center; background: #fff; overflow: hidden; }
/* пустое место над и под кнопкой одинаковое — примерно в 2 раза больше, чем было (≈ высота экрана минус подвал) */
.end__cta { display: flex; align-items: center; justify-content: center; padding: max(240px, calc(100svh - var(--hdr-h) - 280px)) 16px; }
.end__btn { padding: 15.73px 31.47px; font-size: 15.73px; line-height: 18.88px; }
.ft {
  position: relative; width: min(706px, calc(100% - 32px)); min-height: 189px; background: #f2f2f2; color: #000;
  display: flex; flex-direction: column; align-items: flex-start; font-family: var(--font);
}
.ft__who { display: flex; gap: 24px; font-size: 20px; line-height: 24px; }
.ft__tags { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.2; opacity: .5; max-width: 430px; }
.ft__legal { margin-top: auto; padding: 40px 56px 0 0; font-size: 11px; line-height: 1.35; color: rgba(0, 0, 0, .5); }
.ft__legal p + p { margin-top: 4px; }
.ft__links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px !important; }
.ft__links a, .ft__links button { font: inherit; color: #000; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(0, 0, 0, .3); }
.ft__links a:hover, .ft__links button:hover { text-decoration-color: #000; }
.ft__logo { position: absolute; right: 0; bottom: 0; width: 39px; height: 29px; }
/* появление при скролле */
.end .end__btn, .end .ft { transition: transform 1s var(--ease), opacity .8s var(--ease); }
.end:not(.is-btn) .end__btn { opacity: 0; transform: translateY(40px); }
.end:not(.is-ft) .ft { transform: translateY(100%); }
@media (max-width: 809.98px) {
  .ft__who { font-size: 18px; gap: 16px; }
  .ft__tags { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .end .end__btn, .end .ft { opacity: 1 !important; transform: none !important; } }

/* ---------- плашка согласия на cookie ---------- */
.cc {
  position: fixed; left: 16px; bottom: 16px; z-index: 200; width: min(440px, calc(100% - 32px));
  padding: 16px; background: #000; color: #fff; font-family: var(--font); font-size: 13px; line-height: 1.4;
  opacity: 0; transform: translateY(16px); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.cc.is-in { opacity: 1; transform: none; }
.cc a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.cc__b { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.cc__yes { background: #fff; color: #000; padding: 8px 16px; font-size: 13px; }
.cc__no { color: rgba(255, 255, 255, .7); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.cc__yes:hover { background: #e6e6e6; }
.cc__no:hover { color: #fff; }

/* ---------- страница политики ---------- */
.pp { max-width: 760px; margin: 0 auto; padding: 40px 16px 96px; font-size: 15px; line-height: 1.55; }
.pp__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 48px; }
.pp__top a { text-decoration: underline; text-underline-offset: 3px; }
.pp h1 { font-size: 32px; line-height: 1.15; margin-bottom: 8px; }
.pp h2 { font-size: 19px; margin: 36px 0 10px; }
.pp p, .pp li { color: rgba(0, 0, 0, .8); }
.pp p + p { margin-top: 10px; }
.pp ul { padding-left: 20px; margin: 8px 0; }
.pp li + li { margin-top: 4px; }
.pp a { text-decoration: underline; text-underline-offset: 2px; }
.pp__date { color: rgba(0, 0, 0, .5) !important; font-size: 13px; }
