/* ============================================================
   Лев Тагин — портфолио
   Токены и метрики сняты из Figma «Sky Design Sys» / 254:9272
   ============================================================ */

:root {
  /* цвет */
  --bg:        #0a0a0b;   /* фон фрейма 254:9272 */
  --surface:   #121214;   /* плашка ховера 285:8211 */
  --fg:        #ffffff;
  /* В макете это белый на 60% и 40%, то есть чистый серый. Лев попросил
     увести его в холод: та же светлота, но с еле заметным синим подтоном
     (B выше R на ~25) — на тёмном фоне читается мягче нейтрального. */
  --muted:     #8b93a3;                   /* было opacity-60 */
  --dim:       #666e80;                   /* было opacity-40 */
  --line:      rgba(255, 255, 255, .1);   /* border карточек */
  --acid:      #e5ff27;                   /* акцент манифеста 444:11636 */

  /* метрика */
  /* Сетка макета: при артборде 1456 это 6 колонок по 213 с гаттером 20,
     страница 1378 и поля по 39. Контентная колонка 446 = ровно
     колонки 3–4, поэтому весь дизайн ложится на сетку без подгонки.
     Посмотреть колонки можно по Cmd+G (в интерфейсе не показываем). */
  --gut:       20px;
  --page:      min(1378px, 100% - 40px);
  /* Зазор между секциями. Считается от высоты экрана: Лев просил,
     чтобы блок читался отдельно — «блок, вокруг пустота, дальше
     следующий», — а это возможно только если воздух растёт вместе
     с экраном, а не стоит фиксированной константой. */
  --gap-sec:   clamp(180px, 30vh, 340px);
  --r-card:    2px;
  --r-chip:    8px;
  --r-btn:     12px;

  /* типографика: в макете SF Pro — на Apple берётся системный,
     на остальных падаем в ближайший гротеск */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* макет задаёт узкую оптическую ось — без неё строки шире и рвутся не там */
  --fvar: "wdth" 100, "opsz" 28;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1;
  font-variation-settings: var(--fvar);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

::selection { background: var(--fg); color: var(--bg); }

:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--r-chip);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ── контентная колонка ──────────────────────────────────── */

/* контент занимает две средние колонки; на средних экранах
   расширяется до четырёх, на узких — на всю страницу.
   Все три состояния лежат на границах колонок */
.col {
  width: calc((var(--page) - 100px) / 3 + var(--gut));
  margin-inline: auto;
}

@media (max-width: 1100px) {
  .col { width: calc((var(--page) - 100px) * 2 / 3 + 3 * var(--gut)); }
}

@media (max-width: 760px) {
  .col { width: var(--page); }
}

/* ── служебные колонки по Cmd+G ──────────────────────────── */

.peek {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  pointer-events: none;
}
.peek.is-on { display: block; }

.peek__in {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gut);
  width: var(--page);
  height: 100%;
  margin-inline: auto;
}
.peek__in span { background: rgba(255, 255, 255, .06); }

/* ── навигация ───────────────────────────────────────────── */

/* Вкладка, приклеенная к нижнему краю экрана: верх скруглён, а по
   бокам «уши» с обратным скруглением — плашка не висит в воздухе,
   а вытекает из края. Обводки и подсветки нет: форму держит тон,
   как на референсе, а любая рамка оборвалась бы на стыке с ушами. */
.nav {
  --nav-bg: #17171b;
  --ear: 18px;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 32px);
}

.nav__inner {
  position: relative;
  display: flex;
  gap: 2px;
  /* снизу больше: край экрана поджимает. На айфоне добавляем полосу
     home-индикатора, иначе ссылки уезжают под неё */
  padding: 6px 6px calc(10px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--nav-bg);
}

/* Ухо = квадрат R×R у нижнего края, из которого маска вырезает
   четверть круга с центром в дальнем от плашки верхнем углу.
   Остаётся вогнутый клин, который сводит плашку с краем экрана. */
