/* ==========================================================================
   style.css — переменные, шапка и главная страница

   Порядок разделов:
     1.  Переменные и утилиты
     2.  Прелоадер
     3.  Шапка (десктоп) и шапка на телефоне
     4.  Первый экран
     5.  Блок «Обо мне»
     6.  Портфолио: карточки проектов и плашка наведения
     7.  Галерея «Посмотреть ещё»
     8.  Навыки
     9.  Контакты
     10. Появление блоков и курсор-след
     11. Адаптив: планшет и узкие экраны, затем телефон
     12. Плашка о cookies

   Правила:
     — размеры и цвета берём из переменных :root, не хардкодим;
     — брейкпоинты только 1279 / 1023 / 767 / 639px, каждый одним блоком;
       исключение — 980px в блоке «Обо мне»: это граница его раскладки;
     — размеры шрифтов адаптивные через clamp(), эталон 1280px;
     — правки для телефона дописываем в мобильный блок, а не в конец файла.
   ========================================================================== */

/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
  --bg: #fcfcfc;
  --text-primary: #1e1e1e;
  --text-secondary: rgba(30, 30, 30, 0.9);
  --text-thirty: rgba(30, 30, 30, 0.6);
  --text-additional: rgba(0, 0, 0, 0.5);
  --text-white: #ffffff;
  --btn-accent: #464646;
  --btn-light: #f2f2f2;
  --btn-text: #ffffff;
  --card-bg: #eff1f1;
  --card-text-primary: #313333;
  --card-text-secondary: #777979;
  --card-text-thirty: #636565;
  --card-text-stroke: rgba(209, 211, 211, 0.6);
  --contact-bg: #b3a1d1;
  --transition-theme: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  --content-px: clamp(40px, 10.4vw, 200px);
  --header-h: 100px;

  /* Крупная типографика течёт по ширине окна. Каждый clamp() достигает
     максимума ровно на 1280px, поэтому десктоп остаётся прежним. */
  --fs-hero:    clamp(30px, 2.1vw + 21.12px, 48px); /* 1280: 26.88 + 21.12 = 48 */
  --fs-hero-d:  clamp(20px, 1.5vw + 12.8px,  32px); /* 1280: 19.2 + 12.8 = 32 */
  --fs-section: clamp(30px, 2.2vw + 21.84px, 50px); /* 1280: 28.16 + 21.84 = 50 */
  --fs-block:   clamp(28px, 1.3vw + 23.36px, 40px); /* 1280: 16.64 + 23.36 = 40 */
  --fs-cta:     clamp(26px, 1.5vw + 20.8px,  40px); /* 1280: 19.2 + 20.8 = 40 */
  --fs-heading: clamp(24px, 1.35vw + 18.72px, 36px); /* 1280: 17.28 + 18.72 = 36 */
}

body {
  background: var(--bg);
}
/* ===== УТИЛИТЫ ===== */

/* Слово с дефисом не рвётся на две строки: «онлайн-платформы» */
.nowrap { white-space: nowrap; }

/* ===== ПРЕЛОАДЕР ===== */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
}

#preloader.slide-up {
  transform: translateY(-105%);
  transition: transform 0.85s cubic-bezier(.76, 0, .24, 1);
}

#preloader svg {
  width: 200px;
  height: 160px;
  overflow: visible;
}

#pl-dot {
  transform-origin: 49px 29px;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s ease,
              transform 0.35s cubic-bezier(.34, 1.56, .64, 1);
}
#pl-dot.go {
  opacity: 1;
  transform: scale(1);
}

#pl-path {
  fill: none;
  stroke: white;
  stroke-width: 15;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ===== ШАПКА ===== */
.pd-nav {
  --pd-ink: #1e1e1e;
  --pd-bar: 255,255,255;
  --pd-bar-opacity: .6;
  --pd-blur: 20px;
  --pd-speed: .2s;
  --pd-ease: cubic-bezier(.19,1,.22,1);

  position: sticky; top: 0; z-index: 100;
  height: 80px;
  font-family: 'Montserrat', sans-serif;
}
.pd-nav * { box-sizing: border-box; margin: 0; padding: 0; }

.pd-nav::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(var(--pd-bar), var(--pd-bar-opacity));
  -webkit-backdrop-filter: blur(var(--pd-blur));
  backdrop-filter: blur(var(--pd-blur));
}

.pd-nav__inner {
  position: relative;
  height: 100%;
  padding: 0 var(--content-px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
}

.pd-nav__logo {
  font-size: 24px; font-weight: 500; line-height: 1.55;
  color: #000; text-decoration: none; white-space: nowrap;
}

.pd-nav__menu { display: flex; align-items: center; gap: 0; list-style: none; }

.pd-nav__link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 20px;
  border-radius: 100px;
  font-size: 18px; font-weight: 500; line-height: 1.55;
  color: var(--pd-ink); text-decoration: none; white-space: nowrap;
  background-color: transparent;
  transition: background-color var(--pd-speed) ease-in-out, color var(--pd-speed) ease-in-out;
}
.pd-nav__link:hover,
.pd-nav__link.is-active {
  background-color: var(--pd-ink);
  color: #fff;
}

/* въезд при загрузке */
.pd-nav__logo,
.pd-nav__menu {
  opacity: 0;
  transition: opacity 1s var(--pd-ease), transform 1s var(--pd-ease);
  backface-visibility: hidden;
}
.pd-nav__logo { transform: translateX(-100px); }
.pd-nav__menu { transform: translateX(100px); }

.pd-nav.pd-in .pd-nav__logo,
.pd-nav.pd-in .pd-nav__menu { opacity: 1; transform: none; }

@media (max-width: 639px) {
  .pd-nav { height: 64px; }
  .pd-nav__inner { padding: 0 16px; }
  .pd-nav__logo { font-size: 19px; }
  .pd-nav__link { height: 36px; padding: 0 12px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-nav__logo, .pd-nav__menu {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}

/* ===== ШАПКА НА ТЕЛЕФОНЕ: кнопка-бургер и выезжающее меню =====
   Показываются только в мобильном блоке в конце файла. */

/* ── NAV CTA — скрыт на десктопе, виден на мобиле ── */
.pd-nav .pd-nav__cta { display: none; }

/* ── HAMBURGER BUTTON ── */
.pd-nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}
.pd-nav__burger:hover { background: rgba(30,30,30,0.06); }

.pd-nav__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1),
              opacity   0.25s ease,
              transform 0.35s cubic-bezier(.4,0,.2,1);
}

