/* ==========================================================================
   ETR Study — landing (landing.etr-study-app.tech)
   Built on the TMA UI Kit «Ember v3». Every colour reads a --tma-* token
   (loaded from vendor/tma-kit.bundle.css); this file only adds page-level
   layout — hero, phone frame, section rhythm. Zero raw hex.
   The whole page runs inside `.tma-scope` (dark-first, the product's native
   register); the breathing orb is the one signature moment, kept singular.
   ========================================================================== */

/* ---- Base resets (the kit bundle ships components, not page resets) ----- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
}

.lp-noscript {
    margin: 0;
    padding: var(--tma-sp-8) var(--tma-sp-4);
    text-align: center;
    color: var(--tma-text-secondary);
}

.lp-noscript a {
    color: var(--tma-text-accent);
}

/* ---- Page frame --------------------------------------------------------- */

.lp {
    min-height: 100dvh;
    overflow-x: clip;
    background: var(--tma-surface-canvas);
    color: var(--tma-text-primary);
    font-family: var(--tma-font-sans);
    -webkit-font-smoothing: antialiased;
}

.lp__wrap {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 40px);
}

/* :where() keeps this at zero specificity so component rules like
   .tma-btn--primary (which sets its own on-accent ink) still win. */
:where(.lp a) {
    color: inherit;
    text-decoration: none;
}

.lp-eyebrow {
    font-family: var(--tma-font-mono);
    font-size: var(--tma-fs-tag);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tma-text-accent);
}

/* ---- Header ------------------------------------------------------------- */

.lp-head {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in oklab, var(--tma-surface-canvas) 82%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tma-border-regular);
}

.lp-head__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tma-sp-4);
    height: 64px;
}

.lp-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--tma-sp-2);
    font-weight: var(--tma-fw-heavy);
    font-size: var(--tma-fs-h4);
    letter-spacing: var(--tma-tr-tight);
}

.lp-brand__mark {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
}

/* Product mark — the mosaic orb is the kit's `.tma-mosaic` primitive
   (services/telegram/src/styles/primitives/mosaic.css, delivered here in
   vendor/tma-kit.bundle.css). Geometry and motion live only there; the
   landing just mounts the markup via mountMosaics() in landing.js. */

.lp-head__left {
    display: flex;
    align-items: center;
    gap: var(--tma-sp-3);
    flex: none;
}

/* «beta» mark — the same hand-drawn ember β as the app header: calligraphy
   stroke (2.4s) + spring pulse at the end, slanted −8° like handwriting.
   JS re-toggles .is-draw every 2 minutes to redraw it (see landing.js).
   Transform layering: slant on the span, pulse on the svg, draw on the path. */
.lp-beta {
    display: inline-flex;
    align-items: center;
    flex: none;
    width: 18px;
    margin-inline-end: 2px;
    color: var(--tma-text-accent);
    transform: skewX(-8deg);
}

.lp-beta svg {
    display: block;
    transform-origin: 50% 60%;
}

.lp-beta path {
    /* gap > pathLength+1 — see the draw keyframes: keeps the offset-101
       start frame truly empty (no wrap-around cap dot). */
    stroke-dasharray: 100 102;
    stroke-dashoffset: 0;
}

.lp-beta.is-draw svg {
    animation: lp-beta-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 2.25s backwards;
}

.lp-beta.is-draw path {
    animation: lp-beta-draw 2.4s cubic-bezier(0.65, 0, 0.35, 1) backwards;
}

@keyframes lp-beta-draw {
    /* 101, not 100 — at exactly 100 the round linecap paints a stray dot
       at the path start before the stroke begins. */
    from { stroke-dashoffset: 101; }
    to   { stroke-dashoffset: 0; }
}

@keyframes lp-beta-pop {
    0%   { transform: scale(1); }
    60%  { transform: scale(1.16); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .lp-beta.is-draw svg,
    .lp-beta.is-draw path {
        animation: none;
    }
}

.lp-head__nav {
    display: flex;
    align-items: center;
    gap: var(--tma-sp-6);
    min-width: 0;
}

/* Only the text nav links get the muted colour — NOT the primary CTA
   button, whose own .tma-btn--primary ink must win (else it goes low-contrast). */
.lp-head__nav .lp-navlink {
    display: none;
    flex: none;
    white-space: nowrap;
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-small);
    transition: color var(--tma-dur-fast) var(--tma-ease-out);
}

.lp-head__nav .lp-navlink:hover {
    color: var(--tma-text-primary);
}

/* ---- Section rhythm ----------------------------------------------------- */

.lp-section {
    padding-block: clamp(64px, 10vw, 112px);
}

.lp-section__head {
    position: relative;
    display: grid;
    margin-bottom: clamp(32px, 6vw, 56px);
}

