/* M4Q — общая дизайн-система сайта: токены тем, типографика, шапка, кнопки, подвал.
   Используется главной, страницами возможностей и правовыми документами. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-tint: #f1f2fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f7;
  --line: #e6e8f0;
  --line-strong: #d5d9e5;
  --ink: #0b0d16;
  --ink-2: #262b3b;
  --muted: #535a6e;
  --faint: #646b80;
  --accent: #4b44e0;
  --accent-2: #2559d9;
  --accent-soft: #eceafe;
  --accent-line: #c9c4fb;
  --ok: #0f7a41;
  --ok-soft: #e3f6ec;
  --warn: #9a5b00;
  --warn-soft: #fff3df;
  --grad-text: linear-gradient(100deg, #5a47ef 0%, #3557e6 52%, #0d78c0 100%);
  --grad-brand: linear-gradient(120deg, #6a5cff 0%, #3a7bff 55%, #1fb6ea 100%);
  --btn-bg: #4a4fe4;
  --btn-grad: linear-gradient(135deg, #5d4ff0 0%, #2c5fe8 100%);
  --btn-shadow: 0 1px 0 rgb(255 255 255 / .22) inset, 0 10px 28px -10px rgb(70 70 230 / .65);
  --header-bg: rgb(255 255 255 / .84);
  --shadow-sm: 0 1px 2px rgb(16 20 40 / .06), 0 1px 1px rgb(16 20 40 / .04);
  --shadow-md: 0 1px 2px rgb(16 20 40 / .05), 0 12px 32px -12px rgb(16 20 60 / .16);
  --shadow-lg: 0 2px 6px rgb(16 20 40 / .05), 0 40px 80px -32px rgb(20 24 80 / .28);
  --shadow-window: 0 0 0 1px rgb(16 20 40 / .06), 0 30px 70px -24px rgb(24 30 90 / .32), 0 12px 24px -16px rgb(16 20 40 / .18);
  --win-bar: #f3f4f8;
  --glow-1: rgb(106 92 255 / .18);
  --glow-2: rgb(31 160 255 / .16);
  --focus: #4b44e0;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Cascadia Code", "SF Mono", "JetBrains Mono", Consolas, "Roboto Mono", monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
}

/* Без JavaScript тема следует системной настройке; с JavaScript — сохранённому выбору. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #07080d; --bg-soft: #0b0d14; --bg-tint: #0d0f1a; --surface: #0f1119; --surface-2: #131622; --surface-3: #191c2a;
    --line: rgb(255 255 255 / .08); --line-strong: rgb(255 255 255 / .14);
    --ink: #f2f4fa; --ink-2: #d9dde8; --muted: #a3aabd; --faint: #8f97ab;
    --accent: #a5a9ff; --accent-2: #7fb3ff; --accent-soft: rgb(124 112 255 / .14); --accent-line: rgb(150 140 255 / .35);
    --ok: #4ade80; --ok-soft: rgb(74 222 128 / .12); --warn: #fbbf5a; --warn-soft: rgb(251 191 90 / .12);
    --grad-text: linear-gradient(100deg, #b3a9ff 0%, #8cb4ff 50%, #7fe1ff 100%);
    --header-bg: rgb(7 8 13 / .72);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-md: 0 1px 0 rgb(255 255 255 / .04) inset, 0 16px 40px -16px rgb(0 0 0 / .7);
    --shadow-lg: 0 1px 0 rgb(255 255 255 / .05) inset, 0 40px 90px -30px rgb(0 0 0 / .85);
    --shadow-window: 0 0 0 1px rgb(255 255 255 / .1), 0 40px 100px -30px rgb(0 0 0 / .9), 0 0 120px -40px rgb(90 80 255 / .35);
    --win-bar: #151824;
    --glow-1: rgb(106 92 255 / .32); --glow-2: rgb(31 150 255 / .24);
    --focus: #a5a9ff;
  }
}
:root[data-theme="dark"], .band-dark {
  color-scheme: dark;
  --bg: #07080d; --bg-soft: #0b0d14; --bg-tint: #0d0f1a; --surface: #0f1119; --surface-2: #131622; --surface-3: #191c2a;
  --line: rgb(255 255 255 / .08); --line-strong: rgb(255 255 255 / .14);
  --ink: #f2f4fa; --ink-2: #d9dde8; --muted: #a3aabd; --faint: #8f97ab;
  --accent: #a5a9ff; --accent-2: #7fb3ff; --accent-soft: rgb(124 112 255 / .14); --accent-line: rgb(150 140 255 / .35);
  --ok: #4ade80; --ok-soft: rgb(74 222 128 / .12); --warn: #fbbf5a; --warn-soft: rgb(251 191 90 / .12);
  --grad-text: linear-gradient(100deg, #b3a9ff 0%, #8cb4ff 50%, #7fe1ff 100%);
  --header-bg: rgb(7 8 13 / .72);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-md: 0 1px 0 rgb(255 255 255 / .04) inset, 0 16px 40px -16px rgb(0 0 0 / .7);
  --shadow-lg: 0 1px 0 rgb(255 255 255 / .05) inset, 0 40px 90px -30px rgb(0 0 0 / .85);
  --shadow-window: 0 0 0 1px rgb(255 255 255 / .1), 0 40px 100px -30px rgb(0 0 0 / .9), 0 0 120px -40px rgb(90 80 255 / .35);
  --win-bar: #151824;
  --glow-1: rgb(106 92 255 / .32); --glow-2: rgb(31 150 255 / .24);
  --focus: #a5a9ff;
}

/* Тёмная полоса раздела в обеих темах получает токены тёмной темы. */
.band-dark { background-color: #070912; color: var(--ink); }
[data-theme="dark"] .band-dark { background-color: #0a0c16; }

/* ——— База ——— */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; background-color: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-sans); font-kerning: normal; text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; overflow-wrap: break-word;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 650; letter-spacing: -.025em; text-wrap: balance; color: var(--ink); overflow-wrap: anywhere; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgb(106 92 255 / .25); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.wrap { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-weight: 600; transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ——— Типографика разделов ——— */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font: 600 .8125rem/1.2 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--grad-brand); }
.section-title { font-size: clamp(2rem, 1.15rem + 3.2vw, 3.5rem); line-height: 1.04; letter-spacing: -.038em; }
.section-lead { margin-top: 20px; font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); line-height: 1.6; color: var(--muted); max-width: 640px; }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .section-lead { margin-inline: auto; }
.section-title .grad-text { display: inline-block; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: 0; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; text-underline-offset: 4px; }
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 16px; height: 16px; transition: transform .25s var(--ease-out); }
.text-link:hover svg { transform: translateX(2px); }

