/* Strona produktowa Lokalomat AI Studio (lokalomat/index.html, lokalomat/en/index.html; generuje tools/build_lokalomat.py).
   Kolory z colors_v2.css. Najpierw układ statyczny (działa wszędzie), potem efekty przewijania w CSS
   (scroll-driven animations) tylko tam, gdzie przeglądarka je zna i użytkownik nie prosi o ograniczenie ruchu. */
@property --lk-count { syntax: '<integer>'; inherits: false; initial-value: 11; }

.lk { max-width: 1080px; margin: 0 auto; padding-top: 96px; color: var(--text-secondary); }
.lk h2 { font-family: 'Caviar Dreams', sans-serif; font-weight: 700; color: var(--text-primary); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; margin: 0 0 1rem; }
.lk h3 { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); margin: 0 0 .4rem; }
.lk section { margin: 0 0 7rem; scroll-margin-top: 90px; }
.lk a:not([class]) { color: var(--accent-text, var(--accent-tech)); font-weight: 600; }
.lk-center { text-align: center; }
.lk-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lk-note { font-size: .95rem; }
.lk-kicker { margin: 0 0 .6rem; color: var(--accent-text, var(--accent-tech)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
/* Na całą szerokość okna; .lk section ustawia margin, więc selektor musi być mocniejszy */
.lk .lk-pro, .lk .lk-marquee { width: 100vw; margin-left: calc(50% - 50vw); }


/* Pasek postępu przewijania (tylko z efektami) */
.lk-progress { display: none; }

/* Ścieżka i przełącznik języka */
.lk .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .9rem; }
.lk-lang { margin-left: auto; display: inline-flex; border: 1px solid var(--border-color); border-radius: 50px; padding: 2px; }
.lk-lang a { min-width: 2.4rem; padding: 4px 10px; border-radius: 50px; text-align: center; font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--text-secondary) !important; text-decoration: none; }
.lk-lang a:hover { color: var(--text-primary) !important; }
.lk-lang a.is-current { background: var(--accent-tech); color: #fff !important; }

/* Przyciski */
.lk-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }
.lk .btn-primary-custom, .lk .btn-secondary-custom { display: inline-block; margin: 0; padding: 12px 26px; text-decoration: none; }

