/* ===== Material Design 3 · токены =====
   Цветовые роли по умолчанию (seed #6750A4); app.js пересчитывает их из выбранного цвета. */
:root {
  --md-primary: #65558f; --md-on-primary: #fff;
  --md-primary-container: #e9ddff; --md-on-primary-container: #4d3d75;
  --md-secondary: #625b71; --md-on-secondary: #fff;
  --md-secondary-container: #e8def8; --md-on-secondary-container: #4a4458;
  --md-tertiary: #7e5260; --md-on-tertiary: #fff;
  --md-tertiary-container: #ffd9e3; --md-on-tertiary-container: #633b48;
  --md-error: #ba1a1a;
  --md-surface: #fdf7ff; --md-on-surface: #1d1b20; --md-on-surface-variant: #49454e;
  --md-surface-container-lowest: #fff; --md-surface-container-low: #f8f2fa;
  --md-surface-container: #f2ecf4; --md-surface-container-high: #ece6ee;
  --md-surface-container-highest: #e6e0e9;
  --md-outline: #7a757f; --md-outline-variant: #cac4cf;
  --md-inverse-surface: #322f35; --md-inverse-on-surface: #f5eff7; --md-inverse-primary: #cfbdfe;

  /* Форма */
  --shape-xs: 4px; --shape-s: 8px; --shape-m: 12px; --shape-l: 16px; --shape-xl: 28px; --shape-full: 999px;
  /* Движение: emphasized и standard easing из спецификации M3 */
  --ease-emph: cubic-bezier(.2, 0, 0, 1);
  --ease-emph-dec: cubic-bezier(.05, .7, .1, 1);
  --ease-emph-acc: cubic-bezier(.3, 0, .8, .15);
  --ease-std: cubic-bezier(.2, 0, 0, 1);
  --dur-s: 200ms; --dur-m: 400ms; --dur-l: 600ms;

  --font: "Roboto Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, monospace;
  --rail: 96px; --bar: 80px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --md-primary: #cfbdfe; --md-on-primary: #36275d;
    --md-primary-container: #4d3d75; --md-on-primary-container: #e9ddff;
    --md-secondary: #cbc2db; --md-on-secondary: #332d41;
    --md-secondary-container: #4a4458; --md-on-secondary-container: #e8def8;
    --md-tertiary: #efb8c8; --md-on-tertiary: #4a2532;
    --md-tertiary-container: #633b48; --md-on-tertiary-container: #ffd9e3;
    --md-error: #ffb4ab;
    --md-surface: #141218; --md-on-surface: #e6e0e9; --md-on-surface-variant: #cac4cf;
    --md-surface-container-lowest: #0f0d13; --md-surface-container-low: #1d1b20;
    --md-surface-container: #211f24; --md-surface-container-high: #2b292f;
    --md-surface-container-highest: #36343a;
    --md-outline: #948f99; --md-outline-variant: #49454e;
    --md-inverse-surface: #e6e0e9; --md-inverse-on-surface: #322f35; --md-inverse-primary: #65558f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --md-primary: #cfbdfe; --md-on-primary: #36275d;
  --md-primary-container: #4d3d75; --md-on-primary-container: #e9ddff;
  --md-secondary: #cbc2db; --md-on-secondary: #332d41;
  --md-secondary-container: #4a4458; --md-on-secondary-container: #e8def8;
  --md-tertiary: #efb8c8; --md-on-tertiary: #4a2532;
  --md-tertiary-container: #633b48; --md-on-tertiary-container: #ffd9e3;
  --md-error: #ffb4ab;
  --md-surface: #141218; --md-on-surface: #e6e0e9; --md-on-surface-variant: #cac4cf;
  --md-surface-container-lowest: #0f0d13; --md-surface-container-low: #1d1b20;
  --md-surface-container: #211f24; --md-surface-container-high: #2b292f;
  --md-surface-container-highest: #36343a;
  --md-outline: #948f99; --md-outline-variant: #49454e;
  --md-inverse-surface: #e6e0e9; --md-inverse-on-surface: #322f35; --md-inverse-primary: #65558f;
  color-scheme: dark;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  background: var(--md-surface); color: var(--md-on-surface);
  transition: background-color var(--dur-m) var(--ease-std), color var(--dur-m) var(--ease-std);
}
a { color: var(--md-primary); }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--md-primary); outline-offset: 2px; border-radius: var(--shape-s); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--md-primary); color: var(--md-on-primary); padding: 8px 16px; border-radius: var(--shape-full); }
.noscript { padding: 24px; text-align: center; }