/* ——— Иконки ——— */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ——— Кнопки ——— */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 8px 20px; border-radius: 999px; font: 600 .9375rem/1 var(--font-sans); letter-spacing: -.005em;
  text-align: center; isolation: isolate; overflow: hidden; -webkit-tap-highlight-color: transparent;
  transition: transform .2s var(--ease-out), box-shadow .3s var(--ease-out), background-color .2s, border-color .2s, color .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-lg { min-height: 52px; padding: 10px 26px; font-size: 1rem; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .875rem; white-space: nowrap; }
.btn-primary { color: #fff; background-color: var(--btn-bg); background-image: var(--btn-grad); box-shadow: var(--btn-shadow); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / .28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:hover { box-shadow: 0 1px 0 rgb(255 255 255 / .22) inset, 0 16px 36px -12px rgb(70 70 230 / .75); }
.btn-secondary { color: var(--ink); background-color: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--accent-line); background-color: var(--surface-2); }
.btn-ghost { color: var(--ink); background-color: transparent; }
.btn-ghost:hover { background-color: var(--surface-3); }
.btn .arrow { transition: transform .25s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn:hover .arrow-down { transform: translateY(2px); }
@media (prefers-reduced-motion: reduce) { .btn, .btn::after, .btn .arrow { transition: none; } }

.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--ink-2);
  border: 1px solid transparent; transition: background-color .2s, border-color .2s, color .2s;
}
.icon-button:hover { background-color: var(--surface-3); color: var(--ink); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ——— Шапка ——— */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h); container: site-header / inline-size;
  background-color: var(--header-bg); border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(1.8) blur(16px); backdrop-filter: saturate(1.8) blur(16px);
  transition: border-color .3s, background-color .3s;
}
html[data-scrolled] .site-header { border-bottom-color: var(--line); }
.nav { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.1875rem/1 var(--font-display); letter-spacing: -.02em; color: var(--ink); flex: none; }
.brand img { width: 37px; height: 24px; }
.brand-note { margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line-strong); font: 500 .8125rem/1.2 var(--font-sans); letter-spacing: 0; color: var(--faint); }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 12px; border-radius: 999px; font-size: .9375rem; font-weight: 500; color: var(--muted); transition: color .2s, background-color .2s; }
.nav-links a:hover { color: var(--ink); background-color: var(--surface-3); }
.nav-links a[aria-current] { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-links + .nav-actions { margin-left: 8px; }
.nav-actions:first-child, .brand + .nav-actions { margin-left: auto; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* Мобильное меню на <details> работает и без JavaScript. */
.menu { display: none; position: static; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-toggle .close { display: none; }
.menu[open] .menu-toggle .open { display: none; }
.menu[open] .menu-toggle .close { display: block; }
.menu-panel {
  position: absolute; left: 0; right: 0; top: var(--header-h); padding: 12px var(--gutter) 24px;
  background-color: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
  max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
}
.menu[open] .menu-panel { animation: menu-in .35s var(--ease-out); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
.menu-panel nav { display: grid; grid-template-columns: minmax(0, 1fr); }
.menu-panel nav a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 4px; font-size: 1.0625rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu-panel nav a svg { width: 18px; height: 18px; color: var(--faint); }
.menu-panel .btn { width: 100%; margin-top: 20px; }

/* Меню сворачивается по ширине шапки в em: и на узком экране, и при крупном тексте. */
@container site-header (max-width: 66em) {
  .nav-links, .brand-note { display: none; }
  .menu { display: block; }
  .nav-links + .nav-actions { margin-left: auto; }
}

/* ——— Подвал ——— */
.site-footer { margin-top: clamp(64px, 10vw, 120px); border-top: 1px solid var(--line); background-color: var(--bg-soft); }
.footer-main { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; padding: 56px 0 40px; }
.footer-about p { margin-top: 16px; max-width: 320px; color: var(--muted); font-size: .9375rem; }
.footer-col h2 { margin-bottom: 14px; font: 600 .8125rem/1.2 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.footer-col ul { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.footer-col a { color: var(--ink-2); font-size: .9375rem; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 24px 0 32px; border-top: 1px solid var(--line); }
.footer-note { max-width: 760px; color: var(--faint); font-size: .8125rem; line-height: 1.55; }
.theme-switch { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 3px; gap: 2px; border-radius: 20px; background-color: var(--surface-3); border: 1px solid var(--line); }
.theme-switch button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--muted); transition: color .2s, background-color .2s, box-shadow .2s; }
.theme-switch button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch button[aria-pressed="true"] { color: var(--ink); background-color: var(--surface); box-shadow: var(--shadow-sm); }
@media (max-width: 860px) {
  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-about { grid-column: 1 / -1; }
}
@container site-header (max-width: 26em) {
  .nav-actions .nav-download { display: none; }
}
@media (max-width: 360px) {
  .footer-main { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* ——— Рамки настоящих снимков. Снимки не наклоняются и не размываются. ——— */
.window {
  position: relative; border-radius: 14px; overflow: hidden; background-color: var(--surface);
  box-shadow: var(--shadow-window);
}
.window-bar {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 0 0 14px;
  background-color: var(--win-bar); border-bottom: 1px solid var(--line); color: var(--muted);
  font: 500 .75rem/1 var(--font-sans);
}
.window-bar img { width: 19px; height: 12px; }
.window-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-caption { display: flex; align-self: stretch; }
.window-caption i { display: grid; place-items: center; width: 44px; }
.window-caption i::before { content: ""; width: 10px; height: 1px; background-color: currentColor; opacity: .75; }
.window-caption i:nth-child(2)::before { height: 9px; width: 9px; background: none; border: 1px solid currentColor; border-radius: 1.5px; }
.window-caption i:nth-child(3)::before { width: 11px; height: 11px; background: linear-gradient(45deg, transparent calc(50% - .5px), currentColor calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)), linear-gradient(-45deg, transparent calc(50% - .5px), currentColor calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)); }
.window-shot { display: block; position: relative; aspect-ratio: 2848 / 1786; background-color: var(--surface-2); }
.window-shot img { width: 100%; height: 100%; object-fit: cover; }
.phone {
  position: relative; padding: 7px; border-radius: 34px; background-color: #0b0c11;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .08) inset, 0 0 0 1px rgb(10 12 20 / .5), 0 30px 60px -20px rgb(10 14 40 / .5);
}
[data-theme="dark"] .phone { box-shadow: 0 0 0 1px rgb(255 255 255 / .14) inset, 0 0 0 1px rgb(0 0 0 / .6), 0 40px 80px -24px rgb(0 0 0 / .9); }
.phone-shot { display: block; position: relative; aspect-ratio: 1080 / 1951; border-radius: 27px; overflow: hidden; background-color: var(--surface-2); }
.phone-shot img { width: 100%; height: 100%; object-fit: cover; }

/* ——— Появление при прокрутке: без JavaScript, на compositor; в остальных браузерах контент статичен. ——— */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal-up linear both; animation-timeline: view(); animation-range: entry 0px entry min(55%, 260px); }
    .reveal-group > * { animation: reveal-up linear both; animation-timeline: view(); animation-range: entry calc(var(--i, 0) * 36px) entry calc(min(50%, 220px) + var(--i, 0) * 36px); }
  }
}
@keyframes reveal-up { from { opacity: 0; transform: translateY(28px); } }

/* Системное уменьшение движения отключает и короткие переходы состояний. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .site-header, .site-footer, .skip-link, .menu { display: none !important; }
  body { background: #fff; color: #000; }
}
