/* ============================================================
   landing-film.css — film na /prezentacja zbudowany W CAŁOŚCI w HTML/CSS
   (bez ilustracji SVG i bez SMIL; jedyne SVG to drobne ikony jak na landingu).

   Ładowany WYŁĄCZNIE przez <HeadContent> strony Components/Pages/Prezentacja.razor, po css/marketing.css
   (z niego tokeny :root: kolory, fonty, ramki, cienie). Silnik: wwwroot/js/landing-intro.js.
   Scenariusz i czasy scen: Components/Landing/IntroFilm.razor (tablica Scenes), sceny: Components/Landing/Scenes/.

   Widoki: #landing-root[data-view="film" | "end"]
     film — pełnoekranowa nakładka (pasek postępu, „ekran" ze scenami, sterowanie),
     end  — karta końcowa [data-testid="film-end"] w <main> (w widoku film jest tylko niewidoczna → zero CLS).

   ZASADY RUCHU
   - Animujemy tylko transform / opacity (+ clip-path przy odsłonięciach). Zero animacji layoutu i kolorów.
   - Animacje elementów działają WYŁĄCZNIE w scenie z klasą .scene--run (aktywna + schodząca podczas przejścia);
     nieaktywne sceny nie animują nic w tle. JS restartuje scenę: zdejmuje .scene--run, reflow, dokłada.
   - Opóźnienie elementu: style="--d:900ms" (od startu sceny); czas opcjonalnie --t.
   - Prymitywy wejścia (.a-*) mają fill „backwards" i keyframe „to" = stan bazowy elementu, więc po animacji
     zostaje zwykły styl (brak wiszących transformacji). Elementy efemeryczne (kursor, pierścień, lot pliku)
     mają stan bazowy „ukryty".
   - Pauza: #landing-root.is-paused → animation-play-state: paused na WSZYSTKIM w nakładce (także pasek postępu).
   - Reduced motion: wszystkie animacje scen trwają 1 ms bez opóźnień → od razu stan końcowy (bez ruchu).
   - Układ scen: kontener rozmiaru .film__stage („film-stage"); kadr poziomy = @container (min-aspect-ratio: 6/5),
     w przeciwnym razie pionowy. Makiety (.fx-art) to kontenery inline-size — ich wnętrze skaluje się w cqi
     (jak viewBox), więc kompozycja wygląda tak samo od 320 do 1000 px szerokości makiety.
   ============================================================ */

/* ============================================================
   1. WIDOKI
   ============================================================ */
.landing-film { display: none; }
#landing-root[data-view="film"] .landing-film { display: block; }

/* Karta końcowa zajmuje miejsce także pod filmem — przełączenie widoku nie przesuwa stopki. */
.film-end { visibility: hidden; }
#landing-root[data-view="end"] .film-end { visibility: visible; }

/* Nakładka zasłania stronę — bez przewijania niewidocznej treści pod spodem. Stała rynna paska przewijania:
   pojawienie się scrollbara po końcu filmu nie przesuwa układu w poziomie. */
html:has(#landing-root) { scrollbar-gutter: stable; }
html:has(#landing-root[data-view="film"]),
body:has(#landing-root[data-view="film"]) { overflow: hidden; }
/* Pod nakładką nic nie jest widoczne, więc strona (nawigacja, karta końcowa, stopka) w ogóle się nie maluje:
   zero przesunięć układu przy podmianie fontów pod spodem (CLS), zero pracy malowania. Widoczne zostają tylko
   nakładka i (dla czytników) <h1>. Tab i tak nie wejdzie w tło — landing-intro.js dokłada też `inert`. */
body:has(#landing-root[data-view="film"]) { visibility: hidden; }
#landing-root[data-view="film"] .landing-film,
#landing-root[data-view="film"] > h1 { visibility: visible; }

/* ============================================================
   2. NAKŁADKA, PASEK POSTĘPU, „EKRAN", STEROWANIE
   ============================================================ */
.landing-film {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    overflow: hidden;
    background-color: var(--color-white);
    background-image: radial-gradient(circle, rgba(0, 0, 0, .09) 1.5px, transparent 1.6px);
    background-size: 24px 24px;
    color: var(--color-black);

    --fx-ease: cubic-bezier(.2, .8, .2, 1);      /* wejścia */
    --fx-io: cubic-bezier(.77, 0, .18, 1);       /* przejścia, wipe, ruch kursora */
    --fx-snap: cubic-bezier(.16, 1.1, .3, 1);    /* pieczątka */
    --fx-back: cubic-bezier(.25, 1.35, .4, 1);   /* upadek z dobiciem */
}
.film {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vmin, 16px);
    width: 100%;
    height: 100%;
    max-width: 1760px;
    margin: 0 auto;
    padding: clamp(10px, 1.8vmin, 22px) clamp(12px, 2.2vw, 36px) clamp(8px, 1.6vmin, 18px);
}

/* pasek postępu: segment = scena; aktywny wypełnia się liniowo (transform), ukośne pasy jadą w rytmie filmu */
.film__progress { display: flex; flex: none; gap: 6px; }
.film__seg {
    position: relative;
    flex: 1;
    height: 10px;
    overflow: hidden;
    background: var(--color-white);
    border: var(--border-thin);
}
.film__seg-fill {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--color-red);
    transform: translateX(-101%);
}
.film__seg--done .film__seg-fill { transform: none; }
.film__seg--active .film__seg-fill { animation: film-progress var(--ms, 5000ms) linear both; }
.film__seg--active .film__seg-fill::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -24px;
    right: 0;
    background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0, 0, 0, .28) 6px 12px);
    animation: film-stripes .7s linear infinite;
}
@keyframes film-progress { from { transform: translateX(-101%); } to { transform: none; } }
@keyframes film-stripes { to { transform: translateX(16.97px); } }   /* okres pasów 45° = 12px·√2 */

/* „ekran" — kontener rozmiaru dla scen */
.film__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 6px 6px 0;   /* miejsce na twardy cień */
    overflow: hidden;
    isolation: isolate;
    container: film-stage / size;
    background: var(--color-black);   /* „czarny ekran" przed startem (czekanie na fonty) = kurtyna sceny 1 */
    border: var(--border-medium);
    box-shadow: 6px 6px 0 var(--color-black);
}
/* plakietka pauzy na ekranie (stan niesie aria-pressed przycisku — napis jest dekoracją) */
.film__stage::after {
    content: "Pauza" / "";
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 60;
    padding: 4px 12px;
    background: var(--color-black);
    color: var(--color-white);
    box-shadow: 3px 3px 0 var(--color-red);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: .875rem;
    opacity: 0;
    pointer-events: none;
}
#landing-root.is-paused .film__stage::after { opacity: 1; }

/* sterowanie */
.film__controls {
    display: flex;
    flex: none;
    align-items: center;
    gap: 12px;
    min-height: 48px;
}
.film__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 16px;
    background: var(--color-white);
    color: var(--color-black);
    border: var(--border-medium);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.film__btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.film__btn:active { transform: translate(2px, 2px); box-shadow: none; }
.film__btn:focus-visible { outline: 3px solid var(--color-red); outline-offset: 3px; }
.film__btn--pause { width: 48px; padding: 0; }
.film__btn--skip { margin-left: auto; background: var(--color-black); color: var(--color-white); }
.film__icon { display: block; flex: none; width: 22px; height: 22px; }
.film__icon-play { display: none; }
#landing-root.is-paused .film__icon-pause { display: none; }
#landing-root.is-paused .film__icon-play { display: block; }
#landing-root.is-paused .film__btn--pause { background: var(--color-red); color: var(--color-white); }

.film__step {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    margin: 0;
}
.film__count {
    flex: none;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 1.0625rem;
    font-variant-numeric: tabular-nums;
}
.film__chapter {
    min-width: 0;
    overflow: hidden;
    color: var(--color-gray-700);
    font-weight: var(--font-weight-semibold);
    font-size: .9375rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ============================================================
   3. SCENY — baza, tła, przejście „wipe + ostrze"
   ============================================================ */
.scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    visibility: hidden;
    background-color: var(--color-white);
    background-image: radial-gradient(circle, rgba(0, 0, 0, .08) 1.5px, transparent 1.6px);
    background-size: 24px 24px;
    background-position: center;
    color: var(--color-black);
}
.scene--gray { background-color: var(--color-gray-100); }
.scene--dark {
    background-color: var(--color-black);
    background-image: radial-gradient(circle, rgba(255, 255, 255, .13) 1.5px, transparent 1.6px);
    color: var(--color-white);
}
.scene--active,
.scene--leaving { visibility: visible; }
.scene--active { z-index: 2; }
.scene--leaving { z-index: 1; }