.ms {
  font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal;
  font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-smoothing: antialiased; user-select: none;
  transition: font-variation-settings var(--dur-s) var(--ease-std);
}
.ms.fill { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }

/* Типографика M3 */
.display-l { font-size: clamp(44px, 9vw, 72px); line-height: 1.05; font-weight: 500; letter-spacing: -0.02em; margin: 0; font-variation-settings: "wdth" 110; }
.headline-l { font-size: clamp(28px, 5vw, 36px); line-height: 1.2; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.headline-s { font-size: 24px; line-height: 32px; font-weight: 500; margin: 0; }
.title-l { font-size: 22px; line-height: 28px; font-weight: 500; margin: 0; }
.title-m { font-size: 16px; line-height: 24px; font-weight: 600; margin: 0; letter-spacing: .01em; }
.body-l { font-size: 16px; line-height: 24px; margin: 0; }
.body-m { font-size: 14px; line-height: 20px; margin: 0; }
.label-l { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .01em; }
.label-m { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; }
.muted { color: var(--md-on-surface-variant); }
.mono { font-family: var(--mono); }

/* ===== Каркас: rail / bar ===== */
.nav {
  position: fixed; z-index: 20; display: flex;
  background: var(--md-surface-container);
  transition: background-color var(--dur-m) var(--ease-std);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--md-on-surface-variant); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-ind {
  position: relative; display: grid; place-items: center;
  width: 56px; height: 32px; border-radius: var(--shape-full); overflow: hidden;
}
.nav-ind::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--md-secondary-container);
  transform: scaleX(0); opacity: 0;
  transition: transform var(--dur-m) var(--ease-emph), opacity var(--dur-s) var(--ease-std);
}
.nav-ind::after { content: ""; position: absolute; inset: 0; background: var(--md-on-surface); opacity: 0; transition: opacity var(--dur-s); }
.nav-item:hover .nav-ind::after { opacity: .08; }
.nav-ind .ms { position: relative; }
.nav-label { font-size: 12px; font-weight: 600; letter-spacing: .03em; transition: color var(--dur-s); }
.nav-item[aria-current="page"] { color: var(--md-on-surface); }
.nav-item[aria-current="page"] .nav-ind::before { transform: scaleX(1); opacity: 1; }
.nav-item[aria-current="page"] .ms { color: var(--md-on-secondary-container); font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }

.nav-fab {
  display: grid; place-items: center; width: 56px; height: 56px; border: 0; cursor: pointer;
  border-radius: var(--shape-l); background: var(--md-tertiary-container); color: var(--md-on-tertiary-container);
  box-shadow: 0 1px 3px rgb(0 0 0 / .15), 0 4px 8px rgb(0 0 0 / .1);
  transition: border-radius var(--dur-m) var(--ease-emph), transform var(--dur-s) var(--ease-std), box-shadow var(--dur-s);
}
.nav-fab:hover { border-radius: var(--shape-xl); box-shadow: 0 2px 4px rgb(0 0 0 / .18), 0 8px 16px rgb(0 0 0 / .12); }
.nav-fab:active { transform: scale(.94); }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 16px;
  background: color-mix(in srgb, var(--md-surface) 86%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--md-on-surface); font-weight: 600; font-size: 18px; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--shape-m);
  background: var(--md-primary); color: var(--md-on-primary); font-weight: 800; font-size: 18px;
  transition: border-radius var(--dur-m) var(--ease-emph), transform var(--dur-m) var(--ease-emph);
}
.brand:hover .brand-mark { border-radius: 50%; transform: rotate(-8deg); }
.icon-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: transparent; color: var(--md-on-surface-variant); cursor: pointer; position: relative; overflow: hidden;
}
.icon-btn:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.icon-btn .ms { transition: transform var(--dur-l) var(--ease-emph); }
.icon-btn.spin .ms { transform: rotate(360deg); }

main { outline: none; padding: 8px 16px calc(var(--bar) + 104px); max-width: 1120px; margin: 0 auto; }

