/* Файл хранит стили лендинга AngelSystem: шапка, ангел на весь экран, факты, шаги подключения, подключение через ИИ,
   возможности, финал и подвал. */

:root {
    color-scheme: dark;
    --bg: #0b0d11;
    --bg-deep: #07090c;
    --surface: #13161c;
    --surface-2: #181c23;
    --line: #232831;
    --line-soft: #1b2028;
    --line-strong: #323946;
    --text: #e9ecf1;
    --text-soft: #a6aebb;
    --text-dim: #6f7887;
    --accent: #5b9dff;
    --accent-strong: #3d7fe0;
    --accent-glow: rgb(91 157 255 / 38%);
    --accent-soft: rgb(91 157 255 / 12%);
    --header-height: 64px;
    --radius-m: 12px;
    --radius-l: 18px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font);
}

* {
    box-sizing: border-box;
}

/* Документ не прокручивается: страница прокручивается в области .page-scroll. */
html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--bg-deep);
}

body {
    display: flex;
    flex-direction: column;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.page-scroll,
body > .angel-scroll-frame-page {
    min-height: 0;
    flex: 1 1 auto;
}

.page-scroll {
    display: flex;
    flex-direction: column;
    overflow: auto;
    scroll-behavior: smooth;
}

.page-scroll > main {
    flex: 1 0 auto;
}

a {
    color: inherit;
}

/* ---------------------------------------------- ШАПКА ---------------------------------------------- */

.landing-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    height: var(--header-height);
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: calc(var(--header-height) * -1);
    padding: 0 clamp(16px, 4vw, 40px);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.landing-header.is-scrolled {
    border-color: var(--line-soft);
    background: rgb(7 9 12 / 72%);
    backdrop-filter: blur(14px);
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.landing-brand img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

/* ---------------------------------------------- КНОПКИ ---------------------------------------------- */

.landing-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 26px;
    border: 1px solid transparent;
    border-radius: var(--radius-m);
    font-size: 15px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s var(--ease-out), box-shadow 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* целевое действие: залитая яркая кнопка цвета бренда со свечением */
.landing-button-primary {
    color: #ffffff;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    box-shadow: 0 10px 34px var(--accent-glow), inset 0 1px 0 rgb(255 255 255 / 22%);
}

.landing-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 44px rgb(91 157 255 / 52%), inset 0 1px 0 rgb(255 255 255 / 26%);
}

.landing-button-ghost {
    min-height: 40px;
    padding: 0 18px;
    border-color: var(--line-strong);
    color: var(--text);
    background: rgb(255 255 255 / 3%);
    font-size: 14px;
}

.landing-button-ghost:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.landing-button:focus-visible,
.landing-link:focus-visible,
.landing-brand:focus-visible,
.site-footer-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.landing-link {
    color: var(--text-soft);
    font-size: 15px;
    font-weight: 550;
    text-decoration: none;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.landing-link:hover {
    color: var(--text);
    text-decoration: underline;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 26px;
}

.landing-actions.is-centered {
    justify-content: center;
}

.landing-kicker {
    margin: 0;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ---------------------------------------------- АНГЕЛ И ПОГРУЖЕНИЕ ---------------------------------------------- */

/* высота задает путь прокрутки: большая часть - погружение в зрачок, затем короткая пауза,
   после нее мир устройств уезжает вместе со страницей, как обычный раздел */
.hero {
    position: relative;
    height: 230vh;
    flex: none;
}

/* небо над ангелом: теплый свет за ним и холодное сияние сверху; высота - видимая часть экрана при показанных
   панелях браузера (svh): на телефоне низ первого экрана с кнопками не уходит под нижнюю панель браузера */
.hero-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background:
        radial-gradient(ellipse 34% 30% at 50% 37%, rgb(240 195 90 / 7%), rgb(240 195 90 / 0%) 72%),
        radial-gradient(ellipse 70% 50% at 50% 0%, rgb(91 157 255 / 9%), rgb(91 157 255 / 0%) 72%),
        radial-gradient(ellipse at 50% 42%, #0d1320 0%, var(--bg-deep) 66%);
}

.ascii-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-canvas {
    position: absolute;
    inset: 0;
}

.hero-copy {
    position: absolute;
    bottom: clamp(48px, 8vh, 88px);
    left: 50%;
    z-index: 2;
    display: flex;
    width: min(1000px, calc(100% - 32px));
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    transform: translateX(-50%);
}

/* мягкая подложка, чтобы текст читался поверх символов */
.hero-copy::before {
    position: absolute;
    inset: -40px -80px -30px;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgb(7 9 12 / 92%) 36%, rgb(7 9 12 / 0%) 74%);
    content: "";
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(34px, 4.1vw, 60px);
    font-weight: 750;
    line-height: 1.04;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.hero-lead {
    max-width: 560px;
    margin: 0 0 10px;
    color: var(--text-soft);
    font-size: clamp(16px, 1.35vw, 19px);
    line-height: 1.5;
    text-wrap: balance;
}

.hero-copy .landing-actions {
    justify-content: center;
}

.portal-copy {
    position: absolute;
    top: 50%;
    left: clamp(24px, 7vw, 120px);
    z-index: 2;
    display: flex;
    width: min(440px, 36vw);
    flex-direction: column;
    gap: 14px;
    visibility: hidden;
    opacity: 0;
    translate: 0 -50%;
}

/* мягкая подложка: звезды за текстом не выглядят знаками препинания */
.portal-copy::before {
    position: absolute;
    inset: -48px -64px;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgb(7 9 12 / 86%) 35%, rgb(7 9 12 / 0%) 72%);
    content: "";
}

.portal-copy h2 {
    margin: 0;
    font-size: clamp(30px, 3.3vw, 46px);
    font-weight: 750;
    line-height: 1.08;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.portal-copy p:last-child {
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.55;
}

/* подсказка прокрутки: колесико мыши с бегущей точкой */
.scroll-cue {
    position: absolute;
    bottom: 14px;
    left: 50%;
    width: 22px;
    height: 34px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    transform: translateX(-50%);
}

.scroll-cue span {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 4px;
    height: 7px;
    border-radius: 2px;
    background: var(--accent);
    transform: translateX(-50%);
    animation: scroll-cue 1.8s var(--ease-out) infinite;
}

@keyframes scroll-cue {
    0% { opacity: 0; transform: translate(-50%, 0); }
    25% { opacity: 1; }
    80% { opacity: 0; transform: translate(-50%, 12px); }
    100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* ---------------------------------------------- КОРОТКО О ГЛАВНОМ ---------------------------------------------- */

/* полоса фактов сразу после погружения: четыре коротких факта через тонкие разделители */
.facts {
    position: relative;
    flex: none;
    border-block: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgb(13 19 32 / 80%), rgb(7 9 12 / 0%));
}

.facts-list {
    display: grid;
    width: min(1120px, calc(100% - 32px));
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.fact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 30px 26px;
    border-left: 1px solid var(--line-soft);
}

.fact:first-child {
    border-left: 0;
}

.fact strong {
    color: var(--text);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.fact span {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.45;
}

/* ---------------------------------------------- РАЗДЕЛЫ ---------------------------------------------- */

.landing-section {
    position: relative;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(88px, 14vh, 160px) 0 0;
}

.section-head {
    display: flex;
    max-width: 680px;
    flex-direction: column;
    gap: 14px;
    margin-bottom: clamp(36px, 6vh, 60px);
}

/* подпись раздела: моноширинная, с коротким лучом слева */
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.section-kicker::before {
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, rgb(91 157 255 / 0%), var(--accent));
    content: "";
}

.section-head h2,
.ai-copy h2,
.final-copy h2 {
    margin: 0;
    font-size: clamp(30px, 3.4vw, 46px);
    font-weight: 750;
    line-height: 1.08;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.section-lead {
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.55;
}

/* ---------------------------------------------- ШАГИ ---------------------------------------------- */

/* шаги на одной линии: номера - узлы линии, по линии бежит свет */
.steps-list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps-list::before,
.steps-list::after {
    position: absolute;
    top: 28px;
    right: 0;
    left: 28px;
    height: 1px;
    content: "";
}

.steps-list::before {
    background: linear-gradient(90deg, rgb(91 157 255 / 55%), rgb(91 157 255 / 18%) 75%, rgb(91 157 255 / 0%));
}

.steps-list::after {
    top: 27px;
    height: 3px;
    background: linear-gradient(90deg, rgb(91 157 255 / 0%) 44%, var(--accent) 50%, rgb(91 157 255 / 0%) 56%);
    background-size: 260% 100%;
    filter: blur(0.6px);
    animation: step-light 5.5s linear infinite;
}

@keyframes step-light {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
}

.step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-number {
    position: relative;
    z-index: 1;
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--accent);
    background: var(--bg-deep);
    box-shadow: 0 0 0 8px var(--bg-deep);
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 600;
    transition: border-color 0.6s ease 0.3s, box-shadow 0.6s ease 0.3s;
}

/* узел загорается, когда шаг появился на экране */
.step.is-visible .step-number {
    border-color: rgb(91 157 255 / 65%);
    box-shadow: 0 0 0 8px var(--bg-deep), 0 0 28px rgb(91 157 255 / 38%);
}

.step h3,
.feature h3 {
    margin: 4px 0 0;
    font-size: 19px;
    font-weight: 680;
    letter-spacing: -0.01em;
}

.step h3 {
    margin-top: 14px;
    font-size: 20px;
}

.step p,
.feature p {
    margin: 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.55;
}

.step code,
.chat-steps code {
    padding: 1px 6px;
    border-radius: 6px;
    color: var(--text);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 13px;
}

/* что делать руками: команда или короткая подсказка моноширинным шрифтом */
.step-meta {
    align-self: flex-start;
    margin-top: 6px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-soft);
    background: rgb(255 255 255 / 2%);
    font-family: var(--font-mono);
    font-size: 12.5px;
}

/* ---------------------------------------------- ПОДКЛЮЧЕНИЕ ЧЕРЕЗ ИИ ---------------------------------------------- */

/* панель с сиянием по краям: слева сообщение для нейросети, справа пример разговора */
.ai-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: center;
    padding: clamp(26px, 4vw, 52px);
    border: 1px solid rgb(91 157 255 / 22%);
    border-radius: 24px;
    background:
        radial-gradient(ellipse 60% 80% at 0% 0%, rgb(91 157 255 / 14%), rgb(91 157 255 / 0%) 70%),
        radial-gradient(ellipse 50% 70% at 100% 100%, rgb(240 195 90 / 8%), rgb(240 195 90 / 0%) 70%),
        linear-gradient(180deg, #10141c, #0b0e14);
    box-shadow: 0 30px 80px rgb(0 0 0 / 35%), inset 0 1px 0 rgb(255 255 255 / 4%);
}

.ai-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
}

/* сообщение для нейросети: моноширинная строка и яркая кнопка копирования рядом */
.ai-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 10px 10px 10px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-m);
    background: var(--bg-deep);
    box-shadow: 0 0 0 4px rgb(91 157 255 / 6%);
}