/* Wejście sceny: odsłonięcie od lewej (clip-path), na krawędzi jedzie czerwono-czarne „ostrze".
   Scena schodząca (.scene--leaving) zostaje pod spodem w kadrze końcowym, aż JS ją wyłączy (animationend). */
.scene--active.scene--run { animation: film-wipe 640ms var(--fx-io) backwards; }
.scene::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    background: linear-gradient(to left, var(--color-red) 0 10px, var(--color-black) 10px 15px, transparent 15px);
    transform: translateX(-101%);
}
.scene--active.scene--run::after { animation: film-blade 640ms var(--fx-io) backwards; }
@keyframes film-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes film-blade { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* ============================================================
   4. PRYMITYWY ANIMACJI (tylko w .scene--run)
   ============================================================ */
.scene--run .a-rise   { animation: a-rise var(--t, 600ms) var(--fx-ease) var(--d, 0ms) backwards; }
.scene--run .a-fade   { animation: a-fade var(--t, 450ms) ease var(--d, 0ms) backwards; }
.scene--run .a-pop    { animation: a-pop var(--t, 420ms) cubic-bezier(.2, 1.4, .4, 1) var(--d, 0ms) backwards; }
.scene--run .a-stamp  { animation: a-stamp var(--t, 440ms) var(--fx-snap) var(--d, 0ms) backwards; }
.scene--run .a-drop   { animation: a-drop var(--t, 650ms) var(--fx-back) var(--d, 0ms) backwards; }
.scene--run .a-slide  { animation: a-slide var(--t, 560ms) var(--fx-ease) var(--d, 0ms) backwards; }
.scene--run .a-flip   { animation: a-flip var(--t, 620ms) var(--fx-ease) var(--d, 0ms) backwards; }
.scene--run .a-wipe   { animation: a-wipe var(--t, 520ms) var(--fx-io) var(--d, 0ms) backwards; }
.scene--run .a-grow-x { animation: a-grow-x var(--t, 600ms) var(--fx-io) var(--d, 0ms) backwards; }
.scene--run .a-grow-y { animation: a-grow-y var(--t, 520ms) var(--fx-ease) var(--d, 0ms) backwards; }
/* wciśnięcie przycisku — lico wjeżdża w twardy cień i wraca (stan bazowy bez zmian) */
.scene--run .a-press  { animation: a-press 340ms ease-in-out var(--d, 0ms); }

.a-grow-x { transform-origin: 0 50%; }
.a-grow-y { transform-origin: 50% 100%; }
.a-flip { transform-origin: 50% 0; }
.a-wipe { display: inline-block; }
.fx-title.a-wipe { display: block; }

@keyframes a-rise  { from { opacity: 0; transform: translateY(var(--y, 18px)); } }
@keyframes a-fade  { from { opacity: 0; } }
@keyframes a-pop   { from { opacity: 0; transform: scale(.4); } 60% { opacity: 1; } }
@keyframes a-stamp {
    0%  { opacity: 0; transform: scale(1.9) rotate(-9deg); }
    55% { opacity: 1; }
    72% { transform: scale(.95) rotate(1.2deg); }
}
@keyframes a-drop  { 0% { opacity: 0; transform: translateY(-48px); } 30% { opacity: 1; } }
@keyframes a-slide { from { opacity: 0; transform: translateX(-24px); } }
@keyframes a-flip  { from { opacity: 0; transform: perspective(700px) rotateX(-82deg); } 45% { opacity: 1; } }
@keyframes a-wipe  { from { clip-path: inset(-30% 100% -30% -6%); } to { clip-path: inset(-30% -6% -30% -6%); } }
@keyframes a-grow-x { from { transform: scaleX(0); } }
@keyframes a-grow-y { from { transform: scaleY(0); } }
@keyframes a-press  { 35%, 65% { transform: translate(var(--px, 3px), var(--px, 3px)); } }
@keyframes a-show  { from { opacity: 0; } }

/* ============================================================
   5. WSPÓLNE KLOCKI SCEN
   ============================================================ */

/* --- układ „podpis + makieta": pionowo (podpis nad makietą), w kadrze poziomym obok siebie --- */
.fx-split {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: center;
    gap: clamp(14px, 3.4cqh, 32px);
    padding: clamp(14px, 4.6cqw, 40px);
    text-align: center;
}
.fx-cap { width: 100%; max-width: 36rem; }

.fx-title {
    margin: 0 0 clamp(8px, 1.8cqh, 16px);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: clamp(1.5rem, min(7.4cqw, 5.2cqh), 3.25rem);
    line-height: 1.04;
    letter-spacing: -.02em;
    text-wrap: balance;
}
.fx-title::after {
    content: "";
    display: block;
    width: clamp(44px, 9cqw, 72px);
    height: 6px;
    margin: .32em auto 0;
    background: var(--color-red);
}
.fx-lead {
    max-width: 42ch;
    margin: 0 auto;
    color: var(--color-gray-800);
    font-size: clamp(.9375rem, min(4.2cqw, 2.7cqh), 1.25rem);
    line-height: 1.45;
    text-wrap: pretty;
}
.scene--dark .fx-lead { color: var(--color-gray-300); }

.fx-eyebrow {
    display: inline-block;
    margin: 0 0 clamp(8px, 1.8cqh, 16px);
    padding: 4px 10px;
    background: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: clamp(.75rem, 3cqw, .9375rem);
    line-height: 1.3;
    letter-spacing: .02em;   /* bez uppercase — „KSeF" musi zachować pisownię */
}
.fx-eyebrow--red { background: var(--color-red); }
.scene--dark .fx-eyebrow { background: var(--color-white); color: var(--color-black); }
.scene--dark .fx-eyebrow--red { background: var(--color-red); color: var(--color-white); }

/* numer kroku 01/02/03 (jak .mk-steps__item::before na landingu) */
.fx-step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 clamp(10px, 2.2cqh, 20px);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: clamp(.8125rem, 3.4cqw, 1rem);
}
.fx-step__n {
    padding: 2px 10px;
    background: var(--color-red);
    color: var(--color-white);
    border: var(--border-medium);
    box-shadow: 3px 3px 0 var(--color-black);
    font-weight: var(--font-weight-black);
    font-size: 1.6em;
    line-height: 1.1;
}

/* makieta: stałe proporcje 4:3, wnętrze w jednostkach cqi */
.fx-art {
    position: relative;
    width: min(100%, calc(46cqh * 4 / 3));
    aspect-ratio: 4 / 3;
    container-type: inline-size;
    text-align: left;
}

@container film-stage (min-aspect-ratio: 6/5) {
    .fx-split {
        grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
        align-content: stretch;
        align-items: center;
        justify-items: start;
        gap: clamp(20px, 3.4cqw, 72px);
        padding: clamp(16px, 5cqh, 56px) clamp(20px, 4.6cqw, 88px);
        text-align: left;
    }
    .fx-cap { max-width: 38rem; }
    .fx-title { font-size: clamp(1.375rem, min(4.4cqw, 8.4cqh), 5.25rem); }
    .fx-title--long { font-size: clamp(1.25rem, min(3.5cqw, 6.8cqh), 4rem); }
    .fx-title::after { margin-inline: 0; }
    .fx-lead { margin: 0; font-size: clamp(.9375rem, min(1.55cqw, 3.1cqh), 1.625rem); }
    .fx-eyebrow { font-size: clamp(.75rem, min(1.05cqw, 2.1cqh), 1.125rem); }
    .fx-step { font-size: clamp(.8125rem, min(1.2cqw, 2.4cqh), 1.25rem); }
    .fx-art { width: min(100%, calc(80cqh * 4 / 3)); justify-self: center; }
}

/* --- drobne elementy makiet --- */

/* zielony znacznik „gotowe" (rozmiar = font-size kontekstu) */
.fx-ok {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 1.2em;
    height: 1.2em;
    background: var(--color-success);
    border: max(2px, .12em) solid var(--color-black);
}
.fx-ok::after {
    content: "";
    width: .3em;
    height: .56em;
    border: solid var(--color-white);
    border-width: 0 .13em .13em 0;
    transform: translateY(-.06em) rotate(45deg);
}

/* chip (np. „Dane z GUS"); --ok = z zielonym ptaszkiem */
.fx-chip {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: .38em .7em;
    background: var(--color-white);
    color: var(--color-black);
    border: max(2px, .12em) solid var(--color-black);
    box-shadow: .18em .18em 0 var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    white-space: nowrap;
}
.fx-chip--ok::before {
    content: "";
    flex: none;
    width: .4em;
    height: .72em;
    margin: -.12em .15em 0 .1em;
    border: solid var(--color-success);
    border-width: 0 .17em .17em 0;
    transform: rotate(45deg);
}

