/* ==========================================================================
   Песновея — витринные страницы: общие блоки
   Главная, «Примеры песен», страницы поводов и сценариев, руководства.

   Здесь то, что у этих страниц общее: токены, заголовки разделов с
   номером, первый экран с пятнами и эквалайзером, форма идеи, кнопка
   «Остановить анимацию», тёмная полоса оплаты, карточки песен, шаги
   мастера с картинками, карточки поводов, частые вопросы, финальный
   призыв — и их движение. Своё у страниц — в home.css (главная и
   «Примеры») и landing.css (поводы, сценарии, руководства).

   Раньше всё это жило в home.css, и страница повода либо грузила бы
   114 КБ, из которых ей нужна половина, либо держала бы в landing.css
   копию нужных правил — копию, которая разошлась бы с главной при первой
   же правке. Префикс home- у классов остался с тех времён: переименование
   не дало бы ничего, кроме риска сломать главную.

   Подключается через $asset() — с версией по содержимому. Цвета — только
   токены брендбука из app.css. Коралловый здесь — заливка, линия и точка,
   но не цвет текста на светлом: его контраст 3.08:1 (§18).

   Движение устроено в три слоя, и каждый можно потерять без ущерба:
     - без JavaScript страница статична и полна: макеты стоят в итоговом
       состоянии, всё видно и работает;
     - .hp-motion (ставит home.js) — параллакс, полоса прочитанного,
       разовые движения картинок шагов;
     - .hp-loop — бесконечные петли: эквалайзеры, блик, пятна, картинки
       шагов. Его снимает кнопка «Остановить анимацию» (WCAG 2.2.2).
   При prefers-reduced-motion скрипт не ставит ни одного класса (а если
   просьбу включили на открытой странице — снимает их), правила в конце
   файла на всякий случай гасят всё, что могло двигаться.
   Анимируются только transform и opacity: они не трогают раскладку.
   ========================================================================== */

