/* ── Cobalt Pro layer (2026-09) ────────────────────────────────────────────
   Loaded after styles.css. Hero + live offers feed + motion polish.
   Tokens live in :root of styles.css; spec: docs/design-system.md (v2).
   ────────────────────────────────────────────────────────────────────────── */

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
    background: rgba(10, 14, 23, 0.78);
    border-bottom-color: rgba(143, 176, 255, 0.08);
}
.logo-icon { border-radius: 8px; }

/* ── Primary button: light sweep on hover ───────────────────────────────── */
.btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.22) 45%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 700ms var(--ease-cine);
}
.btn-primary:hover::after { transform: translateX(120%); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.cx-hero {
    position: relative;
    padding: calc(var(--header-h) + var(--announce-h) + 64px) 0 80px;
    background: var(--bg-0);
    overflow: hidden;
    isolation: isolate;
}
.cx-hero-bg {
    --mx: 72%;
    --my: 38%;
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(560px 400px at var(--mx) var(--my), rgba(47, 102, 240, 0.22), transparent 70%),
        linear-gradient(rgba(143, 176, 255, 0.055) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(90deg, rgba(143, 176, 255, 0.055) 1px, transparent 1px) 0 0 / 56px 56px;
    -webkit-mask-image: radial-gradient(120% 95% at 50% 15%, #000 55%, transparent 100%);
    mask-image: radial-gradient(120% 95% at 50% 15%, #000 55%, transparent 100%);
}
.cx-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 56px;
    align-items: center;
}
.cx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-soft);
}
.cx-eyebrow::before {
    content: "";
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}
.cx-h1 {
    margin-top: 18px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -0.045em;
    text-wrap: balance;
}
.cx-h1 span { color: var(--accent-soft); }
.cx-sub {
    margin-top: 22px;
    max-width: 34rem;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-md);
}
.cx-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}
.cx-btn-main {
    padding: 17px 30px;
    font-size: 16px;
    box-shadow: 0 10px 30px rgba(47, 102, 240, 0.35);
}
.cx-micro {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-lo);
}
.cx-micro li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cx-micro li::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(74, 222, 154, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ADE9A' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.cx-play-note {
    max-width: 34rem;
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-soft);
    border-radius: 12px;
    background: rgba(18, 25, 41, 0.72);
}
.cx-play-note p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-md);
}
.cx-play-note p + p {
    margin-top: 6px;
    color: var(--text-lo);
}

/* QR — desktop with a mouse only; phones download directly */
.cx-qr {
    display: none;
    align-items: center;
    gap: 14px;
    max-width: 380px;
    margin-top: 28px;
    padding: 12px 16px 12px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(18, 25, 41, 0.6);
}
.cx-qr img {
    flex: none;
    width: 76px;
    height: 76px;
    padding: 4px;
    border-radius: 8px;
    background: #FFFFFF;
}
.cx-qr p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-md);
}
.cx-qr strong {
    display: block;
    font-size: 14px;
    color: var(--text-hi);
}
@media (min-width: 1024px) and (pointer: fine) {
    .cx-qr { display: flex; }
}

/* ── Live offers feed ───────────────────────────────────────────────────── */
.cx-feed {
    position: relative;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(26, 35, 56, 0.72), rgba(18, 25, 41, 0.9));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 400ms var(--ease), box-shadow 400ms var(--ease);
}

/* Panther mascot (same character as the demo film) lying on the card's top edge near the right
   corner, watching the headline. Sizes measured on media/mascot/panther-lie-2.png:
   737x592, perch line y 331 (55.912%) where the front paws meet the card's top border; the tail
   runs down past the card's right corner. Phones reuse the same art, scaled down. */