/* przycisk z twardym cieniem jako osobną warstwą (wciśnięcie = lico wjeżdża w cień) */
.fx-btn { position: relative; display: inline-grid; --px: max(2px, 1cqi); }
.fx-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--color-black);
    transform: translate(var(--px), var(--px));
}
.fx-btn__face {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45em;
    padding: .55em 1em;
    background: var(--color-red);
    color: var(--color-white);
    border: max(2px, .45cqi) solid var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    white-space: nowrap;
}
.fx-btn__face .mk-icon { width: 1.15em; height: 1.15em; }

/* kursor myszy: najazd z (--cx, --cy) na swoje miejsce, „klik" w 52% czasu, potem znika */
.fx-cursor {
    position: absolute;
    left: 58%;
    top: 52%;
    z-index: 8;
    width: max(16px, 5.6cqi);
    height: max(16px, 5.6cqi);
    opacity: 0;
    pointer-events: none;
}
.fx-cursor__svg { display: block; width: 100%; height: 100%; }
.scene--run .fx-cursor { animation: fx-cursor var(--t, 1400ms) var(--fx-io) var(--d, 0ms) both; }
@keyframes fx-cursor {
    0%   { opacity: 0; transform: translate(var(--cx, 20cqi), var(--cy, 14cqi)); }
    12%  { opacity: 1; }
    45%  { opacity: 1; transform: translate(0, 0) scale(1); }
    52%  { transform: translate(0, 0) scale(.78); }
    60%  { transform: translate(0, 0) scale(1); }
    82%  { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 0; transform: translate(3cqi, 4cqi); }
}

/* kwadratowy „pierścień" kliknięcia (echo uderzenia) */
.fx-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 7;
    width: 16cqi;
    height: 16cqi;
    margin: -8cqi 0 0 -8cqi;
    border: max(2px, .6cqi) solid var(--color-red);
    opacity: 0;
    pointer-events: none;
}
.scene--run .fx-ring { animation: fx-ring 700ms var(--fx-ease) var(--d, 0ms) forwards; }
@keyframes fx-ring {
    0%   { opacity: .95; transform: scale(.3) rotate(0deg); }
    100% { opacity: 0; transform: scale(1.45) rotate(12deg); }
}

/* pulsująca obwódka (pętla) */
.fx-pulse {
    position: absolute;
    inset: calc(-1 * max(5px, 1.4cqi));
    border: max(2px, .5cqi) solid var(--color-red);
    opacity: 0;
    pointer-events: none;
}
.scene--run .fx-pulse { animation: fx-pulse 1.4s ease-out var(--d, 0ms) infinite; }
@keyframes fx-pulse {
    0%       { opacity: .9; transform: scale(.94); }
    70%, 100% { opacity: 0; transform: scale(1.12); }
}

/* licznik-odometr (Scenes/FilmRoll.razor): kolumna 2×(0–9), stan bazowy = cyfra docelowa w 2. obiegu */
.fx-roll { display: inline-flex; align-items: flex-start; line-height: 1; font-variant-numeric: tabular-nums; vertical-align: top; }
.fx-roll__col { display: inline-block; height: 1em; overflow: hidden; }
.fx-roll__strip { display: block; transform: translateY(calc((10 + var(--n)) * -5%)); }
.fx-roll__strip > span { display: block; height: 1em; }
.fx-roll__sep { white-space: pre; }
.scene--run .fx-roll__strip { animation: fx-roll calc(720ms + var(--k) * 90ms) cubic-bezier(.2, .75, .25, 1) var(--d, 0ms) backwards; }
@keyframes fx-roll { from { transform: translateY(0); } }