/* X-состояние */
.pd-nav__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pd-nav__burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.pd-nav__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV DRAWER ── */
.pd-nav-drawer {
  display: none;
  position: fixed;
  left: 0; right: 0;
  top: 64px;
  bottom: 0;
  z-index: 98;
  background: var(--bg);
  flex-direction: column;
  padding: 0 24px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.pd-nav-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pd-nav-drawer__nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pd-nav-drawer__menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
}

.pd-nav-drawer__link {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 38px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -1px;
  padding: 14px 0;
  opacity: 0;
  transition: opacity 0.25s ease, color 0.2s ease;
}
.pd-nav-drawer.is-open .pd-nav-drawer__menu li:nth-child(1) .pd-nav-drawer__link { opacity: 1; transition-delay: 0.08s; }
.pd-nav-drawer.is-open .pd-nav-drawer__menu li:nth-child(2) .pd-nav-drawer__link { opacity: 1; transition-delay: 0.14s; }
.pd-nav-drawer.is-open .pd-nav-drawer__menu li:nth-child(3) .pd-nav-drawer__link { opacity: 1; transition-delay: 0.20s; }
.pd-nav-drawer__link:active { color: var(--text-thirty); }

.pd-nav-drawer__cta {
  width: 100%;
  justify-content: center;
  font-size: 16px !important;
  padding: 14px 24px !important;
  opacity: 0;
  transition: opacity 0.25s ease 0.26s;
}
.pd-nav-drawer.is-open .pd-nav-drawer__cta { opacity: 1; }

/* ===== ПЕРВЫЙ ЭКРАН ===== */
.hero {
  min-height: clamp(560px, 66.4vw, 850px);   /* 1280: 849.9 ≈ 850 */
  padding-top: var(--header-h);
  padding-bottom: clamp(64px, 14.06vw, 180px); /* 1280: 179.9 ≈ 180 */
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 100px;
}

.hero__content {
  padding: 0 var(--content-px);
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: relative;
  z-index: 1;
}

.hero__illustration {
  position: absolute;
  right: clamp(20px, 9.6vw, 184px);
  top: 280px;
  width: clamp(280px, 34vw, 650px);
  height: clamp(205px, 25vw, 477px);
  pointer-events: none;
  z-index: 0;
}

.hero__illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__headline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero__greeting {
  font-weight: 400;
  font-size: 28px;
  color: var(--text-secondary);
}

.hero__title {
  font-weight: 500;
  font-size: var(--fs-hero);
  color: var(--text-primary);
  line-height: normal;
}

.hero__desc {
  font-weight: 400;
  font-size: var(--fs-hero-d);
  color: var(--text-secondary);
  line-height: normal;
}

.hero__cta {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Кнопки первого экрана мельче общих. Селектор с родителем — чтобы
   не зависеть от порядка подключения components.css и не задеть
   кнопки контактов и шапки. */
.hero__cta .btn       { font-size: 16px; padding: 12px 18px; }
.hero__cta .btn__icon { width: 18px; height: 18px; }

/* ===== БЛОК «ОБО МНЕ» ===== */

#about-inner {
  position: relative;
  overflow: hidden;
  background: #3c3c3c;
  border-radius: 80px 80px 0 0;
}

/* Десктоп (от 981px): раскладка макета 1200 × 852.
   Все размеры — доли ширины окна: 1200px макета = 100vw, то есть
   1px макета = 0.08333vw. Раньше то же делал скрипт через transform: scale,
   теперь CSS: без JS, текст не размывается масштабированием. */
.pd-ab-wrap {
  position: relative;
  overflow: hidden;
  height: 71vw;                          /* 852 */
}

/* ── «>2 лет» ── */
.pd-figma-stat {
  position: absolute;
  top: 7.5vw;                            /* 90 */
  left: 10vw;                            /* 120 */
  right: 10vw;
  z-index: 8;
  pointer-events: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  display: flex; flex-direction: column;
  letter-spacing: -0.1333vw;             /* −1.6 */
}
.pd-figma-stat-main { font-size: 3.6667vw; color: #fafafa; line-height: 1.2; }              /* 44 */
.pd-figma-stat-dim  { font-size: 2.8333vw; color: rgba(250,250,250,0.70); line-height: 3.6667vw; } /* 34 / 44 */

/* ── Карточки: ряд с одинаковым шагом ── */
.pd-ab-cards {
  position: absolute;
  top: 11.8333vw;                        /* 142 */
  left: 0; right: 0;
  display: flex;
  gap: 5vw;                              /* 60 между карточками */
  padding-left: 2.9167vw;                /* 35 */
  z-index: 2;
}
.pd-ab-group {
  flex: 0 0 auto;
  width: 27.5vw;                         /* 330 */
  height: 15.3333vw;                     /* 184 */
  will-change: transform;
}

.pd-ab-card {
  width: 100%; height: 100%;
  border-radius: 2.6667vw;               /* 32 */
  background: #eedfff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3.3333vw;                   /* 40 */
}
.pd-ab-group--1 .pd-ab-card { transform: rotate(-5deg); }
.pd-ab-group--3 .pd-ab-card { transform: rotate(6deg); }

/* Лейбл: скрыт, проявляется при .pd-ab-drop */
.pd-ab-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.8333vw; font-weight: 500; /* 34 */
  color: #1e1e1e;
  white-space: nowrap;
  letter-spacing: -0.0417vw;             /* −0.5 */
  opacity: 0; transform: scale(0.85);
  transform-origin: center;
  transition: opacity 0.9s cubic-bezier(.19,1,.22,1),
              transform 0.9s cubic-bezier(.19,1,.22,1);
}

/* ── Анимация падения (карточка едет вниз на 190 с отскоком) ── */
@keyframes pd-ab-drop {
  0%   { transform: translateY(0); }
  52%  { transform: translateY(16vw); }      /* 192 */
  68%  { transform: translateY(14.8333vw); } /* 178 */
  82%  { transform: translateY(16vw); }      /* 192 */
  91%  { transform: translateY(15.5vw); }    /* 186 */
  100% { transform: translateY(15.8333vw); } /* 190 */
}
.pd-ab-group--1.pd-ab-drop { animation: pd-ab-drop 2.6s ease-out 0.1s both; }
.pd-ab-group--2.pd-ab-drop { animation: pd-ab-drop 2.6s ease-out 0.3s both; }
.pd-ab-group--3.pd-ab-drop { animation: pd-ab-drop 2.6s ease-out 0.5s both; }

