/* Shared controls override legacy section-specific corner styles. Media play
   controls remain circular; every rectangular action uses the same radius. */
:root { --control-radius: 10px; }
/* Replaced video elements must never use their aspect-ratio/min-height as a
   grid minimum. Keep the controls in their own column at every breakpoint. */
#demo-section .demo-layout { min-width: 0; grid-template-columns: minmax(0,1.5fr) minmax(270px,.75fr); align-items: stretch; }
#demo-section :is(.demo-video,.demo-controls) { min-width: 0; width: 100%; max-width: 100%; }
#demo-section .demo-video { min-height: 0; aspect-ratio: 16 / 9; align-self: center; }
#demo-section .demo-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#demo-section .demo-controls { overflow-wrap: anywhere; }
#demo-section #waveCanvas { display: block; min-width: 0; max-width: 100%; }
@media (max-width: 1000px) {
    #demo-section .demo-layout { grid-template-columns: minmax(0,1fr); }
    #demo-section .demo-video { min-height: 0; }
    #demo-section .demo-controls { min-height: 0; padding: 24px; }
}
/* The first screen has one shared height budget: navigation, optional offer,
   hero and orange tape. The tape stays in document flow when scrolling. */
@media (min-width: 1000px) and (min-height: 640px) {
    body .hero { height: var(--landing-hero-available,calc(100svh - var(--landing-header-height) - 62px)); min-height: 0; padding-block: 12px; }
    body .hero-grid { height: 100%; min-height: 0; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: clamp(24px,4vw,80px); }
    body .hero-copy { padding-block: 8px; }
    body .hero .badge { margin-bottom: 16px; }
    body .hero .halloween-edition { margin-bottom: 12px; }
    body .hero h1 { font-size: clamp(34px,min(4vw,6.7svh),78px); margin-bottom: 18px; }
    body .hero p.lead { font-size: clamp(14px,.95vw,19px); line-height: 1.5; margin-bottom: 20px; }
    body .hero .btn { min-height: 48px; }
    body .hero .hero-ctas { gap: 10px; margin-bottom: 12px; }
    body .hero .hero-proof { font-size: 10px; }
    body .hero .carousel-wrapper { --card-w: min(100%,clamp(350px,38vw,720px)); --card-h: clamp(220px,calc(var(--landing-hero-available,650px) - 105px),540px); }
    body .hero .arcade-carousel { height: calc(var(--landing-hero-available,650px) - 24px); }
    [data-landing-compact="true"] .hero-copy { padding-block: 0; }
    [data-landing-compact="true"] .hero .badge { margin-bottom: 10px; font-size: 8px; }
    [data-landing-compact="true"] .hero .halloween-edition { margin-bottom: 8px; }
    [data-landing-compact="true"] .hero h1 { font-size: clamp(32px,3.25vw,54px); margin-bottom: 14px; }
    [data-landing-compact="true"] .hero p.lead { font-size: 14px; line-height: 1.45; margin-bottom: 14px; }
    [data-landing-compact="true"] .hero .btn { min-height: 44px; padding-inline: 16px; font-size: 12px; }
    [data-landing-compact="true"] .hero .hero-proof { font-size: 9px; }
    [data-landing-compact="true"] .hero .halloween-hero-guest { display: none; }
}
body :is(.btn,.dub-main-cta,.landing-auth-submit,.seasonal-theme-toggle) {
    border-radius: var(--control-radius) !important;
}
body :is(.btn,.dub-main-cta) { text-transform: none; letter-spacing: -.1px; }
body :is(.carousel-controls,.carousel-nav,.dubs-nav) { border-radius: var(--control-radius); }

/* These selectors must beat the original light how-it-works section. */
html[data-season="halloween"] #how .section-title,
html[data-season="halloween"] #how .step h3 { color: #f5eee4; }
html[data-season="halloween"] #how .step p { color: #c3b0ce; }
html[data-season="halloween"] #how .section-tag { color: #ffc294; }
html[data-season="halloween"] #how .step-num { color: #ffc294; }
html[data-season="halloween"] #how .steps.is-gsap-motion .steps-set .step {
    background: linear-gradient(145deg,#2c2033,#1c1721);
    border-color: #a584af66; box-shadow: 0 16px 40px #0003;
}

/* Use the section's full width for the examples heading. On smaller screens
   keep natural wrapping instead of clipping or shrinking it to tiny text. */
