/* ============================================================
   landing.css — общие стили для вариантов главной страницы
   Использует переменные из styles.css (#0b0e12, #f0b27a)
   Современные фичи: @property, scroll-driven animations,
   :has(), clamp(), view transitions.
   ============================================================ */

/* ---------- CSS @property: анимируемые градиенты ---------- */
@property --aurora-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@property --glow-x {
    syntax: '<percentage>';
    initial-value: 30%;
    inherits: false;
}
@property --glow-y {
    syntax: '<percentage>';
    initial-value: 20%;
    inherits: false;
}

/* ---------- View Transitions между страницами ---------- */
::view-transition-old(root) {
    animation: vt-fade-out 0.35s ease-in forwards;
}
::view-transition-new(root) {
    animation: vt-slide-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
@keyframes vt-fade-out {
    to { opacity: 0; transform: scale(0.98); filter: blur(6px); }
}
@keyframes vt-slide-in {
    from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: none; }
}

/* ============================================================
   ОБЩЕЕ: секции лендинга
   ============================================================ */
.landing-section {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 5rem) 1.5rem;
}

.landing-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #f0b27a;
    padding: 0.35rem 0.9rem;
    border: 1px solid rgba(240, 178, 122, 0.35);
    border-radius: 999px;
    background: rgba(240, 178, 122, 0.07);
}

.landing-title {
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 1rem 0 0.75rem;
    background: linear-gradient(120deg, #f0f2f5 30%, #f0b27a 70%, #e88bff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-subtitle {
    color: #aab3c0;
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 640px;
}

/* ---------- Появление при скролле (IntersectionObserver) ---------- */
.reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- Scroll-driven progress-линия (чистый CSS) ---------- */
.landing-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: 0 50%;
    background: linear-gradient(90deg, #f0b27a, #e88bff, #667eea);
    z-index: 1100;
    animation: progress-grow linear both;
    animation-timeline: scroll(root block);
    pointer-events: none;
}
@keyframes progress-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ============================================================
   HERO (общий)
   ============================================================ */
.hero-screen {
    position: relative;
    min-height: 92svh;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
    padding: 6rem 1.5rem 3rem;
}

.hero-aurora {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(45% 55% at var(--glow-x) var(--glow-y), rgba(232, 139, 255, 0.18), transparent 70%),
        radial-gradient(40% 50% at 70% 80%, rgba(102, 126, 234, 0.16), transparent 70%),
        radial-gradient(35% 45% at 20% 70%, rgba(240, 178, 122, 0.14), transparent 70%);
    animation: aurora-drift 14s ease-in-out infinite alternate;
    filter: blur(10px);
    z-index: 0;
    pointer-events: none;
}
@keyframes aurora-drift {
    0%   { --glow-x: 25%; --glow-y: 20%; transform: rotate(var(--aurora-angle)) scale(1); }
    50%  { --glow-x: 70%; --glow-y: 45%; }
    100% { --glow-x: 45%; --glow-y: 75%; transform: rotate(calc(var(--aurora-angle) + 12deg)) scale(1.08); }
}

.hero-notes {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.hero-note {
    position: absolute;
    bottom: -3rem;
    color: rgba(240, 178, 122, 0.35);
    animation: note-float linear infinite;
    user-select: none;
}
@keyframes note-float {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(-110svh) rotate(320deg); opacity: 0; }
}

/* .hero-inner — контейнер героя во всю ширину (этап 5.4-M):
   баннеры занимают всю ширину экрана, а текст живёт в отдельном
   блоке .hero-copy с ограниченной шириной. */
.hero-inner { position: relative; z-index: 1; width: 100%; }
.hero-copy { max-width: 860px; margin: 0 auto; }

.hero-title {
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 1.2rem 0 1.4rem;
}

/* Печатающийся текст */
.typewriter-caret {
    display: inline-block;
    width: 3px;
    height: 1em;
    margin-left: 4px;
    background: #f0b27a;
    vertical-align: -0.12em;
    animation: caret-blink 0.9s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.hero-tagline {
    color: #b0c2d1;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    max-width: 620px;
    margin: 0 auto 2.2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-glow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2.1rem;
    border: none;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0b0e12;
    background: linear-gradient(135deg, #f0b27a, #ffd9a8);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
    box-shadow: 0 0 0 rgba(240, 178, 122, 0);
    overflow: hidden;
}
.btn-glow:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 40px rgba(240, 178, 122, 0.35);
}
.btn-glow::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-20deg);
    animation: btn-shine 3.2s ease-in-out infinite;
}
@keyframes btn-shine {
    0%, 60% { left: -80%; }
    100% { left: 160%; }
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2rem;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #f0f2f5;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    transition: 0.25s;
    cursor: pointer;
}
.btn-ghost:hover {
    border-color: #f0b27a;
    color: #f0b27a;
    transform: translateY(-3px);
}

.scroll-hint {
    position: absolute;
    bottom: 1.6rem;
    left: 50%;
    transform: translateX(-50%);
    color: #6b7684;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    z-index: 1;
    animation: hint-bounce 2s ease-in-out infinite;
}
@keyframes hint-bounce { 50% { transform: translate(-50%, 8px); } }

/* ---------- Градиентный разделитель-переход ---------- */
.section-divider {
    height: 120px;
    background: linear-gradient(to bottom, transparent, rgba(240, 178, 122, 0.06));
    clip-path: ellipse(75% 100% at 50% 0%);
    margin-top: -1px;
}