/* Телефон: нижняя панель */
@media (max-width: 839px) {
  .nav {
    left: 0; right: 0; bottom: 0; height: calc(var(--bar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    justify-content: space-around; align-items: center;
  }
  .nav-item { flex: 1; padding: 12px 0 16px; }
  .nav-fab {
    position: fixed; right: 16px; bottom: calc(var(--bar) + 16px + env(safe-area-inset-bottom));
  }
}
/* Планшет и ПК: rail слева */
@media (min-width: 840px) {
  .nav {
    top: 0; bottom: 0; left: 0; width: var(--rail);
    flex-direction: column; align-items: center; gap: 12px; padding: 20px 0;
    background: var(--md-surface);
  }
  .nav-fab { margin-bottom: 28px; }
  body { padding-left: var(--rail); }
  .topbar { padding: 0 32px; }
  main { padding: 16px 32px 64px; }
}

/* ===== Переходы между страницами (fade-through из M3) ===== */
.page { animation: page-in var(--dur-m) var(--ease-emph-dec) both; }
.page.leaving { animation: page-out 140ms var(--ease-emph-acc) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(24px) scale(.985); } }
@keyframes page-out { to { opacity: 0; transform: translateY(-8px) scale(.99); } }

/* Появление при прокрутке, со ступенькой */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--dur-l) var(--ease-emph-dec), transform var(--dur-l) var(--ease-emph-dec); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Компоненты ===== */
.section { margin-top: 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--md-primary); margin-bottom: 8px; }
.eyebrow .ms { font-size: 18px; }

.card {
  position: relative; border-radius: var(--shape-xl); padding: 24px; overflow: hidden;
  background: var(--md-surface-container-low); color: inherit; text-decoration: none;
  transition: background-color var(--dur-m) var(--ease-std), transform var(--dur-m) var(--ease-emph), box-shadow var(--dur-m) var(--ease-emph), border-radius var(--dur-m) var(--ease-emph);
}
.card.filled { background: var(--md-surface-container-highest); }
.card.outlined { background: var(--md-surface); border: 1px solid var(--md-outline-variant); }
.card.interactive { cursor: pointer; }
.card.interactive:hover { transform: translateY(-4px); box-shadow: 0 2px 6px rgb(0 0 0 / .08), 0 12px 28px rgb(0 0 0 / .1); }
.card.interactive:active { transform: translateY(-1px) scale(.99); }

/* Ripple (состояние «нажатие») */
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .16; transform: scale(0); animation: ripple 550ms var(--ease-std) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: var(--shape-full); border: 0; cursor: pointer;
  font-size: 15px; font-weight: 600; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  transition: box-shadow var(--dur-s), background-color var(--dur-s), border-radius var(--dur-m) var(--ease-emph), transform var(--dur-s);
}
.btn .ms { font-size: 20px; }
.btn:active { border-radius: var(--shape-m); }
.btn-filled { background: var(--md-primary); color: var(--md-on-primary); }
.btn-filled:hover { box-shadow: 0 1px 3px rgb(0 0 0 / .2), 0 4px 10px rgb(0 0 0 / .12); }
.btn-tonal { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.btn-outlined { background: transparent; color: var(--md-primary); border: 1px solid var(--md-outline); }
.btn-text { background: transparent; color: var(--md-primary); padding: 0 12px; }
.btn-tonal:hover, .btn-outlined:hover, .btn-text:hover { background-image: linear-gradient(color-mix(in srgb, currentColor 8%, transparent), color-mix(in srgb, currentColor 8%, transparent)); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--shape-s); border: 1px solid var(--md-outline-variant);
  font-size: 13px; font-weight: 600; color: var(--md-on-surface-variant); background: transparent; white-space: nowrap;
}
.chip .ms { font-size: 18px; }
.chip.assist { background: var(--md-surface-container-low); }
.chip-filter { cursor: pointer; transition: background-color var(--dur-s), color var(--dur-s), border-color var(--dur-s); }
.chip-filter .ms { width: 0; overflow: hidden; transition: width var(--dur-m) var(--ease-emph); }
.chip-filter[aria-pressed="true"] { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.chip-filter[aria-pressed="true"] .ms { width: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== Фон: «аврора» из цветов палитры ===== */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .45;
  animation: drift 26s var(--ease-std) infinite alternate;
}
.aurora i:nth-child(1) { background: var(--md-primary-container); top: -25vmax; left: -10vmax; }
.aurora i:nth-child(2) { background: var(--md-tertiary-container); top: 10vmax; right: -25vmax; animation-duration: 32s; animation-delay: -8s; }
.aurora i:nth-child(3) { background: var(--md-secondary-container); bottom: -30vmax; left: 20vmax; animation-duration: 38s; animation-delay: -16s; opacity: .35; }
@keyframes drift { 50% { transform: translate(8vmax, 6vmax) scale(1.1); } 100% { transform: translate(-6vmax, 10vmax) scale(.95); } }
:root[data-theme="dark"] .aurora i { opacity: .28; }

/* Прогресс прокрутки — волнистая линия M3 Expressive */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 6px; z-index: 30; pointer-events: none; }
.scroll-progress svg { width: 100%; height: 100%; color: var(--md-primary); }
.scroll-progress path { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p, 0)); transition: stroke-dashoffset 80ms linear; }
@media (min-width: 840px) { .scroll-progress { left: var(--rail); } }