/* Head copy stays measure-bound; the ordinal owns the free right half.
   rem, not ch: ch tracks each child's OWN font, so 62ch on the big h2
   meant ~1200px and the heading ran under the ordinal. 40rem ≈ 640px —
   the original measure — regardless of the child's type size. */
.lp-section__head > :not(.lp-secnum) {
    max-width: 40rem;
}

/* Giant outlined section ordinal — 01 Метод · 02 Внутри · 03 Бот · 04 Что
   нового. Absolutely positioned so it does not stretch the h2 row; grid-row
   2 is the heading (eyebrow is row 1), so the glyph top matches the h2 even
   when the bot head also has a lede + «подробнее» link. */
.lp-secnum {
    position: absolute;
    grid-row: 2;
    top: 0;
    right: clamp(8px, 6vw, 96px);
    font-family: var(--tma-font-mono);
    font-weight: var(--tma-fw-bold);
    font-size: clamp(88px, 11vw, 168px);
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 2px color-mix(in oklab, var(--tma-ember-500) 70%, transparent);
    user-select: none;
    pointer-events: none;
}

@media (max-width: 900px) {
    .lp-secnum {
        display: none;
    }
}

.lp-section__head h2 {
    font-size: var(--tma-fs-h1);
    font-weight: var(--tma-fw-heavy);
    letter-spacing: var(--tma-tr-tight);
    line-height: var(--tma-lh-tight);
    margin: var(--tma-sp-3) 0 0;
}

.lp-section__head p {
    margin: var(--tma-sp-4) 0 0;
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-lead);
    line-height: var(--tma-lh-normal);
}

/* ---- Hero --------------------------------------------------------------- */

.lp-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--tma-border-regular);
}

/* one warm bloom behind the phone — the only ambient light on the page */
.lp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        58% 55% at 78% 30%,
        color-mix(in oklab, var(--tma-ember-500) 20%, transparent),
        transparent 70%
    );
    pointer-events: none;
}

.lp-hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(32px, 6vw, 72px);
    align-items: center;
    padding-block: clamp(56px, 9vw, 104px);
}

.lp-hero h1 {
    /* Sized for the stat-led headline («80% выученного / забывается за
       неделю. / Твоего — нет.»): the i18n string carries an explicit <br>
       after the stat and nbsp-joins the ember clause, so it lands as three
       even lines. 42px ceiling is load-bearing — the hero copy column is
       ~508px at 1440, and the longest line («забывается за неделю.», 21
       Cyrillic glyphs ≈ 0.56em each) only fits under ~42px; the old
       15ch/68px slogan sizing broke the stat into five lines and pushed
       the CTA under the fold. */
    font-size: clamp(30px, 3.2vw, 42px);
    font-weight: var(--tma-fw-heavy);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: var(--tma-sp-4) 0 0;
    max-width: 25ch;
}

.lp-hero h1 em {
    font-style: normal;
    color: var(--tma-text-accent);
}

.lp-hero__lede {
    margin: var(--tma-sp-5) 0 0;
    max-width: 44ch;
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-lead);
    line-height: var(--tma-lh-normal);
}

.lp-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tma-sp-3);
    margin-top: var(--tma-sp-8);
}

.lp-hero__meta {
    margin-top: var(--tma-sp-5);
    display: flex;
    flex-wrap: wrap;
    gap: var(--tma-sp-2) var(--tma-sp-5);
    color: var(--tma-text-tertiary);
    font-family: var(--tma-font-mono);
    font-size: var(--tma-fs-caption);
}

.lp-hero__meta b {
    color: var(--tma-text-primary);
    font-weight: var(--tma-fw-semi);
}

/* Big CTA button — reuses .tma-btn look but a touch larger for the hero */
.lp-btn-lg {
    padding: 14px 22px;
    font-size: var(--tma-fs-lead);
    border-radius: var(--tma-rad-full);
}

.lp-btn-lg svg {
    width: 20px;
    height: 20px;
}

/* ---- Phone frame -------------------------------------------------------- */

.lp-phone {
    justify-self: center;
    width: 320px;
    max-width: 100%;
    border-radius: 44px;
    padding: 12px;
    background: linear-gradient(
        180deg,
        color-mix(in oklab, var(--tma-neutral-400) 60%, transparent),
        color-mix(in oklab, var(--tma-neutral-300) 80%, transparent)
    );
    box-shadow: var(--tma-elev-3), 0 40px 80px -40px rgba(0, 0, 0, 0.8);
}