.page-home,
.page-examples,
.page-landing,
.page-guides {
    --home-paper: var(--brand-warm-white);
    --home-surface: #ffffff;
    --home-line: var(--color-border);
    --home-line-strong: var(--color-border-strong);
    --home-accent: var(--color-accent);
    --home-accent-soft: var(--brand-lavender);
    --home-on-night: #ffffff;
    /* Приглушённый текст на тёмных полосах: 7.2:1 на самом светлом их
       участке (фиолетовом), поэтому годится и для мелкого текста. */
    --home-on-night-muted: #d9d3ee;
    --home-night: linear-gradient(105deg, #0e0f17 0%, #1b1240 48%, #4011aa 100%);
    --home-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --home-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --home-radius: 20px;
    --home-shadow: 0 1px 2px rgba(17, 19, 26, 0.05), 0 22px 44px -22px rgba(49, 22, 120, 0.3);
    --home-shadow-lg: 0 2px 6px rgba(17, 19, 26, 0.06), 0 40px 80px -32px rgba(49, 22, 120, 0.45);
    /*
     * Градиент для текста. Фирменный начинается с #ff7a62, а у него на
     * светлом фоне 2.6:1 — буквы в начале фразы бледнели бы. Здесь те же
     * коралл и фиолетовый, но темнее: каждая точка перехода не ниже 5:1
     * к фону первого экрана. В тёмной теме — наоборот, светлее.
     */
    --home-text-gradient: linear-gradient(95deg, #d8392e 0%, #c22f5c 38%, #5b20d6 100%);
    /* Пастель плиток, шагов и поводов. Тёмный текст на них — от 5.3:1. */
    --home-tint-coral: #ffe6df;
    --home-tint-violet: #ece4ff;
    --home-tint-sun: #fff0c9;
    --home-tint-pink: #ffe4ee;
    --home-tint-mint: #dcf3e8;
    /* Цвета фигур в иллюстрациях — никогда не цвет текста. */
    --home-sun: #ffc53d;
    --home-pink: #ff8fb1;
    --home-shape-violet: var(--brand-violet);
    --home-vinyl: #1b1726;
}

@media (prefers-color-scheme: dark) {
    :where(:root:not([data-theme="light"])) .page-home,
    :where(:root:not([data-theme="light"])) .page-examples,
    :where(:root:not([data-theme="light"])) .page-landing,
    :where(:root:not([data-theme="light"])) .page-guides {
        --home-paper: var(--color-bg-subtle);
        --home-surface: var(--color-bg-raised);
        --home-accent-soft: #241d3d;
        --home-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 44px -22px rgba(0, 0, 0, 0.75);
        --home-shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.45), 0 40px 80px -32px rgba(0, 0, 0, 0.85);
        --home-text-gradient: linear-gradient(95deg, #ff8a7a 0%, #ff85a8 42%, #a68bff 100%);
        --home-tint-coral: #33201f;
        --home-tint-violet: #251d42;
        --home-tint-sun: #2e2716;
        --home-tint-pink: #321c29;
        --home-tint-mint: #16291f;
        --home-shape-violet: #a68bff;
    }
}

/* То же для тёмной темы, выбранной переключателем в шапке. */
:where(:root[data-theme="dark"]) .page-home,
:where(:root[data-theme="dark"]) .page-examples,
:where(:root[data-theme="dark"]) .page-landing,
:where(:root[data-theme="dark"]) .page-guides {
    --home-paper: var(--color-bg-subtle);
    --home-surface: var(--color-bg-raised);
    --home-accent-soft: #241d3d;
    --home-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 44px -22px rgba(0, 0, 0, 0.75);
    --home-shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.45), 0 40px 80px -32px rgba(0, 0, 0, 0.85);
    --home-text-gradient: linear-gradient(95deg, #ff8a7a 0%, #ff85a8 42%, #a68bff 100%);
    --home-tint-coral: #33201f;
    --home-tint-violet: #251d42;
    --home-tint-sun: #2e2716;
    --home-tint-pink: #321c29;
    --home-tint-mint: #16291f;
    --home-shape-violet: #a68bff;
}

/*
 * clip, а не hidden: декоративные пятна и плашки не расширяют страницу,
 * но липкий макет мастера внутри продолжает работать — hidden сделал бы
 * обёртку контейнером прокрутки, и sticky молча перестал бы липнуть.
 */
.home,
.examples,
.landing {
    overflow-x: clip;
}

/* Последний раздел стоит вплотную к подвалу: белая полоса между ними
   читалась бы как пустой раздел. У главной и страниц поводов это тёмный
   финальный блок, у руководства — кремовый «Что почитать ещё» перед
   кремовым же подвалом, у списка руководств — карточка с призывом со
   своим нижним отступом. */
.page-home .site-footer,
.page-landing .site-footer,
.page-guides .site-footer {
    margin-top: 0;
}

/* Скрытое атрибутом hidden остаётся скрытым, даже если класс задаёт
   display: иначе подсказки и кнопки показались бы и без скрипта. */
.home [hidden],
.examples [hidden],
.landing [hidden] {
    display: none !important;
}

/* На тёмных полосах фиолетовая рамка фокуса почти не видна. */
.home-band :focus-visible,
.home-cta :focus-visible {
    outline-color: #ffffff;
}

/* --- Разделы: ритм, номер, заголовок -------------------------------------- */

/* clip не даёт украшениям залезть в соседний раздел и, в отличие от
   hidden, не ломает липкие блоки внутри. */
.home-section {
    position: relative;
    overflow: clip;
    padding-block: clamp(4rem, 2.5rem + 5vw, 7.5rem);
    background: var(--color-bg);
}

.home-section--paper {
    background: var(--home-paper);
    border-block: 1px solid var(--home-line);
}

.home-head {
    position: relative;
    display: grid;
    gap: 1rem 3rem;
    margin-bottom: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
}

/*
 * Крупный контурный номер раздела — украшение: псевдоэлемент не читается
 * как отдельная строка, а «/ ""» убирает его и из дерева доступности.
 * Сам номер уже есть в подписи над заголовком.
 *
 * Номер — своя ячейка сетки заголовка, а не слой поверх неё. Слоем со
 * сдвигом при прокрутке он упирался в край раздела и липкую шапку, а на
 * 1280 px «05» лёг поверх текста. В ячейке ему некуда наезжать при любой
 * длине заголовка. На телефоне рядом с заголовком места нет, и номер не
 * показывается.
 */
.home-head::before {
    content: attr(data-num);
    content: attr(data-num) / "";
    display: none;
    font-size: clamp(4.5rem, 1.5rem + 7vw, 8.5rem);
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: -0.06em;
    font-variant-numeric: tabular-nums;
    color: transparent;
    -webkit-text-stroke: 1px var(--home-line-strong);
    pointer-events: none;
}

@media (min-width: 48rem) {
    .home-head {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .home-head::before {
        display: block;
        grid-column: 2;
        grid-row: 1;
    }

    .home-head__main {
        grid-column: 1;
        grid-row: 1;
    }

    .home-head > .home-lead {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

.home-kicker {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 0 0 1.125rem;
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--home-accent);
}

.home-kicker__num {
    font-weight: 750;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.home-kicker__line {
    width: 3rem;
    height: 1px;
    background: currentColor;
    transform-origin: left;
}

.home-title {
    position: relative;
    z-index: 1;
    max-width: 20ch;
    margin: 0;
    font-size: clamp(1.875rem, 1.15rem + 2.6vw, 3rem);
    font-weight: 780;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.home-title__accent {
    color: var(--home-accent);
}

.home-lead {
    position: relative;
    z-index: 1;
    max-width: 34rem;
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--color-text-muted);
}

/* Широкий экран: заголовок слева во всю высоту, справа номер над
   вводным абзацем. */
@media (min-width: 60rem) {
    .home-head {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        align-items: end;
    }

    .home-head::before {
        justify-self: end;
    }

    .home-head__main {
        grid-row: 1 / span 2;
    }

    .home-head > .home-lead {
        grid-column: 2;
    }
}

.home-more {
    margin: 2.25rem 0 0;
}

.home-arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    font-weight: 650;
    color: var(--home-accent);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.3em;
}

.home-arrow-link::after {
    content: "→";
    transition: transform 0.3s var(--home-ease);
}

.home-arrow-link:hover::after {
    transform: translateX(4px);
}

/* --- Первый экран ---------------------------------------------------------- */

.home-hero {
    position: relative;
    isolation: isolate;
    overflow: clip;
    padding-block: clamp(2rem, 1rem + 3vw, 3.5rem) clamp(3rem, 2rem + 4vw, 5.5rem);
    background: linear-gradient(180deg, var(--home-paper) 0%, var(--color-bg) 92%);
}

.home-hero__backdrop {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* Слои первого экрана догоняют курсор и прокрутку плавно, а не рывком. */
.hp-motion .home-hero [data-depth] {
    transition: transform 0.5s var(--home-ease);
}

/*
 * Пятно состоит из двух слоёв: сам элемент двигает скрипт (параллакс),
 * а псевдоэлемент медленно «дышит» по кругу. Одно свойство transform на
 * одном элементе они бы делили, и анимация перебивала бы параллакс.
 */
.home-orb {
    position: absolute;
    display: block;
    border-radius: 50%;
    will-change: transform;
}

.home-orb::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.home-hero .home-orb--coral {
    top: -14rem;
    right: -10rem;
    width: 36rem;
    height: 36rem;
}

.home-hero .home-orb--coral::before {
    background: radial-gradient(closest-side, rgba(255, 122, 98, 0.36), rgba(255, 90, 78, 0));
}

.home-hero .home-orb--violet {
    bottom: -22rem;
    left: -16rem;
    width: 44rem;
    height: 44rem;
}

.home-hero .home-orb--violet::before {
    background: radial-gradient(closest-side, rgba(91, 32, 214, 0.2), rgba(91, 32, 214, 0));
}

.home-hero .home-orb--lilac {
    top: 34%;
    left: 46%;
    width: 24rem;
    height: 24rem;
}

.home-hero .home-orb--lilac::before {
    background: radial-gradient(closest-side, rgba(166, 139, 255, 0.28), rgba(166, 139, 255, 0));
}

/* Нотный стан на фоне: пять линий, как у настоящего. */
.home-hero__staff {
    position: absolute;
    left: 0;
    bottom: 6%;
    width: 100%;
    height: 12rem;
    fill: none;
    stroke: var(--home-accent);
    opacity: 0.14;
}

.home-hero__staff path {
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

/* Эквалайзер вдоль нижнего края первого экрана. Высота меньше нижнего
   отступа раздела: столбики не заходят под форму и макет. */
.home-hero__eq {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    gap: clamp(3px, 0.45vw, 8px);
    height: clamp(2.25rem, 1.5rem + 2.5vw, 4rem);
    padding-inline: 2vw;
    opacity: 0.5;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.home-hero__bar {
    flex: 1 1 0;
    height: 100%;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #ff7a62 0%, #ff5a4e 35%, #5b20d6 100%);
    transform-origin: 50% 100%;
    transform: scaleY(var(--h, 0.5));
}

.home-hero__bar--h0 { --h: 0.18; }
.home-hero__bar--h1 { --h: 0.32; }
.home-hero__bar--h2 { --h: 0.46; }
.home-hero__bar--h3 { --h: 0.7; }
.home-hero__bar--h4 { --h: 0.28; }
.home-hero__bar--h5 { --h: 0.88; }
.home-hero__bar--h6 { --h: 0.55; }
.home-hero__bar--h7 { --h: 0.4; }
.home-hero__bar--t1 { animation-duration: 1.1s; animation-delay: -0.3s; }
.home-hero__bar--t2 { animation-duration: 1.7s; animation-delay: -0.9s; }
.home-hero__bar--t3 { animation-duration: 0.95s; animation-delay: -0.5s; }
.home-hero__bar--t4 { animation-duration: 1.25s; animation-delay: -1.1s; }
.home-hero__bar--t5 { animation-duration: 1.9s; animation-delay: -0.2s; }

/* Полоса прочитанного вверху окна: только вместе с движением. */
.home-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: none;
    height: 3px;
    pointer-events: none;
}

.hp-motion .home-progress {
    display: block;
}

.home-progress__fill {
    display: block;
    height: 100%;
    background: var(--brand-gradient);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

/* Набор фигур для иллюстраций: в разметке есть, на экране нет. */
.home-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.home-hero__grid {
    display: grid;
    gap: clamp(2.5rem, 1rem + 4vw, 4rem);
    align-items: center;
}

@media (min-width: 60rem) {
    .home-hero__grid {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    max-width: 100%;
    margin: 0 0 1.25rem;
    padding: 0.375rem 0.875rem 0.375rem 0.75rem;
    border: 1px solid var(--home-line);
    border-radius: var(--radius-full);
    background: var(--home-surface);
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

.home-eyebrow__pulse {
    position: relative;
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--brand-coral);
}

.home-eyebrow__pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--brand-coral);
    opacity: 0;
}

/*
 * Размер тянется за шириной экрана. Нижняя граница подобрана под 320 px:
 * слово «персональную» должно поместиться в строку целиком, иначе оно
 * распирает не заголовок, а весь документ.
 */
.home-hero__title {
    margin: 0 0 1.25rem;
    font-size: clamp(2rem, 1.05rem + 3.2vw, 3.25rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

/*
 * Акцент заголовка — градиентные буквы без подчёркивания: фиолетовое
 * с чертой читалось как ссылка. Сплошной цвет задан всегда: его видят
 * браузеры без background-clip: text и проверка контраста (8:1 и 6.9:1
 * в светлой и тёмной теме). clone — у каждой строки переноса свой
 * полный градиент.
 */
.home-hero__accent {
    color: var(--home-accent);
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
    .home-hero__accent {
        background-image: var(--home-text-gradient);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        -webkit-box-decoration-break: clone;
        box-decoration-break: clone;
    }
}

/* Режим высокой контрастности убирает фоновые картинки, и прозрачные
   буквы исчезли бы вместе с градиентом. */
@media (forced-colors: active) {
    .home-hero__accent {
        background: none;
        -webkit-text-fill-color: currentColor;
    }
}

.home-hero__promise {
    max-width: 34rem;
    margin: 0 0 1.5rem;
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* --- Пробная песня над формой ---------------------------------------------- */

/*
 * Подарок при подтверждении почты (partials.trial_offer) — между обещанием
 * и формой; раньше на этом экране под кнопкой стояла цена. Подложка —
 * фирменные коралл и фиолетовый на десятую часть поверх цвета карточек:
 * плашку видно в обеих темах, но с кнопкой «Создать песню» она не спорит.
 * «Бесплатно» — фиолетовым, а не градиентом: на подложке начало
 * градиента бледнее 4.5:1 (§18), а сплошной цвет — от 5.2:1 в обеих темах.
 */
.home-offer {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 0 0 1rem;
    padding: 0.75rem 1rem 0.75rem 0.75rem;
    border: 1px solid rgba(255, 90, 78, 0.32);
    border-radius: 16px;
    background:
        linear-gradient(100deg, rgba(255, 90, 78, 0.12), rgba(91, 32, 214, 0.1)),
        var(--home-surface);
    box-shadow: var(--shadow-sm);
}

.home-offer__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 14px;
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 10px 20px -12px rgba(255, 90, 78, 0.9);
}

.home-offer__icon svg {
    width: 1.625rem;
    height: 1.625rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-offer__body {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}

.home-offer__title {
    margin: 0;
    font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.home-offer__accent {
    color: var(--home-accent);
}

.home-offer__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--color-text-muted);
}

/* --- Форма идеи ------------------------------------------------------------ */

.home-idea {
    display: grid;
    gap: 0.875rem;
    padding: clamp(0.875rem, 0.6rem + 1vw, 1.25rem);
    border: 1px solid var(--home-line);
    border-radius: var(--home-radius);
    background: var(--home-surface);
    box-shadow: var(--home-shadow);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-idea:focus-within {
    border-color: var(--home-accent);
}

.home-idea__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.home-idea__label {
    font-size: 0.9375rem;
    font-weight: 650;
}

/* 16 px — меньше нельзя: iOS увеличивает страницу при фокусе на поле. */
.home-idea__input {
    width: 100%;
    min-height: 5rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--home-line-strong);
    border-radius: 14px;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    /* «Описать идею ↑» ведёт сюда: над полем должны остаться видны
       липкая шапка, подпись и подсказки — на телефоне они в две строки. */
    scroll-margin-top: 12.5rem;
}

.home-idea__input::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

.home-idea__ideas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

/* Подсказка вставляет текст в поле — отсюда плюс перед подписью. */
.home-idea__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2rem;
    padding: 0.125rem 0.75rem 0.125rem 0.625rem;
    border: 1px dashed var(--home-line-strong);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.home-idea__chip::before {
    content: "+";
    font-weight: 700;
    color: var(--home-accent);
}

@media (pointer: coarse) {
    .home-idea__chip {
        min-height: 2.5rem;
    }
}

.home-idea__chip:hover {
    border-style: solid;
    border-color: var(--home-accent);
    background: var(--home-accent-soft);
    color: var(--home-accent);
}

.home-idea__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* Выбор «вокал или инструментал» — сегменты вместо кружков: так видно,
   что вариантов два и один из них уже выбран. Сами кружки остаются в
   разметке и получают фокус — клавиатура работает как у обычных радио. */
.home-idea__kind {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1 1 100%;
    gap: 0.25rem;
    min-width: 0;
    margin: 0;
    padding: 0.25rem;
    border: 1px solid var(--home-line);
    border-radius: 14px;
    background: var(--home-paper);
}

/* Где помещается — сегменты по ширине подписей, рядом с кнопкой. */
@media (min-width: 30rem) {
    .home-idea__kind {
        grid-template-columns: auto auto;
        flex: 0 0 auto;
    }

    .home-idea__option span {
        white-space: nowrap;
    }
}

.home-idea__option {
    position: relative;
    display: flex;
    min-width: 0;
}

.home-idea__option input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.home-idea__option span {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.25rem;
    border-radius: 10px;
    /* На 320 px «Инструментал» иначе вылезает за свою половину. */
    font-size: clamp(0.8125rem, 0.5rem + 1.6vw, 0.9375rem);
    letter-spacing: -0.01em;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: var(--color-text-muted);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 30rem) {
    .home-idea__option span {
        padding-inline: 0.625rem;
    }
}

.home-idea__option input:checked + span {
    background: var(--home-surface);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(17, 19, 26, 0.14);
}

.home-idea__option input:focus-visible + span {
    outline: 3px solid var(--home-accent);
    outline-offset: 1px;
}

.home-idea__submit {
    flex: 1 1 11rem;
    padding-inline: 1.25rem;
    white-space: nowrap;
    border-radius: 14px;
    font-weight: 650;
    box-shadow: 0 14px 28px -14px rgba(91, 32, 214, 0.75);
}

.home-idea__arrow {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s var(--home-ease);
}

.home-idea__submit:hover .home-idea__arrow {
    transform: translateX(3px);
}

.home-idea__hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* --- Кнопка «Остановить анимацию» ------------------------------------------ */

.home-still {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text-muted);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.home-still:hover {
    border-color: var(--home-line-strong);
    color: var(--color-text);
}

/* Две полоски — пауза; когда петли остановлены — треугольник. */
.home-still__icon {
    width: 0.625rem;
    height: 0.75rem;
    border-inline: 3px solid currentColor;
}

/* В строке ленты на телефоне — только значок: подпись остаётся для
   экранного диктора, но не выталкивает заголовок ленты в две строки. */
@media (max-width: 30rem) {
    .home-still--small {
        justify-content: center;
        min-width: 2.75rem;
        padding: 0;
    }

    .home-still--small .home-still__text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* Подпись по состоянию: петли идут — «Остановить», стоят — «Включить».
   До home.js кнопка уже на месте (так под неё не прыгает страница) и
   говорит «Остановить»: скрипт сейчас включит петли. «Включить» — только
   когда скрипт работает, а петли стоят. */
.home-still__off,
.hp-motion:not(.hp-loop) .home-still__on {
    display: none;
}

.hp-motion:not(.hp-loop) .home-still__off {
    display: inline;
}

.hp-motion:not(.hp-loop) .home-still__icon {
    width: 0;
    height: 0;
    border-inline: 0;
    border-left: 0.625rem solid currentColor;
    border-block: 0.375rem solid transparent;
}

/* Подсказки идей и кнопка «Остановить анимацию» стоят в разметке без
   hidden: home.js приезжает после первой отрисовки, и появись они только
   тогда — поле идеи и кнопка «Создать песню» прыгали бы вниз под пальцем.
   Там, где скрипта нет, их убирает CSS: подсказки без него не работают.
   Кнопке движения нечего останавливать и при просьбе обходиться без
   движения — тогда скрипт петли не включает вовсе. */
@media (scripting: none) {
    .home-idea__ideas,
    .home-still {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-still {
        display: none;
    }
}

/* --- Тёмная полоса: российский сервис и оплата ----------------------------- */

.home-band {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(2rem, 1.4rem + 2vw, 3rem);
    /* Сплошной цвет под градиентом — то, с чем сравнивается контраст. */
    background-color: var(--brand-ink);
    background-image: var(--home-night);
    color: var(--home-on-night);
}

/* Косой блик проходит по полосе раз в несколько секунд. */
.home-band::after {
    content: "";
    position: absolute;
    top: -50%;
    bottom: -50%;
    left: 0;
    z-index: -1;
    width: 30%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0));
    transform: translateX(-130%) skewX(-14deg);
    pointer-events: none;
}

.home-band__inner {
    display: grid;
    gap: 1.5rem 3rem;
    align-items: center;
}

@media (min-width: 64rem) {
    .home-band__inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    }
}

.home-band__title {
    max-width: 32ch;
    margin: 0 0 0.625rem;
    font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--home-on-night);
}

.home-band__strong {
    font-weight: 800;
}

.home-band__text {
    max-width: 40rem;
    margin: 0;
    font-size: 0.9375rem;
    color: var(--home-on-night-muted);
}

/*
 * Билет: слева способы оплаты, справа корешок «1 кредит — один запуск».
 * Полупрозрачная подложка — картинкой, а не цветом фона: цвет фона
 * остаётся за полосой, и проверка контраста сравнивает с ним. Вырезы
 * перфорации — маска: сквозь них видна сама полоса, какого бы цвета
 * градиент ни был в этом месте.
 *
 * Ширина корешка — в ch, а не в rem: маске нужна известная ширина, а
 * надпись «1 кредит» в широком системном шрифте (DejaVu Sans) на пятую
 * часть длиннее, чем в Arial, и в корешке фиксированной ширины прилипала
 * к правому краю. ch — ширина цифры того же шрифта: корешок растёт вместе
 * с надписью, в узком шрифте остаётся прежним.
 */
.home-ticket {
    --stub: calc(12.5ch + 1.75rem);
    --notch: 0.75rem;
    --cut: radial-gradient(circle at calc(100% - var(--stub)) 0, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) top / 100% 51% no-repeat,
        radial-gradient(circle at calc(100% - var(--stub)) 100%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) bottom / 100% 51% no-repeat;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--stub);
    max-width: 38rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    background-image: linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
    -webkit-mask: var(--cut);
    mask: var(--cut);
    transition: transform 0.4s var(--home-ease);
}

.home-ticket:hover {
    transform: translateY(-3px);
}

.home-ticket__main {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    padding: 1.125rem 1.25rem;
}

.home-ticket__label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--home-on-night-muted);
}

.home-ticket__plain {
    margin: 0;
    font-weight: 650;
}

.home-ticket__stub {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.125rem;
    padding: 1rem 0.75rem;
    border-left: 2px dashed rgba(255, 255, 255, 0.34);
    text-align: center;
}

.home-ticket__big {
    margin: 0;
    white-space: nowrap;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--home-on-night);
}

.home-ticket__small {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--home-on-night-muted);
}

/* На узком экране корешок уходит вниз, вырезы — на боковые края. */
@media (max-width: 33.99rem) {
    .home-ticket {
        --stub: 4.25rem;
        --cut: radial-gradient(circle at 0 calc(100% - var(--stub)), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
            radial-gradient(circle at 100% calc(100% - var(--stub)), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto var(--stub);
    }

    .home-ticket__stub {
        grid-auto-flow: column;
        justify-content: center;
        align-items: baseline;
        gap: 0.625rem;
        padding: 0 1rem;
        border-top: 2px dashed rgba(255, 255, 255, 0.34);
        border-left: 0;
    }
}

/* Логотипы оплаты (.paylist) — в app.css: они есть и на страницах без
   этого файла — тарифах и оплате в кабинете. */

/* --- Карточки песен (главная, «Примеры», страницы поводов) ----------------- */

.song-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/*
 * На телефоне витрина главной — лента с прокруткой вбок: шесть обложек
 * столбиком заняли бы шесть экранов. Лента выходит под край ровно на
 * ширину отступа контейнера — страница от этого не шире.
 */
@media (max-width: 47.99rem) {
    .song-tiles--rail {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: min(80%, 18rem);
        gap: 1rem;
        margin-inline: calc(-1 * var(--space-5));
        padding: 0.5rem var(--space-5) 1.25rem;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--space-5);
        scrollbar-width: thin;
    }

    .song-tiles--rail > .song-tile {
        scroll-snap-align: start;
    }
}

@media (min-width: 48rem) {
    .song-tiles--rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Кнопки и шкала ленты — только на телефоне и только со скриптом
   (hidden снимает home.js). Шкала заполняется по мере прокрутки. */
.home-rail-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 48rem) {
    .home-rail-nav {
        display: none;
    }
}

.home-rail-nav__button {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--home-line-strong);
    border-radius: 50%;
    background: var(--home-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.home-rail-nav__button:hover {
    border-color: var(--home-accent);
    color: var(--home-accent);
}

/* aria-disabled, а не disabled: кнопку в конце ленты нельзя выключать
   по-настоящему — фокус с неё улетел бы на <body>. */
.home-rail-nav__button[aria-disabled="true"] {
    opacity: 0.4;
    cursor: default;
}

.home-rail-nav__button[aria-disabled="true"]:hover {
    border-color: var(--home-line-strong);
    color: var(--color-text);
}

.home-rail-nav__button svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-rail-nav__track {
    flex: 1;
    height: 4px;
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--home-line);
}

.home-rail-nav__fill {
    display: block;
    height: 100%;
    background: var(--brand-gradient);
    transform: scaleX(0.2);
    transform-origin: 0 50%;
    transition: transform 0.3s var(--home-ease);
}

@media (min-width: 64rem) {
    .song-tiles--rail {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.song-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--home-line);
    border-radius: var(--home-radius);
    background: var(--home-surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s var(--home-ease), box-shadow 0.4s var(--home-ease), border-color 0.3s ease;
}

.song-tile:hover,
.song-tile:focus-within {
    border-color: var(--home-line-strong);
    box-shadow: var(--home-shadow-lg);
    transform: translateY(-6px);
}

/*
 * Играющая карточка выделена рамкой: в ленте её видно и краем глаза.
 * Состояние двумя путями: :has() по классу плеера и класс is-playing,
 * который home.js ставит по событиям play/pause/ended, — для браузеров
 * без :has(). Внутри :is() непонятный браузеру :has() просто
 * пропускается, а не отменяет всё правило.
 */
.song-tile:is(.is-playing, :has(.player--playing)) {
    border-color: var(--home-accent);
}

.song-tile__cover {
    position: relative;
    aspect-ratio: 1 / 1;
    margin: 0.625rem 0.625rem 0;
    overflow: hidden;
    border-radius: 14px;
    background: var(--brand-gradient);
    color: #ffffff;
}

/* Когда плеер ожил, вся обложка — кнопка «играть / пауза» (home.js). */
.song-tile.is-playable .song-tile__cover {
    cursor: pointer;
}

.song-tile__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--home-ease);
}

.song-tile:hover .song-tile__image {
    transform: scale(1.06);
}

.song-tile__cover--blank {
    display: grid;
    place-items: center;
}

.song-tile__blank {
    width: 58%;
    height: 58%;
}

/* Шесть вариантов фирменного градиента для песен без обложки: цвета те
   же, меняются угол и точка перехода — соседние карточки различаются. */
.song-tile__cover--tone-1 { background: linear-gradient(200deg, #ff7a62 0%, #ff5a4e 36%, #5b20d6 100%); }
.song-tile__cover--tone-2 { background: linear-gradient(160deg, #5b20d6 0%, #ff5a4e 70%, #ff7a62 100%); }
.song-tile__cover--tone-3 { background: linear-gradient(120deg, #4011aa 0%, #5b20d6 45%, #ff7a62 100%); }
.song-tile__cover--tone-4 { background: linear-gradient(45deg, #ff5a4e 0%, #5b20d6 60%, #4011aa 100%); }
.song-tile__cover--tone-5 { background: linear-gradient(90deg, #ff7a62 0%, #5b20d6 100%); }

.song-tile__play {
    position: absolute;
    left: 0.875rem;
    bottom: 0.875rem;
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: var(--brand-violet);
    box-shadow: 0 12px 24px -8px rgba(17, 19, 26, 0.55);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: opacity 0.3s ease, transform 0.4s var(--home-ease);
}

.song-tile:hover .song-tile__play,
.song-tile:is(.is-playing, :has(.player--playing)) .song-tile__play {
    opacity: 1;
    transform: none;
}

/* На сенсорном экране наведения нет — кнопка видна всегда. */
@media (hover: none) {
    .song-tile__play {
        opacity: 1;
        transform: none;
    }
}

.song-tile__icon {
    width: 1.375rem;
    height: 1.375rem;
}

.song-tile__icon--pause,
.song-tile:is(.is-playing, :has(.player--playing)) .song-tile__icon--play {
    display: none;
}

.song-tile:is(.is-playing, :has(.player--playing)) .song-tile__icon--pause {
    display: block;
}

/* Играющая песня узнаётся издалека: столбики на обложке. */
.song-tile__eq {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: none;
    align-items: flex-end;
    gap: 3px;
    height: 2rem;
    padding: 0.4375rem 0.625rem;
    border-radius: var(--radius-full);
    background: #11131a;
}

.song-tile:is(.is-playing, :has(.player--playing)) .song-tile__eq {
    display: inline-flex;
}

.song-tile__eq i {
    width: 4px;
    height: 100%;
    border-radius: 2px;
    background: #ffffff;
    transform-origin: bottom;
    transform: scaleY(0.6);
}

.song-tile__time {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    background: #11131a;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.song-tile__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    padding: 0.875rem 1.125rem 1rem;
}

.song-tile__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Отступы по вертикали — цель нажатия не меньше 24 px (WCAG 2.5.8). */
.song-tile__link {
    display: inline-block;
    padding-block: 0.1875rem;
    color: var(--color-text);
    text-decoration: none;
}

.song-tile__link:hover {
    color: var(--home-accent);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Стиль уже обрезан по слову в шаблоне; в карточке — до двух строк,
   чтобы обрезка не случилась второй раз посреди слова. */
.song-tile__style {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Общий плеер внутри карточки: обложка и название уже есть выше. */
.song-tile__player {
    margin-top: auto;
    padding-top: 0.625rem;
}

.song-tile .player {
    padding: 0;
    border: 0;
    background: none;
}

.song-tile .player__art,
.song-tile .player__title,
.song-tile .player__subtitle {
    display: none;
}

.song-tile .player__button {
    width: 2.75rem;
    height: 2.75rem;
}

/* Узкая карточка — ползунок на своей строке, как у плеера на телефоне
   (app.css): кнопка, два времени и ползунок в ряд требуют около 14 rem, а
   в три колонки на планшете карточке их не хватает, и время вылезало за
   край. Ширина берётся у самой карточки, а не у окна: колонка зависит от
   сетки страницы. */
.song-tile__player {
    container-type: inline-size;
}

@container (max-width: 14.5rem) {
    .song-tile .player__controls {
        flex-wrap: wrap;
        gap: 0.5rem 0.625rem;
    }

    .song-tile .player__seek {
        order: 1;
        flex-basis: 100%;
        min-width: 0;
    }

    .song-tile [data-player-total] {
        margin-left: auto;
    }
}

.home-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Картинка слева от номера и названия, текст — во всю ширину карточки:
   в узкой колонке рядом с картинкой он рассыпался бы на восемь строк. */
.home-step {
    --step-tint: var(--home-tint-coral);
    position: relative;
    display: grid;
    grid-template-columns: clamp(4.5rem, 1.5rem + 14vw, 7rem) minmax(0, 1fr);
    column-gap: 0.875rem;
    grid-template-areas:
        "art num"
        "art title"
        "text text";
    grid-template-rows: auto auto 1fr;
    padding: 0.875rem;
    border: 1px solid var(--home-line);
    border-radius: 18px;
    background: var(--home-surface);
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.home-step--2 { --step-tint: var(--home-tint-violet); }
.home-step--3 { --step-tint: var(--home-tint-sun); }
.home-step--4 { --step-tint: var(--home-tint-pink); }

.home-step__art {
    grid-area: art;
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    background: var(--step-tint);
}

.home-step__num {
    grid-area: num;
    align-self: end;
    display: block;
    margin-bottom: 0.125rem;
    font-size: 0.8125rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
    color: var(--home-accent);
}

.home-step__num svg {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--color-success);
}

.home-step__title {
    grid-area: title;
    margin: 0 0 0.25rem;
    font-size: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.home-step__text {
    grid-area: text;
    max-width: 30rem;
    margin: 0.625rem 0 0;
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.home-step--result {
    display: block;
    margin-top: 0.75rem;
    padding: 1.125rem 1.25rem;
    border-color: var(--home-line-strong);
    background: var(--home-paper);
}

/* Планшет: две колонки карточек, картинка — шапкой во всю ширину. */
@media (min-width: 40rem) and (max-width: 59.99rem) {
    .home-step {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "art" "num" "title" "text";
        grid-template-rows: auto auto auto 1fr;
    }

    .home-step__art {
        margin-bottom: 0.75rem;
    }

    .home-step__text {
        margin-top: 0;
    }
}

/* --- Иллюстрации шагов ------------------------------------------------------ */

.art-blob { fill: var(--home-surface); opacity: 0.55; }
.art-bubble { fill: var(--home-surface); stroke: var(--home-accent); stroke-width: 3; }
.art-heart { fill: var(--brand-coral); }
.art-spark { fill: var(--home-sun); }
.art-spark--2 { fill: var(--home-shape-violet); }
.art-spark--3 { fill: var(--brand-coral); }
.art-page { fill: var(--home-surface); stroke: var(--home-line-strong); stroke-width: 2; }
.art-rings circle { fill: var(--step-tint); stroke: var(--home-accent); stroke-width: 2.5; }

/* pathLength="1": штрих длиной в линию — она «дописывается», когда
   сдвиг штриха уходит в ноль. Без анимации линия нарисована целиком. */
.art-line {
    fill: none;
    stroke: var(--home-accent);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 1 1;
}

.art-line--2,
.art-line--4 { stroke: var(--home-line-strong); }
.art-pen__body { fill: var(--home-sun); }
.art-pen__tip { fill: var(--brand-ink); }
.art-pen__cap { fill: var(--brand-coral); }
.art-panel { fill: var(--home-vinyl); }
.art-bar { fill: url(#hs-grad); }
.art-note { fill: var(--home-shape-violet); }
.art-note--2 { fill: var(--brand-coral); }
.art-box { fill: var(--brand-violet); }
.art-lid__top { fill: #6c35e8; }
.art-ribbon { fill: var(--home-sun); }
.art-bow { fill: var(--home-sun); stroke: #d99a12; stroke-width: 2; }
.art-tag__string { fill: none; stroke: var(--color-text-muted); stroke-width: 2; }
.art-tag__card { fill: var(--home-paper); stroke: var(--home-accent); stroke-width: 2; }
.art-tag__text { font: 800 14px var(--font-sans); fill: var(--color-text); }
.art-bit { fill: var(--brand-coral); }
.art-bit--2,
.art-bit--5 { fill: var(--home-shape-violet); }
.art-bit--3 { fill: var(--home-sun); }
.art-bit--4 { fill: var(--home-pink); }

/* Точки вращения — по рамке фигуры или в координатах рисунка: иначе
   браузер крутит фигуру вокруг угла всего SVG. */
.art-pop { transform-box: fill-box; transform-origin: 30% 100%; }
.art-beat,
.art-note,
.art-bit,
.art-spark { transform-box: fill-box; transform-origin: center; }
.art-pen { transform-box: view-box; transform-origin: 170px 130px; }
.art-bar { transform-box: fill-box; transform-origin: 50% 100%; }
.art-lid { transform-box: fill-box; transform-origin: 10% 100%; }
.art-tag { transform-box: view-box; transform-origin: 160px 100px; }

/* --- Поводы ---------------------------------------------------------------- */

.home-occasions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* У каждого повода свой оттенок: пастельная заливка сверху уходит в
   цвет карточки, и под текстом фон уже ровный. */
.home-occasion { --occ-tint: var(--home-tint-coral); }
.home-occasion--violet { --occ-tint: var(--home-tint-violet); }
.home-occasion--sun { --occ-tint: var(--home-tint-sun); }
.home-occasion--pink { --occ-tint: var(--home-tint-pink); }
.home-occasion--mint { --occ-tint: var(--home-tint-mint); }

.home-occasion__link {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: var(--home-radius);
    background-color: var(--home-surface);
    background-image: linear-gradient(165deg, var(--occ-tint) 0%, var(--occ-tint) 18%, rgba(255, 255, 255, 0) 58%);
    color: var(--color-text);
    text-decoration: none;
    transition: transform 0.4s var(--home-ease), box-shadow 0.4s var(--home-ease), border-color 0.3s ease;
}

.home-occasion__link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(255, 122, 98, 0.16), rgba(255, 122, 98, 0) 55%),
        radial-gradient(100% 80% at 0% 100%, rgba(91, 32, 214, 0.12), rgba(91, 32, 214, 0) 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.home-occasion__link:hover,
.home-occasion__link:focus-visible {
    border-color: var(--home-line-strong);
    box-shadow: var(--home-shadow);
    color: var(--color-text);
    transform: translateY(-4px);
}

.home-occasion__link:hover::before,
.home-occasion__link:focus-visible::before {
    opacity: 1;
}

.home-occasion__icon {
    display: block;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
    transition: transform 0.45s var(--home-ease);
}

/* На телефоне карточки поводов — строками со значком слева: шесть
   карточек в полный рост заняли бы три экрана. */
@media (max-width: 39.99rem) {
    .home-occasions {
        gap: 0.75rem;
    }

    .home-occasion__link {
        display: grid;
        grid-template-columns: 3rem minmax(0, 1fr);
        column-gap: 1rem;
        padding: 1.125rem;
    }

    .home-occasion__icon {
        grid-row: 1 / span 3;
        width: 3rem;
        height: 3rem;
        margin: 0;
    }

    .home-occasion__text {
        margin-bottom: 0.5rem;
    }
}

/* Цвета значков поводов. */
.si-coral { fill: var(--brand-coral); }
.si-violet { fill: var(--home-shape-violet); }
.si-paper { fill: var(--home-surface); stroke: var(--color-text); stroke-width: 2.2; stroke-linejoin: round; }
.si-cream { fill: none; stroke: var(--home-surface); stroke-width: 2.5; stroke-linecap: round; }
.si-flame { fill: #ffab1f; }
.si-ring { fill: none; stroke: #e0a41c; stroke-width: 4; }
.si-ring--violet { stroke: var(--home-shape-violet); }
.si-gem,
.si-heart { fill: var(--brand-coral); }
.si-spark { fill: var(--home-sun); }
.si-string { fill: none; stroke: var(--color-text-muted); stroke-width: 1.8; stroke-linecap: round; }
.si-shine { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 2; stroke-linecap: round; }
.si-stem { fill: #2f9e6a; stroke: #2f9e6a; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.si-line { fill: none; stroke: var(--color-text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* Значки сценариев и руководств (partials.occasion_icon): кружки, мегафон,
   микрофон, джойстик, блокнот. */
.si-sun { fill: var(--home-sun); }
.si-note { fill: var(--home-shape-violet); }
.si-waves { fill: none; stroke: var(--home-shape-violet); stroke-width: 2.2; stroke-linecap: round; }
.si-cream--bold { stroke-width: 3; }
.si-line--thin { stroke-width: 1.8; }

.home-occasion__link:hover .home-occasion__icon {
    transform: rotate(-8deg) scale(1.08);
}

.home-occasion__title {
    margin: 0 0 0.5rem;
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.home-occasion__text {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.home-occasion__more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 650;
    color: var(--home-accent);
}

.home-occasion__more::after {
    content: "→";
    transition: transform 0.3s var(--home-ease);
}

.home-occasion__link:hover .home-occasion__more::after {
    transform: translateX(4px);
}

/* --- Частые вопросы -------------------------------------------------------- */

.home-faq {
    display: grid;
    gap: 2rem 4rem;
}

@media (min-width: 60rem) {
    .home-faq {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        align-items: start;
    }

    .home-faq__aside {
        position: sticky;
        top: 6rem;
    }
}

.home-faq__aside .home-title {
    margin-bottom: 1rem;
}

.home-faq__list {
    border-top: 1px solid var(--home-line);
}

.home-faq__item {
    border-bottom: 1px solid var(--home-line);
}

.home-faq__item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 3.5rem;
    padding: 1.125rem 0;
    font-size: 1.0625rem;
    font-weight: 650;
    line-height: 1.4;
    list-style: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.home-faq__item summary::-webkit-details-marker {
    display: none;
}

/* Плюс, который поворотом становится крестиком. */
.home-faq__item summary::after {
    content: "";
    flex: none;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--home-line-strong);
    border-radius: 50%;
    background:
        linear-gradient(currentColor, currentColor) center / 0.75rem 1.5px no-repeat,
        linear-gradient(currentColor, currentColor) center / 1.5px 0.75rem no-repeat;
    transition: transform 0.35s var(--home-ease), border-color 0.2s ease;
}

.home-faq__item summary:hover {
    color: var(--home-accent);
}

.home-faq__item[open] summary::after {
    border-color: var(--home-accent);
    transform: rotate(45deg);
}

.home-faq__item p {
    margin: 0 0 1.25rem;
    padding-right: 3.5rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

/* --- Финальный призыв ------------------------------------------------------ */

.home-cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(4.5rem, 3rem + 5vw, 8rem);
    background-color: var(--brand-ink);
    background-image: linear-gradient(135deg, #0e0f17 0%, #1d1146 55%, #34108f 100%);
    color: var(--home-on-night);
    text-align: center;
}

.home-cta__glow {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.home-cta .home-orb--coral {
    top: -18rem;
    right: -12rem;
    width: 38rem;
    height: 38rem;
}

.home-cta .home-orb--coral::before {
    background: radial-gradient(closest-side, rgba(255, 90, 78, 0.42), rgba(255, 90, 78, 0));
}

.home-cta .home-orb--violet {
    bottom: -26rem;
    left: -14rem;
    width: 46rem;
    height: 46rem;
}

.home-cta .home-orb--violet::before {
    background: radial-gradient(closest-side, rgba(166, 139, 255, 0.38), rgba(166, 139, 255, 0));
}

.home-cta__wave {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: -1;
    width: 100%;
    height: 38%;
    fill: #ffffff;
    opacity: 0.06;
}

.home-cta__wave rect {
    transform-box: fill-box;
    transform-origin: center;
}

.home-cta__inner {
    position: relative;
    max-width: 46rem;
}

.home-cta__title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 1.2rem + 3.2vw, 3.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--home-on-night);
}

.home-cta__text {
    max-width: 34rem;
    margin: 0 auto 2rem;
    font-size: 1.125rem;
    color: var(--home-on-night-muted);
}

.home-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 0;
}

.home-cta__button,
.home-cta__ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
    padding: 0 2rem;
    border-radius: 14px;
    font-size: 1.0625rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.3s var(--home-ease), box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Белая кнопка с фиолетовой надписью — 8:1, и на тёмной полосе она
   самое яркое пятно. */
.home-cta__button {
    background: #ffffff;
    color: var(--brand-violet);
    box-shadow: 0 18px 40px -16px rgba(255, 90, 78, 0.75);
}

.home-cta__button:hover {
    color: var(--brand-violet-dark);
    box-shadow: 0 22px 48px -14px rgba(255, 90, 78, 0.9);
    transform: translateY(-2px);
}

.home-cta__ghost {
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--home-on-night);
}

.home-cta__ghost:hover {
    background-image: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1));
    color: var(--home-on-night);
    transform: translateY(-2px);
}

/* ==========================================================================
   Движение. Всё ниже работает только с классами от home.js.
   ========================================================================== */

/* Подпись раздела: линия прочерчивается, когда раздел появился. */
.has-reveal .reveal .home-kicker__line {
    transform: scaleX(0);
    transition: transform 0.9s var(--home-ease) 0.2s;
}

.has-reveal .reveal.is-visible .home-kicker__line {
    transform: none;
}

/*
 * Карточки в сетках появляются лесенкой. Анимацией с заполнением
 * backwards, а не переходом: переход с задержкой остался бы на карточке
 * и после появления, и подъём при наведении запаздывал бы на полсекунды.
 */
.has-reveal .reveal:not(.is-visible) > li {
    opacity: 0;
}

.has-reveal .reveal.is-visible > li {
    animation: home-rise 0.7s var(--home-ease) backwards;
}

.has-reveal .reveal.is-visible > li:nth-child(2) { animation-delay: 0.07s; }
.has-reveal .reveal.is-visible > li:nth-child(3) { animation-delay: 0.14s; }
.has-reveal .reveal.is-visible > li:nth-child(4) { animation-delay: 0.21s; }
.has-reveal .reveal.is-visible > li:nth-child(5) { animation-delay: 0.28s; }
.has-reveal .reveal.is-visible > li:nth-child(n + 6) { animation-delay: 0.35s; }

/* Бесконечные петли: только с .hp-loop и только пока блок на экране. */
.hp-loop .home-hero.is-live .home-eyebrow__pulse::after {
    animation: home-ping 2.4s ease-out infinite;
}

.hp-loop .home-hero.is-live .home-orb::before,
.hp-loop .home-cta.is-live .home-orb::before {
    animation: home-drift 16s ease-in-out infinite alternate;
}

.hp-loop .home-hero.is-live .home-orb--violet::before,
.hp-loop .home-cta.is-live .home-orb--violet::before {
    animation-duration: 21s;
    animation-direction: alternate-reverse;
}

.hp-loop .home-band.is-live::after {
    animation: home-sheen 9s ease-in-out infinite;
}

.hp-loop .song-tile:is(.is-playing, :has(.player--playing)) .song-tile__eq i {
    animation: home-eq 0.8s ease-in-out infinite alternate;
}

.song-tile__eq i:nth-child(2) { animation-delay: -0.3s; }
.song-tile__eq i:nth-child(3) { animation-delay: -0.6s; }
.song-tile__eq i:nth-child(4) { animation-delay: -0.15s; }

.hp-loop .home-cta.is-live .home-cta__wave rect {
    animation: home-wave 2.6s ease-in-out infinite alternate;
}

.home-cta__wave rect:nth-child(4n + 1) { animation-delay: -0.4s; }
.home-cta__wave rect:nth-child(4n + 2) { animation-delay: -1.1s; }
.home-cta__wave rect:nth-child(4n + 3) { animation-delay: -1.8s; }
.home-cta__wave rect:nth-child(4n + 4) { animation-delay: -0.7s; }

.hp-motion .home-faq__item[open] p {
    animation: home-rise 0.45s var(--home-ease);
}

/* Эквалайзер первого экрана. */
.hp-loop .home-hero.is-live .home-hero__bar {
    animation: home-eq 1.4s ease-in-out infinite alternate;
}

/*
 * Картинки шагов: у каждой своё маленькое действие, пока шаг на экране
 * (класс is-live ставит home.js). Разовое — сердце появляется, строки
 * дописываются, крышка подарка приоткрывается — под .hp-motion; петли —
 * под .hp-loop, их снимает кнопка «Остановить анимацию».
 */
.hp-motion .home-step.is-live .art-pop { animation: home-art-pop 0.8s var(--home-bounce) 0.2s backwards; }
.hp-motion .home-step.is-live .art-line { animation: home-draw 0.6s var(--home-ease) 0.3s backwards; }
.hp-motion .home-step.is-live .art-line--2 { animation-delay: 0.55s; }
.hp-motion .home-step.is-live .art-line--3 { animation-delay: 0.8s; }
.hp-motion .home-step.is-live .art-line--4 { animation-delay: 1.05s; }
.hp-motion .home-step.is-live .art-lid { animation: home-lid 1.3s var(--home-bounce) 0.35s both; }
.hp-motion .home-step.is-live .art-bit { animation: home-bit 1s var(--home-ease) 0.55s backwards; }
.hp-motion .home-step.is-live .art-bit--2 { animation-delay: 0.62s; }
.hp-motion .home-step.is-live .art-bit--3 { animation-delay: 0.7s; }
.hp-motion .home-step.is-live .art-bit--4 { animation-delay: 0.66s; }
.hp-motion .home-step.is-live .art-bit--5 { animation-delay: 0.74s; }

.hp-loop .home-step.is-live .art-beat { animation: home-beat 1.8s ease-in-out 1s infinite; }
.hp-loop .home-step.is-live .art-spark { animation: home-twinkle 2.4s ease-in-out infinite alternate; }
.hp-loop .home-step.is-live .art-spark--2 { animation-delay: -0.8s; }
.hp-loop .home-step.is-live .art-spark--3 { animation-delay: -1.6s; }
.hp-loop .home-step.is-live .art-pen { animation: home-pen 2.6s ease-in-out 0.3s infinite alternate; }
.hp-loop .home-step.is-live .art-bar { animation: home-eq 1.1s ease-in-out infinite alternate; }
.hp-loop .home-step.is-live .art-bar--2 { animation-delay: -0.3s; }
.hp-loop .home-step.is-live .art-bar--3 { animation-delay: -0.75s; }
.hp-loop .home-step.is-live .art-bar--4 { animation-delay: -0.15s; }
.hp-loop .home-step.is-live .art-bar--5 { animation-delay: -0.6s; }
.hp-loop .home-step.is-live .art-bar--6 { animation-delay: -0.95s; }
.hp-loop .home-step.is-live .art-bar--7 { animation-delay: -0.45s; }
.hp-loop .home-step.is-live .art-note { animation: home-note 2.2s ease-in-out infinite alternate; }
.hp-loop .home-step.is-live .art-note--2 { animation-delay: -1.1s; }
.hp-loop .home-step.is-live .art-tag { animation: home-swing 2.8s ease-in-out 1.2s infinite alternate; }

@keyframes home-rise {
    from { opacity: 0; transform: translateY(1.25rem); }
    to { opacity: 1; transform: none; }
}

@keyframes home-ping {
    0% { opacity: 0.6; transform: scale(1); }
    80%, 100% { opacity: 0; transform: scale(2.8); }
}

@keyframes home-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(6%, 8%, 0) scale(1.12); }
}

@keyframes home-eq {
    from { transform: scaleY(0.18); }
    to { transform: scaleY(var(--h, 1)); }
}

@keyframes home-sheen {
    0% { transform: translateX(-130%) skewX(-14deg); }
    55%, 100% { transform: translateX(430%) skewX(-14deg); }
}

@keyframes home-wave {
    from { transform: scaleY(0.3); }
    to { transform: scaleY(1); }
}

@keyframes home-art-pop {
    from { opacity: 0; transform: scale(0.4) rotate(-8deg); }
}

@keyframes home-draw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes home-lid {
    0% { transform: none; }
    45% { transform: translateY(-22px) rotate(-12deg); }
    100% { transform: translateY(-7px) rotate(-5deg); }
}

@keyframes home-bit {
    from { opacity: 0; transform: translateY(34px) scale(0.2); }
}

@keyframes home-beat {
    0%, 60%, 100% { transform: scale(1); }
    15% { transform: scale(1.16); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
}

@keyframes home-twinkle {
    from { opacity: 0.35; transform: scale(0.7) rotate(0deg); }
    to { opacity: 1; transform: scale(1.1) rotate(25deg); }
}

@keyframes home-pen {
    from { transform: translate(-10px, 6px) rotate(-5deg); }
    to { transform: translate(4px, -2px) rotate(3deg); }
}

@keyframes home-note {
    from { transform: translateY(4px) rotate(-8deg); }
    to { transform: translateY(-6px) rotate(10deg); }
}

@keyframes home-swing {
    from { transform: rotate(-5deg); }
    to { transform: rotate(6deg); }
}

/* --- Тёмная тема: то, что не решают токены --------------------------------- */

@media (prefers-color-scheme: dark) {
    :where(:root:not([data-theme="light"])) .home-hero .home-orb--coral::before {
        background: radial-gradient(closest-side, rgba(255, 122, 98, 0.22), rgba(255, 90, 78, 0));
    }

    :where(:root:not([data-theme="light"])) .home-hero .home-orb--violet::before {
        background: radial-gradient(closest-side, rgba(166, 139, 255, 0.2), rgba(166, 139, 255, 0));
    }

    :where(:root:not([data-theme="light"])) .home-hero__staff {
        opacity: 0.2;
    }

    :where(:root:not([data-theme="light"])) .home-head::before {
        -webkit-text-stroke-color: var(--color-border-strong);
    }

    /* Пастельная заливка поводов на тёмной карточке уходит в прозрачный
       тёмный, а не белый: иначе середина карточки светлела бы. */
    :where(:root:not([data-theme="light"])) .home-occasion__link {
        background-image: linear-gradient(165deg, var(--occ-tint) 0%, var(--occ-tint) 18%, rgba(29, 31, 44, 0) 58%);
    }

    :where(:root:not([data-theme="light"])) .home-hero__eq {
        opacity: 0.4;
    }
}

/* То же для тёмной темы, выбранной переключателем в шапке. */
:where(:root[data-theme="dark"]) .home-hero .home-orb--coral::before {
    background: radial-gradient(closest-side, rgba(255, 122, 98, 0.22), rgba(255, 90, 78, 0));
}

:where(:root[data-theme="dark"]) .home-hero .home-orb--violet::before {
    background: radial-gradient(closest-side, rgba(166, 139, 255, 0.2), rgba(166, 139, 255, 0));
}

:where(:root[data-theme="dark"]) .home-hero__staff {
    opacity: 0.2;
}

:where(:root[data-theme="dark"]) .home-head::before {
    -webkit-text-stroke-color: var(--color-border-strong);
}

:where(:root[data-theme="dark"]) .home-occasion__link {
    background-image: linear-gradient(165deg, var(--occ-tint) 0%, var(--occ-tint) 18%, rgba(29, 31, 44, 0) 58%);
}

:where(:root[data-theme="dark"]) .home-hero__eq {
    opacity: 0.4;
}

/* --- Просьба не двигать интерфейс (§18) ------------------------------------ */

/*
 * Скрипт в этом режиме не ставит ни одного класса, так что правила выше
 * и так не срабатывают. Здесь — страховка для того, что двигается без
 * него: подъём карточек при наведении и повороты иконок.
 */
@media (prefers-reduced-motion: reduce) {
    .home *,
    .home *::before,
    .home *::after,
    .examples *,
    .examples *::before,
    .examples *::after,
    .landing *,
    .landing *::before,
    .landing *::after {
        animation: none !important;
        transition: none !important;
    }

    .song-tile:hover,
    .song-tile:focus-within,
    .home-occasion__link:hover,
    .home-occasion__link:focus-visible,
    .paylist__plate:hover,
    .home-ticket:hover,
    .song-tile:hover .song-tile__image,
    .home-occasion__link:hover .home-occasion__icon,
    .home-cta__button:hover,
    .home-cta__ghost:hover {
        transform: none;
    }

    .home-band::after,
    .home-progress {
        display: none;
    }

    /* Просьбу могут включить при открытой странице: скрытые до
       появления карточки должны показаться сразу, без перезагрузки. */
    .has-reveal .reveal:not(.is-visible) > li {
        opacity: 1;
    }
}

/* На бумаге прокрутки нет — всё, что ждало появления, печатается. */
@media print {
    .has-reveal .reveal:not(.is-visible) > li {
        opacity: 1 !important;
    }

    .home-progress,
    .home-rail-nav {
        display: none !important;
    }
}