/* Мобильный вариант: карточка выпадает сверху на своё место с отскоком */
@keyframes pd-ab-drop-m {
  0%   { transform: translateY(-140%); opacity: 0; }
  15%  { opacity: 1; }
  55%  { transform: translateY(8%); }
  75%  { transform: translateY(-4%); }
  90%  { transform: translateY(2%); }
  100% { transform: translateY(0); opacity: 1; }
}
/* без анимации — карточки сразу на местах. Селектор тяжелее правил падения
   из блока ≤980: те стоят ниже в файле и при равном весе победили бы */
@media (prefers-reduced-motion: reduce) {
  .pd-ab-wrap .pd-ab-cards .pd-ab-group.pd-ab-drop { animation: none; }
}

/* Лейбл проявляется после начала падения */
.pd-ab-group--1.pd-ab-drop .pd-ab-label { opacity: 1; transform: scale(1); transition-delay: 0.25s; }
.pd-ab-group--2.pd-ab-drop .pd-ab-label { opacity: 1; transform: scale(1); transition-delay: 0.45s; }
.pd-ab-group--3.pd-ab-drop .pd-ab-label { opacity: 1; transform: scale(1); transition-delay: 0.65s; }

/* ── Бегущая строка ── */
.pd-ab-ticker {
  position: absolute;
  top: 40.8333vw;                        /* 490 */
  left: 0; right: 0;
  /* низ хвостика «g» — 312 от верха строки, блок кончается на границе макета */
  height: 30.1667vw;                     /* 362 */
  overflow: hidden;
  z-index: 1;
}
@keyframes pd-ab-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-25%); }
}
.pd-ab-ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: pd-ab-marquee 10s linear infinite;
}
.pd-ab-ticker-item {
  font-family: 'Montserrat', sans-serif;
  font-size: 19.5vw; font-weight: 600;   /* 234 */
  color: #404040;
  line-height: 1.55;
  flex-shrink: 0;
  padding-right: 0.2em;
}

/* ── До 980px: поток — надпись, ряд карточек лесенкой, лента ── */
@media (max-width: 980px) {
  /* Все размеры и отступы блока привязаны к ширине экрана: при сужении
     блок уменьшается целиком, а не раздвигается фиксированными отступами */
  .pd-ab-wrap {
    height: auto;
    display: flex;
    flex-direction: column;
    padding: clamp(28px, 5vw, 48px) var(--content-px) 0;
  }

  /* Порядок на любой ширине: надпись сверху, карточки посередине,
     лента всегда внизу блока */
  .pd-ab-wrap > .pd-figma-stat { order: -1; }
  .pd-ab-cards                 { order: 0; }
  .pd-ab-ticker                { order: 1; }

  /* Карточки в ряд лесенкой: средняя ниже двух крайних.
     Не помещаются — ужимаются вместе с шириной экрана. */
  .pd-ab-cards {
    position: static;
    padding-left: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(8px, 2vw, 24px);
    margin-bottom: clamp(24px, 4.4vw, 44px);
  }
  .pd-ab-wrap .pd-ab-group {
    flex: 1 1 0;
    min-width: 0;
    max-width: 260px;
    width: auto; height: auto;
    /* Падение на 190 рассчитано на десктоп. Класс оставляем — от него
       зависит проявление подписи, — а сдвиг убираем. */
    animation: none;
  }
  /* пропорции десктопной карточки (330×184): размер задаёт ширина ряда */
  .pd-ab-wrap .pd-ab-card {
    border-radius: clamp(14px, 2.4vw, 24px);
    padding: 0 clamp(3px, calc(1.6vw - 5px), 15px);   /* на 5px уже с каждой стороны */
    height: auto;
    aspect-ratio: 330 / 184;
  }
  /* средняя карточка опускается — сдвиг растёт вместе с шириной экрана */
  .pd-ab-wrap .pd-ab-group--2 { margin-top: clamp(24px, 6vw, 56px); }
  /* наклоны те же, что на десктопе */
  .pd-ab-wrap .pd-ab-group--1 .pd-ab-card { transform: rotate(-5deg); }
  .pd-ab-wrap .pd-ab-group--2 .pd-ab-card { transform: none; }
  .pd-ab-wrap .pd-ab-group--3 .pd-ab-card { transform: rotate(6deg); }
  /* на телефоне «Product Design» может уйти в две строки — это нормально */
  .pd-ab-wrap .pd-ab-label {
    font-size: clamp(15px, calc(2.6vw + 4px), 28px);   /* на телефоне 15px: 18 занимали почти всю карточку */
    font-weight: 400;   /* на узких экранах — regular */
    letter-spacing: -0.5px;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }
  /* падение сверху, как на десктопе, но на своё место в ряду */
  .pd-ab-wrap .pd-ab-group--1.pd-ab-drop { animation: pd-ab-drop-m 1.4s cubic-bezier(.3,.7,.4,1) .1s both; }
  .pd-ab-wrap .pd-ab-group--2.pd-ab-drop { animation: pd-ab-drop-m 1.4s cubic-bezier(.3,.7,.4,1) .3s both; }
  .pd-ab-wrap .pd-ab-group--3.pd-ab-drop { animation: pd-ab-drop-m 1.4s cubic-bezier(.3,.7,.4,1) .5s both; }

  .pd-ab-ticker {
    position: static;
    height: auto;
    /* снизу воздух под хвостиком «g»: при межстрочном 1.15 он стоит
       почти вплотную к краю строки */
    padding: clamp(4px, 1.6vw, 16px) 0 clamp(12px, 3vw, 28px);
    overflow: hidden;
    /* блок с боковыми полями, а лента выходит за них — от края экрана */
    margin: 0 calc(-1 * var(--content-px));
  }
  /* межстрочный близко к единице: у строки 1.3 под буквами лежала пустота */
  .pd-ab-ticker .pd-ab-ticker-item {
    font-size: clamp(60px, 11vw, 108px);
    line-height: 1.15;
    padding-right: 0.45em;   /* шаг между повторами: было 0.2em */
  }

  .pd-ab-wrap > .pd-figma-stat {
    position: static;
    left: auto; right: auto;
    margin-bottom: clamp(24px, 4vw, 40px);
    letter-spacing: -1.2px;
  }
  /* межстрочный — от кегля: фиксированные 44px десктопа при мелком шрифте
     раздвигали строки */
  .pd-ab-wrap .pd-figma-stat-main { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.2; }
  .pd-ab-wrap .pd-figma-stat-dim  { font-size: clamp(20px, 3.6vw, 34px); line-height: 1.3; }
}

/* ===== ПОРТФОЛИО: КАРТОЧКИ ПРОЕКТОВ ===== */
.projects {
  background: var(--bg);
  padding: 100px 0 80px;
  min-height: 1490px;
}