/* ============================================================
   V1: «Как это работает»
   ============================================================ */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.4rem;
    margin-top: 2.5rem;
}
.step-card {
    position: relative;
    padding: 2rem 1.6rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s;
}
.step-card:hover {
    transform: translateY(-6px);
    border-color: rgba(240, 178, 122, 0.45);
}
.step-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 60% at 50% 0%, rgba(240, 178, 122, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.35s;
}
.step-card:hover::before { opacity: 1; }
.step-num {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(180deg, #f0b27a, transparent 85%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.step-card h3 { margin: 0.8rem 0 0.5rem; font-size: 1.2rem; }
.step-card p { color: #aab3c0; font-size: 0.95rem; }
.step-icon { font-size: 1.6rem; color: #f0b27a; margin-bottom: 0.6rem; }

/* ============================================================
   V1: Витрина поэтов
   ============================================================ */
.poets-vitrine {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.4rem;
    margin-top: 2.5rem;
}
.poet-vitrine-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #141922;
}
.poet-vitrine-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s;
}
.poet-vitrine-card:hover img {
    transform: scale(1.07);
    filter: brightness(0.55);
}
.poet-vitrine-info {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.4rem 1.2rem;
    background: linear-gradient(to top, rgba(11, 14, 18, 0.95), transparent);
    transform: translateY(30%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.poet-vitrine-card:hover .poet-vitrine-info { transform: none; }
.poet-vitrine-info h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }
.poet-vitrine-info p {
    color: #aab3c0;
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.4s 0.1s;
}
.poet-vitrine-card:hover .poet-vitrine-info p { opacity: 1; }

/* ---------- Цитата (v1/v2) ---------- */
.quote-block {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    padding: 2.5rem 1rem;
}
.quote-text {
    font-size: clamp(1.3rem, 3vw, 1.9rem);
    font-style: italic;
    line-height: 1.5;
    color: #e8ecf2;
}
.quote-author {
    margin-top: 1.2rem;
    color: #f0b27a;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.85rem;
}
.quote-fade { transition: opacity 0.6s; }
.quote-fade.is-switching { opacity: 0; }

/* ============================================================
   V2: 3D-карусель обложек (coverflow)
   ============================================================ */
.coverflow-stage {
    position: relative;
    height: 380px;
    margin-top: 2.5rem;
    perspective: 1200px;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
}
.coverflow-stage.is-dragging { cursor: grabbing; }
.coverflow-track {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.coverflow-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 240px;
    margin: -160px 0 0 -120px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #141922;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.65s, filter 0.65s;
}
.coverflow-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    pointer-events: none;
}
.coverflow-item .coverflow-caption {
    padding: 0.7rem 0.9rem;
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.coverflow-item.is-active {
    box-shadow: 0 0 0 2px #f0b27a, 0 24px 70px rgba(240, 178, 122, 0.25);
}
.coverflow-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.6rem;
}
.coverflow-arrow {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: #f0f2f5;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.25s;
}
.coverflow-arrow:hover {
    border-color: #f0b27a;
    color: #f0b27a;
    transform: scale(1.08);
}
.coverflow-title {
    text-align: center;
    min-width: 220px;
    font-weight: 600;
    font-size: 1.05rem;
}
.coverflow-title small {
    display: block;
    color: #aab3c0;
    font-weight: 400;
    font-size: 0.85rem;
}

/* ---------- Эквалайзер-визуализатор (v2) ---------- */
.viz-bar-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 70px;
    margin: 2rem auto 0;
    max-width: 640px;
}
.viz-bar {
    flex: 1;
    max-width: 14px;
    height: 100%;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(to top, #667eea, #f0b27a);
    transform-origin: bottom;
    transform: scaleY(0.08);
    transition: transform 0.12s ease-out;
}
.viz-bar.idle {
    animation: viz-idle 1.6s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * 0.09s);
}
@keyframes viz-idle {
    from { transform: scaleY(0.1); }
    to { transform: scaleY(calc(0.25 + var(--amp, 0.3))); }
}
.viz-hint {
    text-align: center;
    color: #6b7684;
    font-size: 0.8rem;
    margin-top: 0.7rem;
}

/* ---------- Счётчики статистики (v2) ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.2rem;
    margin-top: 2.5rem;
    text-align: center;
}
.stat-card {
    padding: 1.8rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.stat-value {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    background: linear-gradient(135deg, #f0b27a, #e88bff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}
.stat-label { color: #aab3c0; font-size: 0.9rem; margin-top: 0.4rem; }

/* ============================================================
   V3: Кинематографические «главы»
   ============================================================ */
.cinema-scroll {
    height: 100svh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}
.cinema-scroll::-webkit-scrollbar { display: none; }

.chapter {
    position: relative;
    height: 100svh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem;
    overflow: hidden;
}
.chapter-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 1rem;
}
.chapter-num {
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #f0b27a;
    margin-bottom: 1rem;
}
.chapter h2 {
    font-size: clamp(2rem, 6vw, 3.6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.2rem;
}
.chapter p {
    color: #b0c2d1;
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    max-width: 560px;
    margin: 0 auto 1.8rem;
}

/* Скролл-driven появление текста глав (чистый CSS, без JS) */
.chapter-content > * {
    animation: chapter-in linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 35%;
}
@keyframes chapter-in {
    from { opacity: 0; transform: translateY(60px) scale(0.96); filter: blur(8px); }
    to   { opacity: 1; transform: none; filter: none; }
}

/* Фон главы */
.chapter-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.32) saturate(1.1);
    animation: chapter-zoom linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
}
@keyframes chapter-zoom {
    from { transform: scale(1.15); }
    to { transform: scale(1); }
}
.chapter::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(80% 60% at 50% 50%, transparent 30%, rgba(11, 14, 18, 0.9) 100%);
}

