:root {
    --primary-color: #0b4251; 
    --accent-color: #f5a623;  
    --light-blue: #4a90e2;    
    --text-color: #444444;
    --slide-bg: radial-gradient(circle at center, rgba(255, 255, 255, 0.9) 0%, rgba(240, 244, 248, 0.9) 100%);
    --slide-bg-alt: radial-gradient(circle at center, rgba(253, 253, 253, 0.9) 0%, rgba(230, 235, 241, 0.9) 100%);
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; 
    font-family: 'Lato', sans-serif;
    color: var(--text-color);
    background-color: #ffffff; 
}

/* ==========================================
   PRELOADER (Ekran ładowania)
========================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff; /* Czyste tło, zakrywające skakanie */
    z-index: 9999; /* Zawsze na samej górze */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

/* Klasa dodawana przez JS, by ukryć preloader */
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Tekst ładowania zamiast kółka */
/* Tekst ładowania w domyślnej czcionce systemowej */
.preloader-text {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1.1rem;
    color: #888888; /* Neutralny szary */
    animation: pulseText 1.5s ease-in-out infinite;
    text-align: center;
    padding: 0 20px;
}

@keyframes pulseText {
    0% { opacity: 0.4; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.4; transform: scale(0.98); }
}

/* NOWE: Animacja odpala się dopiero po załadowaniu strony */
body.loaded .hero-content {
    animation: fadeInUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    animation-delay: 0.2s; /* Dajemy 200ms opóźnienia, żeby preloader zdążył zacząć znikać */
}

/* WSTAWIONE TŁO Z PUZZLAMI */
body::before {
    content: "";
    position: fixed;
    inset: 0; 
    background: url('../img/puzzle-background.png') center / 8% repeat;
    opacity: 0.25;
    z-index: 0; 
    pointer-events: none; 
}

/* WYBIERAK JĘZYKA */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: flex-end;
    box-sizing: border-box;
    z-index: 1000;
    pointer-events: none; 
    transition: opacity 0.4s ease, transform 0.4s ease; /* NOWE: płynna animacja */
}

/* NOWE: Klasa ukrywająca pasek */
.top-bar.hidden {
    opacity: 0;
    transform: translateY(-100%);
}

.lang-selector {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.lang-selector a {
    text-decoration: none;
    color: var(--text-color);
    margin: 0 5px;
    transition: color 0.2s;
}

.lang-selector a.active, .lang-selector a:hover {
    color: var(--accent-color);
}

/* KONTENER PREZENTACJI */
.presentation-viewport {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    z-index: 1; 
}

.slides-wrapper {
    height: 100%;
    width: 100%;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* STRUKTURA SLAJDU */
.slide {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ZMIENIONE: Asymetryczny padding. Góra: 4rem, Prawa: 4rem (na kropki), Dół: 4rem, Lewa: 2rem */
    padding: 4rem 4rem 4rem 2rem; 
    box-sizing: border-box;
    background: var(--slide-bg); 
    overflow: hidden; 
}

.slide:nth-child(even) { background: var(--slide-bg-alt); }

.slide-inner {
    width: 100%;
    max-width: 1500px; 
    display: grid;
    gap: 20px; 
    align-items: center;
    max-height: 90vh; 
}

.layout-split { grid-template-columns: 1.25fr 1fr; }
.layout-center { grid-template-columns: 1fr; text-align: center; max-width: 800px; }

/* NOWE: Ujednolicenie pozycji tekstu względem obrazków */
.content-box {
    justify-self: center; /* Centruje cały blok tekstu wewnątrz jego kolumny (1.25fr) */
    width: 100%;
    max-width: 600px; /* Zatrzymuje "rozlewanie" krótkich tekstów i trzyma je w ryzach */
}

/* TYPOGRAFIA */
h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.slide-subtitle {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--light-blue); 
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: block;
}

.slide-inner p {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 400; 
}

.slide-inner ul {
    list-style-type: none;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1.6;
    font-weight: 400;
}

.slide-inner ul li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 20px;
}

.slide-inner ul li::before {
    content: '•'; 
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-size: 2rem;
    line-height: 1rem;
    top: 4px;
}

/* GRAFIKI I MEDIA */
.media-container {
    display: flex;
    justify-content: center; 
    align-items: center;
}

.media-container img {
    max-width: 100%;
    max-height: 85vh; 
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(26, 54, 93, 0.15);
    border: 1px solid rgba(0,0,0,0.05); 
}

/* Usuwa cień i ramkę wyłącznie dla grafiki SVG z roadmapą */
.media-container img[src*="roadmap.svg"] {
    box-shadow: none;
    border: none;
    background-color: transparent; /* Zabezpieczenie, by tło na pewno było niewidoczne */
}

/* LINKI KONTAKTOWE */
.contact-links {
    display: flex;
    flex-wrap: wrap; /* Pozwala na złamanie do nowej linii na bardzo wąskich ekranach */
    justify-content: center;
    gap: 2.5rem; /* Zwiększony odstęp - działa od razu w poziomie i w pionie */
}