/* sześcian KSeF (CSS 3D, jak w posterze hero): biały front z napisem, czarna góra z czerwoną szczeliną */
.fx-cube {
    --s: 24cqi;
    position: relative;
    width: var(--s);
    height: var(--s);
    transform-style: preserve-3d;
    transform: rotateX(-19deg) rotateY(-26deg);
}
.scene--run .fx-cube { animation: fx-cube-idle 3.2s ease-in-out infinite alternate; }
@keyframes fx-cube-idle {
    from { transform: rotateX(-19deg) rotateY(-33deg); }
    to   { transform: rotateX(-16deg) rotateY(-19deg); }
}
.fx-cube__face {
    position: absolute;
    inset: 0;
    border: max(2px, .7cqi) solid var(--color-black);
}
.fx-cube__face--front {
    display: grid;
    place-items: center;
    background: var(--color-white);
    color: var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: calc(var(--s) * .27);
    line-height: 1;
    letter-spacing: -.01em;
    transform: translateZ(calc(var(--s) / 2));
}
.fx-cube__face--top {
    background:
        linear-gradient(#1A1A1A, #1A1A1A) center / 62% 8% no-repeat,
        linear-gradient(var(--color-red), var(--color-red)) center / 72% 20% no-repeat,
        var(--color-black);
    transform: rotateX(90deg) translateZ(calc(var(--s) / 2));
}
.fx-cube__face--side {
    background: var(--color-black);
    transform: rotateY(90deg) translateZ(calc(var(--s) / 2));
}
/* błysk szczeliny przy „połknięciu" pliku */
.fx-cube__glow {
    position: absolute;
    left: 12%;
    right: 12%;
    top: 36%;
    bottom: 36%;
    background: var(--color-red-light);
    opacity: 0;
}
.scene--run .fx-cube__glow { animation: fx-glow 650ms ease-out var(--d, 0ms) forwards; }
@keyframes fx-glow { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

/* ============================================================
   6. SCENY
   ============================================================ */

/* ---------- 6.1 OTWARCIE ---------- */
.s-open {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(16px, 5cqw, 72px);
    text-align: center;
}
/* wielki konturowy „KSeF" w tle (jak .mk-final::before) — dekoracja, pusty tekst alternatywny.
   Obrys POD wypełnieniem w kolorze tła (paint-order) — uzasadnienie przy .mk-final::before w marketing.css. */
.s-open::before {
    content: "KSeF" / "";
    position: absolute;
    right: -3cqw;
    bottom: -5cqh;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: min(44cqw, 62cqh);
    line-height: .8;
    letter-spacing: -.04em;
    color: var(--color-white);
    -webkit-text-stroke: 4px rgba(0, 0, 0, .08);
    paint-order: stroke fill;
    pointer-events: none;
    user-select: none;
}
.scene--run .s-open::before { animation: s-open-drift var(--ms, 4500ms) linear both; }
@keyframes s-open-drift { from { transform: translateX(5%); } to { transform: translateX(-3%); } }

.s-open__curtain { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.s-open__half { position: absolute; top: 0; bottom: 0; width: 50.5%; background: var(--color-black); }
.s-open__half--l { left: 0; }
.s-open__half--r { right: 0; }
.scene--run .s-open__half--l { animation: s-open-l 720ms var(--fx-io) var(--d, 0ms) both; }
.scene--run .s-open__half--r { animation: s-open-r 720ms var(--fx-io) var(--d, 0ms) both; }
@keyframes s-open-l { to { transform: translateX(-101%); } }
@keyframes s-open-r { to { transform: translateX(101%); } }
.s-open__logo { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.s-open__logo-in {
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: clamp(2.25rem, min(11cqw, 16cqh), 7.5rem);
    line-height: 1;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.s-open__logo-dot { color: var(--color-red); }
.scene--run .s-open__logo { animation: s-open-logo 420ms var(--fx-io) var(--d, 0ms) both; }
@keyframes s-open-logo { to { opacity: 0; transform: scale(.8); } }

.s-open__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}
.s-open__title {
    margin: 0 0 clamp(16px, 4cqh, 40px);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: clamp(1.875rem, min(10.4cqw, 7.4cqh), 4.5rem);
    line-height: 1.02;
    letter-spacing: -.03em;
    text-wrap: balance;
}
.s-open__w { display: inline-block; }
.s-open__accent { display: block; width: fit-content; margin: .16em auto 0; transform: rotate(-2deg); }
.s-open__accent-in {
    display: inline-block;
    padding: .04em .24em .1em;
    background: var(--color-red);
    color: var(--color-white);
    border: max(3px, .055em) solid var(--color-black);
    box-shadow: .1em .1em 0 var(--color-black);
}
.s-open__steps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 3cqh, 22px);
    margin: 0;
    padding: 0;
    list-style: none;
}
.s-open__steps li {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .55em;
    padding: .35em .85em .35em .35em;
    background: var(--color-white);
    border: var(--border-medium);
    box-shadow: 4px 4px 0 var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: clamp(.9375rem, min(4.4cqw, 3cqh), 1.25rem);
    line-height: 1.1;
    white-space: nowrap;
}
.s-open__n {
    display: grid;
    place-items: center;
    width: 1.65em;
    height: 1.65em;
    background: var(--color-black);
    color: var(--color-white);
    font-weight: var(--font-weight-black);
}
.s-open__steps li:last-child .s-open__n { background: var(--color-red); }
.s-open__steps li + li::before {   /* strzałka ▼ między krokami */
    content: "";
    position: absolute;
    left: 50%;
    top: calc(-1 * clamp(14px, 3cqh, 22px) + 3px);
    width: 14px;
    height: 8px;
    margin-left: -7px;
    background: var(--color-black);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}
@container film-stage (min-aspect-ratio: 6/5) {
    .s-open__title { font-size: clamp(2rem, min(6.6cqw, 11.5cqh), 8rem); }
    .s-open__steps { flex-direction: row; gap: clamp(28px, 3.6cqw, 56px); }
    .s-open__steps li { font-size: clamp(.875rem, min(1.6cqw, 3.1cqh), 1.625rem); }
    .s-open__steps li + li::before {   /* strzałka ▶ */
        left: calc(-1 * clamp(28px, 3.6cqw, 56px) / 2 - 5px);
        top: 50%;
        width: 10px;
        height: 16px;
        margin: -8px 0 0;
        clip-path: polygon(0 0, 100% 50%, 0 100%);
    }
}

/* ---------- 6.2 TERMINY KSeF (ciemna) ---------- */
.s-dates {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(12px, 3.4cqh, 36px);
    padding: clamp(14px, 4.6cqw, 40px);
}
.s-dates__head { text-align: center; }
.s-dates__head .fx-title,
.s-dates__head .fx-lead { max-width: 30ch; margin-inline: auto; }
.s-dates__head .fx-lead { max-width: 44ch; }
.s-dates__track { position: relative; }
.s-dates__axis {   /* pion: czerwona oś po lewej */
    position: absolute;
    z-index: 0;
    left: clamp(6px, 2.2cqw, 12px);
    top: 4px;
    bottom: 4px;
    width: 6px;
    background: var(--color-red);
    transform-origin: 50% 0;
}
.scene--run .s-dates__axis { animation: a-grow-y 1300ms var(--fx-io) var(--d, 0ms) backwards; }
.s-dates__list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: clamp(8px, 1.8cqh, 16px);
    margin: 0;
    padding: 0 0 0 clamp(26px, 7.5cqw, 40px);
    list-style: none;
}
.s-dates__card {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35em .7em;
    padding: clamp(9px, 1.9cqh, 22px) clamp(12px, 2.2cqw, 24px);
    background: var(--color-white);
    color: var(--color-black);
    border: 3px solid var(--color-white);
    box-shadow: 6px 6px 0 var(--color-red);
    text-align: left;
}
.s-dates__card > * { margin: 0; }
.s-dates__date {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: clamp(1.125rem, min(5.6cqw, 3.9cqh), 1.875rem);
    line-height: 1;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.s-dates__status {
    padding: 3px 8px;
    background: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: clamp(.6875rem, 2.7cqw, .8125rem);
    line-height: 1.2;
    letter-spacing: .06em;
    text-transform: uppercase;   /* „OBOWIĄZUJE" / „NADCHODZI" — bez słowa KSeF */
}
.s-dates__title {
    flex-basis: 100%;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: clamp(.9375rem, min(4.2cqw, 2.9cqh), 1.25rem);
    line-height: 1.2;
}
.s-dates__note {
    flex-basis: 100%;
    color: var(--color-gray-800);
    font-size: clamp(.8125rem, min(3.4cqw, 2.4cqh), 1rem);
    line-height: 1.35;
}
.s-dates__card--next {
    background: var(--color-black);
    color: var(--color-white);
    border: 3px dashed var(--color-white);
    box-shadow: none;
}
.s-dates__card--next .s-dates__status { background: var(--color-red); }
.s-dates__card--next .s-dates__note { color: var(--color-gray-300); }
/* „Nadchodzi" — czerwona ramka pulsuje po wejściu kart */
.s-dates__card--next::after {
    content: "";
    position: absolute;
    inset: -9px;
    border: 3px solid var(--color-red);
    opacity: 0;
    pointer-events: none;
}
.scene--run .s-dates__card--next::after { animation: fx-pulse 1.6s ease-out 3000ms infinite; }

@container film-stage (min-aspect-ratio: 6/5) {
    .s-dates { padding: clamp(16px, 5cqh, 56px) clamp(20px, 5.2cqw, 96px); }
    .s-dates__head { text-align: left; }
    .s-dates__head .fx-title,
    .s-dates__head .fx-lead { max-width: none; margin-inline: 0; }
    .s-dates__axis {   /* poziom: oś za kartami */
        left: 0;
        right: 0;
        top: clamp(24px, 5.2cqh, 46px);
        bottom: auto;
        width: auto;
        height: 6px;
        transform-origin: 0 50%;
    }
    .scene--run .s-dates__axis { animation-name: a-grow-x; }
    .s-dates__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.6cqw, 44px); padding: 0; }
    .s-dates__card { display: block; box-shadow: 8px 8px 0 var(--color-red); }
    .s-dates__card--next { box-shadow: none; }
    .s-dates__date { margin-bottom: .32em; font-size: clamp(1.25rem, min(2.8cqw, 5.6cqh), 3.25rem); }
    .s-dates__status { display: inline-block; margin-bottom: .75em; font-size: clamp(.6875rem, min(.95cqw, 1.9cqh), 1rem); }
    .s-dates__title { margin-bottom: .35em; font-size: clamp(1rem, min(1.7cqw, 3.4cqh), 1.875rem); }
    .s-dates__note { font-size: clamp(.8125rem, min(1.2cqw, 2.4cqh), 1.25rem); }
}