/* Специальные фоны глав */
.ch-bg-1 { background-image: linear-gradient(140deg, #1a2030, #2a1f3d, #0b0e12); }
.ch-bg-2 { background-image: linear-gradient(140deg, #231a2e, #3a2430, #0b0e12); }
.ch-bg-3 { background-image: linear-gradient(140deg, #16222e, #1f3140, #0b0e12); }

/* Canvas-частицы */
.particles-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Мини-навигация по главам */
.chapter-dots {
    position: fixed;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 1200;
}
.chapter-dots a {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: 0.3s;
    display: block;
}
.chapter-dots a.active {
    background: #f0b27a;
    transform: scale(1.4);
    box-shadow: 0 0 12px rgba(240, 178, 122, 0.6);
}

/* ============================================================
   Секция «Философия» (v1)
   ============================================================ */
.philosophy {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
}
.philosophy-item { padding-left: 1.2rem; border-left: 2px solid rgba(240, 178, 122, 0.4); }
.philosophy-item h3 { margin-bottom: 0.5rem; }
.philosophy-item p { color: #aab3c0; font-size: 0.95rem; }

/* ============================================================
   Клик-переходы на трек: перехват под View Transition
   ============================================================ */
.songs-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 1rem 0 0;
}

/* ---------- Доступность ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-aurora, .hero-note, .btn-glow::after, .viz-bar.idle,
    .scroll-hint, .chapter-content > *, .chapter-bg {
        animation: none !important;
    }
    .reveal { transition: none; opacity: 1; transform: none; }
}

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 640px) {
    .coverflow-stage { height: 320px; }
    .coverflow-item { width: 180px; margin: -125px 0 0 -90px; }
    .coverflow-item img { height: 180px; }
    .chapter-dots { right: 0.6rem; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   КОМПАКТНАЯ КОМПОНОВКА ГЛАВНОЙ
   hero → витрина (карусель + визуализатор) → цитата → песни
   ============================================================ */
.hero-screen.hero-compact {
    min-height: 68svh;
    /* компактный верх: баннер должен стоять близко к шапке (этап 5.4-M) */
    padding: 2.25rem 1.5rem 1.75rem;
}
.hero-screen.hero-compact .hero-tagline {
    font-size: clamp(0.95rem, 1.9vw, 1.15rem);
    max-width: 620px;
}
.showcase-compact {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
}
.showcase-compact .landing-title {
    margin: 0 0 0.4rem;
}
.quote-compact {
    padding-top: 0.25rem;
    padding-bottom: 0.75rem;
}
.quote-compact .quote-block {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.1rem 1.6rem;
}

/* ============================================================
   POSTРАНИЧНАЯ ЛИСТАЛКА «КАК СТОРИС»
   линейка сегментов сверху + scroll-snap по экранам
   Активируется классом stories-mode на <html> (из landing.js)

   Этап 5.7 (23.11.2026): каждая подстраница занимает РОВНО один
   экран (100svh). Раньше высота была (100svh - шапка), поэтому
   точки привязки стояли ближе экрана и в кадре всегда оставались
   «половинки» двух соседних страниц. Теперь фиксированная шапка и
   подвал перекрывают внутренние отступы СВОЕГО слайда, а не соседний.
   ============================================================ */
html.stories-mode {
    scroll-snap-type: y mandatory;
    /* Страница не листается «постепенно»: колесо/клавиши переключают
       сразу целую подстраницу (см. stories-nav.js), а нативный скролл
       остаётся только внутри подстраницы. Полоса прокрутки скрыта,
       чтобы нельзя было встать между страницами. */
    scrollbar-width: none;
    /* ЕДИНАЯ линия старта контента для всех подстраниц:
       фактическая шапка + зона линейки сегментов (rail top = шапка+10,
       высота сегмента 26px) + зазор 16px. Раньше у каждой секции был
       свой padding-top, из-за чего контент то уезжал ниже «пунктира»,
       то линейка наезжала на заголовок. */
    --stories-content-top: calc(var(--header-h, 130px) + 52px);
}
html.stories-mode::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Шапка больше не сдвигает контент: отступ задаёт сам слайд.
   !important обязателен: index.js на load/resize ставит сюда инлайновый
   margin-top = высота шапки + 20px, и он перебивал бы CSS. */
html.stories-mode .main-content {
    margin-top: 0 !important;
}

html.stories-mode .story-slide {
    box-sizing: border-box;
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    /* верх — единая откалиброванная линия под «пунктиром сториз»,
       низ — резерв под закреплённый подвал */
    padding-top: var(--stories-content-top);
    padding-bottom: calc(var(--site-footer-h, 64px) + 0.6rem);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin-top: 0;
    overflow: hidden;
}

/* Короткие страницы-экраны: контент прижат к верху под шапкой.
   Вертикальное центрирование убрано — на большом экране оно
   «съезжало» вниз (баннер hero оказывался в середине страницы). */
html.stories-mode .story-slide.story-fill {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}


/* страницы с внутренним скроллом (витрина, песни, чат):
   прокручивается только содержимое слайда, сама страница листается целиком */
html.stories-mode .story-slide.story-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* ---------- Уплотнение витрины, чтобы карусель + визуализатор
   гарантированно помещались на один экран ---------- */
/* Витрина: единый верхний отступ задаёт .story-slide. */
html.stories-mode #showcase .landing-title {
    margin: 0 0 0.3rem;
}
html.stories-mode #showcase .coverflow-stage {
    height: 320px;
    margin-top: 0.6rem;
}
html.stories-mode #showcase .coverflow-nav {
    margin-top: 0.7rem;
}
html.stories-mode #showcase .viz-bar-row {
    height: 54px;
    margin: 1rem auto 0;
}
html.stories-mode #showcase .viz-hint {
    margin-top: 0.35rem;
    font-size: 0.72rem;
}

/* ---------- «Лента»: компактная шапка страницы (этап 5.4-M) ----------
   Один ряд карточек должен помещаться в экран ЦЕЛИКОМ — без обрезков.
   landing.js дополнительно скрывает ряды, которые не влезают. */
html.stories-mode #feedPage {
    padding-bottom: calc(var(--site-footer-h, 64px) + 0.8rem);
}
html.stories-mode #feedPage .landing-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin: 0.55rem 0 0.3rem;
}
html.stories-mode #feedPage .feed-grid {
    margin-top: 0.9rem;
}
/* страховка: если даже один ряд не влезает по высоте —
   превращаем карточки в компактный горизонтальный список */
.feed-grid.is-row-compact .feed-card {
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem;
}
.feed-grid.is-row-compact .feed-cover {
    width: 64px;
    height: 64px;
    aspect-ratio: auto;
    border-radius: 12px;
    flex: 0 0 auto;
}
.feed-grid.is-row-compact .feed-body {
    padding: 0;
    gap: 0.1rem;
    min-width: 0;
}
.feed-grid.is-row-compact .feed-meta { display: none; }
.feed-grid.is-row-compact .feed-song-title { font-size: 0.95rem; -webkit-line-clamp: 1; }
.feed-grid.is-row-compact .feed-card .feed-play.play-icon {
    margin-top: 0.2rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
}

/* ---------- Линейка сегментов «как в сторис» ----------
   во всю ширину экрана, крупные зоны попадания курсором/пальцем */
.stories-rail {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 0;
    display: flex;
    align-items: stretch;
    gap: 5px;
    padding: 0;
    background: none;
    border: none;
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.5s ease 0.4s;
    pointer-events: none;
}
html.stories-mode .stories-rail { opacity: 1; }