.contact-links a {
    display: inline-block;
    font-size: 1.2rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    padding: 12px 30px;
    border: 2px solid var(--primary-color);
    border-radius: 30px;
    transition: all 0.3s ease;
    max-width: 100%; 
        box-sizing: border-box; 
        white-space: normal; 
        word-break: break-word; 
        text-align: center;
}

.contact-links a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* KROPKI NAWIGACYJNE Z MENU */
.nav-dots {
    position: fixed;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(26, 54, 93, 0.2);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dot:hover { background-color: var(--light-blue); }
.dot.active {
    background-color: var(--accent-color);
    transform: scale(1.2);
}

.dot .tooltip {
    position: absolute;
    right: 25px; 
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background-color: var(--primary-color);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dot .tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--primary-color);
}

.dot:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ==========================================
   HERO SLIDE (Pierwszy slajd)
========================================== */
.hero-slide .slide-inner {
    max-width: 90vw;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
}

.hero-logo {
    max-width: 50%; 
    width: auto;
    max-height: 25vh; 
    margin: 0 auto 1.5rem auto; /* Wymusza wyśrodkowanie i daje odstęp na dole */
    display: block; /* Niezbędne, aby margin: auto zadziałało na obrazku */
    filter: drop-shadow(0 10px 20px rgba(26, 54, 93, 0.15));
}

/* KONTENER TYTUŁU Z TŁEM */
.hero-title-wrapper {
    position: relative;
    width: 100%;
    max-width: 1500px; /* Zabezpieczenie przed nieskończonym rozciąganiem na bardzo szerokich monitorach */
    
    /* --- ZABLOKOWANE PROPORCJE --- */
    aspect-ratio: 4 / 1;
    /* ----------------------------- */

    margin: 0 auto 1rem auto; /* Wyśrodkowanie samego banera i odstęp do loga */
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 35px rgba(11, 66, 81, 0.15);
}

/* OBRAZEK TŁA POD TYTUŁEM */
.hero-title-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(3px) brightness(0.7) opacity(0.95); /* Rozmycie i przyciemnienie zdjęcia (0.5 = 50% jasności) */
    transform: scale(1.1); /* Lekkie powiększenie niweluje jasne, rozmyte krawędzie obrazka */
    z-index: 1;
}

/* TYTUŁ GŁÓWNY (teraz na wierzchu tła) */
.hero-title {
    position: relative;
    z-index: 2;
    font-size: clamp(0.8rem, 4.2vw, 5.5rem); 
    white-space: nowrap; 
    font-weight: 900;
    color: #ffffff; /* Zmieniamy na biały, by odcinał się od ciemnego tła */
    margin: 0; /* Marginesy przejął kontener wrapper */
    line-height: 1.1;
    letter-spacing: -1px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.6); /* Mocniejszy ciemny cień dla super kontrastu */
    text-align: center;
    width: 100%;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-color);
    max-width: 750px;
    margin: 0 auto 2rem auto;
    font-weight: 300;
    line-height: 1.6;
    text-wrap: balance; /* Ta właściwość magicznie łamie tekst na równe połowy! */
    text-align: center; /* Wymagane, by wyśrodkować zbalansowany tekst */
}

.hero-subtitle strong {
    color: var(--accent-color);
    font-weight: 700;
}

.scroll-indicator {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.scroll-indicator:hover {
    opacity: 1;
    transform: scale(1.05);
}

.scroll-indicator p {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--light-blue);
    margin: 0 0 10px 0;
}

.arrow-down {
    width: 20px;
    height: 20px;
    border-right: 3px solid var(--light-blue);
    border-bottom: 3px solid var(--light-blue);
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

/* Animacje */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(45deg);
    }
    40% {
        transform: translateY(-12px) rotate(45deg);
    }
    60% {
        transform: translateY(-6px) rotate(45deg);
    }
}