/* Baner */
.lk-hero { text-align: center; padding: 6vh 0 0; margin-bottom: 4rem; }
.lk-eyebrow { margin: 0 0 1rem; font-weight: 700; color: var(--accent-text, var(--accent-tech)); }
.lk-title { font-family: 'Caviar Dreams', sans-serif; font-weight: 700; font-size: clamp(3rem, 10vw, 7.5rem); line-height: .95; letter-spacing: -.03em; color: var(--text-primary); margin: 0 0 1.4rem; }
.lk-title span { display: block; background: linear-gradient(90deg, var(--accent-tech), var(--accent-premium)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lk-sub { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--text-primary); margin: 0 auto 2rem; max-width: 640px; }
.lk-meta { margin: 1rem 0 0; font-size: .85rem; }
.lk-window { margin: 4rem auto 0; max-width: 1000px; }
.lk-shot { display: block; width: 100%; height: auto; border: 1px solid var(--border-color); border-radius: 14px; }
.lk-window .lk-shot { border-radius: 18px; box-shadow: 0 40px 90px -30px color-mix(in srgb, var(--accent-tech) 55%, transparent), 0 20px 40px rgba(15, 23, 42, .18); }

/* Zdanie słowo po słowie */
/* Tło: grafika Lokalomatu (komputer pod kopułą, chmura na zewnątrz; ta sama co na stronie głównej).
   Tekst na obrazie: biały z cieniem, bez tła pod napisem. */
.lk .lk-words-sticky { width: 100vw; margin-left: calc(50% - 50vw); min-height: 72vh; display: flex; align-items: center;
    background: linear-gradient(90deg, rgba(5, 4, 15, .9) 0%, rgba(5, 4, 15, .55) 45%, rgba(5, 4, 15, 0) 75%),
        #05040f url("../img/lokalomat-bg.webp") 78% 50% / cover no-repeat; }
.lk-words p { font-family: 'Caviar Dreams', sans-serif; font-weight: 700; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.15; color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .75); text-align: left; width: min(1080px, 100% - 32px); margin: 0 auto; padding-right: 40%; }
@media (max-width: 860px) {
    .lk .lk-words-sticky { background: linear-gradient(180deg, rgba(5, 4, 15, .35) 0%, rgba(5, 4, 15, .8) 70%),
        #05040f url("../img/lokalomat-bg-m.webp") 75% 50% / cover no-repeat; align-items: flex-end; padding-bottom: 12vh; }
    .lk-words p { padding-right: 0; }
}

/* Free: karty, które się na siebie nakładają (sticky) */
.lk-free > h2, .lk-free > .lk-kicker { text-align: center; }
.lk-stack { list-style: none; padding: 0; margin: 3rem 0 0; }
.lk-card { position: sticky; top: calc(96px + var(--i) * 16px); display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2rem; align-items: center;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 24px; padding: 2rem; margin-bottom: 6vh; min-height: 56vh;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, .10); transform-origin: 50% 0; }
.lk-card p { font-size: 1.1rem; line-height: 1.6; margin: 0; }
.lk-card h3 { font-family: 'Caviar Dreams', sans-serif; font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.lk-card-visual { display: grid; place-items: center; }
.lk-icon { width: min(60%, 180px); height: auto; color: var(--accent-tech); }

/* Modele: pas nazw rodzin */
/* Przewijany w bok (palcem, kółkiem, myszą); sam płynie dzięki skryptowi na dole strony. Pasek przewijania ukryty */
.lk-marquee { overflow-x: auto; overflow-y: hidden; margin-top: 1rem; margin-bottom: 1rem; scrollbar-width: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.lk-marquee::-webkit-scrollbar { display: none; }
.lk-marquee.is-drag { cursor: grabbing; }
.lk-marquee-row { display: flex; gap: 3.5rem; width: max-content; padding: 0 2rem; font-family: 'Caviar Dreams', sans-serif; font-weight: 700; font-size: clamp(3rem, 11vw, 8.5rem); line-height: 1.1; }
.lk-marquee-row .lk-line { color: transparent; -webkit-text-stroke: 1.5px var(--text-secondary); }
.lk-marquee-row .lk-fill { color: var(--accent-tech); }

/* Pro: poziomy pas kart (bez efektów: zwykłe przewijanie w bok) */
.lk-pro-head { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.lk-track { list-style: none; display: flex; gap: 1.4rem; margin: 2rem 0 0; padding: 0 max(16px, calc(50vw - 540px)) 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory; }
.lk-hcard { flex: 0 0 min(82vw, 420px); scroll-snap-align: center; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 22px; padding: 1.2rem 1.2rem 1.4rem; }
.lk-hcard-visual { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--bg-body); border: 1px solid var(--border-color); display: grid; place-items: center; margin-bottom: 1rem; }
.lk-hcard-visual .lk-shot { width: 100%; height: 100%; object-fit: cover; object-position: 0 0; border: 0; border-radius: 0; }
.lk-hcard-visual .lk-icon { width: 34%; }
.lk-hcard p { margin: 0; line-height: 1.55; }

/* Szybkość: odsłaniany obraz i licznik */
.lk-speed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.lk-big { margin: 0; font-family: 'Inter', sans-serif; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; font-size: clamp(5rem, 16vw, 11rem); line-height: .9; color: var(--text-primary); }
.lk-big small { font-size: .4em; color: var(--accent-tech); }
.lk-count { counter-reset: lk var(--lk-count); }
.lk-count::before { content: counter(lk); }
.lk-speed-p { font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--text-primary); margin: 1rem 0 .6rem; }
.lk-art { display: block; width: 100%; max-width: 476px; height: auto; margin: 0 auto; border-radius: 24px; box-shadow: 0 30px 70px -25px rgba(15, 23, 42, .45); }

/* Wersje i ceny */
.lk-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; margin-top: 2.5rem; }
.lk-plan { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 24px; padding: 2rem; display: flex; flex-direction: column; align-items: flex-start; }
.lk-plan-pro { border: 2px solid var(--accent-tech); }
.lk-price { margin: .6rem 0 0; font-size: 2.4rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.lk-plan-sub { margin: .3rem 0 1.2rem; font-size: .9rem; }
.lk-plan ul { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: .55rem; flex: 1; align-content: start; }
.lk-plan li { position: relative; padding-left: 1.6rem; color: var(--text-primary); }
.lk-plan li::before { content: ''; position: absolute; left: 0; top: .3em; width: .9rem; height: .5rem; border-left: 2px solid var(--accent-tech); border-bottom: 2px solid var(--accent-tech); transform: rotate(-45deg); }
.lk-facts { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.lk-facts li { border-top: 2px solid var(--border-color); padding-top: .8rem; font-size: .9rem; line-height: 1.45; }
.lk-facts strong { display: block; color: var(--text-primary); }
.lk-facts code { font-size: .85em; }

/* Pytania */
.lk-faq { max-width: 760px; margin-left: auto !important; margin-right: auto !important; }
.lk-faq details { border-bottom: 1px solid var(--border-color); padding: 1rem 0; }
.lk-faq summary { cursor: pointer; font-weight: 700; color: var(--text-primary); }
.lk-faq p { margin: .6rem 0 0; line-height: 1.65; }

/* Na koniec */
.lk-end { text-align: center; padding: 4rem 1.5rem; border-radius: 28px; border: 1px solid var(--border-color);
    background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--accent-tech) 22%, transparent), transparent 60%), var(--bg-card); }