/* Подсветка за курсором на карточках */
.spot { --mx: 50%; --my: 50%; }
.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--md-primary) 14%, transparent), transparent 60%);
  transition: opacity var(--dur-m) var(--ease-std);
}
.spot:hover::before { opacity: 1; }
.spot > :not(.big-shape, .ripple) { position: relative; }

/* ===== Главная ===== */
.hero { display: grid; gap: 40px; align-items: center; padding: 24px 0 8px; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.15fr .85fr; gap: 48px; padding: 40px 0 16px; min-height: calc(100dvh - 120px); } }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px 0 6px; margin-bottom: 24px;
  border-radius: var(--shape-full); background: var(--md-surface-container-high); font-size: 14px; font-weight: 600;
}
.kicker .pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--shape-full); background: var(--md-primary); color: var(--md-on-primary); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 0 rgb(47 191 113 / .6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgb(47 191 113 / 0); } 100% { box-shadow: 0 0 0 0 rgb(47 191 113 / 0); } }

/* Имя: вариативный шрифт, буквы «дышат» весом и шириной */
.mega {
  margin: 0; font-size: clamp(76px, 17vw, 176px); line-height: .86; letter-spacing: -0.045em; font-weight: 800;
  display: flex; flex-wrap: wrap; user-select: none;
}
.mega span {
  display: inline-block; color: var(--md-on-surface);
  font-variation-settings: "wght" 800, "wdth" 100, "opsz" 144;
  animation: letter-in .9s var(--ease-emph-dec) both; animation-delay: calc(var(--i) * 60ms);
  transition: font-variation-settings .5s var(--ease-emph), color .5s var(--ease-emph), transform .5s var(--ease-emph);
}
.mega span:hover, .mega span.wave { font-variation-settings: "wght" 300, "wdth" 151, "opsz" 144; color: var(--md-primary); transform: translateY(-4%); }
.mega .accent-dot { color: var(--md-primary); }
@keyframes letter-in { from { opacity: 0; transform: translateY(40%) rotate(8deg); font-variation-settings: "wght" 200, "wdth" 25, "opsz" 144; } }
.hero .lead { font-size: clamp(18px, 2.4vw, 22px); line-height: 1.45; margin: 24px 0 8px; max-width: 30ch; color: var(--md-on-surface-variant); }
.hero .lead b { color: var(--md-on-surface); font-weight: 600; }
.typed-line { font-family: var(--mono); font-size: clamp(15px, 2vw, 17px); color: var(--md-primary); margin: 0 0 32px; min-height: 1.6em; }
@media (max-width: 600px) { .typed-line { min-height: 3.2em; } }
.typed-line::before { content: "› "; opacity: .6; }
.typed::after { content: "▍"; animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.btn-xl { height: 56px; padding: 0 28px; font-size: 16px; border-radius: var(--shape-l); }
.btn-xl:hover { border-radius: var(--shape-xl); }

/* Телефон с живым чатом */
.device-wrap { position: relative; display: grid; place-items: center; padding: 24px 0; }
.shape-bg { position: absolute; width: min(440px, 96vw); aspect-ratio: 1; color: var(--md-primary-container); animation: spin 40s linear infinite; }
.shape-bg path { transition: d 1.2s var(--ease-emph); }
@keyframes spin { to { transform: rotate(360deg); } }
.device {
  position: relative; width: min(330px, 86vw); height: 560px; border-radius: 44px; padding: 10px;
  background: var(--md-surface-container-highest);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .35), 0 0 0 1px var(--md-outline-variant) inset;
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg); transition: transform 1s var(--ease-emph);
}
.device:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }
.screen { height: 100%; border-radius: 36px; overflow: hidden; display: flex; flex-direction: column; background: var(--md-surface-container-lowest); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; background: var(--md-surface-container); }
.chat-ava { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--md-primary); color: var(--md-on-primary); flex: none; }
.chat-ava .ms { font-size: 20px; }
.chat-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.chat-sub { font-size: 12px; color: var(--md-primary); }
.chat { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 14px 12px; overflow: hidden; }
.msg {
  max-width: 86%; padding: 9px 13px; border-radius: 18px; font-size: 13.5px; line-height: 1.4; white-space: pre-line;
  animation: msg-in .5s var(--ease-emph-dec) both; transform-origin: bottom left;
}
.msg.me { align-self: flex-end; background: var(--md-primary); color: var(--md-on-primary); border-bottom-right-radius: 6px; transform-origin: bottom right; }
.msg.bot { align-self: flex-start; background: var(--md-surface-container-high); color: var(--md-on-surface); border-bottom-left-radius: 6px; }
.msg .mono { font-size: 12px; }
.msg-kb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.msg-kb span { display: grid; place-items: center; height: 30px; border-radius: 10px; background: var(--md-secondary-container); color: var(--md-on-secondary-container); font-size: 12px; font-weight: 600; }
.msg.typing { display: flex; gap: 4px; padding: 13px 14px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--md-on-surface-variant); animation: bounce 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 30% { transform: translateY(-5px); opacity: .5; } }
@keyframes msg-in { from { opacity: 0; transform: scale(.6) translateY(12px); } }
.msg.out { animation: msg-out .35s var(--ease-emph-acc) both; }
@keyframes msg-out { to { opacity: 0; transform: translateY(-20px) scale(.96); } }
.composer { display: flex; align-items: center; gap: 8px; margin: 0 10px 12px; padding: 0 6px 0 16px; height: 44px; border-radius: var(--shape-full); background: var(--md-surface-container-high); font-size: 13.5px; color: var(--md-on-surface-variant); }
.composer .txt { flex: 1; white-space: nowrap; overflow: hidden; color: var(--md-on-surface); }
.composer .send { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--md-primary); color: var(--md-on-primary); }
.composer .send .ms { font-size: 18px; }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--shape-l);
  background: var(--md-surface-container-low); box-shadow: 0 10px 30px -8px rgb(0 0 0 / .25); font-size: 13px; font-weight: 600;
  animation: float 7s var(--ease-std) infinite;
}
.float-chip .ms { color: var(--md-primary); font-size: 20px; }
.float-chip.c1 { top: 30%; left: -6%; }
.float-chip.c2 { bottom: 14%; right: -4%; animation-delay: -3.5s; }
.float-chip.c2 .ms { color: var(--md-tertiary); }
@keyframes float { 50% { transform: translateY(-14px); } }
@media (max-width: 520px) { .float-chip.c1 { left: 0; top: 34%; } .float-chip.c2 { right: 0; bottom: 4%; } }