.lp-phone__screen {
    position: relative;
    border-radius: 33px;
    background: var(--tma-surface-canvas);
    overflow: hidden;
    /* Top padding = status-bar band that clears the notch (notch bottom ≈ 36px). */
    padding: 46px 0 16px;
    /* 320×560 keeps the demo phone believable — 640 read as a «stretched»
       device once the sparse Done screen was on it. */
    height: 560px;
}

.lp-phone__notch {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 108px;
    height: 26px;
    border-radius: var(--tma-rad-full);
    background: var(--tma-neutral-0);
    z-index: 5;
}

.lp-screen {
    height: 100%;
    overflow: hidden;
    /* Only the bottom fades (content scrolls off under the frame). Top starts
       solid — the status-bar band already clears the notch, so no top fade. */
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 92%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0, #000 92%, transparent 100%);
}

/* Composed Today screen */
.lp-screen__head {
    padding: 8px var(--tma-sp-4) var(--tma-sp-3);
    color: var(--tma-text-tertiary);
    font-size: var(--tma-fs-small);
    font-weight: var(--tma-fw-medium);
    text-transform: lowercase;
}

.lp-screen__orb {
    display: grid;
    place-items: center;
    padding: var(--tma-sp-4) 0 var(--tma-sp-6);
}

.lp-screen__actions {
    display: flex;
    gap: var(--tma-sp-2);
    padding: 0 var(--tma-sp-4) var(--tma-sp-5);
}

/* ---- Method (ETR — a real ordered process) ------------------------------ */

.lp-etr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--tma-sp-4);
    counter-reset: etr;
}

.lp-etr__card {
    position: relative;
    padding: var(--tma-sp-6);
    background: var(--tma-surface-plate);
    border: 1px solid var(--tma-border-regular);
    border-radius: var(--tma-rad-3);
    box-shadow: var(--tma-elev-1);
}

.lp-etr__k {
    display: inline-flex;
    align-items: center;
    gap: var(--tma-sp-2);
    font-family: var(--tma-font-mono);
    font-size: var(--tma-fs-caption);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tma-text-accent);
}

.lp-etr__k::before {
    counter-increment: etr;
    content: counter(etr, decimal-leading-zero);
    color: var(--tma-text-tertiary);
}

.lp-etr__card h3 {
    font-size: var(--tma-fs-h3);
    font-weight: var(--tma-fw-bold);
    letter-spacing: var(--tma-tr-snug);
    margin: var(--tma-sp-3) 0 0;
}

.lp-etr__card p {
    margin: var(--tma-sp-2) 0 0;
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-small);
    line-height: var(--tma-lh-normal);
}

.lp-etr__arrow {
    position: absolute;
    top: 50%;
    right: calc(var(--tma-sp-4) * -1 - 4px);
    transform: translateY(-50%);
    color: var(--tma-text-accent);
    z-index: 2;
}

.lp-etr__card:last-child .lp-etr__arrow {
    display: none;
}

/* ---- Features ----------------------------------------------------------- */

.lp-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--tma-sp-4);
}

.lp-feature:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.lp-feature {
    padding: var(--tma-sp-6);
    background: var(--tma-surface-plate);
    border-radius: var(--tma-rad-3);
    box-shadow: var(--tma-elev-1);
    display: flex;
    gap: var(--tma-sp-4);
    align-items: flex-start;
}

.lp-feature__icon {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: var(--tma-rad-2);
    display: grid;
    place-items: center;
    font-size: 20px;
    background: color-mix(in oklab, var(--tma-tone-accent) 12%, transparent);
    color: var(--tma-tone-accent);
}

.lp-feature__icon[data-tone="cool"] {
    background: color-mix(in oklab, var(--tma-tone-cool) 14%, transparent);
    color: var(--tma-tone-cool);
}

.lp-feature__icon[data-tone="info"] {
    background: color-mix(in oklab, var(--tma-tone-info) 14%, transparent);
    color: var(--tma-tone-info);
}

.lp-feature__icon[data-tone="warn"] {
    background: color-mix(in oklab, var(--tma-tone-warn) 14%, transparent);
    color: var(--tma-tone-warn);
}

.lp-feature__icon[data-tone="success"] {
    background: color-mix(in oklab, var(--tma-tone-success) 14%, transparent);
    color: var(--tma-tone-success);
}

.lp-feature h3 {
    font-size: var(--tma-fs-h4);
    font-weight: var(--tma-fw-bold);
    letter-spacing: var(--tma-tr-snug);
    margin: 0;
}

.lp-feature p {
    margin: var(--tma-sp-2) 0 0;
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-small);
    line-height: var(--tma-lh-normal);
}

/* ---- Grade demo strip --------------------------------------------------- */

.lp-grades {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--tma-sp-3);
    margin-top: var(--tma-sp-6);
}