/* ---------- 6.3 KROK 1: NIP ---------- */
.s-nip {
    position: absolute;
    inset: 1.5cqi 2.6cqi 3cqi 1cqi;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: max(2px, .6cqi) solid var(--color-black);
    box-shadow: 1.8cqi 1.8cqi 0 var(--color-black);
}
.s-nip__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2cqi 3.6cqi;
    background: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 4cqi;
    line-height: 1;
}
.s-nip__head .fx-ok { font-size: 1em; border-color: var(--color-white); }
.s-nip__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.6cqi 4cqi 2.6cqi;
}
.s-nip__label {
    margin: 0 0 1cqi;
    color: var(--color-gray-700);
    font-size: 2.8cqi;
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
}
.s-nip__row { display: flex; align-items: stretch; gap: 2.4cqi; margin-bottom: 2.6cqi; }
.s-nip__field {
    position: relative;
    display: flex;
    align-items: center;
    height: 8.6cqi;
    margin-bottom: 2.4cqi;
    padding: 0 2.2cqi;
    background: var(--color-white);
    border: max(2px, .45cqi) solid var(--color-black);
    font-size: 3.6cqi;
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    overflow: hidden;
}
.s-nip__field--nip {
    flex: 1;
    min-width: 0;
    gap: 2cqi;
    margin-bottom: 0;
    padding-left: 0;
    overflow: visible;
    font-size: 4.4cqi;
}
.s-nip__tag {
    align-self: stretch;
    display: grid;
    place-items: center;
    padding: 0 2cqi;
    background: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 3.2cqi;
}
.s-nip__digits { position: relative; display: flex; font-variant-numeric: tabular-nums; }
.s-nip__ch { display: inline-block; width: .62em; text-align: center; }
.scene--run .s-nip__ch { animation: a-show 1ms linear calc(800ms + var(--i) * 72ms) backwards; }
/* karetka: skacze o jedną komórkę na znak (steps), mruga po wpisaniu, gaśnie przy kliknięciu w GUS */
.s-nip__caret {
    position: absolute;
    left: 0;
    top: .06em;
    bottom: .06em;
    width: max(2px, .4cqi);
    margin-left: -1px;
    background: var(--color-red);
    transform: translateX(8.06em);   /* 13 komórek × .62em */
    opacity: 0;
}
.scene--run .s-nip__caret {
    animation:
        s-nip-caret-move 936ms steps(13, jump-start) 800ms both,
        s-nip-caret-on 1650ms linear 700ms both;
}
@keyframes s-nip-caret-move { from { transform: translateX(0); } to { transform: translateX(8.06em); } }
@keyframes s-nip-caret-on {
    0%, 68%       { opacity: 1; }
    68.1%, 80%    { opacity: 0; }
    80.1%, 92%    { opacity: 1; }
    92.1%, 100%   { opacity: 0; }
}
.s-nip__load {   /* pasek „pobieranie z GUS" pod polem */
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: calc(-1 * max(2px, .45cqi) - 1.4cqi);
    height: 1cqi;
    background: var(--color-red);
    transform-origin: 0 50%;
    opacity: 0;
}
.scene--run .s-nip__load { animation: s-nip-load 620ms ease-in-out 2420ms both; }
@keyframes s-nip-load {
    0%   { opacity: 1; transform: scaleX(0); }
    80%  { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}
.s-nip__btn { flex: none; font-size: 3.2cqi; }
.s-nip__btn .fx-btn__face { height: 100%; padding: 0 2.6cqi; }
.s-nip__btn .fx-cursor { left: 52%; top: 46%; }
.s-nip__chips { display: flex; flex-wrap: wrap; gap: 2.2cqi; margin-top: .4cqi; font-size: 2.9cqi; }

/* ---------- 6.4 KROK 2: FAKTURA ---------- */
.s-inv {
    position: absolute;
    inset: 0 2.6cqi 3cqi 1cqi;
    display: flex;
    flex-direction: column;
}
.s-inv__tabs { display: flex; gap: 1.4cqi; margin-bottom: 2.6cqi; }
.s-inv__tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1.2cqi;
    padding: 1.4cqi 2.2cqi;
    background: var(--color-white);
    border: max(2px, .45cqi) solid var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: 3cqi;
    line-height: 1;
    white-space: nowrap;
}
.s-inv__tab--on { background: var(--color-black); color: var(--color-white); }
.s-inv__tab--on .fx-ok { border-color: var(--color-white); }
.s-inv__tab-bar {
    position: absolute;
    left: calc(-1 * max(2px, .45cqi));
    right: calc(-1 * max(2px, .45cqi));
    bottom: -1.8cqi;
    height: 1cqi;
    background: var(--color-red);
}
.s-inv__doc {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: max(2px, .6cqi) solid var(--color-black);
    box-shadow: 1.8cqi 1.8cqi 0 var(--color-black);
}
.s-inv__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.6cqi 3cqi;
    background: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 3.4cqi;
    line-height: 1;
}
.s-inv__fa { padding: .8cqi 1.4cqi; background: var(--color-red); font-size: .82em; }
.s-inv__buyer {
    margin: 0;
    padding: 1.8cqi 3cqi 1.2cqi;
    overflow: hidden;
    color: var(--color-gray-700);
    font-size: 2.6cqi;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.s-inv__buyer b { color: var(--color-black); font-weight: var(--font-weight-semibold); }
.s-inv__table { padding: 0 3cqi; }
.s-inv__tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7cqi 19cqi 9cqi;
    align-items: center;
    gap: 1.5cqi;
    padding: 1.2cqi 0;
    border-bottom: max(1px, .3cqi) solid var(--color-gray-300);
    font-size: 3cqi;
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}
.s-inv__tr > :nth-child(n + 2) { text-align: right; }
.s-inv__tr > :first-child { overflow: hidden; text-overflow: ellipsis; }
.s-inv__tr--th {
    padding-top: .4cqi;
    border-bottom-color: var(--color-black);
    color: var(--color-gray-600);
    font-size: 2.4cqi;
}
.s-inv__rate {
    display: inline-block;
    padding: .4cqi 1cqi;
    background: var(--color-red);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 2.6cqi;
    line-height: 1.1;
}
.s-inv__foot {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3cqi;
    padding: 2cqi 3cqi 2.8cqi;
}
.s-inv__send { font-size: 3cqi; }
.s-inv__sum {
    display: grid;
    grid-template-columns: auto auto;
    align-items: end;
    gap: .9cqi 3cqi;
    font-size: 2.9cqi;
}
.s-inv__k { color: var(--color-gray-700); font-weight: var(--font-weight-semibold); line-height: 1; }
.s-inv__v { text-align: right; font-weight: var(--font-weight-semibold); line-height: 1; white-space: nowrap; }
.s-inv__k--big { color: var(--color-black); font-family: var(--font-heading); font-weight: var(--font-weight-black); font-size: 3.6cqi; }
.s-inv__v--big { position: relative; font-family: var(--font-heading); font-weight: var(--font-weight-black); font-size: 5.6cqi; }
.s-inv__uline { position: absolute; left: 0; right: 0; bottom: -1.4cqi; height: 1cqi; background: var(--color-red); }

