/* ===== Темы: светлая — «Бумага», тёмная — «Ночь», шрифт один — Manrope ===== */
:root {
  --font: "Manrope", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --track: -0.025em;
  --bg: #F2F0EB; --text: #121212; --muted: #75726B; --line: #DEDAD2;
  --panel: #FFFFFF; --media: #1A1A1A; --chip: #E6E2DA; --chip-on: #121212; --chip-on-text: #F2F0EB;
  --accent: #121212; --label: #A19D94; --phone-edge: rgba(0,0,0,.12);
  --bubble: #FFFFFF; --bubble-me: #E6E2DA;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #0A0A0A; --text: #F4F4F4; --muted: #AAAAAA; --line: #1E1E1E;
  --panel: #141414; --media: #161616; --chip: #1C1C1C; --chip-on: #F4F4F4; --chip-on-text: #0A0A0A;
  --accent: #F4F4F4; --label: #7A7A7A; --phone-edge: #2A2A2A;
  --bubble: #1C1C1C; --bubble-me: #2A2A2A;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0A; --text: #F4F4F4; --muted: #AAAAAA; --line: #1E1E1E;
  --panel: #141414; --media: #161616; --chip: #1C1C1C; --chip-on: #F4F4F4; --chip-on-text: #0A0A0A;
  --accent: #F4F4F4; --label: #7A7A7A; --phone-edge: #2A2A2A;
  --bubble: #1C1C1C; --bubble-me: #2A2A2A;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  transition: background .4s, color .4s;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 820px; margin: 0 auto; padding: 0 32px; }

/* Серый ярлык в крупной фразе */
.lbl { color: var(--label); }

/* ===== Шапка ===== */
header.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#cases, #about-me { scroll-margin-top: 72px; }
header.top .wrap { display: flex; justify-content: space-between; align-items: center; height: 64px; font-size: 15px; font-weight: 500; }
header.top nav { display: flex; align-items: center; gap: 28px; color: var(--muted); }
header.top nav a:hover { color: var(--text); }
.logo { white-space: nowrap; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--chip); }
.lang button { border: 0; cursor: pointer; font: 600 12px/1 var(--font); letter-spacing: .04em; color: var(--muted); background: transparent; padding: 8px 10px; border-radius: 999px; transition: background .2s, color .2s; }
.lang button.on { background: var(--chip-on); color: var(--chip-on-text); }
.lang a { font: 600 12px/1 var(--font); letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-radius: 999px; transition: background .2s, color .2s; }
.lang a:hover { color: var(--text); }
.lang a.on { background: var(--chip-on); color: var(--chip-on-text); }
/* Тогл языка на сайте: весь блок — одна ссылка */
a.lang { cursor: pointer; }
a.lang span { font: 600 12px/1 var(--font); letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-radius: 999px; transition: background .2s, color .2s; }
a.lang:hover span:not(.on) { color: var(--text); }
a.lang span.on { background: var(--chip-on); color: var(--chip-on-text); }
.cases-note { color: var(--muted); font-size: 15px; margin: -8px 0 32px; }
.lang button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); z-index: 60; padding: 12px 18px; border-radius: 999px; background: var(--chip-on); color: var(--chip-on-text); font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
/* Баннер cookies (на сайте, только где есть счётчик статистики) */
.cc { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: 400px; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 20px 50px -20px rgba(0,0,0,.5); font-size: 14px; line-height: 1.45; }
.cc[hidden] { display: none; }
.cc p { color: var(--muted); }
.cc div { display: flex; gap: 8px; }
.cc button { font: 600 14px/1 var(--font); border: 0; cursor: pointer; padding: 10px 16px; border-radius: 999px; background: var(--chip); color: var(--text); }
.cc button.on { background: var(--chip-on); color: var(--chip-on-text); }
.cc button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@media (max-width: 560px) { .cc { right: 16px; max-width: none; } }

