/* ============ Tokens ============ */
:root {
  --bg: #F4F3EF;
  --bg-dim: #EDEBE6;
  --card: #EEECE7;
  --line: #DEDBD4;
  --line-soft: #E3E1DB;
  --text: #212121;
  --muted: #8C8B87;
  --accent: #7FA356;

  --header-h: 97px;
  --gutter: 32px;
  --sheet-pad: 88px;
  --radius-card: 16px;
  --radius-sheet: 24px;
  --radius-shot: 12px;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.375 var(--font);
  -webkit-font-smoothing: antialiased;
}
html { scrollbar-gutter: stable; }
html.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ============ Header ============ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 var(--gutter);
}
.header__me { display: flex; align-items: center; gap: 20px; min-width: 0; }
.header__avatar { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.header__name { font-size: 16px; font-weight: 500; white-space: nowrap; }
.header__nav { display: flex; align-items: center; gap: 24px; font-size: 16px; font-weight: 500; }
.header__tg { display: inline-flex; align-items: center; gap: 8px; }
.header__tg-arrow { margin-top: 1px; }

/* «Дрожащая» зелёная надпись при наведении — 3 кадра из макета */
.scribble { position: relative; white-space: nowrap; }
.scribble--telegram { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.scribble::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 30px;
  transform: translateY(-50%);
  background: no-repeat center / 100% 100%;
  opacity: 0;
  pointer-events: none;
}
.scribble--experience::after { left: -11px; width: 120px; background-image: url(assets/hover/experience-1.svg); }
.scribble--telegram::after { left: -10px; width: 106px; background-image: url(assets/hover/telegram-1.svg); }
.scribble--cv::after { left: -9px; width: 72px; background-image: url(assets/hover/cv-1.svg); background-size: 92px 30px; background-position: left center; } /* стрелку из кадров обрезаем: «Резюме» теперь страница, а не скачивание */
@media (hover: hover) {
  .scribble:hover { color: transparent; text-decoration-color: transparent; }
  .scribble:hover::after { opacity: 1; }
  .scribble--experience:hover::after { animation: boil-exp .42s steps(1) infinite; }
  .scribble--telegram:hover::after { animation: boil-tg .42s steps(1) infinite; }
  .scribble--cv:hover::after { animation: boil-cv .42s steps(1) infinite; }
  .scribble--cv:hover .dl-icon { color: transparent; }
}
@keyframes boil-exp {
  0%   { background-image: url(assets/hover/experience-1.svg); }
  33%  { background-image: url(assets/hover/experience-2.svg); }
  66%  { background-image: url(assets/hover/experience-3.svg); }
}
@keyframes boil-cv {
  0%   { background-image: url(assets/hover/cv-1.svg); }
  33%  { background-image: url(assets/hover/cv-2.svg); }
  66%  { background-image: url(assets/hover/cv-3.svg); }
}
@keyframes boil-tg {
  0%   { background-image: url(assets/hover/telegram-1.svg); }
  33%  { background-image: url(assets/hover/telegram-2.svg); }
  66%  { background-image: url(assets/hover/telegram-3.svg); }
}
/* предзагрузка кадров, чтобы не мигало при первом наведении */
body::after {
  content: url(assets/hover/experience-2.svg) url(assets/hover/experience-3.svg) url(assets/hover/telegram-2.svg) url(assets/hover/telegram-3.svg) url(assets/hover/cv-2.svg) url(assets/hover/cv-3.svg);
  position: absolute; width: 0; height: 0; overflow: hidden; opacity: 0; pointer-events: none;
}

/* ============ Home ============ */
.home {
  display: flex;
  container-type: inline-size;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding: 0 var(--gutter) clamp(40px, 7vh, 64px); /* снизу воздуха больше, чем по бокам: карточки не прилипают к краю экрана */
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* вертикальные размеры зависят от высоты окна, чтобы главная помещалась без прокрутки */
  padding: clamp(16px, 4.5vh, 40px) 0 16px;
  text-align: center;
}
/* воздух под заголовком поднимает клубок и заголовок выше центра; на невысоких экранах он сжимается,
   поэтому главная остаётся в один экран и карточки не прижимаются к нижнему краю */
@media (min-width: 1000px) {
  .hero::after { content: ""; flex: 0 1 clamp(16px, 11vh, 104px); min-height: 0; }
  .hero > * { flex-shrink: 0; }
}
/* чтобы воздух действительно сжимался, главная ровно в высоту экрана, а отступы вокруг клубка и заголовка —
   гибкие: на невысоком экране они уменьшаются, и карточки не прижимаются к нижнему краю.
   На совсем низких окнах так не делаем — там пусть лучше прокрутка, чем наложение на карточки */
@media (min-width: 1000px) and (min-height: 640px) {
  .home { height: calc(100svh - var(--header-h)); }
  .hero { min-height: 0; padding-top: 0; }
  .hero::before { content: ""; flex: 0 1 clamp(16px, 4.5vh, 40px); min-height: 0; }
}
.hero__art { width: auto; aspect-ratio: 320 / 120; overflow: visible; height: clamp(72px, 15vh, 135px); margin-bottom: clamp(0px, 0.6vh, 8px); } /* под клубком в рисунке уже есть воздух для падающей нитки */
.hero__title {
  font-size: clamp(30px, 5.4vh, 48px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero__title em, .accent { font-style: normal; color: var(--accent); }

/* ---- Работы на главной: 4 главных кейса + строка второстепенных ---- */
.works { display: flex; flex-direction: column; gap: 12px; }
.works__main { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pc {
  position: relative;
  display: block;
  aspect-ratio: 330 / 262;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  overflow: hidden;
  isolation: isolate;
  transition: border-color .2s, background-color .2s;
}
.pc__top { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; align-items: center; gap: 8px; }
.pc__icon { width: 24px; height: 24px; flex: none; }
.pc__name { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; }
.pc__year { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pc__title { position: absolute; top: 50px; left: 16px; right: 16px; max-width: 8.6em; font-size: 22px; line-height: 1.08; font-weight: 500; letter-spacing: -0.018em; }
/* мокап интерфейса выглядывает из-за нижнего края; при наведении чуть приподнимается */
.pc__mock {
  position: absolute;
  top: 50%;
  left: 16px;
  right: -28px;
  bottom: -28px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 10px 28px rgba(40, 36, 30, .10);
  transition: transform .35s var(--ease);
}
.pc__mock svg { display: block; width: 100%; height: auto; }
.lock-ico { flex: none; color: var(--muted); }

.works__more { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.mn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  transition: border-color .2s, background-color .2s;
}
.mn__icon { width: 24px; height: 24px; flex: none; border-radius: 6px; }
.mn__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mn__name { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; }
.mn__desc { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (hover: hover) {
  .pc:hover, .mn:hover { border-color: #CFCCC5; background: #EAE8E2; }
  .pc:hover .pc__mock { transform: translateY(-6px); }
}
.pc:focus-visible .pc__mock { transform: translateY(-6px); }
/* ноутбуки поуже и пониже — карточки компактнее, чтобы главная по-прежнему помещалась в экран */
@media (max-height: 800px) and (min-width: 1000px) {
  .pc { aspect-ratio: 330 / 232; }
  .pc__mock { top: 58%; }
}
/* на ноутбуках подпись второстепенных переносится, а не обрезается */
@media (max-width: 1399px) {
  .works__more { gap: 10px; }
  .mn { gap: 10px; padding: 10px 12px; }
  .mn__desc { white-space: normal; text-wrap: balance; }
}
/* 1000–1199: четыре узкие карточки — делаем их выше, чтобы заголовок и мокап не наезжали друг на друга */
@media (max-width: 1199px) and (min-width: 1000px) {
  .pc { aspect-ratio: 330 / 300; }
  .pc__mock { top: 58%; }
  .pc__title { top: 46px; font-size: 18px; }
  .pc__name { font-size: 14px; }
}
@media (max-width: 999px) {
  .works__main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .works__more { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 599px) {
  .works__main, .works__more { grid-template-columns: 1fr; }
  .works__more { gap: 8px; }
  .pc { aspect-ratio: 330 / 250; }
  .pc__title { font-size: 22px; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  isolation: isolate;
}
.card__top { display: flex; justify-content: space-between; align-items: flex-start; }
.card__icon { width: 24px; height: 24px; }
.card__year { font-size: 13px; color: var(--muted); }
.card__title { font-size: 17px; font-weight: 500; line-height: 1.1; margin-bottom: 6px; }
.card__desc { font-size: 14px; line-height: 1.15; color: var(--muted); }
.card__preview {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius-card) - 1px);
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  background: #fff;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
@media (hover: hover) {
  .card:hover .card__preview { opacity: 1; }
}
a.card:focus-visible .card__preview { opacity: 1; }

/* ============ Sheet (опыт / проект) ============ */
/* Слой поверх главной: шторка выезжает снизу, фон плавно затемняется */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.overlay[hidden] { display: none; }
.overlay__backdrop {
  position: fixed;
  inset: -160px 0; /* с запасом: в iPhone страница заезжает под строку состояния, фон должен закрывать и её */
  background: var(--bg-dim);
  opacity: 0;
  transition: opacity .45s ease;
}
.overlay > .header { position: relative; opacity: 0; transition: opacity .45s ease; }
.overlay.is-open .overlay__backdrop,
.overlay.is-open > .header { opacity: 1; }
/* открытие с прокрученной страницы: шапка шторки оказалась бы поверх карточек — поэтому фон проявляется первым,
   а аватарка с именем — уже на чистом фоне; при закрытии наоборот */
.overlay.from-scroll .overlay__backdrop { transition: opacity .3s ease .12s; }
.overlay.from-scroll.is-open .overlay__backdrop { transition: opacity .22s ease; }
.overlay.from-scroll > .header { transition: opacity .15s ease; }
.overlay.from-scroll.is-open > .header { transition: opacity .3s ease .22s; }

.sheet { position: relative; padding: 0 var(--gutter); }
.sheet__panel {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding: 56px var(--sheet-pad) 120px;
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: var(--bg);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .04);
  transform: translateY(100vh);
  transition: transform .4s cubic-bezier(.4, 0, .9, .5);
  will-change: transform;
}
.sheet__panel:focus { outline: none; }
.overlay.is-open .sheet__panel {
  transform: none;
  transition: transform .6s cubic-bezier(.22, .9, .25, 1);
}
/* крестик закрытия: висит у правого края шторки и при прокрутке остаётся у верха экрана */
.sheet__close-rail { position: absolute; top: 32px; right: 32px; bottom: 0; z-index: 5; width: 40px; pointer-events: none; }
.sheet__close {
  position: sticky;
  top: 16px;
  pointer-events: auto;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #8a8a8a;
  transition: color .2s, background-color .2s;
}
.sheet__close svg { overflow: visible; }

.page-title {
  font-size: 36px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.015em;
  padding-right: 40px;
}
.label { font-size: 16px; font-weight: 400; color: var(--muted); margin-bottom: 14px; }

.prose { font-size: 16px; line-height: 1.375; }
.prose p + p { margin-top: 8px; }
.prose ul { margin-top: 8px; padding-left: 26px; list-style: disc; }
.prose li { padding-left: 2px; }
.prose--lg { font-size: 17px; }
.link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 3px 18px;
  border: 1px solid #CFCCC5;
  border-radius: 999px;
  font-size: 15px;
  color: var(--muted);
  line-height: 20px;
}

/* пасхалка на «Claude Code»: подсказка при наведении или тапе */
.tags .egg { position: relative; cursor: default; }
.tags .egg::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  width: max-content;
  max-width: 250px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  pointer-events: none;
}
.tags .egg:focus-visible { outline-offset: 2px; border-radius: 999px; }
.tags .egg:focus::after { opacity: 1; transform: translate(-50%, 0); }
@media (hover: hover) { .tags .egg:hover::after { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 599px) { .tags .egg::after { max-width: 168px; padding: 8px 12px; } } /* на телефоне плашка у левого края — узкая подсказка не вылезает за экран */

/* аккордеон: плавное раскрытие через grid-rows */
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.collapse.is-open { grid-template-rows: 1fr; }
.collapse__inner { overflow: hidden; min-height: 0; }

/* ---- Опыт работы ---- */
.exp {
  display: grid;
  grid-template-columns: minmax(0, 540px) minmax(0, 588px);
  justify-content: space-between;
  gap: 48px;
  margin-top: clamp(24px, 5vh, 56px);
}
.exp__about .prose p + p { margin-top: 10px; }
.edu { margin: clamp(16px, 4vh, 40px) 0 clamp(16px, 3vh, 32px); }
.edu__toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 16px; }
.edu__chevron { transition: transform .3s var(--ease); }
.edu__toggle[aria-expanded="true"] .edu__chevron { transform: rotate(180deg); }
.edu__list { padding-top: 20px; font-size: 14px; line-height: 1.35; }
.edu__list li + li { margin-top: 8px; }

.jobs { border-top: 1px solid var(--line); }
.job { border-bottom: 1px solid var(--line); }
.job__head {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr) 20px;
  align-items: start;
  gap: 16px;
  width: 100%;
  padding: clamp(12px, 2.2vh, 22px) 30px clamp(10px, 2vh, 20px) 24px;
  text-align: left;
}
.job__date { color: var(--muted); font-size: 16px; transition: color .2s; }
.job__who { display: flex; flex-direction: column; transition: transform .25s var(--ease); }
.job__company { font-size: 16px; font-weight: 500; transition: color .2s; }
.job__role { font-size: 14px; color: var(--muted); margin-top: 1px; }
.job__icon { position: relative; width: 16px; height: 16px; margin-top: 7px; justify-self: end; color: #BDBBB5; transition: transform .3s var(--ease), color .2s; }
.job__icon::before, .job__icon::after {
  content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 1.5px; border-radius: 1px; background: currentColor;
}
.job__icon::after { transform: rotate(90deg); }
.job__head[aria-expanded="true"] .job__icon { transform: rotate(45deg); }
.job__head:disabled { cursor: default; }
.job__head:disabled .job__icon { display: none; }
@media (hover: hover) {
  .job__head:not(:disabled):hover .job__date,
  .job__head:not(:disabled):hover .job__company { color: var(--accent); }
  .job__head:not(:disabled):hover .job__who { transform: translateX(4px); }
  .job__head:not(:disabled):hover .job__icon { color: var(--accent); }
}
.job__desc { padding: 0 30px 22px 24px; font-size: 14px; line-height: 1.35; }

/* ---- Страница проекта ---- */
.project-head .badge {
  display: inline-block;
  margin-top: 14px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}
/* статус проекта рядом с годом: зелёная точка — в работе, серая — завершён */
.project-head .status { display: inline-flex; align-items: center; gap: 7px; height: 26px; margin: 14px 0 0 14px; vertical-align: top; font-size: 15px; color: var(--muted); }
.project-head .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: #B9B6AF; }
.project-head .status--live::before { background: var(--accent); }
.project-info {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 400px);
  justify-content: space-between;
  gap: 48px;
  margin-top: 48px;
}
.block + .block { margin-top: 48px; }

.shots { margin-top: 72px; display: flex; flex-direction: column; gap: 40px; }
.shot figcaption { font-size: 16px; color: var(--muted); margin-bottom: 14px; }
.shot img { width: 100%; border-radius: var(--radius-shot); background: var(--bg-dim); }
.block--extra { margin-top: 48px; max-width: 760px; }

/* ============ Адаптив ============ */

/* Широкие экраны: держим ширину контента */
@media (min-width: 1680px) {
  .header, .home, .sheet { max-width: 1760px; margin-inline: auto; width: 100%; }
  .hero__title { font-size: clamp(30px, 6vh, 56px); }
  .hero__art { height: clamp(72px, 16vh, 150px); }
}

/* Карточки на ноутбуках поменьше: чуть компактнее текст, чтобы держать 264:150 */
@media (max-width: 1399px) {
  .card { padding: 14px; }
  .card__title { font-size: 16px; }
  .card__desc { font-size: 13px; }
}

/* Ноутбуки и планшеты в альбомной ориентации (1000–1279) */
@media (max-width: 1279px) {
  :root { --sheet-pad: 56px; }
  .project-info { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }

  /* «Опыт работы» остаётся в две колонки */
  .exp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
  .exp .prose { font-size: 15px; line-height: 1.35; }
  .job__head { grid-template-columns: 150px minmax(0, 1fr) 16px; gap: 12px; padding-left: 16px; padding-right: 16px; }
  .job__date { font-size: 14px; padding-top: 1px; }
  .job__desc { padding: 0 16px 16px; }
}

/* Планшеты в портретной ориентации */
@media (max-width: 999px) {
  :root { --gutter: 24px; --sheet-pad: 40px; }
  .hero { padding: clamp(12px, 2vh, 40px) 0 clamp(16px, 3vh, 72px); }
  .hero__art { height: clamp(56px, 8vh, 135px); margin-bottom: clamp(10px, 1.6vh, 28px); }
  .hero__title { font-size: clamp(28px, 3.9vh, 44px); }

  .exp { gap: 32px; }
  /* узкие колонки: дата встаёт над компанией */
  .job__head { grid-template-columns: minmax(0, 1fr) 16px; gap: 2px 12px; }
  .job__date { grid-column: 1; grid-row: 1; padding-top: 0; }
  .job__who { grid-column: 1; grid-row: 2; }
  .job__icon { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-top: 0; }
  .project-info { grid-template-columns: 1fr; gap: 0; }
  .project-info__side { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px 48px; }
  .project-info__side .block + .block { margin-top: 0; }
  .project-info__side .block:last-child { grid-column: 1 / -1; }
  .shots { margin-top: 56px; }
}

@media (max-width: 767px) {
  :root { --sheet-pad: 32px; --radius-sheet: 20px; }
  :root { --header-h: 80px; }
  .sheet__panel { padding-top: 20px; padding-bottom: 80px; }
  .sheet__close-rail { top: 16px; right: 16px; }
  .page-title { font-size: 30px; }
  .hero__title { font-size: clamp(28px, 5vh, 38px); }
  .hero__art { height: clamp(64px, 13vh, 112px); }
  .br-wide { display: none; }
  .project-info__side { grid-template-columns: 1fr; gap: 40px; }
  .shots { gap: 32px; }
  /* на телефонах всё в одну колонку — здесь прокрутка неизбежна */
  .exp { grid-template-columns: 1fr; gap: 40px; }
  .exp__about { max-width: 640px; }
  .exp .prose { font-size: 16px; }
  .job__head { padding: 16px 4px; }
  .job__desc { padding: 0 4px 18px; }
}

/* Телефоны */
@media (max-width: 599px) {
  :root { --gutter: 16px; --sheet-pad: 20px; --radius-card: 14px; --radius-shot: 8px; }
  :root { --header-h: 72px; }
  .header__me { gap: 10px; }
  .header__avatar { width: 40px; height: 40px; }
  .header__name, .header__nav { font-size: 14px; }
  .header__nav { gap: 16px; }
  .scribble--experience::after { left: -9px; width: 105px; height: 26px; }
  .scribble--telegram::after { left: -9px; width: 93px; height: 26px; }
  .scribble--cv::after { left: -8px; width: 63px; height: 26px; background-size: 80px 26px; }

  .hero { padding: 24px 0 48px; }
  .hero__art { height: clamp(48px, 8vh, 68px); margin-bottom: 14px; }
  .hero__title { font-size: 30px; line-height: 1.1; }


  .sheet__panel { padding-top: 22px; padding-bottom: 64px; }
  .page-title { font-size: 25px; padding-right: 36px; }
  .project-head .badge { font-size: 14px; }
  .project-info, .exp { margin-top: 32px; }
  .block + .block, .project-info__side { margin-top: 36px; }
  .prose, .prose--lg { font-size: 15px; }
  .label { margin-bottom: 10px; font-size: 15px; }
  .tags li { font-size: 14px; padding: 3px 14px; }

  .exp .prose { font-size: 15px; }

  .shots { margin-top: 40px; gap: 28px; }
  .shot figcaption { font-size: 14px; margin-bottom: 10px; }
}

@media (max-width: 359px) {
  .header__name { display: none; }
}

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

/* Узкие телефоны: экономим место в шапке */
@media (max-width: 400px) {
  .header__nav { gap: 14px; }
  .header__tg-arrow { display: none; }
  .scribble--telegram::after { left: -9px; width: 93px; clip-path: inset(0 16px 0 0); }
}

/* Короткие экраны (ноутбуки, окно браузера не на весь экран): компактная шапка */
@media (max-height: 800px) and (min-width: 768px) {
  :root { --header-h: 80px; }
}

/* «Опыт работы» на десктопе помещается в экран без прокрутки:
   отступы шторки зависят от высоты окна */
@media (min-width: 768px) {
  .sheet__panel[data-page="experience"] {
    padding-top: clamp(32px, 6vh, 56px);
    padding-bottom: clamp(24px, 4vh, 48px);
  }
  .sheet__panel[data-page="experience"] .sheet__close-rail { top: clamp(20px, 4vh, 32px); }
}

/* Совсем низкие окна: ужимаем то, что ещё можно */
@media (max-height: 720px) and (min-width: 1000px) {
  .hero { padding: 12px 0 20px; }
  .hero__art { height: clamp(60px, 13vh, 135px); }
  .card__desc { font-size: 13px; }
  .exp { margin-top: 20px; }
  .exp .prose { font-size: 15px; line-height: 1.33; }
  .edu { margin: 14px 0; }
  .edu__list { padding-top: 12px; }
  .job__head { padding-top: 10px; padding-bottom: 8px; }
  .job__desc { padding-bottom: 12px; }
}

/* ============ «Дрожащая» линия при наведении ============
   Как у «Опыта работы» и «Телеграма» в шапке: элемент становится зелёным,
   контур «кипит» — 3 кадра SVG-фильтра (#boil-1..3 в index.html) с той же частотой */
@keyframes boil {
  0%   { filter: url(#boil-1); }
  33%  { filter: url(#boil-2); }
  66%  { filter: url(#boil-3); }
}
.sheet__close, .edu__toggle, .link { transition: color .15s; }
@media (hover: hover) {
  .sheet__close:hover,
  .edu__toggle:hover,
  .link:hover { color: var(--accent); }

  .sheet__close:hover svg,
  .edu__toggle:hover,
  .link:hover,
  .job__head:not(:disabled):hover .job__date,
  .job__head:not(:disabled):hover .job__company,
  .job__head:not(:disabled):hover .job__icon { animation: boil .42s steps(1) infinite; }
}

/* ============ Карточки на планшетах и телефонах (макет mob_карточка продукта 393) ============
   превью сверху с отступом 8px, ниже название, описание и год зелёной плашкой */
@media (max-width: 999px) {
  .card {
    justify-content: flex-start;
    gap: 0;
    padding: 8px 8px 20px;
    border-radius: 18px;
  }
  .card__preview {
    position: static;
    order: -1;
    height: auto;
    aspect-ratio: 264 / 150;
    border-radius: 11px;
    opacity: 1;
  }
  .card__top { display: contents; }
  .card__icon { display: none; }
  .card__body { padding: 18px 8px 0; }
  .card__title { font-size: 20px; line-height: 1.2; margin-bottom: 6px; }
  .card__desc { font-size: 17px; line-height: 1.2; }
  .card__year {
    order: 3;
    align-self: flex-start;
    margin: 18px 8px 0;
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
  }
}
@media (max-width: 599px) {
  .card__title { font-size: 20px; }
  .card__desc { font-size: 17px; }
}

/* ============ Мобильное меню: плавающая панель внизу ============ */
.tabbar { display: none; }
@media (max-width: 999px) {
  .header__nav { display: none; }
  .home { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .sheet__panel { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }

  .tabbar {
    position: fixed;
    left: 50%;
    max-width: calc(100vw - 24px);   /* не прилипает к краям экрана */
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    gap: 2px;
    padding: 5px;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 999px;
    background: rgba(244, 243, 239, .78);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 8px 28px rgba(33, 33, 33, .12), 0 1px 2px rgba(33, 33, 33, .06);
    transform: translateX(-50%);
    white-space: nowrap;
  }
  .tabbar__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    transition: background-color .25s var(--ease), color .25s var(--ease), transform .15s;
  }
  .tabbar__item:active { transform: scale(.95); }
  .tabbar__item[aria-current="page"] { background: var(--accent); color: #fff; }
  .tabbar__item svg { color: var(--muted); }
  /* разделы сайта | внешние ссылки */
  .tabbar__sep { flex: none; align-self: center; width: 1px; height: 20px; margin: 0 4px; background: rgba(0, 0, 0, .12); }
  .tabbar__short { display: none; }
}
@media (max-width: 479px) {
  .tabbar__item { padding: 0 11px; font-size: 14px; gap: 4px; }
  .tabbar__long { display: none; }
  .tabbar__short { display: inline; }
  .tabbar__sep { margin: 0 2px; }
}
@media (max-width: 379px) {
  .tabbar__item { padding: 0 10px; }
  .tabbar__sep { margin: 0; }
  .tabbar__item svg { display: none; }   /* стрелки убираем: внешние ссылки и так отделены разделителем */
}
@media (max-width: 339px) {
  .tabbar__item { padding: 0 7px; font-size: 13px; gap: 3px; }
}

/* ============ Шапка: аватар ============ */
/* Десктоп: аватар увеличивается при наведении */
.header__avatar { transition: width .35s var(--ease), height .35s var(--ease); }
@media (hover: hover) and (min-width: 1000px) {
  .header__me:hover .header__avatar { width: 76px; height: 76px; }
}

/* Планшеты и телефоны: фото и имя по центру, одно под другим, фото крупнее */
@media (max-width: 999px) {
  :root { --header-h: 150px; }
  .header { justify-content: center; }
  .header__me { flex-direction: column; gap: 10px; }
  .header__avatar { width: 80px; height: 80px; }
  .header__name { display: inline; font-size: 17px; }
}
@media (max-width: 599px) {
  :root { --header-h: 124px; }
  .header__me { gap: 8px; }
  .header__avatar { width: 64px; height: 64px; }
  .header__name { font-size: 16px; }
}

/* ============ Курсор ============
   зелёная точка; над ссылками и кнопками — зелёный «рисованный» круг.
   Включается из app.js только на устройствах с мышью */
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor__pos { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; will-change: transform; transition: opacity .2s; }
html.cursor-hidden .cursor__pos { opacity: 0; }
.cursor__dot {
  display: block;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform .25s var(--ease);
}
.cursor__ring {
  display: block;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  color: var(--accent);
  opacity: 0;
  transform: scale(.4);
  transition: opacity .2s, transform .3s var(--ease);
}
html.cursor-link .cursor__dot { transform: scale(.6); }
html.cursor-link .cursor__ring { opacity: 1; transform: none; animation: boil .42s steps(1) infinite; }
html.cursor-down .cursor__ring { transform: scale(.82); }
html.cursor-down .cursor__dot { transform: scale(.5); }
.cursor__stretch { display: block; width: 0; height: 0; will-change: transform; }

/* «Режим фокуса» в опыте работы: пока один пункт раскрыт, остальные — в одну строку */
.job__head { transition: padding .3s var(--ease); }
.jobs.has-open .job:not(.is-open) .job__head { padding-top: 7px; padding-bottom: 7px; }
.jobs.has-open .job:not(.is-open) .job__role { display: none; }
.jobs.has-open .job:not(.is-open) .job__icon { margin-top: 3px; }
.jobs.has-open .job.is-open .job__desc { padding-bottom: 12px; }
@media (max-width: 999px) {
  /* в узкой колонке дата стоит над компанией — в свёрнутых строках оставляем только компанию */
  .jobs.has-open .job:not(.is-open) .job__date { display: none; }
  .jobs.has-open .job:not(.is-open) .job__who { grid-row: 1; }
  .jobs.has-open .job:not(.is-open) .job__icon { grid-row: 1; margin-top: 0; }
}
@media (max-width: 767px) {
  /* на телефонах страница всё равно прокручивается — фокус не нужен */
  .jobs.has-open .job:not(.is-open) .job__head { padding-top: 16px; padding-bottom: 16px; }
  .jobs.has-open .job:not(.is-open) .job__role,
  .jobs.has-open .job:not(.is-open) .job__date { display: revert; }
  .jobs.has-open .job:not(.is-open) .job__who { grid-row: 2; }
  .jobs.has-open .job:not(.is-open) .job__icon { grid-row: 1 / span 2; }
}


/* ============ «Другие проекты» в конце страницы проекта ============
   те же маленькие плашки, что и второстепенные работы на главной (.mn) */
.more { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); }
.more__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 999px) { .more__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 599px) {
  .more { margin-top: 48px; padding-top: 28px; }
  .more__grid { grid-template-columns: 1fr; gap: 8px; }
}
.sheet__content.is-swapping { animation: content-in .45s var(--ease) both; }
@keyframes content-in { from { opacity: 0; transform: translateY(18px); } }

/* ============ Телефоны: «Образование» — обычный раздел после мест работы ============ */
@media (max-width: 767px) {
  .exp { display: flex; flex-direction: column; gap: 32px; }
  .exp__about { display: contents; }
  .exp .prose { order: 1; }
  .exp .tags { order: 2; }
  .exp .jobs { order: 3; }
  .exp .edu { order: 4; margin: 8px 0 0; }
  .edu__toggle { pointer-events: none; color: var(--muted); font-size: 15px; }
  .edu__chevron { display: none; }
  .edu .collapse { grid-template-rows: 1fr; }
  .edu__list { padding-top: 4px; font-size: 15px; line-height: 1.4; }
  .edu__list li { padding: 12px 0; border-top: 1px solid var(--line); }
  .edu__list li + li { margin-top: 0; }
  .edu__list li:last-child { border-bottom: 1px solid var(--line); }
}

/* ============ Шапка в проекте стоит на месте, шторка при прокрутке наезжает на неё (на всех экранах) ============ */
.overlay > .header { position: sticky; top: 0; z-index: 0; }
.overlay > .sheet { z-index: 1; }

/* Планшеты: пока «Образование» раскрыто, оно встаёт на место тегов — так страница помещается в экран */
@media (min-width: 768px) and (max-width: 1279px) {
  .exp__about:has(.edu__toggle[aria-expanded="true"]) .tags { display: none; }
  .edu__list { padding-top: 12px; }
  .edu__list li + li { margin-top: 6px; }
}
@media (min-width: 768px) and (max-width: 999px) {
  .sheet__panel[data-page="experience"] { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* Иллюстрация на главной: кадры анимации лежат друг на друге */
.ill { position: relative; }
.ill img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ill img[hidden] { display: none; }
.ill .ill__vec { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ill .ill__vec[hidden] { display: none; }

/* Слайды презентации (Gaze Laber): скругление как у самих слайдов, запись поверх экрана */
.shots--slides .shot img { border-radius: 2.1% / 3.7%; }
.shot--media { position: relative; }
.shot__media { position: absolute; object-fit: cover; background: #000; }
/* экран приложения на слайде калибровки */
.shots .shot .shot__media--screen { left: 37.3%; top: 26.2%; width: 56.45%; height: 62.7%; object-position: top center; }
/* рентгеновский снимок на слайде «Как работает считывание взгляда» */
.shots .shot .shot__media--xray { left: 6.28%; top: 24.9%; width: 35.94%; height: 63.85%; border-radius: 3% / 3%; }
/* верхний слой слайда (стрелки) поверх анимации */
.shots .shot .shot__layer { position: absolute; inset: 0; width: 100%; height: 100%; background: none; pointer-events: none; }

/* Длинный макет, нарезанный на части: склеиваем без зазоров */
.shot--stack { border-radius: 24px; overflow: hidden; }
@media (max-width: 599px) { .shot--stack { border-radius: 14px; } }
.shots .shot--stack img { border-radius: 0; }
/* Логотип ИИИ: знак и аватарка чата */
.logo-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.logo-demo__card { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: var(--radius-shot); background: #fff; border: 1px solid var(--line-soft); }
.logo-demo__card img { width: 46%; height: auto; }
.logo-demo__card--dark { background: #1F1F1F; border-color: #1F1F1F; }
@media (max-width: 599px) { .logo-demo { grid-template-columns: 1fr; } }
/* чат и бейдж разной ширины, чтобы не перекликались с сеткой «Других проектов» ниже:
   слева широкая тёмная карточка с чатом, справа квадратный бейдж; высота у них общая */
.logo-demo { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }
.logo-demo__card { aspect-ratio: auto; }
.logo-demo__card--photo { aspect-ratio: 1; }
.logo-demo__card--photo { overflow: hidden; border: 0; background: #E8EDEF; }
.logo-demo__card--photo img { width: 100%; height: 100%; object-fit: cover; }
/* скриншот плашки корпоративного чата */
.logo-demo__card .logo-demo__chat { width: 60%; height: auto; }
@media (max-width: 599px) { .logo-demo { grid-template-columns: 1fr; } .logo-demo__card--dark { aspect-ratio: 16 / 9; } .logo-demo__card .logo-demo__chat { width: 76%; } }

/* ============ Галерея (Сбер): две независимые колонки, одинаковые отступы по вертикали ============ */
.gallery { margin-top: 56px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
.gallery__col { display: flex; flex-direction: column; gap: 40px; }
.g-item figcaption { font-size: 16px; color: var(--muted); margin-bottom: 14px; }
.g-item img { display: block; width: 100%; height: auto; border-radius: var(--radius-shot); background: var(--bg-dim); }
@media (max-width: 599px) {
  .gallery { margin-top: 40px; grid-template-columns: 1fr; gap: 28px; }
  .gallery__col { gap: 28px; }
  .g-item figcaption { font-size: 14px; margin-bottom: 10px; }
}

/* ============ Пароль на проект ============ */
.lock { max-width: 460px; margin-top: 40px; }
.lock__text { font-size: 16px; line-height: 1.4; margin-bottom: 20px; }
.lock__row { display: flex; gap: 10px; }
.lock__input {
  flex: 1; min-width: 0; height: 48px; padding: 0 18px;
  border: 1px solid #CFCCC5; border-radius: 999px; background: #fff;
  font: 400 16px/1 var(--font); letter-spacing: .08em; color: var(--text);
}
.lock__input::placeholder { letter-spacing: 0; color: var(--muted); opacity: 1; }
.lock__input:focus { outline: none; border-color: var(--accent); }
.lock__btn { height: 48px; padding: 0 24px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 500; }
.lock__btn { transition: opacity .2s, background-color .2s; }
.lock__btn:disabled { opacity: .45; cursor: default; }
.lock__error { margin-top: 10px; font-size: 14px; color: #C8473B; }
/* закрытые работы: картинки нельзя выделить, перетащить или сохранить через меню; при печати скрыты */
.lock__content { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lock__content .g-item { position: relative; }
.lock__content .g-item img { pointer-events: none; }
.lock__content .g-item::after { content: ""; position: absolute; inset: 0; } /* прозрачный слой поверх картинки */
@media print { .lock__content { display: none !important; } }

/* замок рядом с названием закрытого проекта */
.card__lock { display: inline-block; vertical-align: -1px; margin-left: 7px; color: var(--muted); }
@media (max-width: 999px) { .card__lock { width: 17px; height: 17px; vertical-align: -2px; } }
/* телефоны: поле и кнопка во всю ширину, одно под другим — удобно нажимать пальцем */
@media (max-width: 599px) {
  .lock { margin-top: 28px; max-width: none; }
  .lock__text { font-size: 15px; margin-bottom: 16px; }
  .lock__row { flex-direction: column; gap: 10px; }
  .lock__input, .lock__btn { height: 52px; width: 100%; }
  .lock__input { flex: none; padding: 0 20px; } /* 16px — iOS не увеличивает страницу при фокусе */
  .lock__error { text-align: center; }
}

/* ============ Statera: «просили — сделано» и сетка экранов админки ============ */
.compare { margin-top: 64px; }
/* колонки пропорциональны картинкам — обе одной высоты */
.compare__row { display: grid; grid-template-columns: 1456fr 2000fr; gap: 16px; align-items: start; }
.compare__item figcaption { font-size: 16px; color: var(--muted); margin-bottom: 14px; }
.compare__item img { width: 100%; border-radius: var(--radius-shot); background: var(--bg-dim); }
.block--wide { max-width: none; margin-top: 64px; }
.shot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; }
@media (max-width: 599px) {
  .compare { margin-top: 44px; }
  .compare__row { grid-template-columns: 1fr; gap: 28px; }
  .compare__item figcaption { font-size: 14px; margin-bottom: 10px; }
  .block--wide { margin-top: 44px; }
  .shot-grid { grid-template-columns: 1fr; gap: 28px; }
}
.logo-banner { display: block; width: 100%; height: auto; margin-top: 24px; border-radius: var(--radius-shot); background: #212126; }
@media (max-width: 599px) { .logo-banner { aspect-ratio: 2 / 1; object-fit: cover; } }

/* ============ Swize: мокапы телефонов на лавандовой подложке ============ */
:root { --phone-bg: #E1DEF1; } /* в цвет фона, на который положены мокапы */
.phone-hero {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 4%;
  margin-top: 64px; padding: 48px 10% 24px; border-radius: 24px; background: var(--phone-bg);
}
.phone-hero img { width: 100%; height: auto; }
.phone-hero img:nth-child(2) { transform: translateY(-24px); }
.flows__label { margin-top: 72px; margin-bottom: 0; font-size: 20px; color: var(--text); }
.flow { margin-top: 32px; }
.flow__title { font-size: 17px; font-weight: 500; }
.flow__desc { margin-top: 4px; font-size: 15px; color: var(--muted); max-width: 640px; }
.phones {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 0;
  margin-top: 16px; padding: 16px 12px 4px; border-radius: 20px; background: var(--phone-bg);
}
.phones img { width: 100%; height: auto; }
.shot--flow { margin-top: 72px; }
.shot--flow img { background: #fff; }

@media (max-width: 999px) {
  .phones { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* телефоны: ряд экранов листается пальцем */
@media (max-width: 599px) {
  .phone-hero { margin-top: 40px; padding: 28px 4% 12px; border-radius: 18px; }
  .phone-hero img:nth-child(2) { transform: translateY(-12px); }
  .flows__label { margin-top: 48px; font-size: 18px; }
  .flow { margin-top: 24px; }
  .flow__desc { font-size: 14px; }
  .phones {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0;
    margin: 12px calc(-1 * var(--sheet-pad)) 0; padding: 12px var(--sheet-pad) 4px; border-radius: 0;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .phones::-webkit-scrollbar { display: none; }
  .phones img { flex: none; width: 40%; scroll-snap-align: start; }
  .shot--flow { margin-top: 48px; }
}
/* края мокапов растворяются в подложке — обрезанная тень телефона не даёт видимых прямоугольников */
.phone-hero img, .phones img {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 4%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 4%, #000 92%, transparent);
  mask-composite: intersect;
}

/* ============ Масштабируемая схема ============ */
.zoom {
  position: relative; overflow: hidden; aspect-ratio: 1560 / 1070;
  border-radius: var(--radius-shot); background: #fff; border: 1px solid var(--line-soft);
  touch-action: none; cursor: zoom-in; outline: none;
}
.zoom:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.zoom.is-zoomed { cursor: grab; }
.zoom.is-zoomed:active { cursor: grabbing; }
.shots .zoom .zoom__img, .zoom__img {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none;
  transform-origin: 0 0; border-radius: 0; background: none;
  user-select: none; -webkit-user-drag: none;
}
.zoom__ui { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }
.zoom__ui button {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--line); color: var(--text);
  font-size: 20px; line-height: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.zoom__ui button:hover { color: var(--accent); }
.zoom__hint {
  position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .92); font-size: 13px; color: var(--muted);
  pointer-events: none; transition: opacity .3s;
}
.zoom.is-zoomed .zoom__hint { opacity: 0; }
@media (hover: none) { .zoom__hint { display: none; } }
/* схема Swize в SVG: чёткая при любом масштабе */
.uf { font-family: var(--font); }
.uf .e { fill: none; stroke: #B5B5B5; stroke-width: 1.3; marker-end: url(#uf-arrow); }
.uf .e--d { stroke: #C8C8C8; stroke-dasharray: 6 4; }
.uf .box { fill: #212121; }
.uf .st { fill: #6950F5; }
.uf .dia { fill: #E4E4E4; }
.uf .tx { fill: #fff; font-size: 7.2px; font-weight: 500; text-anchor: middle; dominant-baseline: central; }
.uf .tx--d { fill: #3a3a3a; }
.uf .lbl { font-size: 8px; font-weight: 600; fill: #2a2a2a; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #fff; stroke-width: 6px; }

.zoom--inv { aspect-ratio: 1865 / 795; }
.shot--flow-inv { margin-top: 0; }

/* схема Inventum.ai: в стиле прежней схемы проекта, цвета Inventum */
.uf--inv .e { fill: none; stroke: #7E6F86; stroke-width: 1.1; marker-end: url(#inv-arrow); }
.uf--inv .e--d { stroke: #C04BEB; stroke-dasharray: 4 3; marker-end: url(#inv-arrow-d); }
.uf--inv .page { fill: #fff; stroke: #A39DA7; stroke-width: 1; }
.uf--inv .accent { fill: #B414E6; }
.uf--inv .actor { fill: #241B28; }
.uf--inv .dia { fill: #fff; stroke: #C04BEB; stroke-width: 1.2; }
.uf--inv .pick { fill: #fff; stroke: #D47AF2; stroke-width: 1.1; stroke-dasharray: 5 3; }
.uf--inv .card { fill: #FBFAFC; stroke: #E4E0E7; stroke-width: 1; }
.uf--inv .tx { fill: #fff; font-size: 7.4px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.uf--inv .tx--d { fill: #231C26; }
.uf--inv .tx--s { font-size: 6.8px; }
.uf--inv .tx--l { text-anchor: start; font-size: 7px; }
.uf--inv .ic { fill: none; stroke: #fff; stroke-width: 1.1; stroke-linecap: round; }
.uf--inv .ci { fill: #2B2430; font-size: 6.4px; font-weight: 500; dominant-baseline: central; }
.uf--inv .ci--h { font-weight: 700; }
.uf--inv .ci .ar { fill: #B414E6; font-weight: 700; }
.uf--inv .bul { fill: #B414E6; }
.uf--inv .bul--s { fill: none; stroke: #B414E6; stroke-width: .7; }
.uf--inv .an { fill: #231C26; font-size: 6.6px; font-weight: 700; }

/* ============ Вырез экрана и системные полосы (iPhone, Android) ============
   viewport-fit=cover растягивает страницу на весь экран, поэтому отступаем
   от выреза/«брови», скруглённых углов и полосы «домой» через safe-area */
.header, .home, .sheet {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.header { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
.home { min-height: calc(100svh - var(--header-h) - env(safe-area-inset-top)); }

/* ============ Единая шкала отступов на страницах проектов ============
   --s-head     шапка проекта → содержимое (и форма пароля)
   --s-section  между крупными разделами: тексты → картинки → «Дополнительно» → «Другие проекты»
   --s-block    между блоками внутри раздела и между картинками в ленте
   --s-inner    текст → картинка внутри одного блока
   --s-caption  подпись → картинка, заголовок блока → текст
   --s-gap      между элементами, стоящими рядом (колонки, сетки) */
:root { --s-head: 48px; --s-section: 72px; --s-block: 40px; --s-inner: 24px; --s-caption: 14px; --s-gap: 16px; }
@media (max-width: 999px) { :root { --s-head: 40px; --s-section: 56px; --s-block: 32px; --s-inner: 20px; --s-caption: 12px; --s-gap: 12px; } }
@media (max-width: 599px) { :root { --s-head: 32px; --s-section: 44px; --s-block: 28px; --s-inner: 16px; --s-caption: 10px; --s-gap: 12px; } }

.sheet__panel .project-info, .sheet__panel .lock { margin-top: var(--s-head); }
.sheet__panel .block + .block,
.sheet__panel .project-info__side { margin-top: var(--s-block); }
@media (min-width: 1000px) { .sheet__panel .project-info__side { margin-top: 0; } }
.sheet__panel .project-info__side .block + .block { margin-top: var(--s-block); }
@media (max-width: 999px) { .sheet__panel .project-info__side .block + .block { margin-top: 0; } .sheet__panel .project-info__side { gap: var(--s-block); } }

.sheet__panel .shots, .sheet__panel .gallery, .sheet__panel .compare, .sheet__panel .phone-hero,
.sheet__panel .block--extra, .sheet__panel .block--wide, .sheet__panel .shot--flow,
.sheet__panel .flows__label, .sheet__panel .more { margin-top: var(--s-section); }
.sheet__panel .shots .shot--flow { margin-top: 0; }
.sheet__panel .more { padding-top: var(--s-block); }

.sheet__panel .shots, .sheet__panel .gallery__col { gap: var(--s-block); }
.sheet__panel .shot-grid { gap: var(--s-block) var(--s-gap); }
.sheet__panel .gallery { column-gap: var(--s-gap); row-gap: var(--s-block); }
.sheet__panel .compare__row, .sheet__panel .logo-demo, .sheet__panel .more__grid { gap: var(--s-gap); }
@media (max-width: 599px) { .sheet__panel .compare__row { gap: var(--s-block); } }
.sheet__panel .flow { margin-top: var(--s-block); }
.sheet__panel .flows__label + .flow { margin-top: var(--s-inner); }

.sheet__panel .label,
.sheet__panel .shot figcaption, .sheet__panel .g-item figcaption, .sheet__panel .compare__item figcaption { margin-bottom: var(--s-caption); }
.sheet__panel .flow__desc { margin-top: 4px; }
.sheet__panel .phones { margin-top: var(--s-caption); }
.sheet__panel .logo-demo, .sheet__panel .logo-banner { margin-top: var(--s-inner); }
/* ряды экранов Swize: колонок столько, чтобы не оставалось одиноких экранов в последней строке */
.sheet__panel .phones { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
@media (max-width: 999px) { .sheet__panel .phones { grid-template-columns: repeat(var(--nt, 4), minmax(0, 1fr)); } }
@media (max-width: 599px) { .sheet__panel .phones { grid-template-columns: none; } }

/* ============ Просмотр фото ============ */
.lb-able { cursor: zoom-in; }
.lb {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(237, 235, 230, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .25s ease;
}
.lb[hidden] { display: none; }
.lb.is-open { opacity: 1; }
.lb__stage {
  position: absolute; inset: 64px 88px 72px; display: grid; place-items: center;
  overflow: hidden; touch-action: none;
}
.lb__img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: var(--radius-shot); box-shadow: 0 18px 60px rgba(33, 33, 33, .14);
  transform-origin: center; user-select: none; -webkit-user-drag: none; cursor: zoom-in;
}
.lb__img.is-anim { transition: transform .3s var(--ease); }
.lb__img.is-in { animation: lb-in .3s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } }
.lb.is-zoomed .lb__img { cursor: grab; box-shadow: none; }
.lb.is-zoomed .lb__img:active { cursor: grabbing; }
.lb.is-protected .lb__img { -webkit-touch-callout: none; }
.lb__btn {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .9); border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06); transition: color .2s, background-color .2s, opacity .2s;
}
.lb__btn:hover { color: var(--accent); background: #fff; }
.lb__close { top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
.lb__nav { top: 50%; margin-top: -22px; }
.lb__nav--prev { left: max(24px, env(safe-area-inset-left)); }
.lb__nav--next { right: max(24px, env(safe-area-inset-right)); }
.lb.is-single .lb__nav, .lb.is-zoomed .lb__nav { opacity: 0; pointer-events: none; }
.lb__bar {
  position: absolute; left: 88px; right: 88px; bottom: max(22px, env(safe-area-inset-bottom));
  display: flex; justify-content: center; gap: 16px; font-size: 15px; color: var(--muted); text-align: center;
  pointer-events: none;
}
.lb__count { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 599px) {
  .lb__stage { inset: 64px 12px 84px; }
  .lb__nav { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); margin-top: 0; }
  .lb__nav--prev { left: 16px; } .lb__nav--next { right: 16px; }
  .lb__bar { left: 72px; right: 72px; bottom: max(26px, calc(env(safe-area-inset-bottom) + 12px)); flex-direction: column; gap: 2px; font-size: 13px; }
  .lb__cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { .lb, .lb__img { transition: none !important; animation: none !important; } }
/* аватар в просмотре: квадратное фото, на планшетах и телефонах аватар — «кликабельный» */
.lb.is-avatar .lb__img { border-radius: 24px; max-width: min(100%, 560px); }
@media (max-width: 999px) { .header__avatar { cursor: zoom-in; } }

/* ============ Схемы: развернуть на весь экран, удобный просмотр с телефона ============ */
.zoom { touch-action: pan-y; }
.zoom.is-full {
  position: fixed; inset: 0; z-index: 950; aspect-ratio: auto;
  border: 0; border-radius: 0; background: #fff; touch-action: none;
}
html.zoom-full { overflow: hidden; }
.zoom__fullbtn .i-close, .zoom.is-full .zoom__fullbtn .i-open { display: none; }
.zoom.is-full .zoom__fullbtn .i-close { display: block; }
.zoom.is-full .zoom__ui { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
.zoom.is-full .zoom__hint { display: none; }
.zoom__tap { display: none; }
@media (hover: none) {
  /* в ленте схема — превью: тап открывает её на весь экран, где работают щипок и перетаскивание */
  .zoom:not(.is-full) .zoom__ui { display: none; }
  .zoom__tap {
    display: flex; align-items: center; gap: 6px; position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
    padding: 6px 12px; border-radius: 999px; background: rgba(33, 33, 33, .78); color: #fff;
    font-size: 13px; white-space: nowrap; pointer-events: none;
  }
  .zoom.is-full .zoom__tap { display: none; }
  .zoom.is-full .zoom__ui button[data-zoom="in"], .zoom.is-full .zoom__ui button[data-zoom="out"] { display: none; }
  .zoom.is-full .zoom__ui { left: 50%; right: auto; transform: translateX(-50%); gap: 10px; }
  .zoom.is-full .zoom__ui button { width: 44px; height: 44px; border-radius: 50%; }
}

/* ============ Просмотр фото: аккуратнее тень, на телефоне — подпись сверху, кнопки снизу ============ */
.lb__img { box-shadow: 0 0 0 1px rgba(33, 33, 33, .06), 0 12px 32px -18px rgba(33, 33, 33, .25); }
@media (max-width: 599px) {
  .lb__stage { inset: max(72px, calc(env(safe-area-inset-top) + 60px)) 12px max(96px, calc(env(safe-area-inset-bottom) + 84px)); }
  .lb__bar { top: max(18px, env(safe-area-inset-top)); bottom: auto; left: 20px; right: 20px; }
  .lb__close { top: auto; right: auto; left: 50%; margin-left: -24px; width: 48px; height: 48px; bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); }
  .lb__nav { bottom: max(26px, calc(env(safe-area-inset-bottom) + 14px)); }
  .lb__nav--prev { left: 24px; } .lb__nav--next { right: 24px; }
}

/* ============ Типографика ============
   заголовки — сбалансированные строки, абзацы — без «висящих» коротких последних строк */
h1, h2, h3, .page-title, .hero__title, .card__title, .flow__title, .label { text-wrap: balance; }
p, li, figcaption, .prose, .card__desc, .flow__desc, .lock__text { text-wrap: pretty; }
body { font-kerning: normal; font-variant-ligatures: common-ligatures; }

/* стрелка у внешних ссылок — как в макете: изогнутая «≻» */
.link-arrow { display: inline-block; flex: none; width: 7px; height: 11px; vertical-align: -1px; margin-left: 3px; }
.header__tg .link-arrow { margin-left: 1px; }
.tabbar__item .link-arrow { margin-left: 1px; color: var(--muted); }
.tabbar__item[aria-current="page"] .link-arrow { color: inherit; }
.link .link-arrow { margin-left: 2px; }

/* ============ Клубок на главной ============ */
.ill .ill__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ill--interactive .ill__svg { cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; }
.ill--interactive .ill__svg:active { cursor: grabbing; }
/* просмотр фото: высокие картинки (мокапы телефонов) целиком вписываются в окно */
.lb__stage { display: flex; align-items: center; justify-content: center; }
.lb__img { max-width: 100%; max-height: 100%; object-fit: contain; flex: none; }
/* узелок на кнопке, пока открываются закрытые работы */
.lock__btn.is-busy { opacity: 1; display: inline-grid; place-items: center; min-width: 104px; }
.knot path { stroke-dasharray: 100; animation: knot-tie 1.1s steps(13) infinite; }
@keyframes knot-tie { 0% { stroke-dashoffset: 100; } 70%, 100% { stroke-dashoffset: 0; } }

/* ============ Нитка-прогресс чтения ============ */
.thread-progress {
  position: fixed; z-index: 2; top: 50%; right: calc(var(--gutter) + 26px);
  width: 12px; height: min(38vh, 300px); transform: translateY(-50%);
  overflow: visible; pointer-events: none; opacity: 0; transition: opacity .4s ease;
}
.thread-progress.is-on { opacity: 1; }
.thread-progress path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tp-track { stroke: #E3E1DB; stroke-width: 1.4; }
.tp-line { stroke: #8C8B87; stroke-width: 1.4; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .15s linear; }
.tp-knot { stroke: #8C8B87; stroke-width: 1.4; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .5s var(--ease); }
.thread-progress.is-done .tp-knot { stroke-dashoffset: 0; }
@media (min-width: 1680px) { .thread-progress { right: calc((100vw - 1760px) / 2 + var(--gutter) + 26px); } }
@media (max-width: 999px) { .thread-progress { display: none; } }
/* мокап без фона в просмотре: без плашки и рамки, мягкая тень по контуру телефона */
.lb.is-cutout .lb__img { border-radius: 11.5% / 5.7%; box-shadow: none; filter: none; } /* углы по форме телефона — без следов тени исходника */

/* роль рядом с именем в шапке: тем же шрифтом, через точку */
.header__id { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: center; column-gap: 8px; min-width: 0; }
.header__role { font-size: inherit; font-weight: 500; color: inherit; white-space: nowrap; }
.header__sep { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #D3D1CB; font-size: 0; align-self: center; margin-top: 2px; } /* точка крупнее и бледнее */
.header__id .header__name, .header__id .header__role { font-size: 16px; }
@media (max-width: 599px) { .header__id .header__name, .header__id .header__role { font-size: 15px; } }

/* ссылка на PDF-резюме */
/* в покое — стрелка из «резюме.svg», на наведении — рисованные кадры, как у соседних ссылок */
.header__cv { display: inline-flex; align-items: center; gap: 6px; }
.header__cv .dl-icon { flex: none; }
.tabbar__item .dl-icon { width: 9px; height: 9px; color: var(--muted); }
.tabbar__item[aria-current="page"] .dl-icon { color: inherit; }
/* «Обо мне» в шапке: рукописных кадров для этого слова нет — та же «дрожащая» подсветка, что у ссылок */
.header__about { transition: color .15s; }
@media (hover: hover) { .header__about:hover { color: var(--accent); animation: boil .42s steps(1) infinite; } }
/* страница «Резюме»: заголовок и кнопка скачивания PDF в одну строку */
.cv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding-right: 40px; }
.cv-head .page-title { padding-right: 0; }
.cv-dl {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border: 1px solid #CFCCC5; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text);
  transition: border-color .2s, color .2s;
}
.cv-dl svg { color: var(--muted); transition: color .2s, transform .2s var(--ease); }
@media (hover: hover) { .cv-dl:hover { color: var(--accent); border-color: var(--accent); } .cv-dl:hover svg { color: var(--accent); transform: translateY(1px); } }
/* телефоны: кнопка скачивания — во всю ширину под заголовком, удобная для пальца */
@media (max-width: 599px) {
  .cv-head { flex-direction: column; align-items: stretch; gap: 14px; padding-right: 0; }
  .cv-head .page-title { padding-right: 40px; }
  .cv-dl { justify-content: center; height: 48px; padding: 0 16px; border-radius: 12px; font-size: 15px; background: var(--surface, #fff); border-color: var(--line); }
  .cv-dl svg { width: 16px; height: 16px; }
  .cv-dl:active { transform: scale(.98); }
}
@media (min-width: 768px) and (max-width: 999px) { .sheet__panel[data-page="experience"] .exp { margin-top: 24px; } }

/* Планшеты и телефоны: имя и специальность — строками под фото, имя крупнее и жирнее, специальность серым.
   Всё собрано плотно: фото, имя и роль читаются одним блоком */
@media (max-width: 999px) {
  :root { --header-h: 166px; }
  .header__me { gap: 12px; }
  .header__id { flex-direction: column; align-items: center; row-gap: 0; line-height: 1.25; }
  .header__sep { display: none; }
  .header__id .header__name { font-size: 18px; font-weight: 600; }
  .header__id .header__role { font-size: 15px; font-weight: 400; color: var(--muted); }
}
@media (max-width: 599px) {
  :root { --header-h: 140px; }
  .header__me { gap: 10px; }
  .header__id .header__name { font-size: 17px; }
  .header__id .header__role { font-size: 14px; }
}

/* ============ Телефоны: верх главной слева ============
   шапка — строкой (аватар, справа имя и роль), клубок и заголовок выровнены по левому краю,
   заголовок в три строки: «Делаю понятные / интерфейсы для / сложных продуктов» */
.br-phone { display: none; }
@media (max-width: 599px) {
  :root { --header-h: 92px; }
  .header { justify-content: flex-start; }
  .header__me { flex-direction: row; gap: 14px; }
  .header__avatar { width: 52px; height: 52px; }
  .header__id { align-items: flex-start; }
  .header__id .header__name { font-size: 18px; }
  .header__id .header__role { font-size: 15px; }

  .home { min-height: 0; overflow-x: clip; } /* размотанная нитка может уйти за левый край — без горизонтальной прокрутки */
  .hero { flex: none; align-items: flex-start; text-align: left; padding: 12px 0 36px; }
  .hero__art { height: 96px; margin: 0 0 10px -98px; } /* клубок в рисунке по центру — сдвигаем, чтобы он встал у левого края */
  .hero__title { font-size: 34px; line-height: 1.06; letter-spacing: -0.025em; }
  .br-phone { display: inline; }
  .nb-phone { display: none; }
}

/* ============ Телефоны: «было — стало» в Statera одной картинкой ============
   оба скриншота в общей рамке, короткие подписи — внутри неё над каждой картинкой */
@media (max-width: 599px) {
  .sheet__panel .compare__row { gap: 14px; padding: 12px 8px 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
  .sheet__panel .compare__item figcaption { margin: 0 4px 8px; font-size: 13px; line-height: 1.3; }
  .compare__item img { border-radius: 9px; }
}

/* ============ Нижнее меню: пунктов всего три — шрифт и кнопки крупнее ============ */
@media (max-width: 999px) {
  .tabbar__item { height: 46px; padding: 0 18px; font-size: 17px; }
}
@media (max-width: 479px) {
  .tabbar__item { padding: 0 15px; font-size: 16px; }
}
@media (max-width: 359px) {
  .tabbar__item { padding: 0 11px; font-size: 15px; }
}