/* Бегущая строка стека */
.marquee { margin: 48px 0 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee .chip { height: 44px; padding: 0 18px; border-radius: var(--shape-full); font-size: 15px; background: var(--md-surface-container-low); border-color: transparent; color: var(--md-on-surface); }
.marquee .chip .ms { color: var(--md-primary); font-size: 20px; }
@keyframes marquee { to { transform: translateX(-50%); } }

.section { margin-top: 72px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--md-primary); margin-bottom: 8px; }
.eyebrow .ms { font-size: 18px; }
.page-title { font-size: clamp(44px, 9vw, 88px); line-height: .95; letter-spacing: -0.035em; font-weight: 750; margin: 8px 0 0; font-variation-settings: "wdth" 112, "opsz" 144; }
.page-title em { font-style: normal; color: var(--md-primary); font-variation-settings: "wght" 300, "wdth" 140; }
.page-intro { max-width: 52ch; margin: 16px 0 40px; color: var(--md-on-surface-variant); font-size: 18px; }

/* Бенто */
.bento { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .bento { grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(180px, auto); }
  .bento .b-main { grid-column: span 4; grid-row: span 2; }
  .bento .b-side { grid-column: span 2; }
  .bento .b-half { grid-column: span 3; }
}
.bento .card { display: flex; flex-direction: column; gap: 10px; }
.icon-tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--shape-l); background: var(--md-secondary-container); color: var(--md-on-secondary-container); flex: none; transition: border-radius var(--dur-m) var(--ease-emph), transform var(--dur-m) var(--ease-emph); }
.card:hover .icon-tile { border-radius: 50%; transform: rotate(-8deg); }
.b-main { background: var(--md-primary); color: var(--md-on-primary); padding: 32px; min-height: 360px; }
.b-main .muted { color: inherit; opacity: .85; }
.b-main .icon-tile { background: color-mix(in srgb, var(--md-on-primary) 16%, transparent); color: var(--md-on-primary); }
.b-main h3 { font-size: clamp(40px, 6vw, 64px); line-height: 1; letter-spacing: -0.03em; font-weight: 750; margin: 8px 0 0; }
.b-main .big-shape { position: absolute; right: -60px; bottom: -60px; width: 300px; color: color-mix(in srgb, var(--md-on-primary) 10%, transparent); animation: spin 50s linear infinite; pointer-events: none; }
.b-main .chips .chip { border-color: color-mix(in srgb, var(--md-on-primary) 30%, transparent); color: var(--md-on-primary); }
.stat-card b { display: block; font-size: clamp(40px, 6vw, 56px); line-height: 1; font-weight: 750; letter-spacing: -0.03em; color: var(--md-primary); font-variant-numeric: tabular-nums; margin-top: auto; }
.card.accent { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.card.accent b { color: inherit; }
.card .grow { flex: 1; }
.arrow { transition: transform var(--dur-m) var(--ease-emph); }
.card:hover .arrow { transform: translateX(6px); }
.cta-card { background: var(--md-inverse-surface); color: var(--md-inverse-on-surface); }
.cta-card .muted { color: inherit; opacity: .75; }
.cta-card .btn-filled { background: var(--md-inverse-primary); color: var(--md-on-surface); }

/* ===== Проекты ===== */
.projects { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .projects { grid-template-columns: repeat(2, 1fr); } }
.project { display: flex; flex-direction: column; gap: 14px; padding: 0; }
.project.featured { background: var(--md-primary-container); color: var(--md-on-primary-container); }
@media (min-width: 720px) { .project.featured { grid-column: 1 / -1; flex-direction: row; } .project.featured .preview { width: 46%; flex: none; min-height: 300px; } }
.project.featured .muted { color: inherit; opacity: .8; }
.project-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 24px 24px; flex: 1; }
.project.featured .project-body { padding: 28px; }
.project-top { display: flex; align-items: center; gap: 14px; }
.project-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--shape-l); background: var(--md-primary); color: var(--md-on-primary); flex: none; transition: border-radius var(--dur-m) var(--ease-emph), transform var(--dur-m) var(--ease-emph); }
.project:hover .project-icon { border-radius: 50%; transform: rotate(-10deg); }
.project-icon .ms { font-size: 26px; }
/* Превью: мини-чат на «стекле» */
.preview {
  position: relative; margin: 10px 10px 0; padding: 20px 18px 0; border-radius: 22px; overflow: hidden; min-height: 190px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background: radial-gradient(120% 120% at 0% 0%, var(--md-tertiary-container), transparent 60%), var(--md-secondary-container);
}
.project.featured .preview { margin: 10px; padding-bottom: 18px; background: radial-gradient(120% 120% at 100% 0%, var(--md-tertiary-container), transparent 60%), var(--md-primary); }
.preview .msg { animation: none; font-size: 12.5px; box-shadow: 0 6px 16px -8px rgb(0 0 0 / .3); transition: transform var(--dur-m) var(--ease-emph); }
.preview .msg:last-child { border-bottom-left-radius: 6px; margin-bottom: -1px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
.project.featured .preview .msg:last-child { border-radius: 18px; border-bottom-left-radius: 6px; margin: 0; }
.project:hover .preview .msg { transform: translateY(-4px); }
.project:hover .preview .msg:nth-child(2) { transition-delay: 40ms; }
.project:hover .preview .msg:nth-child(3) { transition-delay: 80ms; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { padding: 4px 10px; border-radius: var(--shape-s); background: var(--md-surface-container-highest); color: var(--md-on-surface-variant); font-size: 12px; font-weight: 600; font-family: var(--mono); }
.project.featured .tag { background: color-mix(in srgb, var(--md-on-primary-container) 12%, transparent); color: inherit; }
.badge { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--shape-full); font-size: 12px; font-weight: 700; background: var(--md-surface); color: var(--md-on-surface); white-space: nowrap; }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; }
.badge.done i { background: var(--md-primary); }
.projects.filtering .project { animation: page-in var(--dur-m) var(--ease-emph-dec) both; }

