/* Сайт-визитка. Нейтральная «инженерная» палитра с синим акцентом, моноширинные подписи, светлая и тёмная темы,
   плавные переходы между страницами (View Transitions) и анимации появления. Адаптив от 320 px. */

@font-face { font-family: "Manrope"; src: url("/fonts/manrope-cyrillic.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-21FF, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-cyrillic.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }

/* ---------- Токены ---------- */
:root {
  --bg: #f6f7f9; --bg-alt: #eceff4; --surface: #ffffff; --ink: #0e1116; --soft: #566070; --line: #e1e5eb;
  --accent: #2f5bff; --accent-soft: #e8edff; --on-accent: #ffffff;
  --live: #0b7a45; --live-bg: #dcf4e7; --dev: #8a5300; --dev-bg: #fff0d1;
  --inv-bg: #0e1116; --inv-ink: #eef1f6; --inv-soft: #a5aebd; --inv-line: #2a303b;
  --glow: rgb(47 91 255 / .16);
  --shadow: 0 1px 2px rgb(14 17 22 / .04), 0 14px 34px -18px rgb(14 17 22 / .22);
  --radius: 20px; --radius-sm: 12px;
  --font: "Manrope", system-ui, "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .75, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d11; --bg-alt: #10131a; --surface: #151921; --ink: #eef1f6; --soft: #9ca6b7; --line: #252b36;
    --accent: #7d97ff; --accent-soft: #1b2342; --on-accent: #0b0d11;
    --live: #5fe39f; --live-bg: #0f2a1c; --dev: #ffc561; --dev-bg: #2b2112;
    --inv-bg: #eef1f6; --inv-ink: #0e1116; --inv-soft: #4a5362; --inv-line: #cfd5de;
    --glow: rgb(125 151 255 / .14);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 14px 34px -18px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d11; --bg-alt: #10131a; --surface: #151921; --ink: #eef1f6; --soft: #9ca6b7; --line: #252b36;
  --accent: #7d97ff; --accent-soft: #1b2342; --on-accent: #0b0d11;
  --live: #5fe39f; --live-bg: #0f2a1c; --dev: #ffc561; --dev-bg: #2b2112;
  --inv-bg: #eef1f6; --inv-ink: #0e1116; --inv-soft: #4a5362; --inv-line: #cfd5de;
  --glow: rgb(125 151 255 / .14);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 14px 34px -18px rgb(0 0 0 / .6);
  color-scheme: dark;
}

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-tap-highlight-color: transparent; }
body { min-height: 100svh; background: var(--bg); color: var(--ink); font: 400 clamp(1rem, .96rem + .2vw, 1.0625rem)/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
@media (max-width: 400px) { .project__title { font-size: 1.7rem; } }
p { text-wrap: pretty; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
/* Отступы с учётом «чёлки» и закруглений экрана телефона */
.wrap { width: min(100%, var(--container)); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .02em; color: var(--soft); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: var(--on-accent); }
.skip:focus { top: 12px; }
.arr { display: inline-block; transition: transform .3s var(--ease); }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 20; view-transition-name: site-header;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: transform .4s var(--ease), border-color .3s, box-shadow .3s;
}
.header.is-scrolled { border-bottom-color: var(--line); }
.header.is-hidden { transform: translateY(-100%); }
.header__in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; margin-right: auto; white-space: nowrap; }
.brand__mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: .85rem; letter-spacing: .02em; transition: transform .4s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.06); }
.nav { display: flex; gap: clamp(12px, 2.4vw, 28px); font-weight: 600; font-size: .95rem; }
.nav a { position: relative; text-decoration: none; color: var(--soft); padding-block: 6px; transition: color .2s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }
@media (max-width: 560px) { .nav__hide-sm, .brand__name { display: none; } }
.theme { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .2s, translate .25s var(--ease); }
.theme:hover { border-color: var(--accent); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .5s var(--ease); }
.theme:hover svg { transform: rotate(25deg); }
.theme__moon { display: none; fill: currentColor !important; stroke: none !important; }
:root[data-theme="dark"] .theme__sun { display: none; }
:root[data-theme="dark"] .theme__moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme__sun { display: none; } :root:not([data-theme="light"]) .theme__moon { display: block; } }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ---------- Кнопки, подписи ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1.5px solid var(--accent); background: var(--accent); color: var(--on-accent);
  font-weight: 700; text-decoration: none; text-align: center;
  transition: translate .25s var(--ease), box-shadow .25s, background .2s, border-color .2s;
}
.btn:hover { box-shadow: 0 12px 26px -12px var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); box-shadow: none; }
.link { display: inline-flex; gap: 8px; font-weight: 700; color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.link:hover .arr, .pager__link--next:hover .arr, .cta__item--pdf:hover .arr { transform: translateX(4px); }
.back:hover .arr, .pager__link--prev:hover .arr { transform: translateX(-4px); }
.cta__item--pdf:hover .arr { transform: translateY(3px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(3); opacity: 0; } }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.chip--live, .chip--done { background: var(--live-bg); color: var(--live); }
.chip--dev { background: var(--dev-bg); color: var(--dev); }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-family: var(--mono); font-size: .72rem; color: var(--soft); overflow-wrap: anywhere; transition: border-color .2s, color .2s; }
@media (hover: hover) { .tags li:hover { border-color: var(--accent); color: var(--ink); } }

