/* Profile and rotating facts: intentionally scoped to the second section. */
.about-facts-section { background: #000; }
.about-facts-section .about-inner {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: min(100%, 860px);
  gap: 24px;
  padding: 0 24px;
  text-align: left;
}
.about-profile { display: flex; align-items: center; gap: 24px; flex: 0 0 auto; }
.about-facts-section .about-avatar { width: 88px; height: 88px; }
.about-profile-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.about-facts-section .about-name {
  margin: 0 0 3px;
  color: #f5f5f5;
  font: 500 32px/1.2 "Vela Sans", sans-serif;
  letter-spacing: -.025em;
}
.about-facts-section .about-role { font-size: 17px; line-height: 1.5; color: #919191; white-space: nowrap; }
.about-facts {
  /* Шаги карусели. Карточки по мере удаления от центра уменьшаются, поэтому
     шаг «центр в центр» одинаковым делать нельзя: зазор между краями рос бы от
     12 до 30px. Вместо этого одинаков именно зазор --fact-gap между краями
     соседних карточек, а сдвиги --y1..--y3 считаются от высоты карточки и её
     масштаба: .86, .72 и .58 (их же ставит script.js), полусуммы — .93, .79, .65.
     Высоту и зазор каждый брейкпоинт задаёт сам. */
  --fact-h: 68px;
  --fact-gap: 13px;
  --fact-ms: 600ms;
  --y1: calc(var(--fact-h) * 0.93 + var(--fact-gap));
  --y2: calc(var(--y1) + var(--fact-h) * 0.79 + var(--fact-gap));
  --y3: calc(var(--y2) + var(--fact-h) * 0.65 + var(--fact-gap));
  position: relative; flex: 0 1 360px; min-width: 0; max-width: 360px; height: 390px; border-radius: 16px; touch-action: pan-x;
}
.about-facts-list {
  position: relative;
  width: 100%; height: 100%;
  padding: 0; margin: 0; list-style: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 13%, #000 87%, transparent);
  mask-image: linear-gradient(transparent, #000 13%, #000 87%, transparent);
}
.about-fact {
  --y: 0px;
  position: absolute; top: calc(50% - var(--fact-h) / 2); left: 50%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: max-content; max-width: 100%; height: var(--fact-h); padding: 0 26px;
  border-radius: 999px; background: #111;
  color: #f5f5f5; font: 400 24px/1.3 "Vela Sans", sans-serif;
  white-space: nowrap;
  transform: translate(-50%, var(--y)) scale(var(--scale));
  opacity: var(--opacity);
  transition: transform var(--fact-ms) cubic-bezier(.65,0,.2,1), opacity var(--fact-ms) cubic-bezier(.65,0,.2,1);
}
/* Слот ставит script.js в data-slot; сдвиг берётся из общих шагов выше. */
.about-fact[data-slot="1"] { --y: var(--y1); }
.about-fact[data-slot="2"] { --y: var(--y2); }
.about-fact[data-slot="3"] { --y: var(--y3); }
.about-fact[data-slot="-1"] { --y: calc(var(--y1) * -1); }
.about-fact[data-slot="-2"] { --y: calc(var(--y2) * -1); }
.about-fact[data-slot="-3"] { --y: calc(var(--y3) * -1); }
.about-fact-icon {
  display: block; flex: 0 0 38px; width: 38px; height: 38px;
  background-image: url('assets/about/fact-icons.webp');
  background-repeat: no-repeat; background-size: 300% 200%;
}
.icon-rocket { background-position: 0 0; }
.icon-laptop { background-position: 50% 0; }
.icon-research { background-position: 100% 0; }
.icon-puzzle { background-position: 0 100%; }
.icon-heart { background-position: 50% 100%; }
.icon-blueprint { background-position: 100% 100%; }
.icon-studio { background-image: url('assets/about/lumexart-mark.webp'); background-position: center; background-size: contain; }
.icon-experience { background-image: url('assets/about/experience-xp.png'); background-position: center; background-size: contain; }
/* Карточка с датами: сверху ряд «значок + название», под ним даты. Колонка
   центрирует и то, и другое по ширине всей карточки, поэтому даты стоят строго
   по её середине, а не под названием. Плашки «Работа» нет. */
.about-fact--studio { flex-direction: column; gap: 0; }
.about-fact-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
/* Высоту ряда задаёт значок, он выше строки названия, и под названием оставался
   лишний воздух. Даты подтянуты к названию на долю собственного кегля, поэтому
   зазор одинаково мал и на телефоне, и на десктопе. */
.about-fact-meta { margin-top: -0.65em; color: #a6a6a6; font-size: 12px; line-height: 1.4; text-align: center; }
.about-facts:focus-visible { outline: 2px solid #1688d4; outline-offset: 8px; }
@media (min-width: 1001px) {
  .about-facts-section .about-inner { width: min(100%, 1100px); gap: 32px; padding: 0 32px; }
  .about-profile { gap: 28px; }
  .about-facts-section .about-avatar { width: 116px; height: 116px; }
  .about-facts-section .about-name { font-size: 44px; }
  .about-facts-section .about-role { font-size: 21px; }
  .about-facts { flex-basis: 480px; max-width: 480px; height: 510px; --fact-h: 88px; --fact-gap: 18px; }
  .about-fact { padding: 0 32px; gap: 14px; font-size: 30px; }
  .about-fact--studio { gap: 0; }
  .about-fact-row { gap: 14px; }
  .about-fact-icon { width: 48px; height: 48px; flex-basis: 48px; }
  .about-fact-meta { font-size: 13px; }
}
@media (max-width: 1000px) {
  .about-facts-section .about-inner { padding: 0 32px; gap: 24px; }
  .about-profile { gap: 18px; }
  .about-facts-section .about-avatar { width: 80px; height: 80px; }
  .about-facts-section .about-name { font-size: 29px; }
  .about-facts-section .about-role { font-size: 15px; }
  .about-fact { font-size: 21px; padding: 0 22px; }
}
@media (max-width: 760px) {
  html:has(.about-facts-section):not(.has-case-open) {
    scroll-snap-type: y mandatory;
    scroll-padding: 0;
    scroll-behavior: auto;
  }
  .page-dark #top > section { scroll-snap-align: start; scroll-margin: 0; }
  .page-dark #top > .hero, .about-facts-section { scroll-snap-stop: always; }
  /* Пока script.js перепрыгивает между «Обо мне» и кейсами, снап выключен:
     после программного прыжка он иначе докручивает страницу к своей точке
     ещё одной анимацией, и экран дёргается второй раз. */
  html.scene-jump { scroll-snap-type: none !important; }
  /* Инерция вверх по кейсам останавливается на их начале и не уносит страницу
     дальше к «Обо мне»: назад к нему ведёт следующий свайп (переход в script.js). */
  .page-dark #top > .cases { scroll-snap-stop: always; }
  /* iOS (Safari и встроенный браузер Telegram): снап ставит блок не к верху
     экрана, а ниже строки состояния, и над «Обо мне» остаётся полоса кадра hero
     высотой с эту строку (около 47px). Точку снапа сдвигаем на 64px внутрь блока,
     больше любой строки состояния: от hero на экране ничего не остаётся, а
     скрытые сверху 64px блока пустые. Только для WebKit на iOS, в остальных
     браузерах сдвига нет. Те же 64px учитывают пороги появления в script.js. */
  @supports (-webkit-touch-callout: none) {
    .page-dark #top > .about-facts-section { scroll-margin-top: -64px; }
    /* Из-за того же сдвига низ блока заходит выше нижнего края экрана на
       64px, и из-под него выглядывали отступ и табы кейсов. Блок удлинён
       ровно на сдвиг: в покое он снова доходит до нижнего края, а всё, что
       ниже, остаётся за экраном. Содержимое стоит в .about-viewport, высоту
       которого это не меняет. */
    .page-dark #top > .about-facts-section { height: calc(100vh + 64px); height: calc(100svh + 64px); }
    /* Из-за этого сдвига блок стоит выше экрана на 64px минус строка состояния,
       то есть около 17px, и содержимое съезжает вверх от середины. Верхний отступ
       вдвое больше (34px) возвращает его: центр сдвигается на половину отступа. */
    .about-facts-section .about-viewport { padding-top: 34px; }
  }
  /* svh, как у первого экрана: dvh меняется на ходу, когда Safari сворачивает
     адресную строку, высота блока прыгает вместе со scroll-snap и блок дёргается. */
  .about-facts-section { height: 100vh; height: 100svh; }
  .about-facts-section .about-viewport {
    position: relative;
    height: 100vh;
    height: 100svh;
    /* Содержимое стоит ровно по середине экрана. Раньше снизу держали 72px под
       кнопку «Связаться», и всё съезжало вверх на 36px; кнопке этого места не
       нужно: даже на невысоком экране низ карусели остаётся выше неё (см.
       высоту .about-facts ниже, она считается от высоты экрана). */
    padding-bottom: 0;
  }
  .about-facts-section .about-inner { flex-direction: column; gap: 22px; padding: 32px 20px; }
  .about-profile { flex-direction: column; gap: 14px; text-align: center; }
  .about-profile-copy { align-items: center; }
  .about-facts { flex: none; width: 100%; max-width: 390px; height: clamp(220px, calc(100vh - 390px), 340px); height: clamp(220px, calc(100svh - 390px), 340px); touch-action: pan-y pinch-zoom; --fact-h: 60px; --fact-gap: 12px; }
  .about-fact { font-size: 20px; gap: 10px; }
  .about-fact--studio { gap: 0; }
  .about-fact-row { gap: 10px; }
  .about-fact-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .about-fact-meta { font-size: 10px; }
}
@media (max-width: 370px) {
  .about-facts-section .about-role { font-size: 13px; }
  .about-facts-section .about-avatar { width: 68px; height: 68px; }
  .about-facts-section .about-name { font-size: 26px; }
  .about-fact { font-size: 18px; padding: 0 18px; }
}
@media (max-height: 650px) and (max-width: 760px) {
  .about-facts-section .about-inner { gap: 8px; padding-top: 16px; padding-bottom: 16px; }
  .about-facts { height: clamp(180px, calc(100vh - 360px), 280px); height: clamp(180px, calc(100svh - 360px), 280px); }
}
@media (prefers-reduced-motion: reduce) {
  .about-fact { transition: none; }
}