.cx-jag {
    --jag-w: 45%;
    --jag-x: 57%;
    --jag-perch: -55.912%;
    position: absolute;
    left: var(--jag-x);
    /* -1px: the perch line sits on the border's outer edge, not the padding box */
    top: -1px;
    z-index: 3;
    width: var(--jag-w);
    height: 0;
    pointer-events: none;
    user-select: none;
}
.cx-jag-shadow {
    position: absolute;
    left: 10%;
    width: 70%;
    top: -3px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    filter: blur(3px);
}
.cx-jag-pose {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    height: auto;
    transform: translateY(var(--jag-perch));
}
.cx-feed::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
    opacity: 0;
    animation: cx-scan 3.6s var(--ease) infinite;
    pointer-events: none;
}
@keyframes cx-scan {
    0%   { top: 0;    opacity: 0; }
    12%  { opacity: 0.7; }
    88%  { opacity: 0.7; }
    100% { top: 100%; opacity: 0; }
}
.cx-feed.is-hit-flash {
    border-color: rgba(74, 222, 154, 0.55);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(74, 222, 154, 0.1);
}
.cx-feed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cx-feed-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-lo);
}
.cx-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    background: rgba(74, 222, 154, 0.1);
    font-size: 12px;
    font-weight: 700;
    color: var(--money);
}
.cx-live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--money);
    animation: cx-ping 1.8s var(--ease) infinite;
}
@keyframes cx-ping {
    0%       { box-shadow: 0 0 0 0 rgba(74, 222, 154, 0.55); }
    80%, 100% { box-shadow: 0 0 0 8px rgba(74, 222, 154, 0); }
}
.cx-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0 12px;
}
.cx-rules span {
    padding: 5px 10px;
    border: 1px solid rgba(143, 176, 255, 0.25);
    border-radius: var(--r-pill);
    background: rgba(47, 102, 240, 0.08);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-soft);
    font-variant-numeric: tabular-nums;
}
.cx-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}
.cx-offer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-0);
    transition:
        opacity 500ms var(--ease),
        border-color 400ms var(--ease),
        background-color 400ms var(--ease),
        transform 500ms var(--ease-cine);
}
.cx-offer-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cx-pay {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-hi);
    font-variant-numeric: tabular-nums;
}
.cx-meta {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-lo);
    white-space: nowrap;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.cx-tag {
    flex: none;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    background: var(--bg-3);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-lo);
    white-space: nowrap;
}
.cx-offer.is-new      { opacity: 0; transform: translateY(-14px) scale(0.98); }
.cx-offer.is-checking .cx-tag { background: rgba(47, 102, 240, 0.16); color: var(--accent-soft); }
.cx-offer.is-skip     { opacity: 0.5; }
.cx-offer.is-hit      { border-color: rgba(74, 222, 154, 0.55); background: rgba(74, 222, 154, 0.07); }
.cx-offer.is-hit .cx-pay { color: var(--money); }
.cx-offer.is-hit .cx-tag { background: var(--money); color: #04130D; }
.cx-feed-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-lo);
}
.cx-feed-foot strong {
    font-size: 20px;
    font-weight: 800;
    color: var(--money);
    font-variant-numeric: tabular-nums;
}

/* ── Entrance ───────────────────────────────────────────────────────────── */
.cx-in {
    animation: cx-rise 800ms var(--ease-cine) both;
    animation-delay: calc(var(--d, 0) * 80ms + 60ms);
}
@keyframes cx-rise {
    from { opacity: 0; transform: translateY(18px); filter: blur(4px); }
    to   { opacity: 1; transform: none; filter: none; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
/* One column at the same width the header becomes a burger (900px).
   The card shares the copy's left edge and 34rem measure. The top margin
   is the panther's perch: the head sits in that gap, clear of the Play note. */
@media (max-width: 900px) {
    .cx-hero { padding: calc(var(--header-h) + var(--announce-h) + 36px) 0 56px; }
    .cx-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .cx-sub { font-size: 16px; }
    .cx-feed {
        width: 100%;
        max-width: 34rem;
        justify-self: start;
        margin-top: clamp(20px, 8%, 48px);
    }
    .cx-jag { --jag-w: 30%; --jag-x: 74%; }
}
@media (max-width: 767px) {
    .cx-jag { --jag-w: 28%; --jag-x: 76%; }
}
@media (max-width: 480px) {
    .cx-ctas .btn-primary,
    .cx-ctas .btn-secondary { width: 100%; justify-content: center; }
    .cx-feed { padding: 14px; border-radius: 20px; }
    .cx-pay { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
    .cx-in,
    .cx-live i { animation: none; }
    .cx-feed::before,
    .btn-primary::after { display: none; }
}

/* RU/ES headline is wider than EN (Manrope/Cyrillic) — cap it so it wraps in 2 lines */
html[lang="ru"] .cx-h1,
html[lang="es"] .cx-h1 { font-size: clamp(36px, 5vw, 60px); }

/* ── Film: "How it works" demo player ───────────────────────────────────── */
.film {
    max-width: 960px;
    margin: 0 auto;
}
.film-player {
    position: relative;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    overflow: hidden;
    background: var(--bg-0);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    isolation: isolate;
}
.film-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-0);
}

/* Controls — always visible. Play/pause bottom right, sound pill bottom left
   (the convention players use for "unmute", and the easiest spot to find). */
.film-controls {
    position: absolute;
    right: 12px;
    bottom: 24px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 6px;
}

.film-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid rgba(143, 176, 255, 0.28);
    border-radius: var(--r-pill);
    background: rgba(10, 14, 23, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--text-hi);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.film-btn:hover { border-color: var(--accent-soft); background: rgba(18, 25, 41, 0.9); }
.film-btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.film-btn-label { white-space: nowrap; }

/* Sound: the one control we want people to notice while the film plays muted */
.film-soundgroup {
    position: absolute;
    left: 12px;
    bottom: 24px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
}
.film-sound {
    position: relative;
    padding: 10px 15px;
    border-color: rgba(143, 176, 255, 0.55);
    background: rgba(16, 24, 44, 0.86);
    font-size: 13.5px;
}
.film-sound::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid var(--accent-soft);
    opacity: 0;
    pointer-events: none;
}
/* Draws the eye until the viewer turns sound on (or off) themselves. */
.film-sound.is-prompting { animation: film-sound-nudge 2.6s var(--ease) infinite; }
.film-sound.is-prompting::after { animation: film-sound-ring 2.6s var(--ease) infinite; }
@keyframes film-sound-nudge {
    0%, 62%, 100% { transform: none; }
    70%           { transform: scale(1.045); }
    78%           { transform: none; }
}
@keyframes film-sound-ring {
    0%   { opacity: 0.55; transform: scale(1); }
    38%  { opacity: 0;    transform: scale(1.22); }
    100% { opacity: 0;    transform: scale(1.22); }
}