/* ===== Первый экран ===== */
.hero { padding-block: 120px; }
.hero h1 { font-size: clamp(48px, 8vw, 104px); line-height: 1; letter-spacing: var(--track); font-weight: 600; }
.hero p { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.4; max-width: 720px; margin-top: 32px; color: var(--muted); letter-spacing: -0.01em; }
.hero p b { color: var(--text); font-weight: 500; }
.contacts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.contacts a { padding: 10px 18px; border-radius: 999px; background: var(--chip); font-size: 15px; font-weight: 500; transition: transform .2s; }
.contacts a:hover { transform: translateY(-2px); }
.contacts a.main { background: var(--chip-on); color: var(--chip-on-text); }

/* ===== Блок кейсов ===== */
.cases { padding-block: 40px 120px; }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.cases-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 16px 0 40px; }
.cases-head h2 { font-size: clamp(36px, 5vw, 64px); line-height: 1.02; letter-spacing: var(--track); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  font: inherit; font-size: 14px; font-weight: 500; border: 0; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; background: var(--chip); color: var(--text); transition: background .2s, color .2s;
}
.filters button.on { background: var(--chip-on); color: var(--chip-on-text); }

.card {
  display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 8px; margin-bottom: 8px;
  transition: opacity .3s;
}
.card.hide { display: none; }
.card-media {
  position: relative; background: var(--media); border-radius: 28px; overflow: hidden;
  min-height: 460px; display: flex; align-items: flex-end; justify-content: center; gap: 20px; padding: 56px 32px 0;
}
.card-media .phone { width: 190px; margin-bottom: -90px; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card-media .phone:nth-of-type(1) { margin-bottom: -40px; }
.card:hover .card-media .phone { transform: translateY(-14px); }
.card:hover .card-media .phone:nth-of-type(1) { transform: translateY(-24px); }
.card-num { position: absolute; top: 22px; left: 26px; font-size: 13px; color: #9A9A9A; font-weight: 500; letter-spacing: .04em; }
.card-panel {
  background: var(--panel); border-radius: 28px; padding: 32px; display: flex; flex-direction: column; gap: 18px;
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: var(--chip); }
.card-panel .co { font-size: 14px; color: var(--muted); font-weight: 500; }
.card-panel h3 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; overflow-wrap: break-word; hyphens: auto; }
.card-panel p { color: var(--muted); font-size: 16px; line-height: 1.5; }
.card-panel .role { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.card-panel .role b { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.arrow { width: 44px; height: 44px; border-radius: 50%; background: var(--chip-on); color: var(--chip-on-text); display: grid; place-items: center; font-size: 18px; align-self: flex-end; transition: transform .25s; }
.card:hover .arrow { transform: translateX(4px); }
.card-media.board { align-items: flex-end; padding: 64px 48px 0; }
.card-media.board img { width: 100%; max-width: 560px; aspect-ratio: 4/3; object-fit: cover; object-position: top; border-radius: 16px 16px 0 0; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-media.board img { transform: translateY(-10px); }
/* Если место под экраны уже 560 px — показываем 2 экрана крупнее */
.card-media { container-type: inline-size; }
@container (max-width: 560px) {
  .card-media .phone { width: 40%; max-width: 230px; }
  .card-media .phone:nth-of-type(3) { display: none; }
}
/* Коллаж дизайн-системы: палитра, структура токена, кнопки */
.card-media.collage { display: block; padding: 0; min-height: 460px; }
.collage img { position: absolute; border-radius: 14px; box-shadow: 0 24px 50px -18px rgba(0,0,0,.55); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.collage .c-palette { left: 7%; top: 72px; width: 44%; }
.collage .c-token { right: 6%; top: 96px; width: 50%; }
.collage .c-buttons { right: 12%; top: 300px; width: 34%; }
.card:hover .collage .c-palette { transform: translateY(-8px); }
.card:hover .collage .c-token { transform: translateY(-14px); }
.card:hover .collage .c-buttons { transform: translateY(-20px); }
.card.soon .card-media { min-height: 120px; padding: 0; align-items: center; color: var(--muted); font-size: 15px; }
.card.soon { opacity: .6; }

/* Карточка под NDA: экраны заранее размыты (в файлах), сверху замок */
.card.nda .card-media::after { content: ""; position: absolute; inset: 0; background: rgba(10,10,10,.35); }
.nda-lock { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #F4F4F4; font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.nda-lock svg { padding: 14px; width: 62px; height: 62px; border-radius: 50%; background: rgba(10,10,10,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card.nda .card-num { z-index: 2; }
.nda-note { margin-top: 18px; padding: 12px 16px; border-radius: 14px; background: var(--chip); color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 460px; }

/* ===== Телефон ===== */
/* Экран без рамки: скругление 32 px на 375 px ширины */
.phone { container-type: inline-size; }
.phone img { width: 100%; aspect-ratio: 375/812; object-fit: cover; object-position: top; border-radius: calc(100cqw * 32 / 375); box-shadow: 0 0 0 1px var(--phone-edge), 0 30px 60px -20px rgba(0,0,0,.45); }

/* ===== Разделитель ===== */
.sep { padding: 80px 0; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sep span { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ===== Страница кейса ===== */
.case-hero { padding-block: 100px 80px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.case-hero .back { font-size: 15px; color: var(--muted); display: inline-block; margin-bottom: 40px; }
.case-hero .co { font-size: 16px; color: var(--muted); font-weight: 500; margin-bottom: 14px; }
.case-hero h1 { font-size: clamp(40px, 5vw, 62px); line-height: 1.05; letter-spacing: var(--track); font-weight: 600; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; margin-top: 44px; max-width: 460px; }
.facts div { font-size: 15px; line-height: 1.4; }
.facts span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 3px; }
.case-hero .phone { width: 300px; justify-self: center; }

.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: 140px; }
.numbers div { background: var(--panel); border-radius: 24px; padding: 32px 28px; }
.big-num { display: block; font-size: clamp(44px, 5vw, 68px); line-height: 1; letter-spacing: var(--track); font-weight: 600; color: var(--text); margin-bottom: 12px; }
.numbers p { color: var(--muted); font-size: 15px; line-height: 1.4; }

.statement { padding: 0 0 48px; }
.statement h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.16; letter-spacing: -0.025em; font-weight: 600; }
.body { color: var(--muted); font-size: 18px; line-height: 1.65; margin-top: 28px; max-width: 680px; }
.body + .body { margin-top: 16px; }
.body b { color: var(--text); font-weight: 600; }
.block { padding-bottom: 150px; }

.phones { display: flex; justify-content: center; gap: 28px; margin-top: 72px; flex-wrap: wrap; }
.phones figure { width: 250px; }
.phones.long { align-items: flex-start; }
.phones.long .phone img { aspect-ratio: auto; }
.phones figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 18px; line-height: 1.4; }

.bubbles { display: flex; flex-direction: column; gap: 14px; margin-top: 64px; max-width: 520px; margin-inline: auto; }
.bubble { align-self: flex-start; background: var(--bubble); padding: 14px 20px; border-radius: 22px 22px 22px 6px; font-size: 18px; line-height: 1.4; max-width: 80%; }
.bubble:nth-child(even) { align-self: flex-end; border-radius: 22px 22px 6px 22px; background: var(--bubble-me); }
.bubbles-note { text-align: center; font-size: 14px; color: var(--muted); margin-top: 22px; }

.with-phone { display: grid; grid-template-columns: 1fr 280px; gap: 64px; align-items: center; margin-top: 64px; }
.rules { list-style: none; display: flex; flex-direction: column; gap: 22px; }
.rules li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; font-size: 18px; line-height: 1.45; }
.rules li::before { content: "→"; color: var(--accent); font-weight: 600; }
.rules li span { color: var(--muted); display: block; font-size: 16px; margin-top: 2px; }

.next { padding-block: 40px 140px; }
.next a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; background: var(--panel); border-radius: 28px; padding: 40px; transition: transform .3s; }
.next a:hover { transform: translateY(-4px); }
.next .eyebrow { margin-bottom: 10px; }
.next h3 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.02em; line-height: 1.15; font-weight: 600; }

footer { border-top: 1px solid var(--line); padding-block: 72px 120px; }
footer h2 { font-size: clamp(30px, 4vw, 48px); letter-spacing: var(--track); line-height: 1.1; font-weight: 600; max-width: 640px; }
footer .mail { margin-top: 20px; color: var(--muted); font-size: 15px; user-select: all; }
footer small { display: block; margin-top: 56px; color: var(--muted); font-size: 14px; }

/* ===== Списки в тексте кейса ===== */
.list { color: var(--muted); font-size: 18px; line-height: 1.6; margin-top: 28px; max-width: 680px; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.list b { color: var(--text); font-weight: 600; }
.list li::marker { color: var(--label); }
.block .phones { margin-top: 64px; }

/* ===== Опыт и Обо мне ===== */
.exp { padding-block: 40px 120px; }
.exp-list { margin-top: 24px; border-top: 1px solid var(--line); }
.exp-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; padding-block: 36px; border-bottom: 1px solid var(--line); }
.exp-head h3 { font-size: 28px; letter-spacing: -0.02em; font-weight: 600; line-height: 1.15; }
.exp-head p { color: var(--muted); font-size: 15px; margin-top: 8px; }
.exp-head .exp-note { margin-top: 2px; }
.exp-body p { color: var(--muted); font-size: 17px; line-height: 1.6; max-width: 620px; }
.exp-body .tags { margin-top: 18px; }
.about { padding-block: 40px 140px; }
.about h2 { font-size: clamp(32px, 4vw, 48px); letter-spacing: var(--track); line-height: 1.1; font-weight: 600; margin-top: 16px; }
.about-sub { color: var(--muted); font-size: 20px; margin-top: 10px; }

/* ===== Картинки в кейсах ===== */
.shots { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 0; margin-top: 64px; scroll-snap-type: x mandatory; }
.shots figure { flex: 0 0 auto; scroll-snap-align: start; }
.shots img { height: 440px; width: auto; max-width: none; border-radius: 16px; box-shadow: 0 0 0 1px var(--phone-edge); }
.shots figcaption, .slides figcaption, .wide-img figcaption { font-size: 14px; color: var(--muted); margin-top: 14px; line-height: 1.4; }
.slides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.slides img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top; border-radius: 16px; box-shadow: 0 0 0 1px var(--phone-edge); }
.wide-img { margin-top: 64px; }
.wide-img img { width: 100%; border-radius: 16px; box-shadow: 0 0 0 1px var(--phone-edge); }
.wide-img.narrow-img { max-width: 760px; margin-inline: auto; }
.hero-board { justify-self: center; width: 100%; max-width: 520px; }
.hero-board img { width: 100%; border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.tbl-wrap { overflow-x: auto; margin-top: 28px; max-width: 680px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; padding: 0 16px 12px 0; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { font-weight: 600; }
.bars { margin-top: 36px; display: flex; flex-direction: column; gap: 18px; max-width: 680px; }
.bar { display: grid; grid-template-columns: 1fr; gap: 8px; }
.bar-label { font-size: 15px; }
.bar-track { display: block; height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--text); }
.bar:not(:first-child) .bar-fill { background: var(--label); }
.bar-val { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars-note { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ===== Было / стало ===== */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 820px; margin-top: 64px; }
.compare figure { position: relative; }
.compare img { width: 100%; border-radius: 16px; box-shadow: 0 0 0 1px var(--phone-edge); }
.compare-tag { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--chip-on); color: var(--chip-on-text); }
.compare figcaption { font-size: 14px; color: var(--muted); margin-top: 14px; line-height: 1.4; }

/* ===== Прокрутка лент с экранами: свой тонкий индикатор вместо системной полосы ===== */
.phones, .shots, .funnel { scrollbar-width: none; }
.phones::-webkit-scrollbar, .shots::-webkit-scrollbar, .funnel::-webkit-scrollbar { display: none; }
.scroll-ind { position: relative; width: 50%; max-width: 220px; height: 3px; margin: 20px auto 0; border-radius: 999px; background: var(--line); overflow: hidden; opacity: 0; transition: opacity .3s; }
.scroll-ind.on { opacity: 1; }
.scroll-ind span { position: absolute; top: 0; left: 0; height: 100%; border-radius: inherit; background: var(--label); }

/* ===== Воронка рефинансирования: потери под экранами ===== */
.funnel { display: flex; gap: 12px; overflow-x: auto; margin-top: 56px; scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
.fn-step { flex: 0 0 92px; display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; }
.fn-step .phone { width: 100%; }
.fn-step .phone img { box-shadow: 0 0 0 1px var(--phone-edge); }
.fn-name { font-size: 12px; line-height: 1.3; color: var(--muted); height: 32px; display: flex; align-items: flex-end; }
.fn-bar { height: 120px; display: flex; align-items: flex-start; border-top: 1px solid var(--line); }
.fn-bar span { display: block; width: 100%; min-height: 2px; border-radius: 0 0 6px 6px; background: var(--label); opacity: .55; }
.fn-pct { color: var(--muted); font-weight: 400; }
.fn-loss { font-size: 13px; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fn-step.hot .fn-bar span { background: var(--text); opacity: 1; }
.fn-step.hot .fn-name, .fn-step.hot .fn-loss { color: var(--text); font-weight: 600; }
.fn-step.done .fn-loss { color: var(--text); font-weight: 600; }
.fn-total { flex: 0 0 170px; align-self: flex-start; margin-top: 40px; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 20px; background: var(--panel); font-size: 13px; color: var(--muted); }
.fn-big { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.fn-arrow { font-size: 18px; color: var(--label); margin-block: 4px; }
.fn-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 32px; max-width: 680px; }
.fn-sum > div { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 18px; background: var(--panel); font-size: 14px; line-height: 1.35; color: var(--muted); }
.fn-sum .fn-big { font-size: 28px; }
.fn-sum .hot { background: var(--chip-on); color: var(--chip-on-text); }
.fn-sum .hot .fn-big { color: var(--chip-on-text); }
.fn-note { font-size: 14px; color: var(--muted); margin-top: 20px; max-width: 680px; line-height: 1.5; }

/* ===== Схема «родитель → ребёнок» ===== */
.fam { max-width: 900px; margin: 56px auto 0; }
.fam-head, .fam-row { display: grid; grid-template-columns: 1fr 56px 1fr; gap: 12px; align-items: center; }
.fam-head { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.fam-label { font-size: 12px; color: var(--label); margin: 22px 0 8px; letter-spacing: .04em; text-transform: uppercase; }
.fam-cell { display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 12px; border-radius: 16px; background: var(--panel); }
.fam-cell.empty { background: transparent; }
.fam-cell .phone { flex: 0 0 64px; }
.fam-cell p { font-size: 15px; line-height: 1.4; min-width: 0; }
.fam-arrow { text-align: center; font-size: 22px; color: var(--label); }
.fam-arrow.on { color: var(--text); }
.fam-row + .fam-row { margin-top: 8px; }

/* ===== Сетка 27 групп компонентов ===== */
.comp { max-width: 900px; margin: 56px auto 0; }
.comp-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.comp-grid li { padding: 16px 14px; border-radius: 14px; background: var(--panel); font-size: 15px; font-weight: 500; line-height: 1.3; min-width: 0; }
.comp-grid li.bank { background: var(--chip-on); color: var(--chip-on-text); }
.comp-note { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 16px; }
.comp-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--chip-on); flex: 0 0 auto; }
.comp + * { }

/* ===== Появление при прокрутке ===== */
.rv.wait { opacity: 0; transform: translateY(28px); }
.rv { transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }

@media (prefers-reduced-motion: reduce) { .rv.wait { opacity: 1; transform: none; } .rv { transition: none; } }

/* ===== Переключатель темы ===== */
.theme-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--chip); color: var(--text); display: grid; place-items: center; transition: background .2s;
}
.theme-btn:hover { background: var(--line); }
.theme-btn:focus-visible, .filters button:focus-visible, a:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

/* ===== Страница резюме ===== */
.resume-hero { margin-top: 100px; }
.resume-hero .back { font-size: 15px; color: var(--muted); display: inline-block; margin-bottom: 40px; }
.resume-hero h1 { font-size: clamp(40px, 5vw, 62px); line-height: 1.05; letter-spacing: var(--track); font-weight: 600; margin-top: 14px; }
.resume-hero .sub { font-size: 18px; color: var(--muted); margin-top: 14px; }
.cv-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 36px; }
.cv-dl .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; background: var(--chip-on); color: var(--chip-on-text); font-size: 15px; font-weight: 600; transition: transform .2s; }
.cv-dl .btn:hover { transform: translateY(-2px); }
.cv-dl .lang { cursor: pointer; }
.cv-dl .lang button[disabled] { opacity: .4; cursor: default; }
.cv-dl small { color: var(--muted); font-size: 13px; }
.resume-summary { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.4; letter-spacing: -0.015em; font-weight: 500; max-width: 820px; margin-top: 56px; }
.cv-sec { margin-top: 72px; }
.cv-points { color: var(--muted); font-size: 17px; line-height: 1.6; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.cv-points li::marker { color: var(--label); }
.cv-sec .tags { margin-top: 24px; gap: 8px; }
.cv-sec .tag { font-size: 14px; padding: 7px 14px; }
.cv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.cv-two p { font-size: 17px; margin-top: 18px; }
.cv-two p + p { color: var(--muted); margin-top: 4px; }
.resume-page .exp { padding-block: 0; }
.resume-page { padding-bottom: 140px; }
@media (max-width: 860px) {
  .resume-hero { margin-top: 48px; }
  .cv-sec { margin-top: 56px; }
  .resume-summary { margin-top: 40px; }
  .cv-two { grid-template-columns: 1fr; gap: 0; }
  .cv-two > div + div { margin-top: 40px; }
}

/* ===== Телефон (адаптив) ===== */
@media (max-width: 560px) {
  header.top nav a[href$="#cases"], header.top nav a[href$="#about-me"] { display: none; }
}
@media (max-width: 860px) {
  .wrap, .narrow { padding: 0 16px; }
  header.top nav { gap: 14px; }
  header.top .wrap { font-size: 14px; }
  .hero { padding-block: 72px 80px; }
  .card { grid-template-columns: 1fr; gap: 0; margin-bottom: 16px; }
  .card-media { min-height: 0; padding: 64px 20px 0; gap: 14px; border-radius: 28px 28px 0 0; }
  .card-panel { border-radius: 0 0 28px 28px; }
  .card-media .phone { width: 46%; max-width: 200px; margin-bottom: -60px; }
  .card-media .phone:nth-of-type(1) { margin-bottom: -20px; }
  .card-media .phone:nth-of-type(3) { display: none; }
  .card-media.board { padding: 56px 20px 0; }
  .card-media.collage { min-height: 300px; }
  .collage .c-palette { left: 5%; top: 56px; width: 46%; }
  .collage .c-token { right: 4%; top: 72px; width: 52%; }
  .collage .c-buttons { right: 8%; top: 170px; width: 38%; }
  .case-hero { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 48px; }
  .narrow .phones, .phones.wrap { padding-inline: 16px; }
  .case-hero .phone { width: 240px; }
  .numbers { grid-template-columns: 1fr; padding-bottom: 96px; }
  .block { padding-bottom: 100px; }
  .with-phone { grid-template-columns: 1fr; }
  .with-phone .phone { width: 240px; justify-self: center; }
  /* Экраны в кейсах — одной строкой с прокруткой вбок */
  .phones { flex-wrap: nowrap; justify-content: flex-start; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; padding-bottom: 0; }
  .phones::after { content: ""; flex: 0 0 4px; }
  .compare { grid-template-columns: 1fr; }
  .comp-grid { grid-template-columns: repeat(2, 1fr); }
  .comp-grid li { padding: 13px 12px; font-size: 14px; }
  .fam-head, .fam-row { grid-template-columns: 1fr 28px 1fr; gap: 6px; }
  .fam-cell { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; }
  .fam-cell .phone { flex-basis: auto; width: 56px; }
  .fam-cell p { font-size: 13px; }
  .fn-step { flex-basis: 88px; }
  .fn-sum { grid-template-columns: 1fr; }
  .fn-name { font-size: 11px; }
  .fn-bar { height: 96px; }
  .phones figure { flex: 0 0 40%; width: auto; scroll-snap-align: start; }
  .phones figcaption { font-size: 13px; margin-top: 12px; }
  .exp-row { grid-template-columns: 1fr; gap: 14px; }
  .slides { grid-template-columns: 1fr; }
  .shots img { height: 340px; }
}