body #dubs .section-head { max-width: none; width: 100%; }
body #dubs .section-title { max-width: none; width: 100%; text-wrap: initial; }
@media (min-width: 1000px) {
    body #dubs .section-title { font-size: clamp(30px,3.4vw,60px); white-space: nowrap; }
}

/* One quiet, rounded statistics strip replaces two separate square labels. */
.dubs-section .dub-card-topbar { top: 14px; left: 12px; right: 12px; gap: 8px; }
.dubs-section .dub-card-badge { border-radius: 999px; padding: 7px 9px; box-shadow: none; font-size: 9px; letter-spacing: .06em; }
.dubs-section .card-metrics {
    display: inline-flex; align-items: center; gap: 0; padding: 6px 8px;
    border: 1px solid #ffffff26; border-radius: 999px;
    background: #17121de6; color: #f8f3f9;
    box-shadow: 0 4px 14px #0002;
}
.dubs-section .card-metrics :is(.card-dubs-count,.card-total-views) {
    padding: 0; gap: 5px; border: 0; border-radius: 0; background: none;
    font: 650 11px/1.4 var(--sans); color: #f8f3f9;
}
.dubs-section .card-metrics .card-dubs-count { padding-right: 8px; }
.dubs-section .card-metrics .card-total-views { padding-left: 8px; border-left: 1px solid #ffffff30; }
.dubs-section .card-metrics .dub-ui-icon { width: 13px; height: 13px; flex-basis: 13px; color: #f5c29e; }
body .dubs-section :is(.dub-card,.dub-card-media) { border-radius: 16px; }

/* Posters survive paused/unloaded video. Only the active video is decoded. */
.dub-card-media .dub-card-poster { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dub-card-media video { opacity: 0; }
.dub-card-media.video-loaded video { opacity: 1; }
.dub-card-media.has-poster .placeholder { opacity: 0; visibility: hidden; }

/* The listen action advertises itself before hovering and responds throughout
   hover/focus. The label activates the same native button when tapped. */
#demo-section .rec-btn { position: relative; isolation: isolate; }
#demo-section .rec-btn.mode-listen:not(:disabled) { cursor: pointer; transition: transform .2s ease,filter .2s ease,box-shadow .2s ease; }
#demo-section .rec-btn.mode-listen:not(:disabled)::before {
    content: ""; position: absolute; inset: -9px; border: 2px solid var(--accent);
    border-radius: 50%; pointer-events: none; opacity: 0;
    animation: listen-invitation 2.6s ease-out infinite;
}
#demo-section .rec-btn.mode-listen:not(:disabled):is(:hover,:focus-visible) {
    transform: translateY(-3px) scale(1.07); filter: brightness(1.12);
    box-shadow: 0 0 0 6px var(--accent-glow),0 14px 38px var(--accent-glow);
}
#demo-section .rec-btn.mode-listen:not(:disabled):is(:hover,:focus-visible)::before { animation: listen-invitation 1.15s ease-out infinite; }
#demo-section .rec-btn.mode-listen:not(:disabled):active { transform: scale(.97); }
#demo-section .rec-label { display: block; cursor: pointer; }
#demo-section .rec-btn.mode-listen ~ .rec-label::after {
    content: "Нажми ▶, чтобы прослушать"; display: block; margin-top: 8px;
    color: #5c565e; font: 500 12px/1.4 var(--sans); letter-spacing: 0;
}
html[data-season="halloween"] #demo-section .rec-btn.mode-listen ~ .rec-label::after { color: #c3b0ce; }
#demo-section .rec-btn:disabled ~ .rec-label { cursor: progress; }
@keyframes listen-invitation {
    0% { opacity: .65; transform: scale(.96); }
    72%,100% { opacity: 0; transform: scale(1.28); }
}
@media (max-width: 720px) {
    .dubs-section .dub-card-topbar { top: 12px; left: 10px; right: 10px; gap: 5px; }
    .dubs-section .card-metrics { padding: 5px 7px; }
    .dubs-section .card-metrics :is(.card-dubs-count,.card-total-views) { font-size: 10px; }
    .dubs-section .card-metrics .card-dubs-count { padding-right: 6px; }
    .dubs-section .card-metrics .card-total-views { padding-left: 6px; }
    .dubs-section .dub-card-badge { padding: 6px 8px; font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    #demo-section .rec-btn.mode-listen:not(:disabled)::before { animation: none; opacity: .35; transform: none; }
    #demo-section .rec-btn.mode-listen:not(:disabled):is(:hover,:focus-visible) { transform: none; }
}