/* ==========================================
   MEDIA QUERIES (Responsywność)
========================================== */
@media (max-width: 800px) {
    .layout-split { grid-template-columns: 1fr; gap: 20px; text-align: center; }
    .slide-inner ul li { text-align: left; } 
    .nav-dots { right: 10px; }
    h2 { font-size: 1.8rem; margin-bottom: 10px; }
    
    .slide { 
        align-items: flex-start; /* ZMIENIONE: Zdejmujemy przymusowe centrowanie, treść idzie do góry */
        padding: 12vh 3.5rem 2rem 1.5rem; /* 12vh to bezpieczny, przewidywalny odstęp (ok. 90-100px) */
    }
    .hero-slide {
        align-items: center; /* Wyjątek! Pierwszy slajd z logo nadal chcemy mieć na idealnym środku */
        padding-top: 4rem; 
    }
    .dot .tooltip { display: none; } 
    
    .slide-inner p, .slide-inner ul { font-size: 1.1rem; margin-bottom: 15px; }
    .slide-inner ul li { margin-bottom: 10px; padding-left: 25px; }
    .slide-inner ul li::before { font-size: 1.5rem; top: 0; }
    
    .media-container img { max-height: 40vh; }
    .content-box {
        max-width: 100%; /* Na małych ekranach zdejmujemy limit szerokości tekstu */
        justify-self: start; /* Przywracamy naturalne wyrównanie do lewej */
        
    }
    .hero-title-wrapper {
        aspect-ratio: 3.5 / 1;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    /* Poprawki dla głównego slajdu */
    /*.hero-title { font-size: 1.7rem; margin-bottom: 0.5rem; }*/
    .hero-subtitle { font-size: 0.95rem; margin-bottom: 1rem; }
    .hero-logo { max-height: 12vh; margin-bottom: 1rem; } 
    
    /* Zmniejszamy prawy margines (bo kropki będą mniejsze) i górny padding */
    .slide { padding: 50px 1.8rem 1rem 1rem; }
    .slide-inner { gap: 10px; } /* Mniejsza wyrwa między tekstem a obrazkiem w pionie */
    
    /* Zmniejszenie i przesunięcie kropek nawigacyjnych */
    .nav-dots { right: 5px; transform: translateY(-50%) scale(0.8); }
    
    /* Znaczne skalowanie tekstów, żeby zmieściły się w pionie */
    h2 { font-size: 1.3rem; margin-bottom: 5px; }
    .slide-subtitle { font-size: 0.9rem; margin-bottom: 5px; }
    .slide-inner p, .slide-inner ul { font-size: 0.95rem; margin-bottom: 10px; line-height: 1.4; }
    .slide-inner ul li { margin-bottom: 8px; padding-left: 20px; }
    .slide-inner ul li::before { font-size: 1.2rem; top: 1px; }
    
    /* Ograniczenie obrazków, by zostawiły więcej miejsca dla tekstu */
    .media-container img { max-height: 30vh; }
    
    .contact-links a { font-size: 0.9rem; padding: 8px 16px; }
    .hero-title-wrapper {
        aspect-ratio: 2.5 / 1; 
        padding: 0.5rem; /* Zmniejszamy wewnętrzny odstęp, by dać tekstowi więcej miejsca na boki */
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }
}

/* NOWE: Zabezpieczenie dla najmniejszych telefonów (np. szerokość 320px - 390px) */
@media (max-width: 400px) {
    /*.hero-title { font-size: 1.5rem; }*/
    .slide { padding: 40px 1.5rem 1rem 0.8rem; }
    .slide-inner p, .slide-inner ul { font-size: 0.85rem; }
    .media-container img { max-height: 25vh; }
    /* Jeszcze wyższe proporcje, aby zdjęcie tła nie zmieniło się w cienką linię */
    .hero-title-wrapper {
        aspect-ratio: 2 / 1; 
    }
}

/* Laptopy o małej rozdzielczości pionowej i ekrany w poziomie (np. powiększenie 125%) */
@media (max-height: 750px) {
    .slide { padding: 60px 3.5rem 1rem 1.5rem; }
    .slide-inner { gap: 15px; }
    .hero-logo { max-height: 15vh; margin-bottom: 1rem; }
    /*.hero-title { font-size: 2.2rem; margin-bottom: 0.5rem; }*/
    .hero-subtitle { font-size: 1.1rem; margin-bottom: 1rem; }
    
    .media-container img { max-height: 60vh; } /* Zmniejszone z 65vh, by dać tekstowi szansę */
    
    h2 { font-size: 1.5rem; margin-bottom: 5px; }
    .slide-subtitle { font-size: 0.95rem; margin-bottom: 5px; }
    .slide-inner p, .slide-inner ul { font-size: 1rem; margin-bottom: 8px; line-height: 1.4; }
    .slide-inner ul li { margin-bottom: 5px; padding-left: 20px; }
    .slide-inner ul li::before { font-size: 1.2rem; top: 1px; }
    .contact-links { margin-top: 15px; gap: 10px; }
}

/* NOWE: Ekstremalnie mała wysokość pionowa (laptopy 13" z powiększeniem 150%) */
@media (max-height: 600px) {
    .slide { padding: 50px 2.5rem 1rem 1rem; }
    .slide-inner { gap: 10px; }
    
    .hero-logo { max-height: 12vh; margin-bottom: 0.5rem; }
    /*.hero-title { font-size: 1.8rem; }*/
    .hero-subtitle { font-size: 0.95rem; }
    
    h2 { font-size: 1.3rem; margin-bottom: 2px; }
    .slide-subtitle { font-size: 0.85rem; margin-bottom: 2px; }
    
    /* Mocne ścięcie czcionek, by tekst nie wyjechał za ekran */
    .slide-inner p, .slide-inner ul { font-size: 0.9rem; margin-bottom: 4px; line-height: 1.3; }
    .slide-inner ul li { margin-bottom: 4px; padding-left: 15px; }
    .slide-inner ul li::before { font-size: 1rem; top: 1px; }
    
    /* Oddajemy max-height grafice, by nie znikała, ale pilnujemy proporcji */
    .media-container img { max-height: 55vh; }
    
    .contact-links a { font-size: 0.9rem; padding: 6px 16px; }
}