/* Icon switching */
.film-ico--pause,
.film-ico--sound { display: none; }
.film-play.is-playing .film-ico--play { display: none; }
.film-play.is-playing .film-ico--pause { display: block; }
.film-sound.is-muted .film-ico--sound { display: none; }
.film-sound:not(.is-muted) .film-ico--mute { display: none; }

/* Volume slider next to the sound toggle */
.film-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 84px;
    height: 3px;
    border-radius: 999px;
    background: rgba(143, 176, 255, 0.28);
    outline: none;
    cursor: pointer;
}
.film-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: none;
}
.film-volume::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: none;
}
.film-volume:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }


/* Big play — poster / reduced-motion state */
.film-bigplay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: none;
    width: 72px;
    height: 72px;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    border: 1px solid rgba(143, 176, 255, 0.4);
    border-radius: 50%;
    background: rgba(10, 14, 23, 0.66);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    transition: transform 200ms var(--ease-cine), background-color 200ms var(--ease);
}
.film-player.is-paused .film-bigplay { display: inline-flex; }
.film-bigplay:hover { transform: translate(-50%, -50%) scale(1.06); background: rgba(47, 102, 240, 0.5); }
.film-bigplay:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }

/* Overall progress bar */
.film-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    height: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.film-progress-track,
.film-progress-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
}
.film-progress-track { right: 0; background: rgba(143, 176, 255, 0.22); }
.film-progress-fill { width: 0; background: var(--accent-soft); }
.film-progress:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: -2px; }

/* End overlay */
.film-end {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    background: linear-gradient(180deg, rgba(10, 14, 23, 0.32), rgba(10, 14, 23, 0.82));
}
.film-end[hidden] { display: none; }
.film-end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.film-end-replay {
    padding: 17px 24px;
    border: 1px solid var(--border-ctl);
    border-radius: var(--r-pill);
    background: rgba(18, 25, 41, 0.7);
    color: var(--text-hi);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 200ms var(--ease);
}
.film-end-replay:hover { border-color: var(--accent-soft); }
.film-end-replay:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* Chapter cards */
.film-chapters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.film-chapter {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    background: var(--bg-2);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 220ms var(--ease), background-color 220ms var(--ease), transform 220ms var(--ease);
}
.film-chapter:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.film-chapter:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.film-chapter.is-active { border-color: rgba(143, 176, 255, 0.45); background: var(--bg-3); }
.film-chapter-num {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-3);
    color: var(--text-lo);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    transition: background-color 220ms var(--ease), color 220ms var(--ease);
}
.film-chapter.is-active .film-chapter-num { background: var(--accent); color: #fff; }
.film-chapter.is-done .film-chapter-num { background: var(--accent-soft); color: #04130D; }
.film-chapter-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.film-chapter-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-soft);
}
.film-chapter-title { font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--text-hi); }
.film-chapter-text { font-size: 12.5px; line-height: 1.5; color: var(--text-md); }
.film-chapter-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(143, 176, 255, 0.14);
}
.film-chapter-bar i { display: block; width: 0; height: 100%; background: var(--accent-soft); }

/* Static fallback when the video cannot load */
.film-player.is-error .film-bigplay,
.film-player.is-error .film-controls,
.film-player.is-error .film-soundgroup,
.film-player.is-error .film-progress { display: none; }
.film-chapters.is-static .film-chapter { cursor: default; }
.film-chapters.is-static .film-chapter:hover { transform: none; border-color: var(--border); }

.film-tagline {
    margin: 22px auto 0;
    text-align: center;
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--accent-soft);
}

/* Visually hidden helper */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 767px) {
    /* Phones get the 9:16 cut, so the frame flips with it (cobalt.js picks the
       matching source at the same breakpoint). Capped in width, otherwise a
       tablet just under the breakpoint would stretch a portrait film to ~1.2k tall. */
    .film-player {
        aspect-ratio: 9 / 16;
        width: min(100%, 380px);
        margin: 0 auto;
        border-radius: 16px;
    }
    .film-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 419px) {
    .film-chapter-text { display: none; }
    .film-sound { padding: 9px 13px; font-size: 13px; }
    .film-volume { width: 64px; }
}
@media (prefers-reduced-motion: reduce) {
    .film-chapter:hover { transform: none; }
    .film-sound.is-prompting,
    .film-sound.is-prompting::after { animation: none; }
}