.projects__inner {
  padding: 0 var(--content-px);
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.projects__title {
  font-weight: 600;
  font-size: var(--fs-section);
  letter-spacing: -1.6px;
  color: var(--text-primary);
  line-height: 60px;
}

/* Колонки ужимаются, когда места мало: жёсткие 584px требовали 1550px окна
   вместе с полями и уезжали за край уже на 1440. */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 584px));
  column-gap: min(60px, 5vw);
  justify-content: center;
  position: relative;
}

/* Карточка — поток: текст сверху, под ним «сцена» со скринами.
   Размеры считаются от ширины самой карточки (cqw), с минимумами для
   читаемости. Эталон — карточка 584px: при ней все значения равны макету. */
.project-card {
  background: var(--card-bg);
  border-radius: clamp(24px, 5.48cqw, 32px);
  container-type: inline-size;
  width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition-theme);
}

.project-card--left  { margin-bottom: 80px; }
.project-card--right { margin-top: 50px; margin-bottom: 30px; }

.project-card__dot {
  position: absolute;
  top: clamp(22px, 5.65cqw, 33px);
  left: clamp(18px, 4.28cqw, 25px);
  width: clamp(14px, 3.42cqw, 20px);
  height: clamp(14px, 3.42cqw, 20px);
}

.project-card__dot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-card__info {
  position: relative;
  padding-top: clamp(36px, 8.56cqw, 50px);
  width: max(72.6cqw, min(310px, 100% - 40px));   /* 424 из 584, на узкой карточке шире */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2.74cqw, 16px);
  text-align: center;
  z-index: 2;
}

.project-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.37cqw, 8px);
  width: 100%;
}

.project-card__name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: clamp(20px, 4.11cqw, 24px);
  color: var(--card-text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  line-height: normal;
}

.project-card__desc {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: clamp(15px, 2.74cqw, 16px);
  color: var(--card-text-secondary);
  line-height: 1.6;
  text-align: center;
}

.project-card__tags {
  display: flex;
  gap: clamp(8px, 2.05cqw, 12px);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.project-tag {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 2.74cqw, 16px);
  color: var(--card-text-thirty);
  border: 1px solid var(--card-text-stroke);
  border-radius: 60px;
  padding: clamp(1px, 0.34cqw, 2px) clamp(10px, 2.05cqw, 12px);
  line-height: clamp(24px, 4.66cqw, 27.2px);
}

/* Сцена со скринами: в макете начинается на 200px и тянется до низа (560),
   поэтому 584 × 360. Координаты скринов — в процентах сцены:
   left и width — от ширины (584), top и height — от высоты (360).
   Скрины выходят за низ сцены и обрезаются карточкой, как в макете. */
.project-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 584 / 360;
  margin-top: clamp(10px, 2.23cqw, 13px);
  flex-shrink: 0;
}
.project-card__media .project-card__img { position: absolute; }

/* --- Quran Reader --- */
.project-card--quran .project-card__img {
  top: 11.111%;                       /* 240 − 200 = 40 из 360 */
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 77.74%;                      /* 454 из 584 */
  border: clamp(3px, 0.86cqw, 5px) solid white;
  border-radius: 8px;
  object-fit: cover;
}


/* --- OnBook --- */
.project-card--onbook .project-card__img--back {
  top: 8.333%;                        /* 230 → 30 из 360 */
  left: 10.788%;                      /* 63 из 584 */
  width: 60.959%;                     /* 356 из 584 */
  border: clamp(3px, 0.86cqw, 5px) solid white;
  border-radius: 8px;
  transform: rotate(5deg);
  object-fit: cover;
  z-index: 0;
}

.project-card--onbook .project-card__img--front {
  top: 24.167%;                       /* 287 → 87 из 360 */
  left: 21.233%;                      /* 124 из 584 */
  width: 65.411%;                     /* 382 из 584 */
  border: clamp(3px, 0.86cqw, 5px) solid white;
  border-radius: 8px;
  transform: rotate(-4deg);
  object-fit: cover;
  z-index: 1;
}


/* --- Kalimat: веб --- */
.project-card--kalimat .project-card__img {
  top: 13.889%;                       /* 250 → 50 из 360 */
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 89.041%;                     /* 520 из 584 */
  height: 91.667%;                    /* 330 из 360 */
  border: clamp(3px, 0.86cqw, 5px) solid white;
  border-radius: 8px;
  object-fit: cover;
  object-position: top center;
}

/* --- Kalimat: приложение. Мокапы вертикальные, поэтому уже и выше остальных --- */
.project-card--kalimat-app .project-card__img--back {
  top: 13.889%;                       /* 250 → 50 из 360 */
  left: 20.548%;                      /* 120 из 584 */
  width: 32.534%;                     /* 190 из 584 */
  transform: rotate(-6deg);
  object-fit: contain;
  z-index: 0;
}
.project-card--kalimat-app .project-card__img--front {
  top: 8.889%;                        /* 232 → 32 из 360 */
  left: 44.863%;                      /* 262 из 584 */
  width: 35.959%;                     /* 210 из 584 */
  transform: rotate(4deg);
  object-fit: contain;
  z-index: 1;
}