.lp-grade {
    padding: var(--tma-sp-4);
    border-radius: var(--tma-rad-2);
    background: var(--tma-surface-plate);
    border: 1px solid var(--tma-border-regular);
    text-align: center;
}

.lp-grade__k {
    font-family: var(--tma-font-mono);
    font-size: var(--tma-fs-h2);
    font-weight: var(--tma-fw-bold);
    color: var(--tma-text-accent);
}

.lp-grade__t {
    margin-top: var(--tma-sp-1);
    font-size: var(--tma-fs-caption);
    color: var(--tma-text-tertiary);
}

/* ---- Final CTA ---------------------------------------------------------- */

.lp-cta {
    text-align: center;
    border-top: 1px solid var(--tma-border-regular);
}

.lp-cta h2 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: var(--tma-fw-heavy);
    letter-spacing: var(--tma-tr-tight);
    line-height: var(--tma-lh-tight);
    max-width: 16ch;
    margin: 0 auto;
}

.lp-cta p {
    margin: var(--tma-sp-4) auto 0;
    max-width: 46ch;
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-lead);
}

.lp-cta__row {
    display: flex;
    justify-content: center;
    gap: var(--tma-sp-3);
    margin-top: var(--tma-sp-8);
}

/* ---- Footer ------------------------------------------------------------- */

.lp-foot {
    border-top: 1px solid var(--tma-border-regular);
    padding-block: var(--tma-sp-8);
}

.lp-foot__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tma-sp-4);
    align-items: center;
    justify-content: space-between;
    color: var(--tma-text-tertiary);
    font-size: var(--tma-fs-small);
}

.lp-foot__row a {
    color: var(--tma-text-secondary);
}

.lp-foot__row a:hover {
    color: var(--tma-text-primary);
}

/* ---- Responsive --------------------------------------------------------- */

@media (min-width: 1100px) {
    .lp-head__nav .lp-navlink {
        display: inline;
    }
}

@media (max-width: 900px) {
    .lp-hero__grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .lp-hero h1,
    .lp-hero__lede {
        margin-inline: auto;
    }

    .lp-hero__cta {
        justify-content: center;
    }

    .lp-hero__meta {
        justify-content: center;
    }

    .lp-phone {
        order: -1;
    }

    .lp-etr {
        grid-template-columns: 1fr;
    }

    .lp-etr__arrow {
        display: none;
    }
}

@media (max-width: 620px) {
    .lp-features {
        grid-template-columns: 1fr;
    }

    .lp-grades {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Compact header — at 360px the CTA button pushed the row past the
       viewport (≈50px overflow). The hero carries the same CTA one scroll
       away, so the header keeps only brand + β + controls. */
    .lp-head__nav {
        gap: var(--tma-sp-3);
    }

    .lp-head__nav > .tma-btn {
        display: none;
    }
}

/* ---- Motion / a11y ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .lp * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ==========================================================================
   Interaction layer — loader, controls, intro + scroll reveal, bot section.
   All animation/hiding is gated behind `html.js` so a no-JS visitor still
   sees the full page (progressive enhancement).
   ========================================================================== */

/* ---- Loader ------------------------------------------------------------- */

.lp-loader {
    display: none;
}

.js .lp-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: var(--tma-sp-5);
    background: var(--tma-surface-canvas);
    transition: opacity 0.5s var(--tma-ease-out), visibility 0.5s var(--tma-ease-out);
    /* Failsafe: if landing.js never runs (blocked / errors), this still
       clears the overlay at 6s so the page can't stay stuck behind it. */
    animation: lp-loader-failsafe 0s linear 6s forwards;
}

@keyframes lp-loader-failsafe {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

.lp-loader.is-gone {
    opacity: 0;
    visibility: hidden;
}

@keyframes lp-loader-draw {
    from { stroke-dashoffset: 101; }
    to   { stroke-dashoffset: 0; }
}

/* Brand + status on one line, both uppercase: ETR STUDY · БЕТА.
   Brand in primary ink, the status word in ember — so «бета» reads as a
   state of the product, not its name. */
.lp-loader__title {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-family: var(--tma-font-sans);
    font-size: clamp(34px, 7vw, 56px);
    font-weight: var(--tma-fw-heavy);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tma-text-primary);
}

/* the β lockup mark — same glyph/slant as the site header. This is THE
   dynamic element of the loader: it hand-draws itself, then a spring
   pulse lands right before the page reveals.
   Transform layering (as in the header): the CONSTANT slant lives on the
   wrapper span; the pop animation owns the svg's transform — otherwise
   the animation's backwards-fill would override the skew until it fires. */
.lp-loader__mark {
    display: inline-block;
    transform: skewX(-12deg) translateY(0.1em);
    filter: drop-shadow(0 4px 18px color-mix(in oklab, var(--tma-ember-500) 55%, transparent));
}