/* ---------- 6.5 KROK 3: WYSYŁKA DO KSeF ---------- */
.s-send { position: absolute; inset: 0; }
.s-send__doc {
    position: absolute;
    left: 3cqi;
    top: 3cqi;
    width: 33cqi;
    height: 47cqi;
    display: flex;
    flex-direction: column;
    gap: 2.4cqi;
    padding-bottom: 3cqi;
    background: var(--color-white);
    border: max(2px, .6cqi) solid var(--color-black);
    box-shadow: 1.6cqi 1.6cqi 0 var(--color-black);
}
.s-send__doc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4cqi 2cqi;
    background: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 2.7cqi;
    line-height: 1;
}
.s-send__fa { padding: .6cqi 1cqi; background: var(--color-red); font-size: .85em; }
.s-send__line { display: block; height: 1.6cqi; margin: 0 2.6cqi; background: var(--color-gray-300); }
.s-send__line--short { width: 55%; }
.s-send__total {
    margin: auto 2.6cqi 0 auto;
    padding: 1cqi 1.6cqi;
    border: max(2px, .45cqi) solid var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 3.4cqi;
    line-height: 1;
    white-space: nowrap;
}
.s-send__stamp-tilt { position: absolute; left: 13%; top: 40%; z-index: 1; transform: rotate(-12deg); }
.s-send__stamp {
    display: inline-flex;
    align-items: center;
    gap: 1.4cqi;
    padding: 1.2cqi 2.4cqi;
    background: var(--color-white);
    border: 1cqi solid var(--color-red);
    box-shadow: 0 0 0 .45cqi var(--color-black), 1cqi 1cqi 0 .45cqi var(--color-black);
    color: var(--color-red);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 5cqi;
    line-height: 1;
}
.s-send__stamp::before {   /* ✓ */
    content: "";
    width: 1.5cqi;
    height: 3cqi;
    border: solid var(--color-red);
    border-width: 0 .9cqi .9cqi 0;
    transform: rotate(45deg) translate(-.3cqi, -.5cqi);
}
/* plik FA(3) XML: wyskakuje z faktury i leci łukiem do szczeliny sześcianu */
.s-send__xml {
    position: absolute;
    left: 9cqi;
    top: 21cqi;
    z-index: 3;
    padding: 1.2cqi 2cqi;
    background: var(--color-black);
    color: var(--color-white);
    box-shadow: .9cqi .9cqi 0 var(--color-red);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 2.8cqi;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
}
.scene--run .s-send__xml { animation: s-send-fly 1000ms cubic-bezier(.45, 0, .3, 1) var(--d, 0ms) both; }
@keyframes s-send-fly {
    0%   { opacity: 0; transform: translate(0, 2cqi) scale(.6); }
    12%  { opacity: 1; transform: translate(0, -4cqi) scale(1); }
    55%  { opacity: 1; transform: translate(34cqi, -15cqi) rotate(10deg) scale(.95); }
    86%  { opacity: 1; transform: translate(53cqi, 2cqi) rotate(14deg) scale(.62); }
    100% { opacity: 0; transform: translate(55cqi, 9cqi) rotate(14deg) scale(.4); }
}
.s-send__btn { position: absolute; left: 3cqi; top: 55.5cqi; z-index: 2; font-size: 3.2cqi; }
.s-send__btn .fx-btn__face { padding: 1.6cqi 2.6cqi; }
.s-send__btn .fx-cursor { left: 66%; top: 50%; }
.s-send__status { position: absolute; left: 3cqi; top: 67cqi; font-size: 2.9cqi; }
.s-send__cube { position: absolute; left: 61cqi; top: 39cqi; z-index: 4; width: 24cqi; height: 24cqi; }
.s-send__squash { width: 100%; height: 100%; perspective: 80cqi; transform-origin: 50% 100%; }
.scene--run .s-send__squash { animation: s-send-squash 460ms cubic-bezier(.3, 1.4, .4, 1) var(--d, 0ms); }
@keyframes s-send-squash { 40% { transform: scale(1.07, .88); } 70% { transform: scale(.98, 1.03); } }
/* kwit z numerem KSeF wysuwa się ze szczeliny (dolna krawędź „okna" = szczelina) */
.s-send__ticket-clip {
    position: absolute;
    left: 54cqi;
    top: 6cqi;
    z-index: 5;
    width: 37cqi;
    height: 33cqi;
    overflow: hidden;
    pointer-events: none;
}
.s-send__ticket {
    position: absolute;
    left: 2cqi;
    right: 3cqi;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2cqi;
    padding: 2cqi 2.4cqi 3.4cqi;
    background: var(--color-white);
    border: max(2px, .55cqi) solid var(--color-black);
    border-bottom: 0;
}
.scene--run .s-send__ticket { animation: s-send-ticket 620ms cubic-bezier(.2, .9, .3, 1.12) var(--d, 0ms) backwards; }
@keyframes s-send-ticket { from { transform: translateY(105%); } }
.s-send__ticket-label {
    color: var(--color-red);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 2.8cqi;
    line-height: 1;
}
.s-send__ticket-no {
    font-size: 2.5cqi;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.s-send__upo-tilt { position: absolute; left: 70cqi; top: 65.5cqi; z-index: 6; transform: rotate(-6deg); }
.s-send__upo {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1.8cqi;
    padding: 1.2cqi 2.2cqi 1.2cqi 2.6cqi;
    background: var(--color-black);
    color: var(--color-white);
    box-shadow: 1.2cqi 1.2cqi 0 var(--color-red);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 4.4cqi;
    line-height: 1;
}
.s-send__upo::after {   /* czerwony ✓ */
    content: "";
    width: 1.5cqi;
    height: 3cqi;
    border: solid var(--color-red);
    border-width: 0 .9cqi .9cqi 0;
    transform: rotate(45deg) translateY(-.4cqi);
}

/* ---------- 6.6 FUNKCJE ---------- */
.s-feat {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(12px, 2.8cqh, 28px);
    padding: clamp(14px, 4.6cqw, 40px);
}
.s-feat__head { text-align: center; }
.s-feat__head .fx-title { max-width: 22ch; margin-inline: auto; }
.s-feat__head .fx-lead { max-width: 52ch; }
.s-feat__wrap { position: relative; }
.s-feat__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(6px, 1.3cqh, 12px) clamp(6px, 2.2cqw, 12px);
    margin: 0;
    padding: 0;
    list-style: none;
}
.s-feat__tile {
    display: flex;
    align-items: center;
    gap: .6em;
    min-width: 0;
    padding: .5em .6em;
    background: var(--color-white);
    color: var(--color-black);
    border: var(--border-medium);
    box-shadow: 4px 4px 0 var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: clamp(.75rem, min(3.4cqw, 2.3cqh), .9375rem);
    line-height: 1.15;
}
.s-feat__ico {
    display: grid;
    flex: none;
    place-items: center;
    width: 2em;
    height: 2em;
    background: var(--color-black);
    color: var(--color-white);
}
.s-feat__ico .mk-icon { width: 1.2em; height: 1.2em; }
.s-feat__name { min-width: 0; }
.s-feat__tile--wide { grid-column: 1 / -1; flex-wrap: wrap; row-gap: .5em; }
.s-feat__tile--wide .s-feat__ico { background: var(--color-red); }
.s-feat__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35em;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.s-feat__chips li {
    padding: .2em .5em;
    background: var(--color-white);
    border: 2px solid var(--color-black);
    font-size: .8em;
    line-height: 1.15;
    white-space: nowrap;
}
.s-feat__chips li:first-child { background: var(--color-black); color: var(--color-white); }
.s-feat__stamp-tilt { position: absolute; right: -4px; top: -26px; z-index: 2; transform: rotate(5deg); }
.s-feat__stamp {
    display: inline-block;
    padding: .35em .7em;
    background: var(--color-white);
    border: 4px solid var(--color-red);
    box-shadow: 4px 4px 0 var(--color-black);
    color: var(--color-red);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: clamp(.8125rem, min(3.4cqw, 2.3cqh), 1rem);
    line-height: 1;
    white-space: nowrap;
}
@container film-stage (min-aspect-ratio: 6/5) {
    .s-feat { padding: clamp(16px, 4.6cqh, 52px) clamp(20px, 5.2cqw, 96px); }
    .s-feat__head { text-align: left; }
    .s-feat__head .fx-title { max-width: 30ch; margin-inline: 0; }
    .s-feat__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 2.2cqh, 22px) clamp(10px, 1.5cqw, 24px); }
    .s-feat__tile { padding: .7em .8em; font-size: clamp(.8125rem, min(1.25cqw, 2.5cqh), 1.375rem); }
    .s-feat__tile--wide { grid-column: span 2; }
    .s-feat__stamp-tilt { top: -22px; right: -10px; }
    .s-feat__stamp { font-size: clamp(.875rem, min(1.4cqw, 2.8cqh), 1.5rem); }
}

/* ---------- 6.7 CERTYFIKATY I TRYB OFFLINE ---------- */
.s-cert {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(10px, 2.8cqh, 28px);
    padding: clamp(14px, 4.6cqw, 40px);
}
.s-cert__head { text-align: center; }
.s-cert__head .fx-title { max-width: 22ch; margin-inline: auto; }
.s-cert__panels { display: grid; gap: clamp(10px, 2.2cqh, 18px); }
.s-cert__panel {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.4cqh, 14px);
    min-width: 0;
    padding: clamp(10px, 2cqh, 22px) clamp(12px, 2.2cqw, 24px);
    background: var(--color-white);
    border: var(--border-medium);
    box-shadow: 6px 6px 0 var(--color-black);
}
.s-cert__h {
    display: flex;
    align-items: center;
    gap: .55em;
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: clamp(.9375rem, min(4.3cqw, 2.9cqh), 1.125rem);
    line-height: 1.15;
}
.s-cert__ico {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.9em;
    height: 1.9em;
    background: var(--color-black);
    color: var(--color-white);
}
.s-cert__ico--red { background: var(--color-red); }
.s-cert__ico .mk-icon { width: 1.2em; height: 1.2em; }
.s-cert__art { position: relative; width: min(100%, calc(21cqh * 2.4)); margin-inline: auto; aspect-ratio: 2.4 / 1; container-type: inline-size; }
.s-cert__p {
    margin: 0;
    color: var(--color-gray-800);
    font-size: clamp(.8125rem, min(3.5cqw, 2.4cqh), 1rem);
    line-height: 1.4;
}
@container film-stage (min-aspect-ratio: 6/5) {
    .s-cert { padding: clamp(16px, 4.6cqh, 52px) clamp(20px, 5.2cqw, 96px); }
    .s-cert__head { text-align: left; }
    .s-cert__head .fx-title { max-width: none; margin-inline: 0; }
    .s-cert__panels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2.6cqw, 44px); }
    .s-cert__panel { box-shadow: 8px 8px 0 var(--color-black); }
    .s-cert__art { width: min(100%, calc(34cqh * 2.4)); }
    .s-cert__h { font-size: clamp(1rem, min(1.55cqw, 3.1cqh), 1.75rem); }
    .s-cert__p { font-size: clamp(.8125rem, min(1.15cqw, 2.3cqh), 1.25rem); }
}

/* lewy panel: kreator certyfikatu */
.s-gen { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 4.4cqi; }
.s-gen__steps { display: flex; align-items: center; }
.s-gen__step {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 1.6cqi;
    padding: 1.4cqi 2.4cqi 1.4cqi 1.4cqi;
    background: var(--color-black);
    color: var(--color-white);
    border: max(2px, .5cqi) solid var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: 3.6cqi;
    line-height: 1;
    white-space: nowrap;
}
.s-gen__n {
    display: grid;
    place-items: center;
    width: 1.5em;
    height: 1.5em;
    background: var(--color-white);
    color: var(--color-black);
    font-weight: var(--font-weight-black);
}
.s-gen__step--done .s-gen__n { background: var(--color-red); color: var(--color-white); }
.s-gen__link { flex: 1; height: max(2px, .8cqi); margin: 0 1.2cqi; background: var(--color-black); }
.s-gen__certs { display: flex; gap: 3cqi; }
.s-gen__cert {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 2cqi;
    padding: 2.2cqi 2.4cqi;
    background: var(--color-white);
    border: max(2px, .6cqi) solid var(--color-black);
    box-shadow: 1.2cqi 1.2cqi 0 var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: 3.6cqi;
    line-height: 1.15;
}
.s-gen__cert .mk-icon { flex: none; width: 6cqi; height: 6cqi; color: var(--color-red); }
.s-gen__cert--off .mk-icon { color: var(--color-black); }

