/* =========================================================================
   ZOBACZ JAK PRACUJEMY — "Kulisy laboratorium" (przebudowa od zera)
   Spójne z systemem: dark / szałwia / glass. Korzysta z tokenów z style.css
   ========================================================================= */

.zj2 {
    overflow-x: hidden;
}

/* --- Reveal-on-scroll (gate .zj2-js => brak ryzyka ukrycia treści bez JS) --- */
.zj2-js .zj2-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1);
    will-change: opacity, transform;
}

.zj2-js .zj2-reveal.in-view {
    opacity: 1;
    transform: none;
}

/* ===================== 1. HERO ===================== */
.zj2-hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--bg-secondary);
}

.zj2-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: grayscale(35%) contrast(1.05);
}

.zj2-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(15, 16, 15, 0.55) 0%, rgba(15, 16, 15, 0.82) 70%, var(--bg-main) 100%),
        radial-gradient(circle at 75% 30%, rgba(172, 195, 182, 0.14), transparent 55%);
}

.zj2-hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
}

.zj2-eyebrow {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: var(--accent);
    margin: 0 0 1.25rem;
}

.zj2-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -1px;
    margin: 0 0 1.5rem;
    text-transform: uppercase;
}

.zj2-hero h1 .sage {
    color: var(--accent);
}

.zj2-lead {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
    max-width: 640px;
    margin: 0 0 2.5rem;
}

.zj2-scroll-cue {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-main);
    text-decoration: none;
    padding: 0.85rem 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 100px;
    transition: border-color .3s ease, color .3s ease, background .3s ease;
}

.zj2-scroll-cue span {
    animation: zj2-bob 1.8s ease-in-out infinite;
}

.zj2-scroll-cue:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(172, 195, 182, 0.06);
}

@keyframes zj2-bob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(4px);
    }
}

/* ===================== 2. MANIFEST ===================== */
.zj2-manifest {
    background: var(--bg-main);
    padding: 6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.zj2-manifest-text {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: clamp(1.5rem, 3.5vw, 2.6rem);
    line-height: 1.35;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.zj2-manifest-text strong {
    color: var(--accent);
    font-weight: 600;
}

/* ===================== sekcje wspólne ===================== */
.zj2-section {
    padding: 6.5rem 0;
}

.zj2-section.dark {
    background: var(--bg-secondary);
}

.zj2-head {
    max-width: 680px;
    margin: 0 0 3.5rem;
}

.zj2-kicker {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.zj2-head h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin: 0 0 1rem;
    text-transform: uppercase;
}

.zj2-head p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
}

/* ===================== 3. TIMELINE ===================== */
.zj2-timeline {
    position: relative;
    max-width: 760px;
}

.zj2-timeline::before {
    content: '';
    position: absolute;
    left: 27px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), rgba(172, 195, 182, 0.1));
}

.zj2-step {
    position: relative;
    display: flex;
    gap: 1.8rem;
    padding-bottom: 2.75rem;
}

.zj2-step:last-child {
    padding-bottom: 0;
}

.zj2-step-num {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    background: var(--bg-secondary);
    border: 1px solid rgba(172, 195, 182, 0.4);
}

.zj2-step-body {
    padding-top: 0.4rem;
}

.zj2-step-body h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin: 0 0 0.6rem;
}

.zj2-step-body p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
}

.zj2-step-body strong {
    color: var(--accent);
}

/* ===================== 4. SPRZĘT W AKCJI — sceny + animowane narzędzia ===================== */
.zj2-scenes {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.zj2-scene {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

/* Zygzak — co druga scena odwrócona */
.zj2-scene:nth-child(even) .zj2-scene-visual {
    order: 2;
}

.zj2-scene-text h3 {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    margin: 0 0 0.9rem;
}

.zj2-scene-text p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
}

/* Ramka = miejsce na profesjonalne zdjęcie; do czasu wgrania widać animację */
.zj2-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, rgba(172, 195, 182, 0.10), transparent 60%),
        rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.4);
}

/* Zdjęcie LEŻY POD animacją i gradientem; jest naturalnie przyciemnione,
   więc nigdy nie przysłania animacji — stanowi subtelne tło sceny. */
.zj2-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.42) saturate(0.92);
}

/* Gradient nad zdjęciem, pod animacją — dodatkowo wtapia zdjęcie w tło */
.zj2-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 9, 8, 0.30), rgba(8, 9, 8, 0.62));
}

.zj2-anim {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 2;
}

.zj2-anim svg {
    width: 82%;
    height: 82%;
}