.story-seg {
    flex: 1 1 0;
    height: 26px;               /* крупная зона клика */
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    pointer-events: auto;
}
/* сама полоска */
.story-seg::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 9px; bottom: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}
.story-seg:hover::after {
    background: rgba(255, 255, 255, 0.55);
    transform: scaleY(1.35);
}
.story-seg.is-active::after {
    background: linear-gradient(90deg, #f0b27a, #e88bff, #667eea);
    box-shadow: 0 0 14px rgba(232, 139, 255, 0.65);
    transform: scaleY(1.35);
}
.story-seg:focus-visible {
    outline: 2px solid #f0b27a;
    outline-offset: 3px;
    border-radius: 8px;
}

/* ---------- Кнопки листания подстраниц «влево/вправо» ----------
   Создаются в landing.js на страницах со .story-slide (замена
   отменённых боковых зон тапа). Вытянутые «призывающие» кнопки
   внизу слева/справа; переливающийся градиент бежит в сторону
   листания: «Назад» — влево, «Вперёд» — вправо. */
.stories-arrow {
    position: fixed;
    bottom: calc(var(--site-footer-h, 64px) + env(safe-area-inset-bottom, 0px) + 14px);
    width: 142px;
    height: 46px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background-color: rgba(14, 14, 24, 0.78);
    background-image: linear-gradient(100deg,
        rgba(240, 178, 122, 0.26) 0%,
        rgba(232, 139, 255, 0.34) 35%,
        rgba(102, 126, 234, 0.30) 60%,
        rgba(240, 178, 122, 0.26) 100%);
    background-size: 220% 100%;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    z-index: 1030;
    opacity: 0.88;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 18px rgba(232, 139, 255, 0.18);
    animation: storiesArrowFlow 3.8s linear infinite;
    transition: opacity 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
html.stories-mode .stories-arrow { display: inline-flex; }
.stories-arrow.prev {
    left: max(16px, env(safe-area-inset-left, 0px));
    animation-direction: reverse;   /* перелив бежит влево */
}
.stories-arrow.next {
    right: max(16px, env(safe-area-inset-right, 0px));
}
@keyframes storiesArrowFlow {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}
.stories-arrow i { font-size: 0.8rem; }
.stories-arrow:hover,
.stories-arrow:focus-visible {
    opacity: 1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 26px rgba(232, 139, 255, 0.45);
    transform: translateY(-2px) scale(1.03);
}
.stories-arrow:focus-visible {
    outline: 2px solid #f0b27a;
    outline-offset: 2px;
}
.stories-arrow:active { transform: translateY(0) scale(0.98); }
.stories-arrow:disabled {
    opacity: 0.24;
    cursor: default;
    pointer-events: none;
    animation: none;
    background-image: linear-gradient(100deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.14));
    box-shadow: none;
}
@media (max-width: 640px) {
    .stories-arrow {
        width: 116px;
        height: 44px;
        padding: 0 12px;
        font-size: 0.8rem;
        gap: 0.35rem;
        opacity: 0.72;
        bottom: calc(var(--site-footer-h, 72px) + env(safe-area-inset-bottom, 0px) + 10px);
    }
    .stories-arrow.prev { left: max(8px, env(safe-area-inset-left, 0px)); }
    .stories-arrow.next { right: max(8px, env(safe-area-inset-right, 0px)); }

    /* Резерв под кнопки: контент секции заканчивается выше них,
       чтобы стрелки не накрывали кнопки действий (CTA). */
    html.stories-mode.stories-arrows-on .story-slide {
        padding-bottom: calc(var(--site-footer-h, 72px) + 76px) !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    .stories-arrow { animation: none; transition: none; }
}

/* ============================================================
   ОБЪЁМНАЯ КАРУСЕЛЬ ПОЭТОВ (страница «Поэты»)
   ============================================================ */
.poets-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.poets-page .landing-title { text-wrap: balance; }

.poets-coverflow-stage {
    position: relative;
    height: 400px;
    margin-top: 1rem;
    perspective: 1200px;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
}
.poets-coverflow-stage.is-dragging { cursor: grabbing; }
.poets-coverflow-track {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.poet-cover-item {
    position: absolute;
    top: 14px;
    left: 50%;
    width: 230px;
    margin-left: -115px;
    text-align: center;
    border-radius: 20px;
    background: rgba(20, 25, 34, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 0.9rem 0.9rem 1.1rem;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.65s, filter 0.65s;
    cursor: pointer;
}
.poet-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 16px;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.25s ease-out;
}
.poet-cover-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    /* отражение под портретом */
    -webkit-box-reflect: below 6px linear-gradient(transparent 62%, rgba(255, 255, 255, 0.16));
}
.poet-cover-item h3 {
    margin: 0.9rem 0 0.2rem;
    font-size: 1.08rem;
    font-weight: 600;
    color: #f0f2f5;
}
.poet-cover-item p {
    font-size: 0.76rem;
    color: #aab3c0;
    line-height: 1.35;
}
.poet-cover-item.is-active {
    border-color: rgba(240, 178, 122, 0.45);
}

/* ---------- «Живая» вращающаяся рамка активного портрета
   (CSS @property + conic-gradient) ---------- */
@property --ring-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
.poet-ring {
    position: absolute;
    inset: -3px;
    border-radius: 18px;
    padding: 3px;
    background: conic-gradient(from var(--ring-angle),
        #f0b27a, #e88bff, #667eea, #f0b27a);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 2;
}
.poet-cover-item.is-active .poet-ring {
    opacity: 1;
    animation: ring-spin 3.6s linear infinite;
}
@keyframes ring-spin {
    to { --ring-angle: 360deg; }
}
.poets-coverflow-caption {
    text-align: center;
    min-width: 220px;
    font-weight: 600;
    font-size: 1.05rem;
    color: #f0f2f5;
}
@media (prefers-reduced-motion: reduce) {
    .poet-cover-item.is-active .poet-ring { animation: none; }
}

/* ---------- Цитаты покрупнее ---------- */
.quote-compact .quote-text {
    font-size: clamp(1.5rem, 3.4vw, 2.4rem);
    line-height: 1.4;
    font-weight: 300;
}
.quote-compact .quote-author {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-top: 1rem;
}

/* ============================================================
   УНИКАЛЬНЫЕ АНИМИРОВАННЫЕ ФОНЫ СТРАНИЦ (data-ambient)
   слова стихов · ноты+слова · пластинки · перья · кавычки · цифры
   ============================================================ */
/* Полноэкранные фоновые слои (fixed) — фон занимает весь экран */
.page-ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.page-ambient.is-active { opacity: 1; }

/* контент страниц и футер всегда поверх фоновых слоёв */
html.stories-mode .main-content,
html.stories-mode .site-footer { position: relative; z-index: 1; }

/* ---------- Плавающий градиент-аврора (палитра задаётся JS) ---------- */
.aurora-layer {
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(38% 42% at 28% 30%, var(--c1, #f0b27a), transparent 70%),
        radial-gradient(34% 40% at 72% 64%, var(--c2, #e88bff), transparent 70%),
        radial-gradient(30% 36% at 55% 18%, var(--c3, #667eea), transparent 70%);
    filter: blur(30px);
    opacity: 0.5;
    animation: aurora-float var(--adur, 22s) ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes aurora-float {
    0%   { transform: translate(-4%, -3%) scale(1) rotate(0deg); }
    50%  { transform: translate(4%, 3%) scale(1.09) rotate(4deg); }
    100% { transform: translate(-2%, 5%) scale(1.05) rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
    .aurora-layer { animation: none; }
}

/* ============================================================
   СТРАНИЦА ПЕСНИ и СТРАНИЦА ПОЭТА (в стиле главной)
   ============================================================ */
/* «Назад» — слева, прямо над обложкой/фото поэта */
.back-link {
    position: static;
    width: min(310px, 56vw);
    margin: 0 auto 0.4rem;
    text-align: left;
    z-index: 5;
}
.back-link a { color: #b0c2d1; text-decoration: none; font-size: 0.9rem; transition: color .2s; }
.back-link a:hover { color: #f0b27a; }

.song-hero, .poet-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
/* внутренний контейнер hero — всё строго по центру экрана, гармоничные интервалы */
.song-hero-inner,
#poetHero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    gap: 1.15rem;
}
.song-hero-inner .song-title-gradient,
#poetHero .song-title-gradient { margin-top: 0; }
.song-hero-inner .song-artist-line,
#poetHero .song-artist-line { margin-top: 0; }
.song-hero-inner .hero-actions,
#poetHero .hero-actions { margin-top: 0.3rem; }
.song-hero .platforms-section,
.poet-hero .platforms-section { width: 100%; margin-top: 0.4rem; }
.song-hero .platforms-list,
.poet-hero .platforms-list { justify-content: center; }
.song-hero .song-meta-row,
.poet-hero .song-meta-row { margin-top: 0.2rem; }
.cover-3d {
    position: relative;
    width: min(310px, 56vw);
    border-radius: 24px;
    transform-style: preserve-3d;
    transition: transform 0.25s ease-out;
    will-change: transform;
}
.cover-3d .cover {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 24px;
    display: block;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}
/* живая вращающаяся рамка (как у портретов поэтов) */
.song-ring {
    position: absolute;
    inset: -4px;
    border-radius: 28px;
    padding: 4px;
    background: conic-gradient(from var(--ring-angle), #f0b27a, #e88bff, #667eea, #f0b27a);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: ring-spin 3.6s linear infinite;
    pointer-events: none;
    z-index: 2;
}
.song-title-gradient {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 700;
    background: linear-gradient(120deg, #f0f2f5 30%, #f0b27a 70%, #e88bff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-wrap: balance;
}
.song-artist-line { color: #b0c2d1; font-size: 1.05rem; margin-top: 0.4rem; }
.song-poet-link { color: #f0b27a; text-decoration: none; }
.song-poet-link:hover { text-decoration: underline; }
.song-meta-row {
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.2rem;
    color: #6f7a84;
    font-size: 0.82rem;
}
.poet-stats-line { color: #f0b27a; font-size: 0.95rem; margin-top: 0.6rem; letter-spacing: 1px; }

/* ============================================================
   КАРУСЕЛЬ АВТОРОВ (пользователи, у которых есть песни)
   ============================================================ */
.people-page { display: flex; flex-direction: column; }
.people-cover-item {
    position: absolute;
    top: 20px;
    left: 50%;
    width: 220px;
    margin-left: -110px;
    text-align: center;
    border-radius: 20px;
    background: rgba(20, 25, 34, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 1.1rem 0.9rem 1.2rem;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.65s, filter 0.65s;
    cursor: pointer;
}
.people-avatar,
.people-avatar-fallback {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(240, 178, 122, 0.35);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.people-avatar-fallback {
    display: grid;
    place-items: center;
    font-size: 3rem;
    font-weight: 700;
    color: #f0b27a;
    background: linear-gradient(135deg, #2a3038, #171d26);
    margin: 0 auto;
}
.people-cover-item:hover .people-avatar,
.people-cover-item:hover .people-avatar-fallback {
    border-color: #f0b27a;
    box-shadow: 0 0 26px rgba(240, 178, 122, 0.45);
}
.people-cover-item h3 { margin: 0.9rem 0 0.2rem; font-size: 1.02rem; font-weight: 600; color: #f0f2f5; }
.people-cover-item p { font-size: 0.78rem; color: #aab3c0; }
.people-cover-item.is-active { border-color: rgba(240, 178, 122, 0.45); }

/* --- Текст песни: полноэкранный слайд --- */
.lyrics-page { display: flex; flex-direction: column; }
.lyrics-stage { margin-top: 1rem; }
.lyrics-large {
    font-size: clamp(1.05rem, 2.2vw, 1.5rem);
    line-height: 1.85;
    color: #e7ecf2;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

/* --- Похожие песни / песни поэта: карточки с обложками --- */
.related-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.4rem;
    margin-top: 1.6rem;
}
.related-card {
    background: rgba(20, 25, 34, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, border-color 0.3s;
}
.related-card:hover { transform: translateY(-6px); border-color: rgba(240, 178, 122, 0.5); }
.related-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
}
.related-noimg {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    background: #2a3038;
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    color: #6f7a84;
}
.related-card h3 { margin: 0.8rem 0 0.2rem; font-size: 1rem; color: #f0f2f5; font-weight: 600; }
.related-card p { font-size: 0.78rem; color: #aab3c0; margin-bottom: 0.7rem; }
/* кнопка «Слушать/Пауза» в карточке похожих песен (song.html) */
.related-play {
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 1.6rem);
    margin: 0 0.8rem 0.9rem;
    font-family: inherit;
    font-size: 0.82rem;
}
.related-open { display: inline-block; margin-top: 0.5rem; font-size: 0.78rem; color: #6f7a84; text-decoration: none; }
.related-open:hover { color: #f0b27a; }

/* --- Биография поэта: книжная вёрстка с буквицей --- */
.bio-page { display: flex; flex-direction: column; }
.bio-book { margin-top: 1rem; }
.bio-text {
    max-width: 760px;
    margin: 0 auto;
    color: #d7dee6;
    font-size: 1.05rem;
    line-height: 1.9;
}
.bio-text p:first-child::first-letter {
    font-size: 3.2em;
    font-weight: 700;
    float: left;
    line-height: 0.9;
    margin: 0.06em 0.12em 0 0;
    background: linear-gradient(120deg, #f0b27a, #e88bff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================
   КОЛЬЦЕВАЯ КАРУСЕЛЬ ЦИТАТ
   ============================================================ */
.quotes-coverflow-stage {
    position: relative;
    height: 400px;
    margin-top: 1rem;
    perspective: 1300px;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
}
.quotes-coverflow-stage.is-dragging { cursor: grabbing; }
.quotes-coverflow-track {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.quote-cover-item {
    position: absolute;
    top: 50%;      /* центр задаётся translate(-50%, -50%) в layout() */
    left: 50%;
    width: min(560px, 82vw);
    padding: 2.2rem 2.4rem;
    border-radius: 24px;
    background: rgba(20, 25, 34, 0.6);
    border: 1px solid rgba(240, 178, 122, 0.25);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6);
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.65s, filter 0.65s;
}
.quote-item-text {
    font-size: clamp(1.15rem, 2.6vw, 1.7rem);
    line-height: 1.55;
    color: #f0f2f5;
    font-weight: 300;
    font-style: italic;
}
.quote-item-author {
    margin-top: 1.2rem;
    color: #f0b27a;
    font-size: 1rem;
    letter-spacing: 1px;
}
.quote-cover-item.is-active {
    border-color: rgba(240, 178, 122, 0.55);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(232, 139, 255, 0.12);
}

.page-ambient span {
    position: absolute;
    bottom: -6%;
    font-family: 'Inter', serif;
    font-weight: 600;
    white-space: nowrap;
    color: #f0f2f5;
    font-size: var(--size, 1rem);
    opacity: 0;
    filter: blur(0.3px);
    animation: ambient-rise var(--dur, 18s) linear var(--delay, 0s) infinite;
}
.ambient-vinyl {
    width: 170px;
    height: 170px;
    margin-left: -85px;
    border-radius: 50%;
    border: 2px solid rgba(240, 178, 122, 0.4);
    background:
        radial-gradient(circle, rgba(240, 178, 122, 0.12) 0 8%, transparent 9%),
        repeating-radial-gradient(circle,
            rgba(240, 178, 122, 0.07) 0 3px,
            transparent 3px 9px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
}
@keyframes ambient-rise {
    0%   { transform: translateY(0) rotate(var(--rot, 0deg)); opacity: 0; }
    12%  { opacity: var(--op, 0.15); }
    85%  { opacity: var(--op, 0.15); }
    100% { transform: translateY(-105vh) rotate(var(--end-rot, 0deg)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .ambient { display: none; }
}

/* ============================================================
   Горизонтальная анимация перелистывания страниц-сторис:
   клик справа от центра — вперёд (страница уходит влево),
   клик слева — назад. Направление задаёт html[data-story-dir],
   который выставляет landing.js (initStories) перед
   document.startViewTransition.
   ============================================================ */
html[data-story-dir="forward"]::view-transition-old(root) {
    animation: story-out-left .3s ease-in both;
}
html[data-story-dir="forward"]::view-transition-new(root) {
    animation: story-in-right .3s ease-out both;
}
html[data-story-dir="back"]::view-transition-old(root) {
    animation: story-out-right .3s ease-in both;
}
html[data-story-dir="back"]::view-transition-new(root) {
    animation: story-in-left .3s ease-out both;
}
/* все слои перехода — на одном уровне, без «слоёного» сдвига */
html[data-story-dir]::view-transition-old(root),
html[data-story-dir]::view-transition-new(root) {
    animation-duration: .3s;
    will-change: transform, opacity;
}

@keyframes story-out-left {
    to { transform: translateX(-28%); opacity: 0; }
}
@keyframes story-in-right {
    from { transform: translateX(100%); }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes story-out-right {
    to { transform: translateX(28%); opacity: 0; }
}
@keyframes story-in-left {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    html[data-story-dir]::view-transition-old(root),
    html[data-story-dir]::view-transition-new(root) {
        animation: none;
    }
}

/* ============================================================
   ЭТАП 3 (вовлечение): «Песня дня» + «Лента»
   ============================================================ */

/* --- «Песня дня» на hero главной --- */
.sotd-card {
    margin: 1.1rem auto 0;
    max-width: 640px;
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(240, 178, 122, 0.35);
    background: linear-gradient(135deg, rgba(35, 30, 50, 0.75), rgba(60, 40, 60, 0.65));
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.sotd-card:hover {
    transform: translateY(-3px);
    border-color: rgba(240, 178, 122, 0.65);
}
.sotd-inner {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 0.9rem;
    text-align: left;
}
.sotd-cover {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.sotd-cover.sotd-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f0b27a;
    background: rgba(240, 178, 122, 0.12);
    font-size: 1.4rem;
}
.sotd-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 auto;
    min-width: 0;
}
.sotd-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f0b27a;
    background: rgba(240, 178, 122, 0.14);
    border: 1px solid rgba(240, 178, 122, 0.4);
    border-radius: 999px;
    padding: 0.12rem 0.6rem;
}
.sotd-title {
    font-weight: 700;
    font-size: 1.02rem;
    color: #f5f0e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sotd-author {
    font-size: 0.82rem;
    color: #aab3c0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* переопределение глобального .play-icon (styles.css задаёт width:100%),
   кнопка в строке карточки должна быть компактной */
.sotd-card .sotd-play.play-icon {
    width: auto;
    flex: 0 0 auto;
    align-self: center;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* --- Лента: слайд «Моя лента» / «Популярное» --- */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.1rem;
    width: 100%;
    max-width: 1150px;
    margin: 1.4rem auto 0;
}
.feed-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(160deg, rgba(30, 28, 44, 0.85), rgba(46, 36, 56, 0.8));
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.feed-card:hover {
    transform: translateY(-4px);
    border-color: rgba(240, 178, 122, 0.55);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.feed-cover {
    width: 100%;
    /* 4/3 вместо квадрата: ряд карточек гарантированно помещается
       по высоте подстраницы (этап 5.4-M) */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.feed-cover.feed-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f0b27a;
    background: rgba(240, 178, 122, 0.1);
    font-size: 2.2rem;
}
.feed-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.75rem 0.85rem 0.9rem;
    flex: 1 1 auto;
}
.feed-song-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f5f0e8;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.feed-poet,
.feed-author {
    margin: 0;
    font-size: 0.8rem;
    color: #aab3c0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.feed-poet i { color: #f0b27a; margin-right: 0.3rem; }
.feed-author i { color: #8fa3b8; margin-right: 0.3rem; }
.feed-meta {
    display: flex;
    gap: 0.9rem;
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.78rem;
    color: #6f7a84;
}
.feed-meta i { margin-right: 0.25rem; color: #f0b27a; }
/* переопределение глобального .play-icon (width:100%) — компактная кнопка в карточке ленты */
.feed-card .feed-play.play-icon {
    width: auto;
    align-self: flex-start;
    margin-top: 0.55rem;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .sotd-inner { padding: 0.5rem 0.65rem; gap: 0.6rem; }
    .sotd-cover { width: 48px; height: 48px; }
    .sotd-title { font-size: 0.9rem; }
    .sotd-card .sotd-play.play-icon { padding: 0.35rem 0.8rem; font-size: 0.78rem; }
    .feed-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
}
/* совсем узкие экраны: текст карточки «Песня дня» сжимается, кнопка не наезжает */
@media (max-width: 430px) {
    .sotd-inner { flex-wrap: nowrap; }
    .sotd-body { min-width: 0; }
}

/* SignalR (этап 4.3): живой счётчик «сейчас слушают» — fixed, правый верх,
   независим от layout шапки (иначе теряется в overflow header) */
.live-listeners-badge {
    position: fixed;
    top: 70px;
    right: 14px;
    z-index: 9999;
    display: none;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(138, 90, 255, .85), rgba(255, 90, 160, .85));
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}
@media (max-width: 640px) {
    .live-listeners-badge { display: none !important; }
}

/* --- КАРУСЕЛЬ БАННЕРОВ НА HERO (index.html) — этап 5.4-M ---
   Full-bleed: баннер занимает всю ширину экрана и НЕ зависит
   от ширины текстового блока под ним (.hero-copy).
   Кроссфейд-автолистание 5 с — landing.js.
   Края растворяются в фоне страницы, тёмных полос нет. */
.hero-carousel {
    position: relative;
    /* герой имеет padding 1.5rem по бокам — растягиваем рамку до краёв монитора */
    width: calc(100% + 3rem);
    margin: 0 -1.5rem 1.15rem;
}

.hero-carousel-frame {
    position: relative;
    /* Высота кадра: баннер показывается целиком (object-fit: contain),
       поэтому лица людей не обрезаются ни сверху, ни снизу. */
    height: clamp(258px, 44svh, 600px);
    overflow: hidden;
    background: #0b0e12;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
    isolation: isolate;
}

.hero-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    overflow: hidden;
}

/* Размытая копия баннера заполняет кадр по краям: сам баннер вписан
   целиком (contain) и не обрезает лица, а вокруг нет чёрных полос. */
.hero-slide::before {
    content: '';
    position: absolute;
    inset: -3rem;
    z-index: 0;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
    filter: blur(26px) brightness(0.5) saturate(1.15);
    transform: scale(1.06);
}

.hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* contain: баннер виден целиком по вертикали — лица и головы не обрезаются */
.hero-slide img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: var(--slide-pos, center);
    display: block;
}

/* мягкая растушёвка краёв: баннер «растворяется» в фоне героя,
   поэтому не видно границ и разных градиентов вокруг кнопок */
.hero-carousel-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        linear-gradient(90deg,
            rgba(11, 14, 18, 0.7) 0%,
            rgba(11, 14, 18, 0) 13%,
            rgba(11, 14, 18, 0) 87%,
            rgba(11, 14, 18, 0.7) 100%),
        linear-gradient(180deg,
            rgba(11, 14, 18, 0.5) 0%,
            rgba(11, 14, 18, 0) 20%,
            rgba(11, 14, 18, 0) 62%,
            rgba(11, 14, 18, 0.8) 100%);
}

/* подпись неактивного баннера не просвечивает при кроссфейде */
.hero-slide:not(.is-active) .hero-slide-caption {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hero-slide-caption {
    position: absolute;
    /* правее кнопки «Назад», иначе подпись прячется под ней */
    left: clamp(9rem, 15vw, 12rem);
    /* над закреплённым футером: низ кадра может уходить под него */
    bottom: calc(var(--site-footer-h, 78px) + 0.5rem);
    /* подпись мягко перекрывается полупрозрачной растушёвкой (::after, z-index: 3) */
    z-index: 2;
    max-width: min(74%, 42rem);
    color: #fdf3e7;
    font-size: clamp(0.95rem, 1.6vw, 1.35rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    background: rgba(10, 13, 18, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* стрелки: стеклянные кнопки поверх баннера, без тёмных «квадратов» */
.hero-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(240, 178, 122, 0.35);
    border-radius: 50%;
    background: rgba(14, 18, 24, 0.32);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    backdrop-filter: blur(8px) saturate(1.2);
    color: #ffd7ae;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), inset 0 0 18px rgba(240, 178, 122, 0.12);
    transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-carousel-arrow:hover,
.hero-carousel-arrow:focus-visible {
    opacity: 1;
    background: rgba(240, 178, 122, 0.22);
    border-color: rgba(240, 178, 122, 0.75);
    color: #fff;
}

.hc-prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.hc-next { right: clamp(0.5rem, 2vw, 1.5rem); }

/* точки-переключатели — в стеклянной «пилюле» */
.hero-carousel-dots {
    position: absolute;
    right: clamp(0.9rem, 3vw, 2.4rem);
    bottom: clamp(0.9rem, 2.2vw, 1.5rem);
    z-index: 4;
    display: flex;
    gap: 0.45rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(10, 13, 18, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.hero-carousel-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(244, 233, 220, 0.35);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-carousel-dots button.is-active {
    background: #f0b27a;
    transform: scale(1.25);
}

/* --- Ужатие hero-типографики: баннер + typewriter вмещаются в экран --- */
.hero-screen.hero-compact .hero-title {
    font-size: clamp(1.55rem, 3.4vw, 2.55rem);
    margin: 0.75rem 0 0.55rem;
}

.hero-screen.hero-compact .hero-tagline {
    margin-bottom: 0.9rem;
}

/* «Песня дня» в герое больше не выводится: ряд карточек не помещался
   по высоте и обрезался. Разметка и логика landing.js сохранены. */
.hero-screen.hero-compact .sotd-card {
    display: none !important;
}

/* мобильная адаптация карусели: полный кадр без обрезки по бокам */
@media (max-width: 640px) {
    .hero-carousel { margin-bottom: 0.9rem; }
    .hero-carousel-frame {
        height: auto;
        aspect-ratio: 1584 / 672;
        max-height: 41svh;
    }
    .hero-slide img { object-position: center; }
    .hero-slide-caption {
        left: 0.75rem;
        bottom: 0.65rem;
        max-width: calc(100% - 1.5rem);
        font-size: 0.9rem;
        padding: 0.28rem 0.7rem;
    }
    .hero-carousel-arrow { width: 38px; height: 38px; font-size: 0.85rem; }
    .hc-prev { left: 0.4rem; }
    .hc-next { right: 0.4rem; }
    .hero-carousel-dots { right: 0.6rem; bottom: 0.6rem; gap: 0.3rem; padding: 0.28rem 0.45rem; }
    .hero-carousel-dots button { width: 7px; height: 7px; }
}

@media (max-width: 430px) {
    .hero-slide-caption { font-size: 0.82rem; }
    .hero-carousel-arrow { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide { transition: none; }
}

/* ============================================================
   МОБИЛЬНАЯ ИТЕРАЦИЯ 4.4 (вторая) — 18.11.2026
   1) масштаб листаемой части (--mobile-content-scale)
   2) боковые зоны листания сторис (≥44px)
   3) визуализатор в кадре
   Десктоп (min-width: 641px) не затрагивается.
   ============================================================ */

/* ---------- 1. Горизонтальное переполнение ----------
   Кольцевые карусели и hero-аврора выходят за экран.
   overflow-x: clip режет по вьюпорту и НЕ создаёт скролл-контейнер
   (в отличие от hidden), поэтому scroll-snap на <html> сохраняется. */
@supports (overflow: clip) {
    html { overflow-x: clip; }
}
@supports not (overflow: clip) {
    html { overflow-x: hidden; }
}

/* ---------- 2. Масштаб контента ----------
   Значение по умолчанию 0.667 (1 / 1.5). Переопределяется
   query-параметром ?mscale=0.75 (диапазон 0.6–1.0, см. landing.js). */
html { --mobile-content-scale: 0.667; }

/* Класс mobile-landing-scaled ставит landing.js только на главной
   (там, где есть #showcase): song/poet/user тоже используют
   .story-slide, но их контент уменьшать нельзя — кнопки < 44px. */
@media (max-width: 640px) {
    /* контент начинается ровно под фиксированной шапкой (вне сторис-режима) */
    html.mobile-landing-scaled:not(.stories-mode) .main-content {
        margin-top: var(--header-h, 130px);
    }

    /* Этап 5.4-M: масштаб контента отменён (листание тапом по половинам
       экрана убрано). Секции занимают всю ширину экрана — баннеры и
       карточки больше не «зажаты» в 2/3 ширины, градиент не рвётся. */
    html.mobile-landing-scaled .main-content > .story-slide {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        /* слайд сам резервирует высоту шапки — snap-точка = верх слайда */
        scroll-margin-top: 0;
        overflow-x: clip;
    }
    /* визуальная высота страницы остаётся ровно равной экрану */
    html.mobile-landing-scaled .story-slide.story-fill,
    html.mobile-landing-scaled .story-slide.story-scroll {
        height: 100svh;
        min-height: 100svh;
        max-height: 100svh;
    }

    /* герой: единый верхний отступ, снизу — резерв под подвал */
    html.mobile-landing-scaled .hero-screen.hero-compact {
        padding-bottom: calc(var(--site-footer-h, 64px) + 0.6rem);
    }

    /* Витрина: карусель + визуализатор гарантированно в одном экране */
    html.mobile-landing-scaled #showcase .landing-title { font-size: 1.25rem; }
    html.mobile-landing-scaled #showcase .coverflow-stage { height: 292px; margin-top: 0.4rem; }
    html.mobile-landing-scaled #showcase .coverflow-nav { margin-top: 0.5rem; }
    html.mobile-landing-scaled #showcase .viz-bar-row { height: 48px; margin: 0.7rem auto 0; }
    html.mobile-landing-scaled #showcase .viz-hint { margin-top: 0.25rem; font-size: 0.7rem; }

    /* визуализатор: полосы читаемы на узком экране */
    .viz-bar-row { height: 58px; gap: 3px; }
    .viz-bar { max-width: 10px; border-radius: 4px 4px 0 0; }
    .viz-hint { font-size: 0.74rem; }
}

/* ---------- 3. Боковые зоны листания сторис ----------
   Создаются в landing.js только на страницах со .story-slide.
   По умолчанию скрыты; показываются только на мобильных. */
.story-tap-zone {
    position: fixed;
    top: calc(var(--header-h, 130px) + 40px);
    bottom: 0;
    width: max(44px, calc((100vw - 100vw * var(--mobile-content-scale)) / 2));
    z-index: 1030;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(240, 178, 122, 0.5);
    font-size: 1rem;
    cursor: pointer;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}
.story-tap-zone.prev {
    left: 0;
    padding-left: env(safe-area-inset-left, 0px);
    justify-content: flex-start;
}
.story-tap-zone.next {
    right: 0;
    padding-right: env(safe-area-inset-right, 0px);
    justify-content: flex-end;
}
/* мягкая подсказка-градиент у края */
.story-tap-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
}
.story-tap-zone.prev::before {
    background: linear-gradient(to right, rgba(240, 178, 122, 0.12), transparent 70%);
}
.story-tap-zone.next::before {
    background: linear-gradient(to left, rgba(240, 178, 122, 0.12), transparent 70%);
}
.story-tap-zone .tap-chevron {
    position: relative;
    width: 10px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(-135deg);
    margin: 0 12px;
}
.story-tap-zone.next .tap-chevron { transform: rotate(45deg); }
.story-tap-zone:focus-visible {
    outline: 2px solid #f0b27a;
    outline-offset: -4px;
}

/* Этап 5.4-M: листание тапом по половинам экрана ОТМЕНЕНО.
   Зоны остались в CSS только как страховка от кэша — всегда скрыты. */
.story-tap-zone { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    html.mobile-landing-scaled .story-slide { scroll-behavior: auto; }
}

/* ============================================================
   ЭТАП 5.4-M: скрытие полос прокрутки
   Прокрутка остаётся рабочей (колесо/тач/клавиатура),
   но визуальные полосы не показываются.
   ============================================================ */
html,
body,
.story-slide,
.story-scroll,
.cinema-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.story-slide::-webkit-scrollbar,
.story-scroll::-webkit-scrollbar,
.cinema-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Контроль раскладки ленты: карточки, не влезающие целиком,
   скрываются из landing.js (не показываем «обрезанные» ряды). */
.feed-card.is-row-overflow { display: none !important; }
