/* Geologica раздаётся с нашего сервера: браузер не ходит в Google Fonts */
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(fonts/geologica-cyrillic-ext.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(fonts/geologica-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(fonts/geologica-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(fonts/geologica-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ─── Tokens ───────────────────────────────────────────────
   Тёмная тема — основная. Светлая включается переключателем в шапке
   (data-theme="light" на <html>, выбор хранится в localStorage). */
:root {
  /* Палитра по правилу 60-30-10 из аналоговой триады Иттена (красно-фиолетовая сторона):
     60% — графит с еле заметным подтоном шелковицы, 30% — пыльная шелковица и вино
     (только в переливе фона), 10% — бордо, единственный насыщенный цвет. */
  --paper: #161416;      /* графит, подтон шелковицы почти не виден */
  --surface: #1e1b1e;
  --ink: #efecee;
  --muted: #aaa5aa;
  --line: #2e2a2e;
  --dusk: #b8325e;       /* бордо: кнопки, фокус, черта над цифрами (≥ 3:1 к фону) */
  --on-dusk: #fff5f8;    /* текст на заливке акцентом */
  --dusk-soft: #1f1b1f;
  --signal: #f08aa8;     /* светлое бордо: текст при наведении, фокус, подчёркивания */
  --ok: #3ccb7f;         /* только статус «открыт к работе» */

  /* нижняя зона (контакты, футер) — всегда тёмная */
  --night: #121012;
  --on-night: #f2eff1;
  --on-night-muted: #c9c3c8;
  --night-line: rgb(255 255 255 / .16);
  /* перелив (gradient.js): графит → пыльная шелковица → пыльное вино, на несколько тонов светлее основы */
  --g-page-0: var(--paper); --g-page-1: #221b22; --g-page-2: #281c24; --g-page-3: #2e1d25;
  --g-night-0: var(--night); --g-night-1: #211a21; --g-night-2: #281c24; --g-night-3: #301e27;

  --f: "Geologica", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --gap: clamp(16px, 1.8vw, 24px);
  --max: 1600px;
  --content: calc(min(100vw, var(--max)) - 2 * var(--gutter));
  --space: clamp(48px, 6.5vw, 96px);   /* вертикальный ритм между блоками */
  --header: 68px;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 12px;
  --sheet: #f3f6fd;     /* светлый лист под схемами — цвет рамок из Figma */
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #eeeced; --surface: #ffffff; --ink: #1a171a; --muted: #57525a;
  --line: #d9d4d8; --dusk: #8c1d42; --on-dusk: #ffffff; --dusk-soft: #e4e0e3; --signal: var(--dusk);
  --ok: #138a4b; color-scheme: light;
  --g-page-1: #e9e4e8; --g-page-2: #ebe1e6; --g-page-3: #ecdee3;
}

/* ─── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f); font-weight: 350; font-size: 18px; line-height: 1.55;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-color: var(--signal); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0 0 1em; max-width: 62ch; text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* ─── Единая сетка ───────────────────────────────────────────
   12 колонок, одни и те же вертикали везде: 1 · 5 · 9 · 13.
   main = 1/9 (8 кол.), side = 9/13 (4 кол.), label = 1/5, body = 5/13. */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.c-main  { grid-column: 1 / 9; }
.c-side  { grid-column: 9 / -1; }
.c-label { grid-column: 1 / 5; }
.c-body  { grid-column: 5 / -1; }
.c-mid   { grid-column: 5 / 9; }
.c-full  { grid-column: 1 / -1; }
.thirds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); }

/* ─── Header ─────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.top .wrap { display: flex; align-items: center; gap: 28px; height: var(--header); }
.mark { font-weight: 700; text-decoration: none; letter-spacing: -0.01em; margin-right: auto; white-space: nowrap; }
.nav { display: flex; gap: 26px; font-size: 16px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); white-space: nowrap;
}
.btn:hover { background: var(--dusk); border-color: var(--dusk); color: var(--on-dusk); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.top .btn { min-height: 40px; padding: 0 16px; font-size: 15px; }
.theme-toggle {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--ink); border: 1.5px solid var(--line); margin-right: -16px;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

/* ─── Hero: как на Тильде — имя и роль капсом в две строки,
   ниже текст слева и круглый портрет справа. */
.hero { padding-block: clamp(32px, 5vw, 72px) var(--space); }
/* Текст прижат к низу: кнопки встают на одну линию с низом портрета. */
.hero .grid { row-gap: clamp(32px, 4.5vw, 64px); align-items: end; }
.hero__name {
  font-size: clamp(32px, 7.4vw, 108px); font-weight: 800; line-height: 1.04; letter-spacing: -0.03em;
  text-transform: uppercase; text-wrap: initial;
}
.hero__name span { display: block; color: var(--muted); opacity: .75; }
.hero__lede { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.4; color: var(--muted); max-width: 30em; margin-bottom: 28px; }
.hero__photo {
  position: relative; overflow: hidden; aspect-ratio: 1; width: min(100%, 340px); justify-self: end;
  background: var(--dusk-soft); border-radius: 50%;
}
.hero__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.status { display: inline-flex; align-items: baseline; gap: 10px; font-size: 16px; margin: 0 0 28px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); background: var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .hero__name { animation: rise .9s cubic-bezier(.2,.7,.1,1) both; }
  .hero__photo { animation: fade 1s ease-out .1s both; }
  .hero__text { animation: fade .8s ease-out .2s both; }
  @keyframes fade { from { opacity: 0; } }
  @keyframes rise { from { transform: translateY(40%); opacity: 0; } }
}

/* ─── Ночная зона: контакты + футер на одном градиенте ─────
   Тёмный лист со скруглённым верхом «наезжает» на страницу — как остальные плашки сайта.
   Раньше здесь было длинное растворение из фона, оно и давало пустоту перед контактами. */
.night {
  position: relative; isolation: isolate; overflow: hidden; color: var(--on-night);
  padding-top: clamp(48px, 6vw, 88px);
  border-radius: clamp(28px, 4.5vw, 64px) clamp(28px, 4.5vw, 64px) 0 0;
}
.sg {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(45% 55% at 62% 45%, var(--g-night-3) 0%, transparent 70%),
    radial-gradient(50% 60% at 38% 55%, var(--g-night-1) 0%, transparent 70%),
    var(--night);
}
.sg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sg canvas { opacity: 0; transition: opacity 1.2s ease; }

/* Главная: тихий градиент на всю страницу, закреплён за окном */
/* Высота — по большому вьюпорту (lvh): слой не меняет размер, когда на телефоне
   прячется адресная строка, и холст не перерисовывается посреди прокрутки. */
.sg--page {
  position: fixed; z-index: -1; inset: 0 0 auto; height: 100vh; height: 100lvh;
  background:
    radial-gradient(40% 45% at 62% 48%, var(--g-page-3) 0%, transparent 70%),
    radial-gradient(45% 50% at 40% 52%, var(--g-page-2) 0%, transparent 70%),
    radial-gradient(70% 70% at 50% 50%, var(--g-page-1) 0%, transparent 75%),
    var(--paper);
}
.sg.is-live canvas { opacity: 1; }

/* ─── Движение (motion.js; класс js-motion ставится только без reduced-motion) ─── */
.js-motion [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2,.7,.1,1), transform .8s cubic-bezier(.2,.7,.1,1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js-motion [data-reveal].is-in { opacity: 1; transform: none; }
/* кейсы: название поднимается, как имя на главной */
@media (prefers-reduced-motion: no-preference) {
  .js-motion .cs-title { animation: rise .9s cubic-bezier(.2,.7,.1,1) both; }
}
/* кейсы: телефоны встают по очереди и приподнимаются под курсором */
.js-motion .stage[data-reveal] .screens figure {
  opacity: 0; transform: translateY(40px);
  transition: opacity .7s cubic-bezier(.2,.7,.1,1), transform .7s cubic-bezier(.2,.7,.1,1);
  transition-delay: calc(.15s + var(--n, 0) * 90ms);
}
.js-motion .stage[data-reveal].is-in .screens figure { opacity: 1; transform: none; }
.js-motion .screens img { transition: transform .35s cubic-bezier(.2,.7,.1,1); }
.js-motion .screens figure:hover img { transform: translateY(-8px); }
/* кейсы: «Следующий кейс» уезжает вправо под курсором */
.js-motion .next strong { display: inline-block; transition: transform .45s cubic-bezier(.2,.7,.1,1), color .2s; }
.js-motion .next:hover strong { transform: translateX(clamp(12px, 2vw, 28px)); }
/* портрет чуть смещается за курсором */
/* строки малых проектов и навыков отзываются на наведение */
.js-motion .minor__item .case__media { transition: transform .4s cubic-bezier(.2,.7,.1,1); }
.js-motion .minor__item:hover .case__media { transform: translateX(8px); }

/* ─── Sections ───────────────────────────────────────────── */
.section { padding-block: var(--space); border-top: 1px solid var(--line); }
.section__head { align-items: end; row-gap: 12px; margin-bottom: clamp(28px, 3.5vw, 48px); }
.section__title { font-size: clamp(36px, 4.6vw, 68px); letter-spacing: -0.045em; }
.section__note { color: var(--muted); font-size: 18px; margin: 0; }
.section__head .section__note { grid-column: 1 / 9; }   /* пояснение под заголовком, а не сбоку */

/* ─── Projects ───────────────────────────────────────────── */
.case { row-gap: 24px; align-items: start; }
.case + .case { margin-top: clamp(48px, 6vw, 80px); }
.case__media { border-radius: var(--r-lg); overflow: hidden; background: var(--dusk-soft); display: block; }
.case__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.1,1); }
.case__media:hover img { transform: scale(1.025); }
.case__title { font-size: clamp(36px, 4.2vw, 60px); letter-spacing: -0.04em; margin-bottom: 14px; }
.case__title a { text-decoration: none; transition: color .2s; }
.case__title a:hover { color: var(--signal); }
.case__kind { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
.case__desc { font-size: 19px; line-height: 1.45; }
/* результат кейса: крупная цифра и что она значит */
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px var(--gap); margin: 4px 0 28px; }
.proof div { border-top: 2px solid var(--dusk); padding-top: 12px; }
.proof dt { font-size: clamp(26px, 2.4vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.proof dd { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; }

/* два кейса рядом */
.case-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 64px) var(--gap); margin-top: clamp(56px, 7vw, 96px); }
.case--half .case__media { margin-bottom: 24px; }
.case--half .case__title { font-size: clamp(32px, 3.4vw, 48px); }
.case--half .case__desc { font-size: 18px; max-width: 34em; }