.zj2-frame-tag {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 3;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(8, 9, 8, 0.55);
    padding: 0.35rem 0.7rem;
    border-radius: 100px;
    border: 1px solid rgba(172, 195, 182, 0.3);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* --- Animacja: mikroskop (skaner krąży po chipie) --- */
.zj2-anim-microscope .zj2-scanner {
    transform: translate(75px, 70px);
    animation: zj2-scan 7s ease-in-out infinite;
}

.zj2-anim-microscope .zj2-scanner circle {
    animation: zj2-pulse 2.4s ease-in-out infinite;
}

@keyframes zj2-scan {
    0% { transform: translate(75px, 70px); }
    25% { transform: translate(150px, 72px); }
    50% { transform: translate(120px, 112px); }
    75% { transform: translate(85px, 100px); }
    100% { transform: translate(75px, 70px); }
}

@keyframes zj2-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

/* --- Animacja: mikrolutowanie --- */
.zj2-anim-solder .zj2-iron {
    animation: zj2-tap 1.8s ease-in-out infinite;
}

.zj2-anim-solder .zj2-solder-glow {
    transform-box: fill-box;
    transform-origin: center;
    animation: zj2-glow 1.8s ease-in-out infinite;
}

.zj2-anim-solder .zj2-smoke {
    animation: zj2-rise 2.6s ease-out infinite;
    opacity: 0;
}

.zj2-anim-solder .zj2-smoke-2 {
    animation-delay: 1.1s;
}

@keyframes zj2-tap {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(7px); }
}

@keyframes zj2-glow {
    0%, 100% { transform: scale(0.7); opacity: 0.4; }
    50% { transform: scale(1.4); opacity: 1; }
}

@keyframes zj2-rise {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    25% { opacity: 0.5; }
    100% { transform: translateY(-46px) scale(1.6); opacity: 0; }
}

/* --- Animacja: odzysk danych (bity płyną w górę) --- */
.zj2-anim-data .zj2-bit {
    animation: zj2-bit 2.4s linear infinite;
    opacity: 0;
}

.zj2-anim-data .zj2-bit-2 { animation-delay: 0.8s; }
.zj2-anim-data .zj2-bit-3 { animation-delay: 1.6s; }

@keyframes zj2-bit {
    0% { transform: translateY(0); opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateY(-58px); opacity: 0; }
}

/* --- Animacja: termowizja --- */
.zj2-anim-thermal .zj2-hot {
    transform-box: fill-box;
    transform-origin: center;
    animation: zj2-hot 3s ease-in-out infinite;
}

.zj2-anim-thermal .zj2-hot-2 {
    animation-delay: 1.2s;
}

.zj2-anim-thermal .zj2-thermal-scan {
    animation: zj2-tscan 4s linear infinite;
    opacity: 0.7;
}

@keyframes zj2-hot {
    0%, 100% { opacity: 0.45; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes zj2-tscan {
    0% { transform: translateY(0); }
    100% { transform: translateY(87px); }
}

/* ===================== 5. LICZBY ===================== */
.zj2-stats {
    background: var(--accent);
    color: var(--bg-secondary);
    padding: 4rem 0;
}

.zj2-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.zj2-stat-num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2.6rem, 6vw, 4rem);
    line-height: 1;
    color: var(--bg-secondary);
}

.zj2-stat-label {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(15, 15, 15, 0.7);
}

/* ===================== 6. ZASADY ===================== */
.zj2-principles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.zj2-principle {
    padding: 2.2rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent);
}

.zj2-principle h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin: 0 0 0.7rem;
}

.zj2-principle p {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0;
}

/* ===================== 7. CTA ===================== */
.zj2-cta {
    background: var(--bg-secondary);
    padding: 7rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.zj2-cta h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin: 0 0 1rem;
    text-transform: uppercase;
}

.zj2-cta p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin: 0 auto 2.25rem;
    max-width: 540px;
}

.zj2-cta-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===================== RESPONSYWNOŚĆ ===================== */
@media (max-width: 768px) {
    .zj2-hero {
        min-height: 88vh;
    }

    .zj2-section {
        padding: 4.5rem 0;
    }

    .zj2-manifest {
        padding: 4rem 0;
    }

    .zj2-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 1rem;
    }

    .zj2-principles-grid {
        grid-template-columns: 1fr;
    }

    /* Sceny narzędzi: układ pionowy, animacja/zdjęcie nad tekstem */
    .zj2-scenes {
        gap: 2.5rem;
    }

    .zj2-scene {
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }

    .zj2-scene:nth-child(even) .zj2-scene-visual {
        order: 0;
    }
}

@media (max-width: 560px) {
    .zj2-frame {
        aspect-ratio: 16 / 10;
    }

    .zj2-scene-text p {
        font-size: 0.98rem;
    }

    .zj2-step {
        gap: 1.1rem;
    }

    .zj2-timeline::before {
        left: 22px;
    }

    .zj2-step-num {
        width: 46px;
        height: 46px;
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zj2-js .zj2-reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .zj2-hero-video {
        display: none;
    }

    .zj2-scroll-cue span {
        animation: none;
    }

    /* Zatrzymaj animacje narzędzi przy ograniczeniu ruchu */
    .zj2-anim *,
    .zj2-anim {
        animation: none !important;
    }
}