.lp-loader__title-beta {
    /* oversized against the caps — the mark IS the show */
    display: block;
    width: 0.95em;
    height: 1.24em;
    color: var(--tma-text-accent);
    transform-origin: 50% 60%;
    animation: lp-beta-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s backwards;
}

.lp-loader__title-beta path {
    stroke-dasharray: 100 102;
    stroke-dashoffset: 0;
    animation: lp-loader-draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.1s backwards;
}

.lp-loader__notice {
    font-family: var(--tma-font-sans);
    font-size: var(--tma-fs-small);
    color: var(--tma-text-tertiary);
    text-align: center;
    max-width: 30ch;
}


.lp-loader__bar {
    width: 140px;
    height: 3px;
    border-radius: var(--tma-rad-full);
    background: var(--tma-border-regular);
    overflow: hidden;
}

.lp-loader__bar span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: var(--tma-rad-full);
    background: var(--tma-ember-500);
    animation: lp-slide 1.1s ease-in-out infinite;
}



@keyframes lp-slide {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(360%); }
}

@keyframes lp-breathe {
    0%, 100% { opacity: 0.72; transform: scale(0.96); }
    50%      { opacity: 1;    transform: scale(1.05); }
}

/* ---- Header controls (lang + theme) ------------------------------------ */

.lp-controls {
    display: inline-flex;
    gap: var(--tma-sp-1);
    margin-left: var(--tma-sp-2);
}

.lp-ctl {
    height: 38px;
    min-width: 38px;
    padding: 0 var(--tma-sp-3);
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--tma-border-regular);
    border-radius: var(--tma-rad-full);
    background: transparent;
    color: var(--tma-text-secondary);
    font-family: var(--tma-font-mono);
    font-size: var(--tma-fs-small);
    font-weight: var(--tma-fw-semi);
    cursor: pointer;
    transition: color var(--tma-dur-fast) var(--tma-ease-out),
        border-color var(--tma-dur-fast) var(--tma-ease-out),
        background var(--tma-dur-fast) var(--tma-ease-out);
}

.lp-ctl:hover {
    color: var(--tma-text-primary);
    border-color: var(--tma-text-primary);
}

.lp-ctl.js-lang {
    min-width: 0;
    padding-inline: 12px;
}

.lp-ctl svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.lp-lang {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4em;
}

.lp-lang [data-lang] {
    opacity: 0.38;
}

html[lang="ru"] .lp-lang [data-lang="ru"],
html[lang="en"] .lp-lang [data-lang="en"] {
    opacity: 1;
    color: var(--tma-text-accent);
}

/* ---- Intro rise (hero, on load) ---------------------------------------- */

.js .lp-rise {
    opacity: 0;
    transform: translateY(18px);
}

.js .is-ready .lp-rise,
.is-ready .lp-rise {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s var(--tma-ease-out), transform 0.6s var(--tma-ease-out);
}

.is-ready .lp-hero__copy > .lp-rise:nth-child(1) { transition-delay: 0.10s; }
.is-ready .lp-hero__copy > .lp-rise:nth-child(2) { transition-delay: 0.18s; }
.is-ready .lp-hero__copy > .lp-rise:nth-child(3) { transition-delay: 0.26s; }
.is-ready .lp-hero__copy > .lp-rise:nth-child(4) { transition-delay: 0.34s; }
.is-ready .lp-hero__copy > .lp-rise:nth-child(5) { transition-delay: 0.42s; }
.is-ready .lp-rise--phone { transition-delay: 0.30s; transition-duration: 0.8s; }

/* ---- Scroll reveal ------------------------------------------------------ */

.js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s var(--tma-ease-out), transform 0.6s var(--tma-ease-out);
    transition-delay: calc(var(--d, 0) * 0.08s);
}

.reveal.is-in {
    opacity: 1;
    transform: none;
}

/* ---- Bot section -------------------------------------------------------- */

.lp-bot__grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(32px, 6vw, 64px);
    /* start, not center — the eyebrow and the chat card share one top line */
    align-items: start;
}

.lp-bot__copy h2 {
    font-size: var(--tma-fs-h1);
    font-weight: var(--tma-fw-heavy);
    letter-spacing: var(--tma-tr-tight);
    line-height: var(--tma-lh-tight);
    margin: var(--tma-sp-3) 0 0;
}

.lp-bot__copy > p {
    margin: var(--tma-sp-4) 0 0;
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-lead);
    line-height: var(--tma-lh-normal);
}