.ai-prompt code {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.ai-prompt .landing-button {
    min-height: 42px;
    flex: none;
    padding: 0 18px;
    font-size: 14px;
}

.ai-note {
    margin: 0;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.55;
}

.ai-note .landing-link {
    font-size: 14px;
    text-decoration: underline;
}

/* пример разговора: реплики появляются по очереди, шаги отмечаются галочками */
.ai-chat {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgb(7 9 12 / 72%);
    font-size: 14px;
    line-height: 1.5;
}

.chat-title {
    margin: 0 0 4px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.chat-message {
    max-width: 88%;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.chat-message.is-user {
    align-self: flex-end;
    border-color: rgb(91 157 255 / 30%);
    border-bottom-right-radius: 4px;
    color: #ffffff;
    background: linear-gradient(180deg, rgb(91 157 255 / 28%), rgb(61 127 224 / 22%));
}

.chat-message.is-ai,
.chat-steps {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: var(--text);
    background: var(--surface-2);
}

.chat-steps {
    display: flex;
    max-width: 88%;
    flex-direction: column;
    gap: 9px;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    list-style: none;
}

.chat-steps li {
    position: relative;
    padding-left: 26px;
    color: var(--text-soft);
}

/* галочка из двух линий */
.chat-steps li::before {
    position: absolute;
    top: 3px;
    left: 4px;
    width: 6px;
    height: 12px;
    border: solid #4cc38a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    content: "";
}

/* ---------------------------------------------- ВОЗМОЖНОСТИ ---------------------------------------------- */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.feature {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 14px 24px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-l);
    background: linear-gradient(180deg, rgb(19 22 28 / 85%), rgb(13 15 20 / 55%));
    transition: border-color 0.3s ease, transform 0.4s var(--ease-out), background-color 0.3s ease;
}

/* тонкий свет по верхнему краю при наведении */
.feature::before {
    position: absolute;
    top: 0;
    right: 12%;
    left: 12%;
    height: 1px;
    background: linear-gradient(90deg, rgb(91 157 255 / 0%), var(--accent), rgb(91 157 255 / 0%));
    content: "";
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature:hover {
    border-color: rgb(91 157 255 / 35%);
    transform: translateY(-3px);
}

.feature:hover::before {
    opacity: 1;
}

.feature h3,
.feature p {
    padding: 0 10px;
}

.feature-canvas {
    height: 140px;
    margin-bottom: 10px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-m);
    background: radial-gradient(ellipse at 50% 60%, #0e1420 0%, var(--bg-deep) 75%);
}

/* ---------------------------------------------- ФИНАЛ ---------------------------------------------- */

/* финал на всю ширину: ангел на холсте за текстом, верх и низ холста растворяются в странице */
.final {
    position: relative;
    display: flex;
    min-height: clamp(560px, 94vh, 900px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-top: clamp(40px, 8vh, 100px);
    padding: 0 16px clamp(72px, 12vh, 128px);
    overflow: hidden;
    text-align: center;
    background: radial-gradient(ellipse 40% 34% at 50% 36%, rgb(240 195 90 / 6%), rgb(240 195 90 / 0%) 72%);
}

.final-canvas {
    position: absolute;
    inset: 0;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 84%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 84%, transparent 100%);
}

.final-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.final-copy::before {
    position: absolute;
    inset: -50px -90px -40px;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgb(7 9 12 / 90%) 36%, rgb(7 9 12 / 0%) 74%);
    content: "";
}

.final-copy h2 {
    font-size: clamp(34px, 4.4vw, 60px);
}

.final-copy .landing-actions {
    margin-top: 10px;
}

@media (max-width: 640px) {
    .ai-prompt {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }
}

/* ---------------------------------------------- ПОДВАЛ ---------------------------------------------- */

.site-footer {
    flex: none;
    padding: 26px 16px 32px;
    border-top: 1px solid var(--line-soft);
    background: var(--bg-deep);
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
}

.site-footer-links a {
    color: var(--text-dim);
    font-size: 13px;
    text-decoration: none;
}

.site-footer-links a:hover {
    color: var(--text-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------------------------------------------- ПОЯВЛЕНИЕ ПРИ ПРОКРУТКЕ ---------------------------------------------- */

/* блоки скрываются, только когда скрипт лендинга запущен: без него страница видна целиком */
.has-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.has-reveal [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

.has-reveal .facts-list .fact:nth-child(2),
.has-reveal .steps-list .step:nth-child(2),
.has-reveal .features-grid .feature:nth-child(3n + 2) {
    transition-delay: 0.12s;
}

.has-reveal .facts-list .fact:nth-child(3),
.has-reveal .steps-list .step:nth-child(3),
.has-reveal .features-grid .feature:nth-child(3n) {
    transition-delay: 0.24s;
}

.has-reveal .facts-list .fact:nth-child(4) {
    transition-delay: 0.36s;
}

/* разговор с ИИ: реплики и шаги появляются по очереди после появления панели */
.has-reveal .ai-chat .chat-message,
.has-reveal .ai-chat .chat-steps,
.has-reveal .ai-chat .chat-steps li {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.has-reveal .ai-panel.is-visible .chat-message,
.has-reveal .ai-panel.is-visible .chat-steps,
.has-reveal .ai-panel.is-visible .chat-steps li {
    opacity: 1;
    transform: none;
}

.has-reveal .ai-panel.is-visible .chat-message:nth-of-type(2) { transition-delay: 0.5s; }
.has-reveal .ai-panel.is-visible .chat-message:nth-of-type(3) { transition-delay: 1.4s; }
.has-reveal .ai-panel.is-visible .chat-message:nth-of-type(4) { transition-delay: 2.3s; }
.has-reveal .ai-panel.is-visible .chat-steps { transition-delay: 3.1s; }
.has-reveal .ai-panel.is-visible .chat-steps li:nth-child(1) { transition-delay: 3.2s; }
.has-reveal .ai-panel.is-visible .chat-steps li:nth-child(2) { transition-delay: 3.9s; }
.has-reveal .ai-panel.is-visible .chat-steps li:nth-child(3) { transition-delay: 4.6s; }

/* без движения: ангел неподвижен, путь погружения не нужен */
.is-static .hero {
    height: 100vh;
    height: 100svh;
}

.is-static .scroll-cue,
.is-static .portal-copy {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .page-scroll {
        scroll-behavior: auto;
    }

    .has-reveal [data-reveal],
    .has-reveal .ai-chat .chat-message,
    .has-reveal .ai-chat .chat-steps,
    .has-reveal .ai-chat .chat-steps li,
    .step-number,
    .scroll-cue span,
    .steps-list::after {
        transition: none;
        animation: none;
    }
}

/* ---------------------------------------------- ПЛАНШЕТ И ТЕЛЕФОН ---------------------------------------------- */

@media (max-width: 980px) {
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .has-reveal .features-grid .feature:nth-child(n) {
        transition-delay: 0s;
    }

    .has-reveal .features-grid .feature:nth-child(2n) {
        transition-delay: 0.12s;
    }

    .ai-panel {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 899px) {
    .portal-copy {
        top: auto;
        right: 16px;
        bottom: clamp(40px, 8vh, 72px);
        left: 16px;
        width: auto;
        align-items: center;
        text-align: center;
        translate: none;
    }

    .facts-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fact:nth-child(3) {
        border-left: 0;
    }

    .fact:nth-child(n + 3) {
        border-top: 1px solid var(--line-soft);
    }
}

/* на узком экране шаги идут столбиком: линия слева, номера - ее узлы */
@media (max-width: 760px) {
    .steps-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }

    .steps-list::before,
    .steps-list::after {
        top: 28px;
        bottom: 0;
        left: 27px;
        width: 1px;
        height: auto;
    }

    .steps-list::before {
        background: linear-gradient(180deg, rgb(91 157 255 / 55%), rgb(91 157 255 / 18%) 75%, rgb(91 157 255 / 0%));
    }

    .steps-list::after {
        left: 26px;
        width: 3px;
        background: linear-gradient(180deg, rgb(91 157 255 / 0%) 44%, var(--accent) 50%, rgb(91 157 255 / 0%) 56%);
        background-size: 100% 260%;
        animation-name: step-light-down;
    }

    @keyframes step-light-down {
        from { background-position: 0 100%; }
        to { background-position: 0 0; }
    }

    .step {
        padding-left: 80px;
    }

    .step-number {
        position: absolute;
        top: 0;
        left: 0;
    }

    .step h3 {
        margin-top: 12px;
    }

    .has-reveal .steps-list .step:nth-child(n) {
        transition-delay: 0s;
    }
}

@media (max-width: 640px) {
    :root {
        --header-height: 56px;
    }

    .features-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .has-reveal .features-grid .feature:nth-child(n) {
        transition-delay: 0s;
    }

    /* на телефоне текст первого экрана плотнее и ближе к низу, на низком экране заголовок чуть меньше:
       «Как это работает» всегда видна без прокрутки */
    .hero-copy {
        bottom: clamp(24px, 4svh, 48px);
        gap: 10px;
    }

    .hero-copy h1 {
        font-size: clamp(28px, 4.6svh, 34px);
    }

    .hero-lead {
        margin-bottom: 4px;
    }

    .landing-actions {
        flex-direction: column;
        gap: 14px;
    }

    .landing-actions .landing-button-primary {
        width: 100%;
        max-width: 340px;
    }

    .fact {
        padding: 22px 16px;
    }

    .fact strong {
        font-size: 16px;
    }

    .fact span {
        font-size: 13px;
    }

    .ai-chat {
        padding: 16px;
    }

    .chat-message,
    .chat-steps {
        max-width: 94%;
    }

    .scroll-cue {
        display: none;
    }
}