/* ---------- Первый экран ---------- */
.hero { --hx: 70%; --hy: 20%; padding-block: clamp(32px, 7vw, 96px) clamp(40px, 6vw, 80px); position: relative; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; left: var(--hx); top: var(--hy); width: 70vmax; height: 70vmax; translate: -50% -50%;
  border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); z-index: -1; pointer-events: none;
  transition: left .8s var(--ease), top .8s var(--ease);
}
.hero__in { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .hero__in { grid-template-columns: 1.35fr .65fr; gap: 56px; } }
.hero__title { margin-top: 18px; font-size: clamp(2.35rem, 1.3rem + 5.2vw, 4.9rem); line-height: .98; font-weight: 800; letter-spacing: -.035em; }
.hero__title .w { display: inline-block; }
.hero__role { margin-top: 16px; font-size: clamp(1.1rem, 1rem + .9vw, 1.6rem); font-weight: 700; line-height: 1.3; max-width: 26ch; }
.hero__lead { margin-top: 18px; max-width: 58ch; color: var(--soft); font-size: 1.05rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (max-width: 480px) { .hero__actions .btn { flex: 1 1 100%; } }
.hero__photo { --py: 0px; justify-self: center; width: min(100%, 380px); aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); outline: 1px solid var(--line); outline-offset: 8px; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 28%; transform: translateY(var(--py)) scale(1.06); }
@media (max-width: 899px) { .hero__photo { width: min(78%, 340px); } }
@media (max-width: 899px) and (orientation: landscape) { .hero__photo { width: min(46%, 300px); } }