.lp-bot__more {
    display: inline-block;
    margin-top: var(--tma-sp-4);
    color: var(--tma-text-accent);
    font-weight: var(--tma-fw-semi);
    font-size: var(--tma-fs-body);
    border-bottom: 1px solid transparent;
    transition: border-color var(--tma-dur-fast) var(--tma-ease-out);
}

.lp-bot__more:hover {
    border-bottom-color: var(--tma-text-accent);
}

.lp-bot__list {
    display: grid;
    gap: var(--tma-sp-5);
}

.lp-bot__item {
    display: flex;
    gap: var(--tma-sp-4);
    align-items: flex-start;
}

.lp-bot__k {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: var(--tma-rad-2);
    display: grid;
    place-items: center;
    font-size: 19px;
    background: var(--tma-surface-accent-soft);
}

.lp-bot__item h3 {
    font-size: var(--tma-fs-h4);
    font-weight: var(--tma-fw-bold);
    letter-spacing: var(--tma-tr-snug);
    margin: 0;
}

.lp-bot__item p {
    margin: var(--tma-sp-1) 0 0;
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-small);
    line-height: var(--tma-lh-normal);
}

/* Chat mock */
.lp-chat {
    background: var(--tma-surface-plate);
    border: 1px solid var(--tma-border-regular);
    border-radius: var(--tma-rad-4);
    box-shadow: var(--tma-elev-2);
    overflow: hidden;
}

.lp-chat__head {
    display: flex;
    gap: var(--tma-sp-3);
    align-items: center;
    padding: var(--tma-sp-4);
    border-bottom: 1px solid var(--tma-border-regular);
    background: var(--tma-surface-elevated);
}

/* Bot avatar — the mosaic mark on a soft ember tint, so the ember dots
   stay readable (they'd vanish on a solid ember circle). */
.lp-chat__ava {
    width: 36px;
    height: 36px;
    border-radius: var(--tma-rad-full);
    background: var(--tma-surface-accent-soft);
    display: grid;
    place-items: center;
}

.lp-chat__name {
    font-weight: var(--tma-fw-bold);
}

.lp-chat__status {
    font-size: var(--tma-fs-caption);
    color: var(--tma-text-tertiary);
}

.lp-chat__body {
    display: grid;
    gap: var(--tma-sp-3);
    padding: var(--tma-sp-5);
}

.lp-bubble {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: var(--tma-rad-3);
    font-size: var(--tma-fs-small);
    line-height: 1.4;
}

.lp-bubble--in {
    justify-self: start;
    background: var(--tma-surface-elevated);
    border-bottom-left-radius: var(--tma-rad-1);
}

.lp-bubble--out {
    justify-self: end;
    background: var(--tma-action-primary);
    color: var(--tma-action-primary-text);
    border-bottom-right-radius: var(--tma-rad-1);
}

.lp-bubble--cmd {
    font-family: var(--tma-font-mono);
    color: var(--tma-text-accent);
    background: var(--tma-surface-accent-soft);
    letter-spacing: 0.04em;
}

.lp-bot__cta {
    margin-top: var(--tma-sp-4);
    width: 100%;
    text-align: center;
}

@media (max-width: 900px) {
    .lp-bot__grid {
        grid-template-columns: 1fr;
    }

    .lp-bot__chat {
        order: -1;
    }
}

/* ---- Reduced motion — kill intro/scroll motion, keep everything visible - */

@media (prefers-reduced-motion: reduce) {
    .js .lp-rise,
    .js .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /* .tma-mosaic rings stop via the kit primitive's own reduced-motion
       rule (bundled) — no landing-side override needed. */
    .lp-loader__title-beta,
    .lp-loader__title-beta path,
    .lp-loader__bar span {
        animation: none !important;
    }
}

/* ==========================================================================
   Phone demo — the mini-app flow played on loop inside the hero phone:
   Today → (tap Start Focus) → Focus: card → answer → grade → swipe →
   next card → Done (sage rest) → back to Today. Driven by landing.js;
   reduced-motion visitors just see the static Today screen.
   ========================================================================== */

.lp-screen {
    position: relative;
}

.lp-demo__screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(60%);
    transition: transform 0.45s var(--tma-ease-out), opacity 0.45s var(--tma-ease-out);
    pointer-events: none;
}

.lp-demo__screen.is-active {
    opacity: 1;
    transform: none;
}

/* Today is the no-JS / reduced-motion default. */
.lp-demo__screen--today {
    opacity: 1;
    transform: none;
}

.lp-demo__screen--today:not(.is-active) {
    opacity: 0;
    transform: translateX(-14%);
}

/* Simulated tap — quick press-down on the Start Focus button. */
.lp-demo__screen .tma-btn.is-tap {
    transform: scale(0.94);
    filter: brightness(1.18);
}