.project-card__btn {
  position: absolute;
  bottom: clamp(18px, 5.14cqw, 30px);
  right: clamp(14px, 3.42cqw, 20px);
  width: clamp(52px, 11.64cqw, 68px);
  height: clamp(44px, 8.9cqw, 52px);
  border-radius: 100px;
  background: rgba(127,140,153,0.35);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.project-card__btn:hover { background: rgba(127,140,153,0.55); }

.project-card__btn img {
  width: clamp(16px, 3.42cqw, 20px);
  height: clamp(16px, 3.42cqw, 20px);
  object-fit: contain;
}

/* ===== КАРТОЧКА: ПЛАШКА ПРИ НАВЕДЕНИИ ===== */
.project-card--quran    { --overlay-color: #468ECF; }
.project-card--onbook   { --overlay-color: #2BA6AD; }
.project-card--kalimat     { --overlay-color: #A993D9; }
.project-card--kalimat-app { --overlay-color: #83BFF2; }

.project-card__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-color, #A993D9);
  /* в покое — маленький круг на месте цветной точки (12 в 34;43 из 584) */
  clip-path: circle(2.055cqw at 5.822cqw 7.363cqw);
  transition: clip-path 0.55s cubic-bezier(0.4,0,0.2,1);
  z-index: 15;
  overflow: hidden;
}

/* Шторка почти до низа карточки: центр над карточкой, радиус 630 из 584 */
.project-card:hover .project-card__overlay {
  clip-path: circle(107.877cqw at 50% -17.123cqw);
}

.project-card__overlay::before {
  content: '';
  position: absolute;
  width: 178.767cqw;
  height: 178.767cqw;
  border-radius: 50%;
  background: rgba(255,255,255,0.13);
  top: -78.082cqw;
  left: -45.89cqw;
  pointer-events: none;
}

.project-card__overlay-inner {
  position: absolute;
  left: clamp(24px, 8.56cqw, 50px);
  top: clamp(32px, 10.27cqw, 60px);
  right: clamp(24px, 8.56cqw, 50px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 4.11cqw, 24px);
}

.project-card__overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.project-card__overlay-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: clamp(20px, 4.11cqw, 24px);
  color: white;
  letter-spacing: -0.3px;
  line-height: normal;
}

.project-card__overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 100px;
  padding: 12px 16px;
  color: #f2f2f2;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
}

.project-card__overlay-btn:hover {
  background: #f2f2f2;
  color: #1e1e1e;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(180,180,180,0.15);
}

.project-card__overlay-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  transition: filter 0.25s ease;
}

.project-card__overlay-btn:hover img { filter: brightness(0); }

.project-card__overlay-desc {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 18px;
  color: white;
  line-height: 1.55;
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery {
  background: var(--bg);
  padding: 10px 0 60px;
  overflow: hidden;
}

.gallery__inner {
  position: relative;
  width: min(680px, 92vw);
  aspect-ratio: 680 / 597;
  margin: 0 auto;
}

/* Коллаж разложен в координатах 680×597, поэтому вместе с сужением рамки
   уменьшается и он: множитель — доля от исходной ширины. */
.gallery__covers {
  position: absolute;
  inset: 0;
  transform: scale(calc(0.705 * min(680px, 92vw) / 680px));
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
  transform-origin: center center;
}

.gallery__inner:hover .gallery__covers { transform: scale(calc(0.95 * min(680px, 92vw) / 680px)); }

.gallery__photo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  --ph: 400px;   /* высота одна у всех, ширина — по пропорциям снимка */
  background: white;
  border-radius: 32px;
  padding: 12px;
  box-shadow: -24px 31px 51px 7px rgba(0,0,0,0.15);
}

.gallery__photo img {
  display: block;
  border-radius: 30px;
  height: var(--ph);
  width: auto;
  max-width: none;
}


/* Стопка: четыре снимка внахлёст, каждый со своим наклоном */
.gallery__photo--1 { transform: translate(calc(-50% - 120px), calc(-50% - 20px)) rotate(-14deg); }
.gallery__photo--2 { transform: translate(calc(-50% - 40px), calc(-50% + 30px)) rotate(-5deg); }
.gallery__photo--3 { transform: translate(calc(-50% + 45px), calc(-50% - 25px)) rotate(6deg); }
.gallery__photo--4 { transform: translate(calc(-50% + 125px), calc(-50% + 20px)) rotate(15deg); }

/* При наведении стопка разворачивается в горизонтальный ряд:
   снимки выпрямляются, ужимаются и расходятся с равным шагом.
   Ряд: 3 × 150 + 367 × 0.6 ≈ 670px — умещается в контейнер 680px. */
.gallery__photo {
  transition: transform 0.55s cubic-bezier(0.34, 1.2, 0.5, 1);
}
.gallery__inner:hover .gallery__photo--1 { transform: translate(calc(-50% - 225px), -50%) rotate(0deg) scale(0.6); z-index: 1; }
.gallery__inner:hover .gallery__photo--2 { transform: translate(calc(-50% - 75px), -50%) rotate(0deg) scale(0.6); z-index: 2; }
.gallery__inner:hover .gallery__photo--3 { transform: translate(calc(-50% + 75px), -50%) rotate(0deg) scale(0.6); z-index: 3; }
.gallery__inner:hover .gallery__photo--4 { transform: translate(calc(-50% + 225px), -50%) rotate(0deg) scale(0.6); z-index: 4; }

/* Второй проход снимков нужен только бегущей строке на телефоне —
   в стопке и в сетке он скрыт. Там его включает правило с .is-open. */
.gallery__photo--dup { display: none; }

/* ===== ГАЛЕРЕЯ: РАСКРЫТИЕ КЛИКОМ =====
   Наведение оставляет прежнюю раскладку в ряд, клик раскрывает снимки
   в сетку: они выстраиваются рядами по ширине контейнера. */

.gallery__inner.is-open {
  width: min(1200px, 92vw);
  max-width: none;
  aspect-ratio: auto;
  height: auto;
  cursor: pointer;
}

.gallery__inner.is-open .gallery__covers {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  transform: none;
}

/* снимки выходят из абсолютной раскладки в поток */
.gallery__inner.is-open .gallery__photo {
  position: static;
  flex-shrink: 0;
  width: auto;
  transform: none !important;
  transition: none;
}

/* кнопка своё отработала и уходит; вернуть стопку можно кликом по галерее */
.gallery__inner.is-open .gallery__btn {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  pointer-events: none;
}

@keyframes gallery-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/* без анимации — вместо ленты снимки просто стоят рядами */
@media (max-width: 639px) and (prefers-reduced-motion: reduce) {
  .gallery__inner.is-open .gallery__covers {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
  }
  .gallery__inner.is-open .gallery__photo--dup { display: none; }
}

.gallery__btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  z-index: 10;
  background-image: linear-gradient(235deg, #1e1e1e 8%, #575658 91%);
  color: #fcfcfc;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 28px;
  line-height: normal;
  padding: 28px 32px;
  border-radius: 100px;
  white-space: nowrap;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.gallery__btn:hover { opacity: 0.9; }

/* ===== НАВЫКИ ===== */
.pd-skills {
  --pd-ink: #1e1e1e;
  --pd-muted: #979797;
  --pd-ease: cubic-bezier(.19,1,.22,1);
  background: var(--bg);
  padding: 80px var(--content-px);
}

.pd-skills__title {
  font-size: var(--fs-block);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 60px;
}

/* Вкладки создаются через JS — скрыты на десктопе */
.pd-skills__tabs { display: none; }

.pd-skills__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

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

.pd-card {
  background: #fff;
  border: 1px solid #f8f8f8;
  border-radius: 32px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow: hidden;
  position: relative;
}

.pd-card__tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
}
.pd-tag--blue   { background: #ecf5ff; }
.pd-tag--yellow { background: #fffbec; }
.pd-tag--green  { background: #effff3; }
.pd-tag--indigo { background: #eeecff; }

.pd-card__list { display: flex; flex-direction: column; gap: 20px; list-style: none; }

.pd-card__list li {
  position: relative;
  padding-left: 26px;
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
}

.pd-card__list li::before {
  content: '';
  position: absolute;
  left: 4px; top: 12px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pd-ink);
  transform: scale(0);
  transition: transform .45s var(--pd-ease);
  transition-delay: calc(var(--i, 0) * 70ms + 220ms);
}

.pd-card.pd-in .pd-card__list li::before { transform: scale(1); }
.pd-card__list li span { color: var(--pd-muted); display: block; }

.pd-card__tools { display: flex; flex-wrap: wrap; gap: 15px; }

.pd-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--pd-ink);
  border-radius: 100px;
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
  transition: background .25s ease, color .25s ease, transform .25s var(--pd-ease);
}
/* без заливки при наведении — теги не кнопки, остаётся лёгкий подъём */
.pd-tool:hover { transform: translateY(-3px); }

/* Skills анимации */
.pd-anim {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s var(--pd-ease), transform .9s var(--pd-ease);
}
.pd-anim.pd-in { opacity: 1; transform: none; }

.pd-card.pd-anim--left  { opacity: 0; transform: translateX(-70px); transition: opacity .85s var(--pd-ease), transform .85s var(--pd-ease); }
.pd-card.pd-anim--right { opacity: 0; transform: translateX(70px);  transition: opacity .85s var(--pd-ease), transform .85s var(--pd-ease); }
.pd-card.pd-anim--left.pd-in,
.pd-card.pd-anim--right.pd-in { opacity: 1; transform: none; }

.pd-card .pd-card__tag,
.pd-card .pd-card__list li,
.pd-card .pd-tool {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s var(--pd-ease), transform .6s var(--pd-ease);
  transition-delay: calc(var(--i, 0) * 60ms + 300ms);
}
.pd-card.pd-in .pd-card__tag,
.pd-card.pd-in .pd-card__list li,
.pd-card.pd-in .pd-tool { opacity: 1; transform: none; }

.pd-card .pd-tool { transform: translateY(14px) scale(.93); }
.pd-card.pd-in .pd-tool { transform: none; }

/* ниже 1280 две карточки в ряд становятся уже 500px — раскладываем в столбец */
@media (max-width: 1279px) {
  .projects__grid {
    grid-template-columns: minmax(0, 584px);
    justify-content: center;
    row-gap: 32px;
  }
  .project-card--left  { margin-bottom: 0; }
  .project-card--right { margin-top: 0; margin-bottom: 0; }
  .projects { min-height: 0; }
}

@media (max-width: 1023px) {
  .pd-skills { padding: 60px 24px; }
  .pd-skills__title { font-size: 30px; margin-bottom: 40px; }
  .pd-skills__cols { grid-template-columns: 1fr; }
  .pd-card { padding: 24px; border-radius: 24px; gap: 24px; }
  .pd-card__tag { font-size: 24px; }
  .pd-card__list li { font-size: 17px; line-height: 26px; }
  .pd-tool { font-size: 16px; padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-skills * { transition: none !important; animation: none !important; }
  .pd-anim,
  .pd-card.pd-anim--left,
  .pd-card.pd-anim--right,
  .pd-card .pd-card__tag,
  .pd-card .pd-card__list li,
  .pd-card .pd-tool { opacity: 1 !important; transform: none !important; }
  .pd-card .pd-card__list li::before { transform: scale(1) !important; }
}

/* ===== КОНТАКТЫ ===== */
.contacts {
  background: var(--bg);
  padding: 80px 0;
  min-height: 684px;
}

.contacts__inner {
  padding: 0 var(--content-px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.contacts__card {
  background: var(--contact-bg);
  border-radius: 60px;
  padding: 60px 80px 50px;
  width: 100%;
  max-width: 758px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  text-align: center;
  /* карточка — ссылка целиком: без подчёркивания и синего цвета ссылки */
  text-decoration: none;
  color: inherit;
}
.contacts__card:focus-visible {
  outline: 3px solid #b3a1d1;
  outline-offset: 4px;
}

.contacts__card-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.4s ease;
}

.contacts__card:hover .contacts__card-text { transform: translateY(-20px); }

.contacts__heading {
  font-weight: 600;
  font-size: var(--fs-heading);
  color: #fff;
  /* на узком экране заголовок делится ровно: «Заинтересовал / мой опыт?» */
  text-wrap: balance;
}

.contacts__subtext {
  font-weight: 400;
  font-size: 20px;
  color: #fafafa;
  line-height: 1.5;   /* было normal ≈ 1.2 */
}

.contacts__cta {
  font-weight: 600;
  font-size: var(--fs-cta);
  background: linear-gradient(180deg, rgba(255,255,255,0.8) 22%, rgba(179,161,209,0.8) 171%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: font-size 0.35s cubic-bezier(0.34,1.56,0.64,1);
  display: block;
}

.contacts__card:hover .contacts__cta {
  font-size: 52px;
  animation: cta-jump 0.55s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes cta-jump {
  from { transform: translateY(0); }
  to   { transform: translateY(-12px); }
}

.contacts__links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== ПОЯВЛЕНИЕ БЛОКОВ ПО СКРОЛЛУ ===== */
[data-animate] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

[data-animate].in-view {
  opacity: 1;
  transform: none;
}

[data-animate][data-delay="1"] { transition-delay: 0.12s; }
[data-animate][data-delay="2"] { transition-delay: 0.24s; }
[data-animate][data-delay="3"] { transition-delay: 0.36s; }
[data-animate][data-delay="4"] { transition-delay: 0.48s; }
[data-animate][data-delay="5"] { transition-delay: 0.60s; }

[data-animate="scale"]         { transform: scale(0.95); }
[data-animate="scale"].in-view { transform: scale(1); }

/* ===== КУРСОР-СЛЕД ===== */
@media (hover: hover) and (pointer: fine) {
  body, a, button { cursor: none; }
}

#trail-canvas {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 999999;
  mix-blend-mode: difference;
}

@media (hover: none), (pointer: coarse) {
  #trail-canvas { display: none; }
}


/* ═══════════════════════════════════════════
   АДАПТИВ: планшет и узкие экраны
   Блоки идут от широкого к узкому, как читается каскад.
═══════════════════════════════════════════ */

/* Контакты: четыре кнопки на 768px не помещались в ряд
   (нужно 612px при ширине 608px), и «Сетка» оставалась одна во второй строке */
@media (max-width: 1023px) {
  .contacts__links { gap: 8px; }
}

/* 640–767px: в ряд кнопки не входят — две над двумя, как на телефоне */
@media (max-width: 767px) {
  .contacts__links { max-width: 320px; }
}

/* Боковые поля карточки меньше, чтобы подзаголовок остался в две строки.
   Ниже 640px поля задаёт мобильный блок. */
@media (min-width: 640px) and (max-width: 767px) {
  .contacts__card { padding-inline: 40px; }
}

/* ═══════════════════════════════════════════
   АДАПТИВ: ТЕЛЕФОН ≤ 639px  (эталон 390px)
═══════════════════════════════════════════ */
@media (max-width: 639px) {

  :root {
    --content-px: 20px;
    --header-h: 64px;
  }

  /* ── Nav ── */
  .pd-nav { height: 64px; }
  .pd-nav__inner { padding: 0 20px; }
  .pd-nav__menu  { display: none; }
  .pd-nav__burger { display: flex; }
  .pd-nav-drawer  { display: flex; }

  /* ── Hero ── */
  .hero {
    min-height: auto;
    padding-top: 52px;   /* было 20px — текст стоял вплотную к шапке */
    padding-bottom: 48px;
    border-radius: 0;
    align-items: flex-start;
  }
  .hero__content  { padding: 0 20px; gap: 20px; }
  .hero__text     { gap: 8px; }
  .hero__headline { gap: 6px; }
  .hero__greeting { font-size: 16px; }
  .hero__title    { font-size: 30px; line-height: 1.2; }
  .hero__desc     { font-size: 18px; line-height: 1.5; }
  .hero__illustration { display: none; }
  .hero__cta      { flex-wrap: wrap; gap: 8px; }
  /* кнопки на телефоне не ниже 44px — удобно попадать пальцем */
  .hero__cta .btn       { font-size: 15px; min-height: 44px; padding: 0 18px; }
  .hero__cta .btn__icon { width: 16px; height: 16px; }

  /* Кнопки меньше: текст + иконка */
  .btn            { font-size: 14px; padding: 10px 14px; }
  .btn__icon      { width: 16px; height: 16px; }

  /* ── About: на всю ширину экрана ── */
  #about-inner {
    border-radius: 0;
    margin: 0;
  }
  .pd-ab-wrap > .pd-figma-stat { letter-spacing: -0.8px; }

  /* ── Projects ── */
  .projects        { padding: 48px 0 32px; min-height: auto; }
  .projects__inner { padding: 0 20px; gap: 24px; }
  .projects__title { font-size: 30px; letter-spacing: -0.5px; line-height: 1.2; }
  .projects__grid  { grid-template-columns: 1fr; gap: 16px; }

  .project-card { width: 100%; }
  .project-card--left,
  .project-card--right { margin: 0; }

  /* Dot — скрыт */
  .project-card__dot { display: none; }

  /* Btn — вверху по центру */
  .project-card__btn {
    bottom: auto; right: auto;
    top: 20px; left: 50%;
    transform: translateX(-50%);
    width: 52px; height: 52px;
    border-radius: 50%;
  }

  /* Info — под кнопку */
  .project-card__info {
    padding-top: 88px;
    width: calc(100% - 40px);
  }

  /* На телефоне размеры текста — как в макете (до переделки коэффициент
     здесь был равен 1): без этого название и теги считались бы от узкой
     карточки и становились мельче */
  .project-card__info { gap: 16px; }
  .project-card__header { gap: 8px; }
  .project-card__name { font-size: 24px; }
  .project-card__tags { gap: 12px; }
  .project-tag { font-size: 16px; padding: 2px 12px; line-height: 27.2px; }

  /* Сцена на телефоне выше: скрины крупнее. Проценты по высоте — от 300px */
  .project-card__media { aspect-ratio: auto; height: 300px; margin-top: 12px; }

  /* Quran Reader */
  .project-card--quran .project-card__img {
    top: 5%;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    width: calc(100% - 30px);
  }
  /* OnBook */
  .project-card--onbook .project-card__img--back {
    top: 5%; left: 16px;
    width: calc(100% - 100px);
  }
  .project-card--onbook .project-card__img--front {
    top: 15%; left: 30px;
    width: calc(100% - 50px);
  }

  /* Kalimat: веб — снимок во всю ширину карточки, кадр по верху страницы */
  .project-card--kalimat .project-card__img {
    top: 5%;
    width: calc(100% - 30px);
    height: 80%;
  }
  /* Kalimat: приложение — пара мокапов по центру */
  .project-card--kalimat-app .project-card__img--back {
    top: 1%; left: calc(50% - 130px);
    width: 140px;
  }
  .project-card--kalimat-app .project-card__img--front {
    top: -4.333%; left: calc(50% - 10px);
    width: 150px;
  }

  /* Overlay. Точка-маркер на телефоне скрыта, а плашка в покое раскрыта
     маленьким кругом на её месте — в круг попадал кусок белого текста.
     Сводим круг в ноль и растим из той же точки, что и при наведении. */
  .project-card__overlay { clip-path: ellipse(0% 0% at 50% 0%); }
  /* Овал от верхнего края: низ дуги на 93% высоты карточки, по бокам дуга
     уходит вверх — скругление видно. Проценты считаются от самой карточки,
     поэтому при любой её высоте шторка доходит почти до низа. */
  .project-card:hover .project-card__overlay {
    clip-path: ellipse(95% 93% at 50% 0%);   /* широкий овал — пологая дуга, как на десктопе */
  }
  /* 20px на узкой карточке дают пять строк и упираются в дугу плашки */
  .project-card__overlay-desc { font-size: 16px; line-height: 24px; }
  .project-card__overlay-inner {
    left: 24px; top: 32px; right: 24px;
  }
  .project-card__overlay-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* ── Gallery ── */
  .gallery__inner { width: min(320px, 90vw); height: 280px; }
  .gallery__photo { width: auto; padding: 8px; border-radius: 16px; --ph: 190px; }
  /* На телефоне раскрытая галерея — бегущая строка во всю ширину экрана.
     Второй проход снимков включается, и дорожка сдвигается ровно на
     половину. Промежуток задан отступом справа у каждого снимка, а не gap:
     так половина дорожки — это ровно четыре снимка с отступами, и шов
     не дёргается. */
  .gallery__inner.is-open { width: 100%; overflow: hidden; }
  .gallery__inner.is-open .gallery__photo--dup { display: block; }
  .gallery__inner.is-open .gallery__covers {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: max-content;
    gap: 0;
    animation: gallery-marquee 18s linear infinite;
  }
  .gallery__inner.is-open .gallery__photo {
    margin-right: 12px;
    padding: 6px;
    border-radius: 14px;
    --ph: 44vw;
    /* в ленте карточки стоят плотно — тяжёлая тень стопки здесь лишняя */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  }
  .gallery__inner.is-open .gallery__photo img { border-radius: 10px; }
  .gallery__btn   { font-size: 18px; padding: 14px 20px; }

  /* ── Skills — вкладки ── */
  .pd-skills        { padding: 48px 20px; }
  .pd-skills__title { font-size: 28px; margin-bottom: 20px; }
  .pd-skills__cols  { grid-template-columns: 1fr; gap: 0; }
  .pd-skills__col   { gap: 0; }

  /* Tabs (создаются через JS) */
  .pd-skills__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
  }
  .pd-skills__tab {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    background: #f0f0f0;
    color: #888;
    border: none;
    white-space: nowrap;
    transition: background .2s, color .2s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;   /* без серой вспышки при нажатии */
    line-height: 1.4;
  }
  /* белая вкладка на светлом фоне отделяется мягкой тенью */
  .pd-skills__tab.is-active {
    background: #fff;
    color: #1e1e1e;
    box-shadow: 0 2px 10px rgba(30, 30, 30, 0.10), 0 1px 2px rgba(30, 30, 30, 0.06);
  }

  /* Карточки: все скрыты, показываем только is-active-tab */
  .pd-card {
    display: none;
    padding: 20px;
    border-radius: 20px;
    gap: 20px;
  }
  .pd-card.is-active-tab { display: flex; }
  .pd-card__tag     { font-size: 18px; }
  .pd-card__list li { font-size: 15px; line-height: 22px; padding-left: 20px; }
  .pd-tool          { font-size: 14px; padding: 8px 14px; }

  /* ── Contacts ── */
  .contacts        { padding: 36px 0 32px; min-height: auto; }
  .contacts__inner { padding: 0 20px; gap: 16px; }
  .contacts__card {
    border-radius: 32px;
    padding: 32px 24px 24px;
    gap: 24px;
  }
  .contacts__heading { font-size: 22px; }
  .contacts__subtext { font-size: 15px; }
  .contacts__cta     { font-size: 26px; }
  .contacts__links   { gap: 8px; }

  /* Кнопки в футере — меньше */
  .contacts__links .btn {
    font-size: 15px;
    min-height: 44px;
    padding: 0 16px;
  }
  .contacts__links .btn__icon { width: 16px; height: 16px; }

  /* ── Заголовок навыков ──
     Заголовок выезжал снизу на 40px при зазоре до вкладок 20px и во время
     появления наезжал на них. Сдвиг меньше зазора. */
    .pd-skills__title.pd-anim       { transform: translateY(12px); }
    .pd-skills__title.pd-anim.pd-in { transform: none; }

  /* ── Ручные переносы ──
     Переносы из десктопной вёрстки рвут фразу не там: описание первого
     экрана и описания карточек переносит браузер, balance ровняет строки. */
    .hero__desc br,
    .project-card__desc br { display: none; }
    .hero__desc { text-wrap: balance; }
    /* у описаний карточек balance с неразрывной «онлайн-платформой» давал
       короткую среднюю строку — переносы по ширине выглядят ровнее */
    .project-card__desc { text-wrap: pretty; font-size: 15px; }
    /* текст в плашке наведения: без одинокого последнего слова */
    .project-card__overlay-desc { text-wrap: balance; }

  /* ── Карточка «Kalimat — приложение» ──
     Мокапы ниже на 48px, низ уходит под край карточки. */
    .project-card--kalimat-app .project-card__img--back  { top: 17%; }
    .project-card--kalimat-app .project-card__img--front { top: 11.667%; }

  /* ── Галерея «Посмотреть ещё» ──
     Снимки уменьшались дважды: сами до 190px и ещё раз всем коллажем,
     стопка выходила ~100×90px. Теперь коллаж в пропорциях десктопа и
     крупнее: на касании наведения нет, стопка не разворачивается. */
    .gallery__inner { width: min(680px, 92vw); height: auto; aspect-ratio: 680 / 597; }
    .gallery__photo { padding: 12px; border-radius: 32px; --ph: 400px; }
    .gallery__covers { transform: scale(calc(0.8 * min(680px, 92vw) / 680px)); }
}


/* ===== ПЛАШКА О COOKIES =====
   Плашка о cookies: светлая карточка по центру снизу. Создаётся в js/main.js,
   после «Хорошо» больше не показывается. */
.pd-cookie {
  position: fixed;
  left: 0;
  right: 0;
  margin-inline: auto;            /* центр без translate(-50%) — текст рисуется чётче */
  bottom: 32px;
  z-index: 95;                       /* над контентом, под мобильным меню и прелоадером */
  width: max-content;
  max-width: calc(100% - 40px);   /* по ширине текста, но не шире экрана */
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 12px 12px 28px;
  background: #fff;
  border-radius: 100px;
  box-shadow: 0 12px 40px rgba(30, 30, 30, 0.14);
  font-family: 'Montserrat', sans-serif;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s cubic-bezier(.19,1,.22,1), transform .6s cubic-bezier(.19,1,.22,1);
  pointer-events: none;
}
.pd-cookie.is-in  { opacity: 1; transform: none; pointer-events: auto; }
.pd-cookie.is-out { opacity: 0; transform: translateY(24px); pointer-events: none; }
.pd-cookie__text {
  flex: 1;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.pd-cookie__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--contact-bg);
}
.pd-cookie__ok {
  flex-shrink: 0;
  padding: 13px 26px;
  border: 0;
  border-radius: 100px;
  background: var(--btn-accent);
  color: var(--btn-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .25s ease;
}
.pd-cookie__ok:focus-visible,
.pd-cookie__link:focus-visible { outline: 3px solid var(--contact-bg); outline-offset: 3px; }
@media (hover: hover) {
  .pd-cookie__ok:hover { transform: translateY(-2px); }
  .pd-cookie__link:hover { text-decoration-color: currentColor; }
}
@media (max-width: 639px) {
  .pd-cookie {
    bottom: max(16px, env(safe-area-inset-bottom));
    width: calc(100% - 32px);
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
    border-radius: 24px;
  }
  .pd-cookie__ok { width: 100%; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-cookie { transition: opacity .2s ease; transform: none; }
  .pd-cookie.is-out { transform: none; }
}