/* Анимация загрузки первого экрана */
.load, .hero__title .w { animation: rise .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + 60ms); }
.hero__title .w { animation-name: word; animation-delay: calc(var(--i, 0) * 120ms + 140ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes word { from { opacity: 0; transform: translateY(45%); filter: blur(8px); } }

.numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: clamp(36px, 5vw, 64px); }
@media (min-width: 760px) { .numbers { grid-template-columns: repeat(4, 1fr); } }
.numbers li { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.numbers b { display: block; font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.numbers span { display: block; margin-top: 8px; font-size: .88rem; color: var(--soft); line-height: 1.35; }
@media (max-width: 360px) { .numbers li { padding: 14px; } .numbers span { font-size: .8rem; } }

/* ---------- Секции ---------- */
.section { padding-block: clamp(56px, 8vw, 112px); }
.section--alt { background: var(--bg-alt); }
.head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.head__title { margin-top: 12px; font-size: clamp(1.9rem, 1.3rem + 2.8vw, 3.25rem); line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.head__lead { margin-top: 14px; color: var(--soft); font-size: 1.05rem; }

/* ---------- «Живые» карточки: наклон и подсветка за курсором ---------- */
[data-tilt] {
  --rx: 0deg; --ry: 0deg; --lift: 0px; --mx: 50%; --my: 0%;
  position: relative; transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition: transform .45s var(--ease), box-shadow .3s, border-color .3s;
}
[data-tilt]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), var(--glow), transparent 60%); transition: opacity .3s;
}
@media (hover: hover) and (pointer: fine) {
  [data-tilt]:hover { --lift: -4px; box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
  [data-tilt]:hover::before { opacity: 1; }
}

/* ---------- Главный проект ---------- */
.featured { display: grid; gap: 28px; align-items: center; padding: clamp(18px, 3vw, 36px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (min-width: 1000px) { .featured { grid-template-columns: .95fr 1.05fr; gap: 40px; } }
.featured__title { margin-top: 14px; font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.featured__title a { text-decoration: none; transition: color .2s; }
.featured__title a:hover { color: var(--accent); }
.featured__lead { margin-top: 14px; color: var(--soft); }
.featured .link { margin-top: 22px; }
.featured__media { position: relative; z-index: 2; display: block; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #f2f8f6; }
.wipe { display: block; }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.metrics--row { margin-top: 20px; }
.metrics li { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); min-width: 0; }
.metrics b { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.05; letter-spacing: -.01em; }
.metrics span { display: block; margin-top: 4px; font-size: .8rem; color: var(--soft); line-height: 1.35; }
@media (max-width: 360px) { .metrics li { padding: 12px; } .metrics b { font-size: 1.2rem; } }

/* ---------- Карточки проектов ---------- */
.cards { display: grid; gap: 20px; margin-top: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.cards__cell { display: flex; min-width: 0; }
.card { display: flex; flex-direction: column; width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .8s var(--ease); }
.card__media--contain { display: grid; place-items: center; padding: 18px; background: #f2f8f6; }
.card__media--contain img { height: auto; object-fit: contain; border-radius: 8px; }
@media (hover: hover) { .card:hover .card__media img { transform: scale(1.05); } }
.card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 24px; flex: 1; }
.card__title { font-size: 1.22rem; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.card__title a { text-decoration: none; transition: color .2s; }
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 2; } /* вся карточка кликабельна */
@media (hover: hover) { .card:hover .card__title a { color: var(--accent); } }
.card__text { color: var(--soft); font-size: .95rem; }
.card .tags { margin-top: auto; padding-top: 6px; }
@media (max-width: 400px) { .card__body { padding: 16px 16px 20px; } }

/* ---------- Навыки и опыт ---------- */
.skills { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.skill { padding: 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); transition: border-color .3s; }
@media (hover: hover) { .skill:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); } }
.skill__title { margin-bottom: 12px; font-size: 1rem; font-weight: 800; }
.exp { margin-top: 32px; padding: 22px 24px; border-radius: var(--radius-sm); border: 1px dashed var(--line); background: var(--surface); }
.exp__title { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.exp__item { margin-top: 10px; }
.exp__item p { margin-top: 4px; color: var(--soft); }

/* ---------- Контакты ---------- */
.cta { display: grid; gap: 28px; padding: clamp(24px, 5vw, 56px); border-radius: 28px; background: var(--inv-bg); color: var(--inv-ink); }
@media (min-width: 900px) { .cta { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; } }
.eyebrow--inv { color: var(--accent); }
.cta__title { margin-top: 12px; font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.cta__text p:last-child { margin-top: 14px; color: var(--inv-soft); }
.cta__list { display: grid; gap: 10px; }
.cta__item { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--inv-line); text-decoration: none; transition: border-color .2s, transform .3s var(--ease); }
.cta__item:hover { border-color: var(--accent); transform: translateX(4px); }
.cta__item .mono { color: var(--inv-soft); flex: none; }
.cta__item b { font-weight: 700; overflow-wrap: anywhere; text-align: right; }
.cta__item--pdf { background: var(--accent); border-color: var(--accent); color: #fff; }
.cta__item--pdf .mono { color: inherit; opacity: .8; }
@media (max-width: 420px) { .cta__item { flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; } .cta__item b { text-align: left; } }

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 24px max(24px, env(safe-area-inset-bottom)); font-size: .9rem; color: var(--soft); }
.footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }

/* ---------- Страница проекта ---------- */
.project__head { padding-block: clamp(24px, 4vw, 56px) clamp(24px, 3vw, 40px); }
.back { display: inline-flex; gap: 8px; margin-bottom: 22px; font-weight: 600; color: var(--soft); text-decoration: none; }
.back:hover { color: var(--accent); }
.project__title { margin-top: 14px; font-size: clamp(1.9rem, 1.2rem + 3vw, 3.4rem); line-height: 1.04; font-weight: 800; letter-spacing: -.03em; max-width: 22ch; }
.project__tagline { margin-top: 14px; max-width: 66ch; color: var(--soft); font-size: 1.1rem; }
.facts { display: grid; gap: 10px; margin-top: 26px; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.facts div { padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.facts dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.facts dd { margin-top: 4px; font-weight: 600; overflow-wrap: anywhere; }
.facts a { color: var(--accent); }

.gallery { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.gallery__item { margin: 0; min-width: 0; }
.gallery__img { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-alt); }
.gallery__item figcaption { margin-top: 8px; font-size: .85rem; color: var(--soft); }
.gallery__item--desktop, .gallery__item--video { flex: 1 1 480px; }
.gallery__item--mobile { flex: 0 1 260px; }
.gallery__item--diagram { flex: 1 1 100%; }
@media (max-width: 600px) { .gallery__item--mobile { flex-basis: 62%; margin-inline: auto; } }

.project__body { display: grid; gap: 40px; margin-top: clamp(32px, 4vw, 56px); }
@media (min-width: 1000px) { .project__body { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; } .project__side { position: sticky; top: 88px; } }
.project__lead { font-size: 1.18rem; font-weight: 600; line-height: 1.5; }
.h2 { margin-top: 32px; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; }
.h3 { margin: 24px 0 10px; font-size: 1.05rem; font-weight: 800; }
.bullets { margin-top: 14px; padding-left: 0; list-style: none; display: grid; gap: 12px; }
.bullets li { position: relative; padding-left: 22px; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.stack { margin-top: 12px; }
.stack .tags { margin-top: 6px; }
.note { margin-top: 18px; font-size: .82rem; color: var(--soft); }

.extra { margin-top: clamp(40px, 6vw, 80px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); }
.extra .h2 { margin-top: 0; }
.extra__lead { margin: 10px 0 24px; color: var(--soft); }
.extra__cols { display: grid; gap: 32px; margin-top: 28px; }
@media (min-width: 900px) { .extra__cols { grid-template-columns: 1fr 1fr; gap: 48px; } }
.rows { display: grid; gap: 14px; }
.rows dt { font-weight: 800; }
.rows dd { margin-top: 2px; color: var(--soft); }

.pager { display: grid; gap: 12px; margin-top: clamp(40px, 6vw, 80px); }
@media (min-width: 760px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager__link { display: grid; gap: 6px; padding: 18px 22px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .25s, transform .35s var(--ease), box-shadow .3s; }
.pager__link:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pager__link--prev:hover { transform: translateX(-4px); }
.pager__link--next:hover { transform: translateX(4px); }
@media (min-width: 760px) { .pager__link--next { text-align: right; } }
@media (max-width: 759px) { .pager__stub { display: none; } }

/* ---------- Появление при прокрутке ---------- */
.js [data-reveal] { opacity: 0; translate: 0 24px; transition: opacity .8s var(--ease) var(--d, 0ms), translate .8s var(--ease) var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; translate: 0 0; }
/* «Шторка»: картинка не обрезается (иначе браузер не грузит её), поверх уезжает накладка */
.js [data-reveal="wipe"] { position: relative; opacity: 1; translate: none; --wipe: var(--bg-alt); }
.js [data-reveal="wipe"]::after { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--wipe); transform-origin: right; transition: transform 1.1s var(--ease) var(--d, 120ms); }
.js [data-reveal="wipe"].is-in::after { transform: scaleX(0); }
.js .featured [data-reveal="wipe"] { --wipe: var(--surface); }
.js [data-reveal="wipe"].is-instant::after { transition: none; }
.js [data-reveal].is-instant { transition: none; }

/* ---------- Переходы между страницами (View Transitions) ---------- */
@view-transition { navigation: auto; }
[data-vt] { view-transition-name: var(--vt); }
html.no-vt [data-vt], html.vt-theme [data-vt], html.vt-theme .header { view-transition-name: none; }
::view-transition-group(*) { animation-duration: .6s; animation-timing-function: var(--ease); }
::view-transition-old(*), ::view-transition-new(*) { height: 100%; width: 100%; object-fit: cover; object-position: top; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; }
/* Листание проектов: «Следующий» — страница уезжает влево, «Предыдущий» — вправо */
html:active-view-transition-type(next)::view-transition-old(root) { animation: .45s var(--ease) both vt-out-left; }
html:active-view-transition-type(next)::view-transition-new(root) { animation: .55s var(--ease) both vt-in-right; }
html:active-view-transition-type(prev)::view-transition-old(root) { animation: .45s var(--ease) both vt-out-right; }
html:active-view-transition-type(prev)::view-transition-new(root) { animation: .55s var(--ease) both vt-in-left; }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-10%); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(10%); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(10%); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-10%); } }
/* Смена темы: новая тема раскрывается кругом (анимацию задаёт site.js) */
html.vt-theme::view-transition-old(root), html.vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Без анимаций, если так настроено в системе ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; translate: none; }
  .js [data-reveal="wipe"]::after { display: none; }
  [data-tilt] { transform: none; }
}