/* ---- Focus screen -------------------------------------------------------- */

.lp-demo__fhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px var(--tma-sp-4) var(--tma-sp-3);
}

.lp-demo__ftitle {
    font-size: var(--tma-fs-small);
    font-weight: var(--tma-fw-semi);
    color: var(--tma-text-primary);
}

.lp-demo__fcount {
    font-family: var(--tma-font-mono);
    font-size: var(--tma-fs-caption);
    color: var(--tma-text-tertiary);
}

/* ---- Focus screen: REAL tma-focus primitives, demo-orchestrated ----------
   The card, faces, reveal-hint and grade buttons come straight from the kit
   bundle (focus.css). This block only adds what framer-motion does in the
   app: the rotateY flip on data-revealed, card enter/exit, simulated taps. */

.lp-demo__stage {
    position: relative;
    flex: 1;
    margin: var(--tma-sp-2) var(--tma-sp-4);
    perspective: 1200px;
}

.lp-demo__stage .tma-focus__flip-stage {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(42%) scale(0.95);
    transition: transform 0.4s var(--tma-ease-out), opacity 0.4s var(--tma-ease-out);
}

.lp-demo__stage .tma-focus__flip-stage.is-front {
    opacity: 1;
    transform: none;
}

.lp-demo__stage .tma-focus__flip-stage.is-out {
    opacity: 0;
    transform: translateX(120%) rotate(7deg);
    transition: transform 0.45s var(--tma-ease-in-out), opacity 0.45s var(--tma-ease-in-out);
}

/* The 3D flip the app drives with framer-motion — pure CSS here. */
.lp-demo__stage .tma-focus__card {
    height: 100%;
    max-height: 100%;
    transition: transform 0.55s var(--tma-ease-in-out);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

/* The kit floors the unrevealed card at min(400px, 100dvh−320px) — sized
   for a real phone viewport. Inside the 560px demo phone the stage is
   ~370px, so that floor pushed the card under the grade slots (the
   Again/Hard/Good/Easy row painted over the card bottom and the
   «tap to reveal» hint). The stage IS the viewport here: fill it, no floor. */
.lp-demo__stage .tma-focus__card[data-revealed='false'] {
    min-height: 0;
}

.lp-demo__stage .tma-focus__card[data-revealed='true'] {
    transform: rotateY(180deg);
}

/* Grade strip: reuse the real footer, trim its canvas band for the phone. */
.lp-demo__grades.tma-focus__grades {
    background: transparent;
    border-top: none;
    padding: var(--tma-sp-2) var(--tma-sp-4) var(--tma-sp-2);
}

/* Simulated tap on a grade button. */
.lp-demo__grades .tma-focus__grade.is-hit {
    transform: scale(0.95);
    background: color-mix(in oklab, var(--grade-ink) 38%, transparent);
    border-color: color-mix(in oklab, var(--grade-ink) 75%, transparent);
}

/* ---- Done screen (sage — earned rest, never ember) ----------------------- */

.lp-demo__screen--done {
    justify-content: center;
}

.lp-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tma-sp-4);
    text-align: center;
    padding: 0 var(--tma-sp-6);
}

.lp-done__orb {
    width: 116px;
    height: 116px;
    border-radius: var(--tma-rad-full);
    display: grid;
    place-items: center;
    background: color-mix(in oklab, var(--tma-tone-cool) 14%, transparent);
    color: var(--tma-tone-cool);
}

.lp-done__t {
    font-size: var(--tma-fs-h4);
    font-weight: var(--tma-fw-bold);
}

.lp-done__s {
    font-size: var(--tma-fs-small);
    color: var(--tma-text-tertiary);
    max-width: 24ch;
}

@media (prefers-reduced-motion: reduce) {
    .lp-demo__screen {
        transition: none;
    }
}

/* ---- Changelog («Что нового») -------------------------------------------- */

.lp-releases {
    display: grid;
    gap: var(--tma-sp-4);
    max-width: 720px;
}

.lp-release {
    padding: var(--tma-sp-6) var(--tma-sp-8);
    background: var(--tma-surface-plate);
    border-radius: var(--tma-rad-3);
    box-shadow: var(--tma-elev-1);
    border-left: var(--tma-rail-w) solid var(--tma-ember-500);
}

.lp-release__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--tma-sp-3);
}

.lp-release__v {
    font-family: var(--tma-font-mono);
    font-size: var(--tma-fs-small);
    font-weight: var(--tma-fw-semi);
    color: var(--tma-text-accent);
    background: var(--tma-surface-accent-soft);
    padding: 3px 10px;
    border-radius: var(--tma-rad-full);
    line-height: 1.4;
}