/* Диалог проекта */
.dialog {
  border: 0; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  border-radius: var(--shape-xl); background: var(--md-surface-container-high); color: var(--md-on-surface);
  box-shadow: 0 12px 48px rgb(0 0 0 / .3);
}
.dialog[open] { animation: dialog-in var(--dur-m) var(--ease-emph-dec); }
.dialog::backdrop { background: rgb(0 0 0 / .4); animation: fade var(--dur-m) var(--ease-std); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(-24px) scale(.92); } }
@keyframes fade { from { opacity: 0; } }
.dialog-body { padding: 24px; display: grid; gap: 16px; }
.dialog-head { display: flex; align-items: center; gap: 14px; }
.dialog-head .icon-btn { margin-left: auto; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.feature-list .ms { color: var(--md-primary); font-size: 20px; margin-top: 2px; }
.dialog .preview { margin: 0; border-radius: var(--shape-l); padding-bottom: 16px; min-height: 0; }
.dialog .preview .msg:last-child { border-radius: 18px; border-bottom-left-radius: 6px; margin: 0; }

/* ===== Стек ===== */
.stack-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .stack-grid { grid-template-columns: repeat(4, 1fr); } }
.stack-card { display: flex; flex-direction: column; gap: 16px; }
.stack-card h3 { display: flex; align-items: center; gap: 12px; }
@media (min-width: 1100px) { .stack-card h3 { font-size: 19px; } }
.tech { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--shape-l); background: var(--md-surface-container); transition: background-color var(--dur-s), transform var(--dur-m) var(--ease-emph); }
.tech:hover { background: var(--md-secondary-container); transform: translateX(4px); }
.tech .glyph { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--shape-m); background: var(--md-surface); color: var(--md-primary); font-family: var(--mono); font-weight: 700; font-size: 13px; flex: none; }
.tech b { display: block; font-size: 14.5px; }
.tech small { display: block; font-size: 12.5px; color: var(--md-on-surface-variant); line-height: 1.35; }
.principles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.principle { display: flex; flex-direction: column; gap: 12px; min-height: 220px; }
.principle .num { font-family: var(--mono); color: var(--md-primary); font-size: 13px; font-weight: 600; }
.principle h3 { font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; margin: auto 0 0; }