/* prawy panel: KSeF niedostępny → kolejka offline → zegar (oczekiwanie) → KSeF działa → wysłana */
.s-off { position: absolute; inset: 0; }
.s-off__ksef {
    position: absolute;
    left: 2cqi;
    top: 2cqi;
    width: 27cqi;
    height: 27cqi;
    display: grid;
    place-items: center;
    background: var(--color-white);
    border: max(2px, .7cqi) solid var(--color-black);
    box-shadow: 1.4cqi 1.4cqi 0 var(--color-black);
}
.s-off__ksef-in { font-family: var(--font-heading); font-weight: var(--font-weight-black); font-size: 7.4cqi; line-height: 1; }
.scene--run .s-off__ksef-in { animation: s-off-shake 520ms ease-in-out var(--d, 0ms); }
@keyframes s-off-shake {
    15% { transform: translateX(-1.2cqi) rotate(-3deg); }
    30% { transform: translateX(1cqi) rotate(3deg); }
    45% { transform: translateX(-.8cqi); }
    60% { transform: translateX(.6cqi); }
    75% { transform: translateX(-.3cqi); }
}
.s-off__down {   /* stan „niedostępny": czerwone pasy + plakietka offline */
    position: absolute;
    inset: 0;
    display: grid;
    place-items: start end;
    background: repeating-linear-gradient(-45deg, rgba(220, 0, 0, .2) 0 2.2cqi, transparent 2.2cqi 4.4cqi);
    opacity: 0;
}
.s-off__down .mk-icon {
    width: 8cqi;
    height: 8cqi;
    margin: -3cqi -3cqi 0 0;
    padding: 1.2cqi;
    background: var(--color-red);
    color: var(--color-white);
    border: max(2px, .5cqi) solid var(--color-black);
}
.scene--run .s-off__down { animation: s-off-down 2000ms linear var(--d, 0ms) both; }
@keyframes s-off-down { 0% { opacity: 0; } 6%, 92% { opacity: 1; } 100% { opacity: 0; } }
.s-off__up { position: absolute; right: -2.6cqi; top: -2.6cqi; font-size: 7cqi; }
.s-off__doc {
    position: absolute;
    left: 47.5cqi;
    top: 9cqi;
    width: 13cqi;
    height: 17cqi;
    background: var(--color-white);
    border: max(2px, .5cqi) solid var(--color-black);
    box-shadow: .8cqi .8cqi 0 var(--color-black);
    opacity: 0;
}
.s-off__doc-head { display: block; height: 3.4cqi; background: var(--color-black); }
.s-off__doc::after {
    content: "";
    position: absolute;
    left: 2cqi;
    right: 2cqi;
    top: 6cqi;
    height: 6cqi;
    background: repeating-linear-gradient(var(--color-gray-300) 0 1.2cqi, transparent 1.2cqi 2.4cqi);
}
.scene--run .s-off__doc { animation: s-off-doc 2350ms var(--fx-io) var(--d, 0ms) both; }
@keyframes s-off-doc {
    0%   { opacity: 0; transform: translateY(-12cqi); }
    10%  { opacity: 1; }
    26%  { transform: translateY(0); }
    30%  { transform: translateY(-1.2cqi); }
    34%  { transform: translateY(0); }
    68%  { opacity: 1; transform: translate(0, 0); }
    86%  { opacity: 1; transform: translate(-22cqi, -12cqi) rotate(-8deg) scale(.75); }
    100% { opacity: 0; transform: translate(-38cqi, -3cqi) rotate(-10deg) scale(.4); }
}
/* tacka kolejki — PO dokumencie w DOM, żeby jej przednia ścianka zasłaniała dół kartki */
.s-off__queue {
    position: absolute;
    left: 39cqi;
    top: 18cqi;
    width: 30cqi;
    height: 14cqi;
    background: var(--color-gray-200);
    border: max(2px, .7cqi) solid var(--color-black);
    border-top-width: 0;
}
.s-off__queue-label {
    position: absolute;
    left: 50%;
    top: 100%;
    margin-top: 1.4cqi;
    transform: translateX(-50%);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: 2.9cqi;
    line-height: 1;
    white-space: nowrap;
}
.s-off__clock {
    position: absolute;
    left: 76cqi;
    top: 2cqi;
    width: 20cqi;
    height: 20cqi;
    background: var(--color-white);
    border: max(2px, .7cqi) solid var(--color-black);
    border-radius: 50%;
    box-shadow: 1cqi 1cqi 0 var(--color-black);
}
.s-off__clock::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2cqi;
    height: 2cqi;
    margin: -1cqi 0 0 -1cqi;
    background: var(--color-black);
}
.s-off__hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: .9cqi;
    margin-left: -.45cqi;
    background: var(--color-black);
    transform-origin: 50% 100%;
}
.s-off__hand--h { height: 5cqi; transform: rotate(270deg); }   /* zegar = oczekiwanie na KSeF (bez konkretnej godziny) */
.s-off__hand--m { height: 7.4cqi; background: var(--color-red); transform: rotate(360deg); }
.scene--run .s-off__hand--h { animation: s-off-h 900ms var(--fx-io) var(--d, 0ms) backwards; }
.scene--run .s-off__hand--m { animation: s-off-m 900ms var(--fx-io) var(--d, 0ms) backwards; }
@keyframes s-off-h { from { transform: rotate(150deg); } }    /* upływ kilku godzin */
@keyframes s-off-m { from { transform: rotate(-1080deg); } }  /* 4 obroty wskazówki minutowej */
.s-off__sent { position: absolute; left: 2cqi; top: 33cqi; font-size: 2.9cqi; }

/* ---------- 6.8 CENNIK ---------- */
.s-price {
    position: absolute;
    inset: 3.5cqi 3.6cqi 4cqi 1.5cqi;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: end;
    gap: 2.6cqi 4cqi;
    padding: 5cqi 5cqi 4cqi;
    background: var(--color-white);
    color: var(--color-black);
    border: max(3px, .9cqi) solid var(--color-black);
    box-shadow: 2cqi 2cqi 0 var(--color-black);
}
.s-price__main { grid-row: span 2; align-self: center; }
.s-price__name { margin: 0 0 2.4cqi; font-family: var(--font-heading); font-weight: var(--font-weight-bold); font-size: 3.8cqi; line-height: 1.1; }
.s-price__big {
    margin: 0 0 2.6cqi;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: 16cqi;
    line-height: .9;
    letter-spacing: -.03em;
    white-space: nowrap;
    text-shadow: 1.2cqi 1.2cqi 0 var(--color-red);
}
.s-price__per { margin: 0; color: var(--color-gray-700); font-size: 3.2cqi; font-weight: var(--font-weight-semibold); line-height: 1.35; }
.s-price__plans {
    display: flex;
    align-items: flex-end;
    gap: 1.8cqi;
    height: 44cqi;
    margin: 0;
    padding: 0;
    list-style: none;
}
.s-price__plan {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 1.2cqi;
    min-width: 0;
    height: 100%;
}
.s-price__val { order: 1; font-family: var(--font-heading); font-weight: var(--font-weight-black); font-size: 2.8cqi; line-height: 1; white-space: nowrap; }
.s-price__bar {
    order: 2;
    display: block;
    width: 100%;
    height: calc(var(--h) * .56cqi);
    background: var(--color-black);
    border: max(2px, .45cqi) solid var(--color-black);
}
.s-price__plan--on .s-price__bar { background: var(--color-red); }
.s-price__lim { order: 3; color: var(--color-gray-700); font-size: 2.7cqi; font-weight: var(--font-weight-semibold); line-height: 1; white-space: nowrap; }
.s-price__axis {   /* podpis osi pod słupkami (czytniki dostają pełny opis w każdym <li>) */
    grid-column: 2;
    margin: -2.6cqi 0 0;
    color: var(--color-gray-600);
    font-size: 2.5cqi;
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
    text-align: center;
}
.s-price__trial-tilt { position: absolute; right: -2.4cqi; top: -5cqi; margin: 0; transform: rotate(7deg); }
.s-price__trial {
    display: inline-block;
    padding: 1.4cqi 2.6cqi;
    background: var(--color-white);
    border: 1cqi solid var(--color-red);
    box-shadow: 0 0 0 .45cqi var(--color-black), 1.2cqi 1.2cqi 0 .45cqi var(--color-black);
    color: var(--color-red);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: 3.2cqi;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}
.s-price__trial b { display: block; margin-bottom: .12em; font-weight: var(--font-weight-black); font-size: 1.8em; }