/* второстепенные проекты — строки на той же сетке */
.minor { margin-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--line); }
.minor__item { align-items: center; row-gap: 16px; padding-block: 24px; border-bottom: 1px solid var(--line); text-decoration: none; }
.minor__item .case__media img { aspect-ratio: 2 / 1; }
.minor__item h3 { font-size: clamp(28px, 2.8vw, 40px); letter-spacing: -0.035em; margin-bottom: 8px; }
.minor__item p { color: var(--muted); font-size: 16px; margin: 0; }
.minor__go { justify-self: start; font-size: 16px; text-decoration: underline; text-underline-offset: .22em; }
.minor__item:hover .minor__go { text-decoration-color: var(--signal); }
.minor__item:hover h3 { color: var(--signal); }

.case__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.nowrap { white-space: nowrap; }

/* ─── Процесс на главной: три этапа на одной линии ───────── */
.steps { list-style: none; margin: 0; padding: 0; row-gap: 0; }
.steps li { position: relative; padding-top: 44px; }
.steps li::before { content: ""; position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--dusk); }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 6px; left: 26px; right: calc(-1 * var(--gap) + 12px); height: 2px;
  background: linear-gradient(90deg, var(--dusk), var(--line));
}
.steps h3 { font-size: clamp(24px, 2.2vw, 30px); letter-spacing: -0.03em; margin-bottom: 10px; }
.steps p { color: var(--muted); font-size: 17px; margin: 0; max-width: 32ch; }
.steps__more { display: inline-block; margin-top: clamp(28px, 3.5vw, 44px); font-size: 17px; }