.nav__inner::before,
.nav__inner::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: var(--ear);
  height: var(--ear);
  background: var(--nav-bg);
  pointer-events: none;
}
.nav__inner::before {
  right: 100%;
  -webkit-mask: radial-gradient(circle var(--ear) at top left, transparent 98%, #000 100%);
  mask: radial-gradient(circle var(--ear) at top left, transparent 98%, #000 100%);
}
.nav__inner::after {
  left: 100%;
  -webkit-mask: radial-gradient(circle var(--ear) at top right, transparent 98%, #000 100%);
  mask: radial-gradient(circle var(--ear) at top right, transparent 98%, #000 100%);
}

.nav__link {
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  color: rgba(255, 255, 255, .45);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav__link:hover { color: rgba(255, 255, 255, .85); }

.nav__link.is-active {
  background: var(--fg);
  color: #000;
  font-weight: 700;
}
.nav__link.is-active:hover { color: #000; }

/* ── секции ──────────────────────────────────────────────── */

main > section { margin-bottom: var(--gap-sec); }
main > section:first-child { margin-top: 80px; }

h2 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.01em;
}

/* кнопка «Написать мне» */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-btn);
  background: var(--fg);
  color: #000;
  font-weight: 590;
  line-height: 1.4;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); opacity: .88; }
.btn:active { transform: translateY(0); }
.btn__icon { width: 12px; height: 12px; }

/* ═══════════════════════════════════════════════════════════
   ГЛАВНАЯ. Метрики сняты с Figma «Sky Design Sys» / 444:11636.
   Манифест — 48px/700, интерлиньяж 1, строфы через 72px;
   блок шире контентных 446px и сознательно вылезает вправо,
   ровно как в макете (там он 560px при той же левой границе).
   ═══════════════════════════════════════════════════════════ */

/* кегль манифеста: 48px на десктопе, ниже — по ширине экрана,
   чтобы строки с white-space:nowrap не резались */
.say, .style { --say: clamp(21px, 7.4vw, 48px); }
/* подписи галереи и инструментов — один кегль, до 24 */
:root { --cap: clamp(18px, 5.2vw, 24px); }

/* ── общий слой анимации текста ──────────────────────────── */
/* Юниты режет main.js по спекам скилла animate-text. Класс .anim
   вешает сам main.js первой же строкой — до первой отрисовки,
   поэтому мигания нет, а если скрипт не доехал, блоки просто
   остаются видимыми. Ставить opacity:0 без этого условия нельзя:
   раньше страховочный кадр показывал строфу до её выхода,
   и на скролле она моргала — «видно → пропало → появилось». */
.anim [data-anim] { opacity: 0; }

/* will-change тут сознательно нет: юнитов на странице под сотню,
   и постоянные слои композитора съедают больше, чем экономят —
   WAAPI поднимает слой сам на время анимации */
.au {
  display: inline-block;
  white-space: pre;
}

/* ── манифест ────────────────────────────────────────────── */

main > section.say { margin-top: 120px; }

.say {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 72px;
  margin-bottom: var(--gap-sec);
}

.say__block { display: flex; flex-direction: column; }

.say__ln {
  font-size: var(--say);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.say__dim { color: var(--dim); }

/* переливающийся градиент 444:11660 — стопы макета, зеркально
   продолженные, чтобы петля шла без стыка */
/* Процент в background-position — это не сдвиг, а доля от
   (ширина блока − ширина картинки). При size 200% один полный
   оборот плитки = ровно 200%, поэтому петля сходится без скачка.
   Крайние стопы одинаковые — шва на стыке тоже нет. */
.say__grad {
  background-image: linear-gradient(95deg,
    #e5ff27 0%, #ff51ff 25%, #c67cff 38%, #00bbff 50%,
    #c67cff 62%, #ff51ff 75%, #e5ff27 100%);
  background-size: 200% 100%;
  background-position: 0 0;
  background-repeat: repeat-x;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-flow 8s linear infinite;
}
@keyframes grad-flow {
  from { background-position:   0 0; }
  to   { background-position: 200% 0; }
}

/* фото в строке — 53px при кегле 48. Один блок на оба снимка:
   в манифесте (герой) и у «details» (розовый кадр). */
/* Внешний span забирает анимацию появления: WAAPI с fill:both
   держит на нём свой transform и перебил бы ховер. Ховер поэтому
   отдан внутреннему слою — они больше не спорят. */
.pic {
  position: relative;
  top: -.04em;
  display: inline-block;
  vertical-align: top;
  width: 1.104em;
  height: 1.104em;
  margin-left: .25em;
}
/* Скругление задаёт CSS, а не картинка: у PNG свои углы вшиты,
   но радиус тут тот же (21% стороны) и подложки под фото нет —
   каймы, из-за которой радиус когда-то сняли, взяться неоткуда. */
.pic__in {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 21%;
  overflow: hidden;
  transform-origin: 50% 55%;
  /* Кайма цветом фона: в покое её не видно, а на увеличении она
     режет фото от строки. Ширина 1.6px не случайна — box-shadow
     масштабируется вместе с transform, и при scale(2.6) это ровно
     те 4 пикселя, которые видит глаз. Тень, а не border: не трогает
     раскладку и точно повторяет скругление. */
  box-shadow: 0 0 0 1.6px var(--bg);
  transition: transform .42s cubic-bezier(.34, 1.56, .64, 1);
}
.pic img { width: 100%; height: 100%; object-fit: cover; }
/* по ховеру снимок вырастает в 2.6 раза — это и есть «увеличение» */
.pic:hover { z-index: 3; }
.pic:hover .pic__in { transform: scale(2.6) rotate(6deg); }

/* звезда рядом с «AI native» — пульсирует сама, без ховера */
.say__star {
  display: inline-block;
  vertical-align: top;
  position: relative;
  top: .2em;
  width: .592em;
  height: .592em;
  margin: 0 .1em 0 0;
}
.say__star svg {
  width: 100%;
  height: 100%;
  animation: star-beat 2.6s var(--ease) infinite;
}
@keyframes star-beat {
  0%, 100% { transform: scale(1) rotate(0deg);   filter: drop-shadow(0 0 2px rgba(229, 255, 39, .22)); }
  50%      { transform: scale(1.17) rotate(10deg); filter: drop-shadow(0 0 11px rgba(229, 255, 39, .55)); }
}

/* три молнии: серые заряжаются в кислотный по мере скролла */
/* Переносы строк между тремя <svg> — это обычные пробельные узлы,
   и при кегле 48 они рожали три невидимые строки под коробкой знака.
   Коробка 1em, а хит-зона уходила на 144px вниз и накрывала кнопку
   по центру: курсор становился текстовым, ховер кнопки не срабатывал.
   line-height: 0 убирает эти строки, pointer-events — на всякий:
   молнии чистый декор и мышь им не нужна вовсе. */
.bolts {
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: 1.75em;
  height: 1em;
  line-height: 0;
  pointer-events: none;
}
.bolt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.bolt path { fill: #6c6c6d; }
/* заряд бинарный: молния либо серая, либо кислотная,
   промежуточных состояний по просьбе Льва нет */
.bolt--lit path { fill: var(--acid); }
.bolt--lit { opacity: 0; }
.bolt--lit.is-on { opacity: 1; }

/* кнопка манифеста: 18px, r16, по ховеру кренится и зеленеет */
.btn--boost {
  padding: 12px 24px;
  border-radius: 16px;
  font-size: 18px;
  transition: transform .34s cubic-bezier(.34, 1.56, .64, 1),
              background-color .25s var(--ease),
              color .25s var(--ease);
}
.btn--boost:hover {
  transform: rotate(-5deg) scale(1.08);
  background: var(--acid);
  color: #000;
  opacity: 1;
}
.btn--boost:active { transform: rotate(-5deg) scale(1.02); }
/* анимации текста у кнопки нет: слова прыгали по ховеру и ловили
   баг при наведении — по просьбе Льва осталось только движение
   самой кнопки (крен + кислотная заливка выше) */

/* ── бесконечная галерея ─────────────────────────────────── */

.gal {
  display: flex;
  flex-direction: column;
  gap: 60px;
  /* после галереи пауза длиннее базовой: блок крупный и «шумный»,
     следующей строфе нужно время начаться заново */
  margin-bottom: calc(var(--gap-sec) * 1.35);
}

.gal__cap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--cap);
  font-weight: 510;
  line-height: 1.2;
}
/* в макете приглушены сами строки, а не блок: иначе прозрачность
   подписи спорит с той, которой анимация раскрывает контейнер */
.gal__cap p { color: var(--fg); }
/* Знак — не картинка, а маска: так его можно залить чем угодно,
   в том числе градиентом манифеста. Полупрозрачные части исходного
   SVG остаются полупрозрачными — альфа маски их сохраняет. */
.gal__ico {
  display: inline-block;
  vertical-align: -.24em;
  width: 1.19em;
  height: 1.19em;
  background: var(--fg);
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
  transition: filter .3s var(--ease);
}
.gal__ico--coin  { --i: url(assets/home/coin.svg); }
.gal__ico--games { --i: url(assets/home/games.svg); width: 1.5em; }

/* по наведению на строку знак загорается тем же переливом,
   что и «multidisciplinary» в манифесте */
.gal__cap p:hover .gal__ico {
  background-image: linear-gradient(95deg,
    #e5ff27 0%, #ff51ff 25%, #c67cff 38%, #00bbff 50%,
    #c67cff 62%, #ff51ff 75%, #e5ff27 100%);
  background-size: 200% 100%;
  background-repeat: repeat-x;
  animation: grad-flow 4s linear infinite;
  filter: drop-shadow(0 0 8px rgba(229, 255, 39, .35));
}

/* шапка галереи — та же контентная колонка, поэтому стрелки просто
   прибиты к её правому краю и низу подписи: на всех брейкпоинтах
   они остаются на сетке и никуда не срываются */
.gal__head { position: relative; }

.gal__nav {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 12px;
}

.gal__arr {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  background: none;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.gal__arr:hover,
.gal__arr:focus-visible { color: var(--fg); border-color: rgba(255, 255, 255, .28); }
.gal__arr svg { width: 22px; height: 22px; }
.gal__arr--next svg { transform: scaleX(-1); }

/* сцена во всю ширину: карточки раскладывает main.js,
   ни стрелок, ни точек в макете нет — только скролл и драг */
.gal__stage {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: calc(240px * var(--gs, 1));
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
}
.gal__stage.is-dragging { cursor: grabbing; }

.gal__strip { position: absolute; inset: 0; }

.gal__card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 240px;
  height: 240px;
  margin: -120px 0 0 -120px;
  border-radius: 16px;
  background: #1c1c1c;
  overflow: hidden;
  opacity: 0;
  will-change: transform, opacity;
}
.gal__card button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gal__card img { width: 100%; height: 100%; object-fit: cover; }

/* ── про подход ──────────────────────────────────────────── */

.style {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--gap-sec);
}

/* начертание один в один с манифестом: тот же вес, интерлиньяж
   и трекинг — две строфы должны читаться одним голосом */
.style__ln {
  font-size: var(--say);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
}

/* «details»: белым, с кислотным пунктиром; розовый кадр
   стоит рядом прямо в строке — см. .pic--tilt */
.style__hot {
  position: relative;
  color: var(--fg);
  padding-bottom: .1em;
  background-image: radial-gradient(circle closest-side, var(--acid) 100%, transparent 100%);
  background-size: 8px 4px;
  background-position: 0 100%;
  background-repeat: repeat-x;
  transition: color .3s var(--ease);
  cursor: default;
}
.style__hot:hover,
.style__hot:focus-visible { color: var(--acid); }

/* Мем «смотри сколько деталей»: кадр вылетает только по наведению
   на само слово — в этом вся шутка. Карточка выше строки, поэтому
   её верх ставим по верху «details» и свешиваем вниз. */
.style__shot {
  position: absolute;
  left: calc(100% + .4em);
  top: .5em;
  width: 2.08em;
  height: 2.08em;
  opacity: 0;
  transform: scale(.5) rotate(-26deg);
  transform-origin: 0 0;
  transition: opacity .26s var(--ease),
              transform .44s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
.style__hot:hover .style__shot,
.style__hot:focus-visible .style__shot {
  opacity: 1;
  transform: scale(1) rotate(-8.29deg);
}
/* картинка уже собрана как карточка — с фоном, кадром и скруглением,
   поэтому ни кропа, ни подложки, ни overflow тут нет */
.style__shot img { width: 100%; height: 100%; object-fit: contain; }

/* ── инструменты ─────────────────────────────────────────── */

.box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 64px;   /* запас под ярлыки, которые всплывают над рядом */
  /* тулбокс стоит особняком между строфой о стиле и контактами —
     воздух с обеих сторон шире базового (соседние margin схлопываются,
     поэтому верхний зазор задаётся именно здесь) */
  margin-top: calc(var(--gap-sec) * 1.3);
  margin-bottom: calc(var(--gap-sec) * 1.3);
}

/* Вся раскладка считается от размера плитки --t: так ряд и папка
   ужимаются вместе и на узком экране не вылезают из колонки.
   Папка = два слоя: задний под знаками, передний клапан поверх —
   первая плитка заезжает под него левым краем. */
.box__pile {
  --t: clamp(20px, 6.8vw, 34px);
  position: relative;
  height: calc(var(--t) * 1.42);
  padding-left: calc(var(--t) * 1.46);
}

.box__row {
  position: relative;
  z-index: 2;
  display: flex;
  gap: calc(var(--t) * .22);
}

/* Плашки взяты с резюме: знак приглушён, по наведению разгорается
   в фирменный цвет и подрастает. Плашка прозрачная, обводка еле
   заметная — на тёмном фоне она только собирает ряд, не спорит
   со знаками. Ячейка фиксированная, поэтому scale соседей не толкает. */
.box__row .tool {
  display: grid;
  place-items: center;
  width: var(--t);
  height: var(--t);
}
.box__row .tool__hit {
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 26%;
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(6px);
  transform-origin: center;
  transition: color .2s var(--ease), transform .2s var(--ease),
              border-color .2s var(--ease), background-color .2s var(--ease);
}
.box__row .tool__hit:hover,
.box__row .tool__hit:focus-visible {
  transform: scale(1.14);
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
}
/* размеры знака — в долях от --t, а не в процентах: процент внутри
   grid-ячейки, у которой высота сама зависит от содержимого, у знака
   Figma разрешался по кругу и раздувал плашку до 50px */
.box__row .tool__hit svg { width: calc(var(--t) * .56); height: calc(var(--t) * .56); }
/* знак Figma 2:3 — тянем по высоте, иначе он оптически мельче ряда */
.box__row .tool--multi .tool__hit svg { width: auto; height: calc(var(--t) * .62); }
.box__row .tool--raster .tool__hit img { width: calc(var(--t) * .66); height: auto; }

/* Колесо загрузки в пустой плашке — «инструменты ещё едут».
   Кольцо собрано из conic-градиента с дыркой-маской, а не из border:
   бордюр нельзя залить градиентом, а маска даёт и дугу, и перелив. */
.spin {
  width: calc(var(--t) * .46);
  height: calc(var(--t) * .46);
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, .1) 90deg,
    rgba(255, 255, 255, .55) 320deg, rgba(255, 255, 255, .55) 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent 60%, #000 63%);
  mask: radial-gradient(closest-side, transparent 60%, #000 63%);
  animation: spin 1.4s linear infinite;
  transition: filter .28s var(--ease);
}
.box__row .tool--next .tool__hit:hover .spin,
.box__row .tool--next .tool__hit:focus-visible .spin {
  background: conic-gradient(from 0deg, #e5ff27, #ff51ff, #00bbff, #e5ff27);
  filter: drop-shadow(0 0 6px rgba(229, 255, 39, .3));
}
@keyframes spin { to { transform: rotate(1turn); } }
/* названия встают над рядом: под знаками они читались как подписи
   к чему-то нижнему, сверху — как ярлык самого знака */
.box__row .tool--next .tool__hit { border-style: dashed; background: none; }
.box__row .tool__tip { top: auto; bottom: calc(100% + 10px); transform: translate(-50%, 4px); }
.box__row .tool__hit:hover .tool__tip,
.box__row .tool__hit:focus-visible .tool__tip { transform: translate(-50%, 0); }

.box__folder { position: absolute; left: 0; }
.box__folder--back {
  top: 0;
  width: calc(var(--t) * 1.735);
  height: calc(var(--t) * 1.42);
}
/* курсор на клапане: серый двойник лежит снизу, цветной проявляется
   по наведению на папку — тот же приём, что у молний в манифесте */
.box__cursor--lit { opacity: 0; transition: opacity .28s var(--ease); }
.box__folder--front:hover .box__cursor--lit { opacity: 1; }
/* Свечение по ховеру. Три chained drop-shadow тут не работали: каждый
   следующий размывает результат предыдущего, а жёлтый + маджента +
   голубой в сложении дают белёсое пятно — Лев так и сказал, «оч светлый».
   Размытая плашка позади тоже не годится: ядро градиента прячется за
   корпусом, наружу выходит только выцветший край.
   Работает силуэт: градиент, обрезанный маской самой папки. ВАЖНО —
   размытие живёт на ВНЕШНЕМ слое: filter применяется раньше mask, и на
   одном элементе маска обрезала бы свечение ровно по контуру. */
.box__glow {
  position: absolute;
  z-index: 0;
  left: calc(var(--t) * -.36);
  /* приподнято над папкой — ореол должен светить вверх */
  top: calc(var(--t) * -.52);
  width: calc(var(--t) * 2.45);
  height: calc(var(--t) * 2);
  filter: blur(calc(var(--t) * .27));
  opacity: 0;
  transform: scale(.9);
  transition: opacity .28s var(--ease), transform .42s var(--ease);
  pointer-events: none;
}
.box__glow span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(102deg, #e5ff27 2%, #ff51ff 48%, #00bbff 96%);
  -webkit-mask: url(assets/home/folder-body.svg) no-repeat center / contain;
  mask: url(assets/home/folder-body.svg) no-repeat center / contain;
}
/* :has, а не ховер на самой .box__pile — иначе ореол зажигался бы
   и при наведении на любой знак инструмента в ряду */
.box__pile:has(.box__folder--front:hover) .box__glow {
  opacity: 1;
  transform: scale(1);
}

/* клапан шире задней створки и стоит с ней в один низ */
.box__folder--front {
  z-index: 3;
  top: calc(var(--t) * .265);
  left: calc(var(--t) * -.1);
  width: calc(var(--t) * 1.97);
  height: calc(var(--t) * 1.15);
}

.box__cap {
  display: flex;
  flex-direction: column;
  font-size: var(--cap);
  font-weight: 510;
  line-height: 1.2;
}

/* запас под плавающую пилюлю навигации вместо подвала */
.tail { height: 140px; }

/* ── стрелка у ссылок ────────────────────────────────────── */
/* блок «опыт работы» с главной убран, но стрелка осталась
   у названий компаний в резюме */

.exp__arrow {
  display: inline-block;
  opacity: .45;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}

/* ── инструменты ─────────────────────────────────────────── */

.tools { display: flex; flex-direction: column; gap: 32px; }

.tools__list {
  /* фиксированные ячейки: scale одной иконки больше не толкает соседние —
     раньше ряд был flex по контенту и на ховере весь строй ехал */
  display: grid;
  /* колонки по числу знаков: на главной их восемь, в резюме девять */
  grid-auto-flow: column;
  grid-auto-columns: 40px;
  justify-content: start;
  align-items: center;
  justify-items: start;
  gap: 4px;
}
.tool { display: grid; place-items: center start; width: 40px; height: 34px; }

.tool__hit {
  position: relative;
  display: grid;
  /* влево, а не по центру ячейки: иначе узкий знак Figma висит
     на 12px правее левого края колонки и ряд «съезжает» от текста */
  place-items: center start;
  width: 30px; height: 30px;
  transform-origin: left center;
  will-change: transform;
  color: rgba(255, 255, 255, .45);
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.tool__hit svg { width: 22px; height: 22px; fill: currentColor; }

.tool__hit:hover,
.tool__hit:focus-visible {
  color: var(--brand, var(--fg));
  transform: scale(1.14);
}

/* Figma — знак родно пятицветный, currentColor к нему неприменим:
   гасим через фильтр, на ховере возвращаем цвет */
.tool--multi .tool__hit {
  filter: saturate(0) brightness(1.7);
  opacity: .5;
  transition: filter .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease);
}
.tool--multi .tool__hit svg {
  width: auto;          /* знак 2:3, тянем по высоте — иначе раздувается вширь */
  height: 22px;
}
.tool--multi .tool__hit:hover,
.tool--multi .tool__hit:focus-visible { filter: none; opacity: 1; }

/* Mobbin — растровый чёрный знак, красим фильтром.
   Знак широкий (2.1:1), поэтому по высоте ниже квадратных иконок,
   иначе перевешивает весь ряд оптически */
.tool--raster .tool__hit img {
  width: 28px; height: 13px;
  object-fit: contain;
  filter: invert(1);
  opacity: .45;
  transition: opacity .2s var(--ease);
}

.tool--raster .tool__hit:hover img,
.tool--raster .tool__hit:focus-visible img { opacity: 1; }

.tool__tip {
  position: absolute;
  top: calc(100% + 6px);   /* вниз, иначе наезжает на заголовок секции */
  left: 50%;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -4px);
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.tool__hit:hover .tool__tip,
.tool__hit:focus-visible .tool__tip { opacity: 1; transform: translate(-50%, 0); }

/* ── контакты ────────────────────────────────────────────── */

.contacts { display: flex; flex-direction: column; gap: 32px; }
/* болд на 16px читался кирпичом — Лев просил мягче */
.contacts h2 { font-weight: 590; }
.contacts__list { display: flex; flex-direction: column; gap: 4px; }

/* плашка 454×36 r8 #121214 из макета — раздвигается на 8px за колонку */
.crow {
  display: flex;
  gap: 20px;
  padding: 12px 8px;
  margin-inline: -8px;
  border-radius: var(--r-chip);
  line-height: 1;
  transition: background-color .18s var(--ease);
}
.crow:hover { background: var(--surface); }

.crow__label { flex: 0 0 97px; color: var(--muted); }

.crow__value { font-weight: 590; }


/* ── ачивка ──────────────────────────────────────────────── */
/* Знак и заливка кнопки — шейдер Liquid Metal (Paper Shaders).
   Пока WebGL2 не поднялся (или его нет), на месте знака лежит
   плоский SVG, а кнопка живёт обычной обводкой — блок читается
   без единого пикселя шейдера. */

.ach {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* воздуха до контактов больше обычного зазора секций, снизу —
     наоборот меньше: под кнопкой и так висит пилюля навигации */
  margin-top: calc(var(--gap-sec) * 1.25);
  margin-bottom: 24px;
  text-align: center;
}

/* Сцена держит перспективу: наклон живёт на .ach__badge, а точка
   схода — на родителе, иначе поворот читается как плоский скос.
   Она же служит линейкой для наклона: её саму не крутит, значит
   рамка не гуляет и наклон не входит в автоколебание.
   Поля — запас, чтобы наклонённые углы не задевали подпись. */
.ach__stage {
  perspective: 620px;
  padding: 10px;
}

.ach__badge {
  width: clamp(128px, 38vw, 168px);
  aspect-ratio: 189 / 209;
  transform: rotateX(0deg) rotateY(0deg);
  /* CSS-перехода тут нарочно нет: наклон ведёт догон по кадру в
     metal.js, и transition поверх него только добавлял бы задержку */
}

.ach__flat { width: 100%; height: auto; }
.ach.is-lm .ach__flat { visibility: hidden; }

.ach__label {
  margin-top: 20px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.4;
}
.ach__title {
  margin-top: 2px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 510;
  line-height: 1.4;
  letter-spacing: -.01em;
}

/* кнопка нарочно тихая: прозрачная, с обводкой в 10% белого.
   По ховеру в неё наливается тот же металл, что в знаке. */
.ach__cta {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  margin-top: 22px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 510;
  line-height: 1.4;
  overflow: hidden;
  transition: color .22s var(--ease), border-color .22s var(--ease);
}
.ach__cta:hover, .ach__cta:focus-visible { border-color: rgba(255, 255, 255, .28); }
/* тёмная подпись — только когда под ней действительно налит металл:
   без WebGL2 кнопка остаётся прозрачной, и чёрным по чёрному не прочесть */
.ach.is-lm .ach__cta:hover,
.ach.is-lm .ach__cta:focus-visible { color: #0a0a0b; }
/* светлый ореол: шов металла ходит под подписью, и без него буквы
   на тёмной полосе пропадают */
.ach.is-lm .ach__cta:hover .ach__cta-t,
.ach.is-lm .ach__cta:focus-visible .ach__cta-t {
  text-shadow: 0 0 2px rgba(255, 255, 255, .85), 0 1px 7px rgba(255, 255, 255, .6);
}

.ach__lm {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .28s var(--ease);
}
.ach__cta:hover .ach__lm,
.ach__cta:focus-visible .ach__lm { opacity: 1; }

.ach__cta-t { position: relative; }
.ach__arr {
  display: inline-block;
  transition: transform .22s var(--ease);
}
.ach__cta:hover .ach__arr { transform: translateX(3px); }

@media (max-width: 560px) {
  .ach__label { margin-top: 16px; }
}

/* ── страница «Резюме» ───────────────────────────────────── */

/* документ плотнее лендинга — 120px между секциями рвут чтение */
.is-doc { --gap-sec: 80px; }

.doc {
  /* ширина держится в ритме главной колонки (446px), иначе при переходе
     между страницами контент прыгает почти вдвое */
  width: min(780px, 100% - 40px);
  margin-inline: auto;
}

.doc__bar { display: flex; justify-content: flex-end; padding-top: 24px; }

.pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease);
}
.pdf:hover { background: var(--surface); border-color: rgba(255, 255, 255, .28); }
.pdf svg { width: 15px; height: 15px; }

/* шапка: слева карточка, справа контакты */
.doc__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--line);
}

.doc__id { display: flex; align-items: flex-start; gap: 20px; }

.doc__avatar {
  width: 72px; height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #d9d9d9;
}

.doc__head h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.doc__role  { line-height: 1.4; }
.doc__place { color: var(--dim); line-height: 1.4; }

.doc__links { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.doc__links a {
  color: var(--muted);
  line-height: 1.4;
  transition: color .18s var(--ease);
}
.doc__links a:hover { color: var(--fg); }
.doc__ext { opacity: .5; }

/* секция: метка слева, содержимое справа */
.doc__sec {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  padding-top: 48px;
}
.doc__label { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; }

.doc__prose { display: flex; flex-direction: column; gap: 16px; color: var(--muted); line-height: 1.5; }

/* Range — одна строка перечислением, как в PDF-резюме */
.doc__range { color: var(--muted); line-height: 1.6; }

/* место работы: слева должность и даты, справа описание */
.job {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding-bottom: 28px;
}
.job + .job { padding-top: 0; }

.job__who { display: flex; flex-direction: column; gap: 6px; }
.job__role  { font-weight: 590; line-height: 1.4; }
.job__co    { color: var(--muted); line-height: 1.4; }
.job__co a {
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.job__co a:hover { color: var(--fg); border-bottom-color: currentColor; }
.job__co a:hover .exp__arrow { transform: translate(2px, -1px); opacity: 1; }
.job__amp   { opacity: .5; }
.job__dates { color: var(--dim); line-height: 1.4; }

/* описание места работы — абзац, а не список: в PDF-резюме это
   связный текст, и страница повторяет его слово в слово */
.job__text { color: var(--muted); line-height: 1.5; }

@media (max-width: 800px) {
  .doc__sec { grid-template-columns: 1fr; gap: 20px; padding-top: 44px; }
  .job { grid-template-columns: 1fr; gap: 14px; }
  .doc__head { flex-direction: column; }
  .doc__links { align-items: flex-start; text-align: left; }
}

/* ── страница «Визуалы» ──────────────────────────────────── */

.vis {
  width: min(1000px, 100% - 40px);
  margin-inline: auto;
}

/* колонка с заголовком стоит на месте, пока листается сетка */
.vis__layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

.vis__side {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.vis__side h1 { font-size: 24px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.vis__lead { color: var(--muted); line-height: 1.4; }
.vis__side .btn { margin-top: 8px; }

.vis__grid {
  /* колонки, а не grid: вертикальные видео и горизонтальные кадры
     разной высоты, и masonry-раскладка укладывает их без дыр */
  column-count: 2;
  column-gap: 24px;
}
.vis__item { break-inside: avoid; margin-bottom: 24px; }

.vis__item button {
  display: block;
  width: 100%;
  padding: 0;
  appearance: none;
  background: none;
  border: none;
  cursor: zoom-in;
}

.vis__item img,
.vis__item video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: #1c1c1c;
  transition: border-color .25s var(--ease);
}
/* вертикальные ролики держат свою пропорцию и разбавляют ряд */
.vis__item--tall video { aspect-ratio: 9 / 16; }

.vis__item button:hover img,
.vis__item button:hover video { border-color: rgba(255, 255, 255, .22); }

@media (max-width: 900px) {
  .vis__layout { grid-template-columns: 1fr; gap: 40px; }
  .vis__side { position: static; }
  .vis__grid { column-count: 1; }
}

/* ── лайтбокс ────────────────────────────────────────────── */

.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 5vw;
  background: rgba(6, 6, 7, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  animation: lb-in .18s var(--ease) both;
}
.lb[hidden] { display: none; }

.lb__img,
.lb__video {
  max-width: min(1400px, 100%);
  /* явный потолок в vh: с max-height:100% высокая картинка упиралась в низ экрана */
  max-height: 88vh;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
  animation: lb-pop .22s var(--ease) both;
}
.lb__img[hidden], .lb__video[hidden] { display: none; }
.lb__video { cursor: default; }

.lb__close {
  position: absolute;
  top: 16px; right: 20px;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  appearance: none;
  border: none;
  background: none;
  color: rgba(255, 255, 255, .55);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color .18s var(--ease);
}
.lb__close:hover { color: var(--fg); }

@keyframes lb-in  { from { opacity: 0 } to { opacity: 1 } }
@keyframes lb-pop { from { opacity: 0; transform: scale(.98) } to { opacity: 1; transform: none } }

/* ── подвал ──────────────────────────────────────────────── */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* запас под плавающую пилюлю навигации */
  padding-bottom: 140px;
}
.foot__mark { width: 84px; height: auto; opacity: .5; }
.foot__year { color: var(--dim); }

/* ── адаптив ─────────────────────────────────────────────── */

@media (max-width: 760px) {
  main > section.say { margin-top: 72px; }



  /* на телефоне тот же принцип, но воздуха вдвое меньше: экран
     короткий, и 26vh превратили бы страницу в лестницу из пустот */
  :root { --gap-sec: clamp(104px, 15vh, 160px); }

  .say  { gap: 48px; }
  .gal  { gap: 40px; }
  .box  { gap: 32px; }
  .tail { height: 120px; }
}

@media (max-width: 560px) {
  .tools__list { grid-auto-columns: 1fr; gap: 0; }
  .tool { width: 100%; }

  .crow { flex-direction: column; gap: 6px; }
  .crow__label { flex: none; }

  .btn--boost { padding: 11px 20px; font-size: 16px; }
}

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

/* ── печать / экспорт в PDF ──────────────────────────────── */

/* Цель — уложить резюме ровно в одну страницу A4.
   Область печати при полях 10мм ≈ 718×1047px, поэтому кегль,
   интерлиньяж и все отступы здесь заметно плотнее экранных. */
@media print {
  @page { size: A4 portrait; margin: 10mm; }

  html, body {
    background: #fff !important;
    color: #111 !important;
    font-size: 8.6px;
  }

  .nav, .doc__bar, .skip, .lb, .foot { display: none !important; }

  .doc { width: 100%; max-width: none; }

  /* шапка */
  .doc__head { padding: 0 0 10px; border-color: rgba(0, 0, 0, .18); gap: 16px; }
  .doc__id { gap: 12px; }
  .doc__avatar { width: 52px; height: 52px; }
  .doc__head h1 { font-size: 17px; margin-bottom: 5px; }
  .doc__links { gap: 3px; }

  /* секции */
  .doc__sec { grid-template-columns: 84px 1fr; gap: 18px; padding-top: 12px; break-inside: avoid; }
  .doc__prose { gap: 6px; line-height: 1.4; }
  .doc__range { line-height: 1.4; }

  .job { grid-template-columns: 150px 1fr; gap: 18px; padding-bottom: 7px; break-inside: avoid; }
  .job__who { gap: 2px; }
  .job__text { line-height: 1.4; }

  /* инструменты и контакты */
  .tools__list { grid-auto-columns: 30px; }
  .tool { width: 30px; height: 24px; }
  .tool__hit { width: 22px; height: 22px; }
  .tool__hit svg { width: 16px; height: 16px; }
  .tool--multi .tool__hit svg { height: 16px; }
  .tool--raster .tool__hit img { width: 21px; height: 10px; }
  .crow { padding: 3px 0; margin-inline: 0; }
  .contacts__list { gap: 0; }

  /* приглушённые оттенки на белом читаются плохо — поднимаем контраст */
  .doc__label, .doc__prose, .doc__range, .doc__co, .job__co, .job__text,
  .doc__links a, .crow__label { color: #444 !important; }
  .doc__place, .job__dates { color: #666 !important; }
  .doc__head h1, .doc__role, .job__role, .crow__value { color: #111 !important; }

  a { text-decoration: none; }
  .exp__arrow, .doc__ext { display: none; }

  .tool__hit { color: #333 !important; transform: none !important; }
  .tool--multi .tool__hit { filter: none !important; opacity: 1 !important; }
  .tool--raster .tool__hit img { filter: none !important; opacity: 1 !important; }
}