.lp-release__date {
    font-family: var(--tma-font-mono);
    font-size: var(--tma-fs-caption);
    color: var(--tma-text-tertiary);
}

.lp-release h3 {
    font-size: var(--tma-fs-h3);
    font-weight: var(--tma-fw-bold);
    letter-spacing: var(--tma-tr-snug);
    margin: var(--tma-sp-4) 0 0;
}

.lp-release__list {
    margin: var(--tma-sp-4) 0 0;
    padding: 0 0 0 1.2em;
    display: grid;
    gap: var(--tma-sp-2);
    color: var(--tma-text-secondary);
    font-size: var(--tma-fs-body);
    line-height: var(--tma-lh-normal);
}

.lp-release__list li::marker {
    color: var(--tma-ember-500);
}

/* ---- Chat mock: Telegram-style inline keyboard under bot bubbles --------- */

.lp-chat__group {
    display: grid;
    gap: var(--tma-sp-1);
    justify-items: start;
}

.lp-kb {
    display: flex;
    gap: var(--tma-sp-1);
    max-width: 84%;
    width: 100%;
}

.lp-kb__btn {
    flex: 1;
    text-align: center;
    padding: 7px 10px;
    border-radius: var(--tma-rad-2);
    background: var(--tma-surface-elevated);
    border: 1px solid var(--tma-border-regular);
    font-size: var(--tma-fs-caption);
    font-weight: var(--tma-fw-semi);
    color: var(--tma-text-secondary);
    white-space: nowrap;
}

/* the button the demo user «tapped» */
.lp-kb__btn.is-tapped {
    background: var(--tma-surface-accent-soft);
    border-color: color-mix(in oklab, var(--tma-tone-accent) 55%, transparent);
    color: var(--tma-text-accent);
}

.lp-feature__more {
    margin: var(--tma-sp-2) 0 0;
}

.lp-feature__more a {
    font-size: var(--tma-fs-small);
    font-weight: var(--tma-fw-medium);
    color: var(--tma-tone-accent);
    text-decoration: none;
}

.lp-why__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
    gap: var(--tma-sp-8);
    align-items: start;
}

.lp-why__copy h1 {
    margin: var(--tma-sp-2) 0 var(--tma-sp-4);
    letter-spacing: -0.03em;
}

.lp-why__lede {
    font-size: var(--tma-fs-lead);
    color: var(--tma-text-secondary);
    margin-bottom: var(--tma-sp-6);
}

.lp-why__copy h2 {
    margin: var(--tma-sp-6) 0 var(--tma-sp-3);
    font-size: var(--tma-fs-h3);
}

.lp-why__copy p {
    color: var(--tma-text-secondary);
    line-height: var(--tma-lh-normal);
}

.lp-why__sources {
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--tma-sp-3);
}

.lp-why__sources a {
    color: var(--tma-text-secondary);
    text-decoration: none;
}

.lp-why__sources cite {
    font-style: normal;
    color: var(--tma-text-primary);
}

.lp-memory-shot {
    background: var(--tma-surface-plate);
    border-radius: 20px;
    padding: 20px 16px 16px;
    box-shadow: var(--tma-elev-2, var(--tma-elev-1));
}

.lp-memory-shot__nums {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 14px;
    font-family: var(--tma-font-mono);
    font-weight: 600;
    line-height: 1;
}

.lp-memory-shot__ret {
    font-size: 48px;
    color: var(--tma-tone-accent);
    letter-spacing: -0.03em;
}

.lp-memory-shot__brit {
    font-size: 48px;
    color: var(--tma-tone-warn);
    letter-spacing: -0.03em;
}

.lp-memory-shot__ret span,
.lp-memory-shot__brit span {
    font-size: 20px;
    opacity: 0.8;
}

.lp-memory-shot__sl {
    font-size: 32px;
    font-weight: 300;
    color: var(--tma-text-tertiary);
}

.lp-memory-shot__caps {
    display: flex;
    justify-content: center;
    gap: 56px;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--tma-text-tertiary);
}

.lp-memory-shot__delta {
    margin: 10px auto 0;
    width: fit-content;
    font-family: var(--tma-font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--tma-tone-danger);
    background: color-mix(in oklab, var(--tma-tone-danger) 14%, transparent);
    padding: 3px 11px;
    border-radius: 999px;
}

.lp-memory-shot__chart {
    display: block;
    width: 100%;
    margin-top: 16px;
    color: var(--tma-text-tertiary);
}

.lp-memory-shot__cap {
    margin: var(--tma-sp-3) 0 0;
    text-align: center;
    font-size: var(--tma-fs-small);
    color: var(--tma-text-tertiary);
}

@media (max-width: 860px) {
    .lp-why__grid {
        grid-template-columns: 1fr;
    }
}