/* ─── About ──────────────────────────────────────────────── */
.about { row-gap: 32px; }
.about__text { font-size: clamp(22px, 2vw, 28px); line-height: 1.4; letter-spacing: -0.01em; }
.about__text p { max-width: 30em; }
.facts { margin: 0; }
.facts div { padding: 14px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { margin: 2px 0 0; font-size: 18px; }
.linkish {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-color: var(--dusk); text-decoration-thickness: 2px; text-underline-offset: .22em;
}
.linkish:hover { text-decoration-color: var(--signal); }

/* Образование: узлы со стрелками */
.edu-title { font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -0.03em; margin: clamp(40px, 5vw, 64px) 0 24px; }
.edu { list-style: none; margin: 0; padding: 0; }
.edu li { position: relative; padding-right: 10%; }
.edu__node {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--paper); margin-bottom: 18px; position: relative; z-index: 1;
}
.edu__node svg { width: 26px; height: 26px; }
.edu li.is-done .edu__node { background: var(--ink); color: var(--paper); }
.edu li.is-now .edu__node { background: var(--dusk); border-color: var(--dusk); color: var(--on-dusk); }
.edu li.is-next .edu__node { border-style: dashed; color: var(--muted); border-color: var(--muted); }
.edu li:not(:last-child)::after {
  content: ""; position: absolute; top: 31px; left: 76px; right: calc(-1 * var(--gap) + 14px); height: 2px; background: var(--ink);
}
.edu li:not(:last-child)::before {
  content: ""; position: absolute; top: 26px; right: calc(-1 * var(--gap) + 14px); width: 10px; height: 10px;
  border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(-45deg);
}
.edu li.is-now::after, .edu li.is-now::before { border-color: var(--muted); }
.edu li.is-now::after { background: repeating-linear-gradient(90deg, var(--muted) 0 6px, transparent 6px 12px); }
.edu__when { color: var(--muted); font-size: 15px; }
.edu h4 { margin: 4px 0 6px; font-size: 21px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.edu p { font-size: 16px; margin: 0; color: var(--muted); }

/* ─── Contacts & footer (всегда тёмные, высокий контраст) ── */
.contact { color: var(--on-night); border-top: 0; padding-top: 0; }
.contact .section__title { color: var(--on-night-muted); font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; letter-spacing: -0.015em; }
.contact__mail {
  display: inline-block; font-size: clamp(32px, 7vw, 104px); font-weight: 700; letter-spacing: -0.05em; line-height: 1;
  text-decoration: none; word-break: break-all; margin-bottom: clamp(32px, 5vw, 64px);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat; transition: background-size .4s;
}
.contact__mail:hover { background-size: 100% 3px; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { border-top: 1px solid var(--night-line); }
.links a { display: flex; justify-content: space-between; gap: 12px; padding: 18px 0; text-decoration: none; font-size: 18px; color: var(--on-night); }
.links a span { color: var(--on-night-muted); }
.links a:hover span { color: var(--on-night); }
.foot { color: var(--on-night-muted); font-size: 15px; }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px; border-top: 1px solid var(--night-line); }
.foot a { color: var(--on-night); }

/* ─── Case study page ────────────────────────────────────── */
.cs-hero { padding-block: clamp(28px, 4vw, 56px) clamp(36px, 4.5vw, 56px); }
.back { display: inline-block; color: var(--muted); font-size: 16px; margin-bottom: clamp(20px, 3vw, 40px); }
.cs-title { font-size: min(clamp(52px, 9vw, 128px), calc(var(--content) / var(--em, 3))); font-weight: 800; letter-spacing: -0.05em; line-height: .92; margin-bottom: clamp(24px, 3.5vw, 44px); }
.cs-intro { row-gap: 28px; }
.cs-intro__lede { font-size: clamp(22px, 2.1vw, 30px); line-height: 1.3; letter-spacing: -0.01em; font-weight: 400; }
.cs-intro .facts div { padding: 12px 0; }
.cs-intro .facts dt { font-size: 14px; }
.cs-intro .facts dd { font-size: 17px; }

.cs-block { padding-block: var(--space); border-top: 1px solid var(--line); }
.cs-cols { row-gap: 20px; }
.cs-cols > h2 { font-size: clamp(30px, 3.2vw, 46px); letter-spacing: -0.035em; }
.cs-text p { font-size: 19px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gap); row-gap: 24px; }
.pair h3 { font-size: 24px; margin-bottom: 12px; letter-spacing: -0.02em; }
.pair p { font-size: 17px; }
.fig { margin: clamp(28px, 3.5vw, 48px) 0 0; }
.fig img { border-radius: var(--r-md); width: 100%; transition: box-shadow .2s; }
.fig figcaption { color: var(--muted); font-size: 15px; margin-top: 12px; }
main[data-zoom] .fig img:hover { box-shadow: 0 0 0 2px var(--dusk); }
/* Схемы (JTBD, User Flow, UI-kit) — светлый лист со своим скруглением.
   Прозрачные схемы (UI-kit, User Flow МетеоРитма) — ещё и с полями. */