/* ---------- 6.9 BIURO RACHUNKOWE (ciemna) ---------- */
.s-biuro {
    position: absolute;
    inset: 3cqi 3.6cqi 5cqi 1.5cqi;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3.4cqi;
    padding: 4.4cqi 5cqi 6cqi;
    background: var(--color-white);
    color: var(--color-black);
    border: max(3px, .9cqi) solid var(--color-white);
    box-shadow: 2cqi 2cqi 0 var(--color-red);
}
.s-biuro__head { display: flex; align-items: center; gap: 3cqi; padding-bottom: 3cqi; border-bottom: max(2px, .5cqi) solid var(--color-black); }
.s-biuro__logo {
    display: grid;
    flex: none;
    place-items: center;
    width: 11cqi;
    height: 11cqi;
    background: var(--color-red);
    color: var(--color-white);
    border: max(2px, .6cqi) solid var(--color-black);
}
.s-biuro__logo .mk-icon { width: 6.4cqi; height: 6.4cqi; }
.s-biuro__id { min-width: 0; }
.s-biuro__name { margin: 0 0 1.2cqi; font-family: var(--font-heading); font-weight: var(--font-weight-black); font-size: 4.6cqi; line-height: 1.1; }
.s-biuro__meta { margin: 0; color: var(--color-gray-700); font-size: 2.9cqi; font-weight: var(--font-weight-semibold); line-height: 1.3; }
.s-biuro__list { display: grid; gap: 1.9cqi; margin: 0; padding: 0; list-style: none; }
.s-biuro__list li { position: relative; padding-left: 5.4cqi; font-size: 3.3cqi; font-weight: var(--font-weight-semibold); line-height: 1.3; }
.s-biuro__list li::before {
    content: "";
    position: absolute;
    left: 1.2cqi;
    top: .15em;
    width: 1.4cqi;
    height: 2.7cqi;
    border: solid var(--color-red);
    border-width: 0 .8cqi .8cqi 0;
    transform: rotate(45deg);
}
.s-biuro__zero-tilt { position: absolute; right: -2.6cqi; bottom: -4.4cqi; margin: 0; transform: rotate(-6deg); }
.s-biuro__zero {
    display: inline-flex;
    align-items: baseline;
    gap: 1.6cqi;
    padding: 1.4cqi 2.6cqi;
    background: var(--color-red);
    color: var(--color-white);
    border: max(2px, .6cqi) solid var(--color-black);
    box-shadow: 1.2cqi 1.2cqi 0 var(--color-black);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: 3.4cqi;
    line-height: 1;
    white-space: nowrap;
}
.s-biuro__zero b { font-weight: var(--font-weight-black); font-size: 2.4em; }

/* ============================================================
   6.10 KADR PIONOWY I KOMPAKT (niski ekran pionowy, np. 360×640)
   ============================================================ */
@container film-stage (max-aspect-ratio: 6/5) {
    .s-feat__stamp-tilt { display: none; }
}
@container film-stage (max-aspect-ratio: 6/5) and (max-height: 640px) {
    /* terminy: lead powtarza kartę 1 („wszyscy odbierają") — w kompakcie zostają same karty */
    .s-dates { gap: 12px; }
    .s-dates__head .fx-lead { display: none; }
    .s-dates__card { padding: 8px 12px; }
    .s-dates__note { font-size: .75rem; }
    /* funkcje: bez leadu (zastępuje go pieczątka), ciaśniejsze kafelki */
    .s-feat { gap: 14px; }
    .s-feat__head .fx-lead { display: none; }
    .s-feat__grid { gap: 6px; }
    .s-feat__tile { gap: .45em; padding: .4em .45em; font-size: .71875rem; }
    .s-feat__ico { width: 1.75em; height: 1.75em; }
    .s-feat__chips li { font-size: .78em; }
    .s-feat__stamp-tilt { display: block; top: -24px; }
    /* certyfikaty: bez zdań pod ilustracjami */
    .s-cert__p { display: none; }
}
/* niski kadr poziomy (telefon w poziomie, ~844×390): nagłówki sekcji bez etykiet i leadów */
@container film-stage (min-aspect-ratio: 6/5) and (max-height: 440px) {
    .s-feat,
    .s-cert,
    .s-dates { gap: 10px; }
    .s-feat__head .fx-eyebrow,
    .s-feat__head .fx-lead,
    .s-cert__head .fx-eyebrow,
    .s-cert__p { display: none; }
    .s-feat__head .fx-title { max-width: none; }
    .s-feat__grid { gap: 8px 10px; }
    .s-feat__tile { padding: .4em .55em; }
    .s-feat__stamp-tilt { top: -18px; }
}

/* ============================================================
   7. KARTA KOŃCOWA (data-view="end") — po końcu filmu lub „Pomiń"
   ============================================================ */
.film-end {
    /* karta na środku ekranu, stopka na dole (96px ≈ wysokość stopki na desktopie) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100svh - var(--mk-nav-height) - 96px);
    padding: var(--space-16) var(--space-6);
    background-image: radial-gradient(circle, rgba(0, 0, 0, .08) 1.5px, transparent 1.6px);
    background-size: 24px 24px;
    background-position: center;
}
.film-end__card {
    max-width: 780px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-8);
    background: var(--color-white);
    border: var(--border-thick);
    box-shadow: var(--shadow-xl);
}
.film-end__eyebrow {
    display: inline-block;
    margin: 0 0 var(--space-4);
    padding: var(--space-1) var(--space-3);
    background: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--text-sm);
    letter-spacing: .02em;
}
.film-end__title {
    margin: 0 0 var(--space-5);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -.02em;
    text-wrap: balance;
}
.film-end__title::after {
    content: "";
    display: block;
    width: 76px;
    height: 6px;
    margin-top: var(--space-4);
    background: var(--color-red);
}
.film-end__title:focus { outline: none; }   /* fokus programowy po „Pomiń"/końcu (czytnik ekranu), bez ramki */
.film-end__steps {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-8);
    margin: 0 0 var(--space-5);
    padding: 0;
    list-style: none;
}
.film-end__steps li {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
}
.film-end__steps li + li::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 50%;
    width: 9px;
    height: 13px;
    margin-top: -6.5px;
    background: var(--color-black);
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.film-end__n {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    background: var(--color-black);
    color: var(--color-white);
    font-weight: var(--font-weight-black);
}
.film-end__steps li:last-child .film-end__n { background: var(--color-red); }
.film-end__lead {
    max-width: 56ch;
    margin: 0 0 var(--space-8);
    color: var(--color-gray-800);
    font-size: var(--text-lg);
    text-wrap: pretty;
}
.film-end__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }

/* wejście karty (display widoku → visibility; animacja restartuje się przy przełączeniu data-view) */
#landing-root[data-view="end"] .film-end__card { animation: end-rise 520ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes end-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   8. RESPONSYWNOŚĆ RAMKI FILMU I KARTY KOŃCOWEJ
   (układ scen reaguje na proporcje .film__stage — @container wyżej)
   ============================================================ */
@media (max-width: 767px) {
    .film { gap: 8px; padding: 10px 12px 8px; }
    .film__progress { gap: 4px; }
    .film__seg { height: 8px; }
    .film__stage { margin: 0 4px 4px 0; border-width: 2px; box-shadow: 4px 4px 0 var(--color-black); }
    .film__controls { gap: 10px; }

    .film-end { padding: var(--space-8) var(--space-4) var(--space-12); }
    .film-end__card { padding: var(--space-6) var(--space-5); box-shadow: var(--shadow-lg); }
    .film-end__steps { flex-direction: column; gap: var(--space-3); }
    .film-end__steps li + li::before { display: none; }
    .film-end__lead { font-size: var(--text-base); margin-bottom: var(--space-6); }
    .film-end__actions .cta { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 479px) {
    .film__chapter { display: none; }
}
@media (max-height: 480px) {   /* telefon w poziomie */
    .film { gap: 6px; padding: 6px 12px; }
    .film__seg { height: 6px; }
    .film__controls { min-height: 44px; }
}

/* ============================================================
   9. PAUZA — naprawdę zatrzymuje animacje (sceny, przejście, pasek postępu)
   ============================================================ */
#landing-root.is-paused .landing-film *,
#landing-root.is-paused .landing-film *::before,
#landing-root.is-paused .landing-film *::after { animation-play-state: paused !important; }

/* ============================================================
   10. REDUCED MOTION — JS od razu pokazuje kartę końcową. Gdy ktoś włączy film („Obejrzyj ponownie"),
       sceny pokazują od razu stany końcowe (animacje 1 ms, bez opóźnień i pętli); pasek postępu
       zostaje (liniowe wypełnienie bez ruchu treści), pasy na nim stoją.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .landing-film .scene,
    .landing-film .scene::before,
    .landing-film .scene::after,
    .landing-film .scene *,
    .landing-film .scene *::before,
    .landing-film .scene *::after {
        animation-duration: 1ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition: none !important;
    }
    .film__seg--active .film__seg-fill::after { animation: none; }
    .film__btn:hover,
    .film__btn:active { transform: none; }
    #landing-root[data-view="end"] .film-end__card { animation: none; }
}