/* ===== Процесс ===== */
.steps { display: grid; gap: 12px; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 300px; }
.step .big { font-size: 96px; line-height: .8; font-weight: 800; letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 2px var(--md-primary); font-variation-settings: "wdth" 120; transition: color var(--dur-m) var(--ease-emph); }
.step:hover .big { color: var(--md-primary); }
.step h3 { margin-top: auto; }
.step .eta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--md-primary); }
.step .eta .ms { font-size: 18px; }
.step:nth-child(2) { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.step:nth-child(3) { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.step:nth-child(4) { background: var(--md-primary); color: var(--md-on-primary); }
.step:nth-child(4) .big { -webkit-text-stroke-color: var(--md-on-primary); }
.step:nth-child(4):hover .big { color: var(--md-on-primary); }
.step:nth-child(4) .eta, .step:nth-child(4) .muted { color: inherit; opacity: .85; }
.step:nth-child(n+2) .muted { color: inherit; opacity: .8; }
.checks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.check { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--shape-l); background: var(--md-surface-container-low); }
.check .ms { color: var(--md-primary); }

/* ===== Связь ===== */
.contact-hero { position: relative; overflow: hidden; display: grid; gap: 28px; align-items: center; padding: 40px 24px; border-radius: 40px; background: var(--md-primary); color: var(--md-on-primary); }
@media (min-width: 900px) { .contact-hero { grid-template-columns: 1.3fr 1fr; padding: 56px; } }
.contact-hero .page-title em { color: var(--md-inverse-primary); color: color-mix(in srgb, var(--md-on-primary) 70%, var(--md-primary-container)); }
.contact-hero .big-shape { position: absolute; right: -80px; top: -80px; width: 360px; color: color-mix(in srgb, var(--md-on-primary) 9%, transparent); animation: spin 60s linear infinite; pointer-events: none; }
.contact-hero > * { position: relative; }
.contact-hero .btn-filled { background: var(--md-on-primary); color: var(--md-primary); }
.tg-card { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--shape-xl); background: var(--md-surface); color: var(--md-on-surface); box-shadow: 0 20px 50px -20px rgb(0 0 0 / .4); }
.tg-logo { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #2aabee; color: #fff; flex: none; }
.tg-logo svg { width: 28px; height: 28px; }
.services { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.services .card { display: flex; flex-direction: column; gap: 10px; }
.faq details { border-radius: var(--shape-l); background: var(--md-surface-container-low); padding: 0 20px; transition: background-color var(--dur-s); }
.faq details + details { margin-top: 8px; }
.faq details[open] { background: var(--md-surface-container); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ms { transition: transform var(--dur-m) var(--ease-emph); }
.faq details[open] summary .ms { transform: rotate(180deg); }
.faq details p { margin: 0 0 18px; color: var(--md-on-surface-variant); }

/* ===== Нижний лист с цветами ===== */
.sheet-scrim { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .32); animation: fade var(--dur-m) var(--ease-std); }
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(560px, 100%); transform: translateX(-50%);
  padding: 12px 24px calc(28px + env(safe-area-inset-bottom)); display: grid; gap: 12px;
  border-radius: var(--shape-xl) var(--shape-xl) 0 0; background: var(--md-surface-container-low);
  animation: sheet-in var(--dur-m) var(--ease-emph-dec);
}
.sheet.closing { animation: sheet-out 220ms var(--ease-emph-acc) forwards; }
@keyframes sheet-in { from { transform: translate(-50%, 100%); } }
@keyframes sheet-out { to { transform: translate(-50%, 100%); } }
.sheet-handle { width: 32px; height: 4px; border-radius: 2px; background: var(--md-outline); opacity: .5; margin: 0 auto 8px; }
.seeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 12px; margin-top: 4px; }
.seed {
  aspect-ratio: 1; border-radius: var(--shape-l); border: 0; cursor: pointer; position: relative; overflow: hidden;
  transition: border-radius var(--dur-m) var(--ease-emph), transform var(--dur-s);
}
.seed:hover { border-radius: 50%; }
.seed:active { transform: scale(.92); }
.seed::after { content: ""; position: absolute; inset: 50% 0 0 50%; background: var(--c2); }
.seed[aria-pressed="true"] { border-radius: 50%; box-shadow: 0 0 0 3px var(--md-surface-container-low), 0 0 0 6px var(--md-on-surface); }
.seed-custom { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; justify-self: start; padding: 8px 4px; }
.seed-custom input { width: 40px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; }

/* ===== Snackbar ===== */
.snackbar {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--bar) + 24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  min-height: 48px; display: flex; align-items: center; padding: 12px 20px; border-radius: var(--shape-xs);
  background: var(--md-inverse-surface); color: var(--md-inverse-on-surface); font-size: 14px; max-width: calc(100vw - 32px);
  box-shadow: 0 4px 16px rgb(0 0 0 / .25);
  transition: transform var(--dur-m) var(--ease-emph-dec), opacity var(--dur-s);
}
.snackbar.show { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 840px) { .snackbar { bottom: 24px; margin-left: calc(var(--rail) / 2); } }

.footer { margin-top: 64px; padding: 24px 0 0; border-top: 1px solid var(--md-outline-variant); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--md-on-surface-variant); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