.fig--sheet img, .lightbox.is-sheet .lightbox__stage img { background: var(--sheet); }
.fig--pad img, .lightbox.is-pad .lightbox__stage img { padding: clamp(12px, 2.4vw, 32px); }
:root[data-theme="light"] .fig--sheet img { box-shadow: 0 0 0 1px var(--line); }
:root[data-theme="light"] main[data-zoom] .fig--sheet img:hover { box-shadow: 0 0 0 2px var(--dusk); }
/* Страница сайта целиком — окно браузера, которое листается внутри */
.fig--page .page { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); transition: box-shadow .2s; }
.fig--page .page__bar { display: flex; align-items: center; gap: 6px; height: 36px; padding-inline: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.fig--page .page__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.fig--page .page__bar span { flex: 1; text-align: center; margin-right: 46px; }
.fig--page .page__view { height: clamp(380px, 56vw, 760px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.fig--page .page__view img { display: block; border-radius: 0; }
main[data-zoom] .fig--page img:hover { box-shadow: none; }
main[data-zoom] .fig--page .page:hover { box-shadow: 0 0 0 2px var(--dusk); }
.lightbox.is-page .lightbox__stage { display: block; }
.lightbox.is-page .lightbox__stage img { width: min(100%, 1280px); max-height: none; margin: 0 auto; cursor: default; }

/* Desired Outcome: три колонки — три этапа, как на схеме CFJ */
.outcomes { margin-top: clamp(24px, 3vw, 36px); row-gap: 40px; align-items: start; }
.outcomes__stage { border-top: 2px solid var(--ink); padding-top: 16px; }
.outcomes__title { display: flex; align-items: baseline; gap: 12px; font-size: 21px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0; }
.outcomes__title span { color: var(--muted); font-size: 15px; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.outcomes .fig { margin-top: 20px; }
.outcomes .fig figcaption { font-size: 14px; margin-top: 8px; }

/* плашка «ещё N» под сеткой: остальные картинки открываются в просмотре */
.more {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  margin-top: clamp(24px, 3vw, 36px); padding: clamp(18px, 2vw, 24px) clamp(20px, 2.4vw, 32px);
  background: var(--dusk-soft); border-radius: var(--r-md);
}
.more p { margin: 0; font-size: 17px; max-width: 60ch; color: var(--muted); }
.more b { color: var(--ink); font-weight: 600; }

/* Лента экранов: всегда в плашке, поля одинаковые со всех сторон.
   Если экраны помещаются — стоят по центру, если нет — листаются (стрелки добавляет site.js). */
.stage { --pad: clamp(24px, 3vw, 40px); position: relative; background: var(--dusk-soft); border-radius: var(--r-lg); margin-top: clamp(28px, 3.5vw, 48px); overflow: hidden; }
.screens {
  display: flex; justify-content: safe center; gap: var(--gap);
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: var(--pad); scroll-padding-inline: var(--pad);
}
.screens::-webkit-scrollbar { display: none; }
.screens:focus-visible { outline-offset: -3px; border-radius: var(--r-lg); }
.screens figure { flex: 0 0 auto; width: clamp(200px, 19vw, 256px); margin: 0; scroll-snap-align: start; }
.screens img { width: 100%; }
.screens figcaption { color: var(--muted); font-size: 14px; margin-top: 12px; text-align: center; }
/* мягкие края вместо обрезанного телефона: лента растворяется в плашке */
.screens {
  --fl: 0px; --fr: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
}
.stage.can-prev .screens { --fl: 72px; }
.stage.can-next .screens { --fr: 72px; }
.stage__btn {
  position: absolute; top: calc(50% - 22px); z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
  background: color-mix(in srgb, var(--paper) 82%, transparent); border: 1.5px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .2s, background-color .2s, color .2s, border-color .2s;
}
.stage__btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.stage__btn:disabled { opacity: 0; pointer-events: none; }
.stage__btn[hidden], .stage__bar[hidden] { display: none; }
.stage__btn svg { width: 16px; height: 16px; }
.stage__prev { left: 12px; }
.stage__next { right: 12px; }
/* полоса прогресса вместо системного скроллбара */
.stage__bar { position: absolute; left: var(--pad); right: var(--pad); bottom: 14px; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.stage__bar i { display: block; height: 100%; border-radius: inherit; background: var(--dusk); }
.cs-lead { padding-bottom: var(--space); }   /* лента сразу под шапкой кейса, до первого блока */
.sub { font-size: clamp(24px, 2.4vw, 34px); letter-spacing: -0.03em; margin: clamp(40px, 5vw, 64px) 0 0; }
.wrap:has(> .sub) + .wrap > .stage { margin-top: clamp(20px, 2.4vw, 28px); }

.next { display: block; text-decoration: none; padding-block: var(--space); border-top: 1px solid var(--line); }
.next small { display: block; color: var(--muted); font-size: 16px; margin-bottom: 8px; }
.next strong { font-size: clamp(40px, 6vw, 88px); font-weight: 800; letter-spacing: -0.05em; line-height: .95; }
.next:hover strong { color: var(--signal); }

/* Навигация по кейсу: site.js собирает её из заголовков блоков.
   На широких экранах — колонка слева, блоки кейса сдвигаются вправо; обложка и лента остаются во всю ширину. */
.cs-block { scroll-margin-top: var(--header); }
.toc { display: none; }
@media (min-width: 1180px) {
  .has-toc { --toc: 200px; }
  .has-toc .cs-block.wrap, .has-toc .cs-block > .wrap { padding-left: calc(var(--gutter) + var(--toc) + var(--gap)); }
  /* разделитель блока начинается от текста, а не проходит под навигацией */
  .has-toc .cs-block { position: relative; border-top: 0; }
  .has-toc .cs-block::before {
    content: ""; position: absolute; top: 0; height: 1px; background: var(--line);
    left: calc(max(0px, (100% - var(--max)) / 2) + var(--gutter) + var(--toc) + var(--gap));
    right: calc(max(0px, (100% - var(--max)) / 2) + var(--gutter));
  }
  .toc {
    display: block; position: fixed; z-index: 5; top: calc(var(--header) + 40px); width: var(--toc);
    left: calc(max(0px, (100% - var(--max)) / 2) + var(--gutter));
    max-height: calc(100dvh - var(--header) - 80px); overflow-y: auto; scrollbar-width: none;
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .toc.is-on { opacity: 1; visibility: visible; }
  .toc ol { list-style: none; margin: 0; padding: 0; }
  .toc a {
    display: block; padding: 5px 0; font-size: 15px; line-height: 1.3; text-decoration: none;
    color: color-mix(in srgb, var(--muted) 55%, transparent); transition: color .2s;
  }
  .toc a:hover, .toc a[aria-current] { color: var(--ink); }
}

/* ─── Модальные окна ─────────────────────────────────────── */
.modal {
  width: min(1040px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: var(--r-lg); background: var(--paper); color: var(--ink);
  overflow: auto; overscroll-behavior: contain;
}
.modal::backdrop { background: rgb(12 12 14 / .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal__bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px clamp(20px, 3vw, 40px); background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.modal__bar h2 { font-size: 20px; margin-right: auto; letter-spacing: -0.015em; }
.modal__bar .btn { min-height: 40px; padding: 0 16px; font-size: 15px; }
.close { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.close:hover { background: var(--ink); color: var(--paper); }
.close svg { width: 16px; height: 16px; }
.modal__body { padding: clamp(24px, 3vw, 40px); }
.modal--img { width: min(920px, calc(100vw - 2 * var(--gutter))); }
.modal--img img { width: 100%; border-radius: var(--r-sm); }
.modal--img p { color: var(--muted); font-size: 16px; margin: 16px 0 0; }
/* Просмотр картинок кейса крупно */
main[data-zoom] figure img { cursor: zoom-in; }
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--on-night); overflow: hidden;
}
.lightbox::backdrop { background: rgb(12 12 14 / .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lightbox__stage {
  position: absolute; inset: 72px var(--gutter) 64px; overflow: auto; overscroll-behavior: contain;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; flex: none; border-radius: var(--r-sm); cursor: zoom-in; }
.lightbox.is-zoomed .lightbox__stage { display: block; }
.lightbox.is-zoomed .lightbox__stage img { max-width: none; max-height: none; margin: 0 auto; cursor: zoom-out; }
.lightbox__cap {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0; height: 64px; margin: 0; max-width: none;
  display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 15px; text-align: center;
}
.lightbox__cap small { color: var(--on-night-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lightbox .close { position: absolute; border-color: var(--on-night); color: var(--on-night); background: rgb(12 12 14 / .5); }
.lightbox .close:hover { background: var(--on-night); color: var(--night); }
.lightbox__close { top: 16px; right: var(--gutter); }
.lightbox__nav { top: 50%; translate: 0 -50%; width: 48px; height: 48px; }
.lightbox__prev { left: 12px; }
.lightbox__next { right: 12px; }
@media (max-width: 720px) {
  .lightbox__nav { top: auto; bottom: 8px; translate: none; }
  .lightbox__cap { padding-inline: 56px; }
}
@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: pop .28s cubic-bezier(.2,.7,.1,1); }
  .lightbox[open] .lightbox__stage img { animation: pop .24s cubic-bezier(.2,.7,.1,1); }
  @keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
}

/* Резюме */
.cv { row-gap: 32px; }
.cv__head { display: flex; gap: 20px; align-items: center; }
.cv__head img { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; background: var(--dusk-soft); }
.cv__head h3 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.035em; }
.cv__head p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.cv h4 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 10px; letter-spacing: 0; }
.cv__side > * + h4 { margin-top: 28px; }
.cv__side ul { list-style: none; margin: 0; padding: 0; font-size: 16px; }
.cv__side li { padding: 6px 0; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { border: 1px solid var(--line) !important; border-radius: 999px; padding: 4px 12px !important; font-size: 14px; }
.job { padding-top: 16px; border-top: 2px solid var(--ink); }
.job + .job { margin-top: 32px; }
.job__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.job__head h5 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.job__head span { color: var(--muted); font-size: 15px; }
.job h6 { margin: 20px 0 6px; font-size: 17px; font-weight: 600; }
.job h6 a { font-weight: 600; }
.job > p { font-size: 16px; color: var(--muted); margin-bottom: 8px; }
.job ul { margin: 0; padding-left: 1.1em; font-size: 16px; }
.job li { margin: 6px 0; }
.job li::marker { color: var(--dusk); }

/* ─── Куки: баннер согласия (stats.js) и страница политики ── */
.cookie {
  position: fixed; z-index: 30; left: var(--gutter); bottom: var(--gutter); width: min(440px, calc(100vw - 2 * var(--gutter)));
  padding: 20px 22px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 48px rgb(12 12 14 / .28);
}
.cookie p { margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.cookie p a { color: var(--ink); }
.cookie__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie .btn { min-height: 40px; padding: 0 16px; font-size: 15px; flex: 1 1 auto; }
@media (prefers-reduced-motion: no-preference) {
  .cookie { animation: pop .32s cubic-bezier(.2,.7,.1,1); }
}
.foot__links { display: inline-flex; gap: 20px; flex-wrap: wrap; }
.legal { padding-block: var(--space); }
.legal h1 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.04em; margin-bottom: 24px; }
.legal h2 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.02em; margin: 48px 0 16px; }
.legal p, .legal li { max-width: 68ch; }
.legal ul { padding-left: 1.1em; margin: 0 0 1em; }
.legal li { margin: 6px 0; }
.legal li::marker { color: var(--dusk); }
.legal table { width: 100%; max-width: 860px; border-collapse: collapse; font-size: 16px; margin: 8px 0 16px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-top: 1px solid var(--line); }
.legal th { font-weight: 600; color: var(--muted); font-size: 14px; }
.legal code { font-size: .9em; }
.legal .lede { color: var(--muted); font-size: clamp(18px, 1.6vw, 21px); }
.legal__choice { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.legal__choice output { color: var(--muted); font-size: 16px; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav { display: none; }
  .grid > [class*="c-"] { grid-column: 1 / -1; }
  .hero .grid { row-gap: 32px; }
  .hero__photo { order: -1; width: 120px; justify-self: start; }
  .section__head .section__note { grid-column: 1 / -1; }
  .case-pair { grid-template-columns: 1fr; }
  .steps.thirds { grid-template-columns: 1fr; }
  .steps li { padding: 0 0 36px 40px; }
  .steps li:last-child { padding-bottom: 0; }
  .steps li::before { top: 8px; }
  .steps li:not(:last-child)::after { top: 34px; bottom: 6px; left: 6px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--dusk), var(--line)); }
  .thirds { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .edu { grid-template-columns: 1fr; row-gap: 0; }
  .edu li { padding: 0 0 32px 88px; min-height: 96px; }
  .edu__node { position: absolute; left: 0; top: 0; }
  .edu li:not(:last-child)::after { top: 72px; bottom: 8px; left: 31px; right: auto; width: 2px; height: auto; }
  .edu li:not(:last-child)::before { top: auto; bottom: 8px; left: 27px; right: auto; transform: rotate(45deg); }
  .edu li.is-now::after { background: repeating-linear-gradient(180deg, var(--muted) 0 6px, transparent 6px 12px); }
  .pair { grid-template-columns: 1fr; }
  .stage { --pad: var(--gutter); border-radius: 0; margin-inline: calc(-1 * var(--gutter)); }
  .stage .screens { padding-block: 24px 36px; }
  .outcomes { row-gap: 32px; }
  .minor__item { padding-block: 28px; }
}
@media (hover: none) {
  .stage__btn { display: none; }   /* на телефоне ленту листают пальцем */
}
@media (max-width: 560px) {
  .hero__name { font-size: 9.4vw; }
  .screens figure { width: min(240px, 64vw); }
  body { font-size: 17px; }
  .thirds { grid-template-columns: 1fr; }
  .links { row-gap: 0; }
  .foot .wrap { flex-direction: column; }
  .cv__side { order: 2; }
  .modal__bar h2 { flex: 1 0 calc(100% - 64px); }
  .modal__bar .close { order: 1; }
  .modal__bar .btn { order: 2; flex: 1 1 0; padding: 0 12px; }
  .modal { max-height: calc(100dvh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