.lk-end p { font-size: 1.2rem; margin: 0 0 2rem; }

@media (max-width: 860px) {
    .lk { padding-top: 84px; }
    .lk section { margin-bottom: 5rem; }
    .lk-card { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 1.4rem; gap: 1.2rem; top: calc(80px + var(--i) * 12px); }
    .lk-card .lk-icon { width: 96px; }
    .lk-speed, .lk-plans { grid-template-columns: minmax(0, 1fr); }
    .lk-speed { text-align: center; }
    .lk-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Niski ekran (telefon poziomo): karta wyższa od okna zasłoniłaby swój zrzut, więc bez nakładania */
@media (max-height: 600px) {
    .lk-card { position: static; min-height: 0; }
}

/* ===== Efekty przewijania ===== */
@media (prefers-reduced-motion: no-preference) {
    .lk-hero > * { animation: lk-in .9s cubic-bezier(.2, .7, .2, 1) both; }
    .lk-hero > :nth-child(2) { animation-delay: .08s; }
    .lk-hero > :nth-child(3) { animation-delay: .16s; }
    .lk-hero > :nth-child(4) { animation-delay: .24s; }
    .lk-hero > :nth-child(n+5) { animation-delay: .32s; }
}
@keyframes lk-in { from { opacity: 0; transform: translateY(24px); } }

@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .lk-progress { display: block; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1100; transform-origin: 0 50%;
            background: linear-gradient(90deg, var(--accent-tech), var(--accent-premium));
            animation: lk-grow linear both; animation-timeline: scroll(root); }

        /* Okno aplikacji kładzie się płasko */
        .lk-window { perspective: 1400px; }
        .lk-window .lk-shot { animation: lk-tilt linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; transform-origin: 50% 100%; }

        /* Nagłówki wjeżdżają */
        .lk section > h2, .lk-kicker, .lk-note, .lk-faq details, .lk-facts li, .lk-end > * {
            animation: lk-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }

        /* Słowa rozświetlają się po kolei */
        .lk-words { height: 180vh; view-timeline: --lk-words block; }
        .lk-words-sticky { position: sticky; top: 0; height: 100vh; }
        .lk-w { opacity: .14; animation: lk-light linear both; animation-timeline: --lk-words;
            animation-range: contain calc(5% + var(--i) / var(--n) * 70%) contain calc(5% + (var(--i) + 1) / var(--n) * 70%); }

        /* Karty Free: poprzednia cofa się, gdy nadchodzi następna */
        .lk-stack { view-timeline: --lk-stack block; }
        .lk-card:not(:last-child) { animation: lk-shrink linear both; animation-timeline: --lk-stack;
            animation-range: contain calc(var(--i) / var(--n) * 100%) contain calc((var(--i) + 1) / var(--n) * 100%); }

        
        /* Szybkość: obraz się odsłania, licznik dochodzi do 11 */
        .lk-art { animation: lk-clip linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
        .lk-count { animation: lk-num linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }

        /* Wersje wjeżdżają z boków */
        /* (na telefonie z dołu: przesunięcie w bok poszerzyłoby stronę) */
        .lk-plan { animation: lk-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
        @media (min-width: 861px) {
            .lk-plan-free { animation-name: lk-from-left; }
            .lk-plan-pro { animation-name: lk-from-right; }
        }
    }

    /* Pro: przewijanie w dół przesuwa karty w bok (tylko na szerokim ekranie) */
    @media (prefers-reduced-motion: no-preference) and (min-width: 861px) {
        .lk-pro { height: 420vh; view-timeline: --lk-pro block; }
        .lk-pro-sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-top: 60px; }
        .lk-track { width: max-content; overflow: visible; animation: lk-slide linear both; animation-timeline: --lk-pro; animation-range: contain 0% contain 100%; }
        .lk-hcard { flex-basis: 440px; }
        /* 100vw obejmuje pasek przewijania (Windows): zapas, żeby ostatnia karta nie weszła pod niego */
        .lk-track { padding-right: calc(max(16px, 50vw - 540px) + 24px); }
    }
}

@keyframes lk-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lk-tilt { from { transform: rotateX(24deg) scale(.88); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes lk-rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes lk-light { to { opacity: 1; } }
@keyframes lk-shrink { to { transform: scale(.92); filter: brightness(.85); } }
@keyframes lk-clip { from { clip-path: inset(35% 35% 35% 35% round 24px); } to { clip-path: inset(0 round 24px); } }
@keyframes lk-num { from { --lk-count: 0; } to { --lk-count: 11; } }
@keyframes lk-from-left { from { opacity: 0; transform: translateX(-80px) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes lk-from-right { from { opacity: 0; transform: translateX(80px) rotate(2deg); } to { opacity: 1; transform: none; } }
@keyframes lk-slide { to { transform: translateX(calc(-100% + 100vw)); } }
