:root {
    --granat: #093B6B; 
    --blekit: #028FCD; 
    --szary: #737373; 
    
    --tlo-gradient: radial-gradient(circle at 15% 0%, #bae6fd 0%, #f8fafc 40%, #e2e8f0 100%);
    --tekst: #0f172a; 
    
    --szklo-tlo: rgba(255, 255, 255, 0.75); 
    --szklo-ramka: rgba(9, 59, 107, 0.2); 
    --cien: rgba(9, 59, 107, 0.08);
    --glow: rgba(2, 143, 205, 0.4);
    --input-bg: rgba(255, 255, 255, 0.9); 
}

body.dark-mode {
    --szary: #A3A3A3; 
    --tlo-gradient: radial-gradient(circle at 15% 0%, #0c4a6e 0%, #0f172a 50%, #020617 100%);
    --tekst: #f8fafc; 
    
    --szklo-tlo: rgba(30, 41, 59, 0.65);
    --szklo-ramka: rgba(255, 255, 255, 0.12); 
    --cien: rgba(0, 0, 0, 0.5);
    --glow: rgba(2, 143, 205, 0.6);
    --input-bg: rgba(0, 0, 0, 0.3); 
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    overflow-x: hidden;
}
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif; 
    color: var(--tekst); 
    line-height: 1.7; 
    transition: color 0.4s ease;
    padding-top: 100px; 
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: -10vw;
    width: 120vw;
    height: 100vh;
    background: var(--tlo-gradient);
    z-index: -1;
    
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
    
    transform: translateX(5vw); 
}

body.scrolled::before {
    transform: translateX(-5vw); 
}

/* === KLASA GŁÓWNA GLASSMORPHISM === */
.glass-panel {
    background: var(--szklo-tlo);
    backdrop-filter: blur(16px); 
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--szklo-ramka);
    box-shadow: 0 8px 32px var(--cien);
}

/* === NOWA ANIMACJA STARTOWA (BARDZIEJ PREMIUM) === */
.fade-in-down { 
    opacity: 0; 
    transform: translateY(-50px) scale(0.95); 
    animation: springIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
}

.fade-in-up { 
    opacity: 0; 
    transform: translateY(50px) scale(0.95); 
    animation: springIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
}

@keyframes springIn {
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.delay-1 { animation-delay: 0.15s; }

/* Zmniejszony dystans animacji scrolla, żeby działało szybciej */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }


/* === NAGŁÓWEK (FIXED Z EFEKTEM ROZJEŻDŻANIA) === */
header { 
    position: fixed; top: 0; left: 0; z-index: 1000; width: 100%;
    background-color: transparent; 
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

header.scrolled { 
    background: var(--szklo-tlo);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--szklo-ramka);
    box-shadow: 0 4px 15px var(--cien); 
}

.header-inner {
    display: flex; justify-content: space-between; align-items: center; 
    max-width: 1100px; margin: 0 auto; padding: 25px 20px;
    /* Płynne zmienianie szerokości na boki przy scrollu */
    transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

/* Kiedy zjedziesz w dół, pasek się rozszerza na 100% ekranu */
header.scrolled .header-inner { max-width: 100%; padding: 10px 40px; }

.nav-links { display: flex; gap: 30px; align-items: center; font-weight: 600; font-size: 0.95rem; }
.nav-links a { color: var(--tekst); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--blekit); }
.nav-contact-btn {
    background: none; border: none; color: var(--tekst); font-weight: 600; 
    font-size: 0.95rem; font-family: inherit; cursor: pointer; transition: color 0.2s;
}
.nav-contact-btn:hover { color: var(--blekit); }

.hamburger-btn { display: none; background: none; border: none; color: var(--tekst); font-size: 1.8rem; cursor: pointer; transition: color 0.3s; padding: 0 5px; }
.hamburger-btn:hover { color: var(--blekit); }

.mobile-menu {
    position: absolute; top: 100%; left: 0; width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
    max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease;
    border-top: 1px solid transparent;
}
.mobile-menu.active { max-height: 350px; padding: 25px 0; border-top: 1px solid var(--szklo-ramka); }
.mobile-link { color: var(--tekst); text-decoration: none; font-size: 1.1rem; font-weight: 600; transition: color 0.2s; background: none; border: none; font-family: inherit; cursor: pointer; }
.mobile-link:hover { color: var(--blekit); }

/* --- LOGO --- */
.logo { display: flex; align-items: center; gap: 15px; font-size: 2rem; font-weight: 800; letter-spacing: -1px; flex-shrink: 0; transition: all 0.4s ease; }
header.scrolled .logo { font-size: 1.6rem; } /* Zmniejsza tekst po zjechaniu */

.logo-img { height: 55px; width: auto; transition: height 0.4s ease, opacity 0.3s ease; }
header.scrolled .logo-img { height: 35px; } /* Zmniejsza logo po zjechaniu */

.logo-img.dark-icon { display: none; }
body.dark-mode .logo-img.light-icon { display: none; }
body.dark-mode .logo-img.dark-icon { display: block; }

.logo-text { display: inline-block; transition: font-size 0.4s ease; }
.logo span.bracket { color: var(--blekit); }
.logo span.m { color: var(--granat); transition: color 0.4s ease; }
body.dark-mode .logo span.m { color: #ffffff; } /* Fix dla trybu ciemnego */
.logo span.code { color: var(--szary); font-weight: 600; }


.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* INNE ELEMENTY */
.info-msg {
    position: fixed; top: 90px; left: 50%; transform: translate(-50%, -20px); opacity: 0; visibility: hidden;
    font-size: 0.95rem; color: var(--tekst); text-align: center; max-width: 550px; width: 90%;
    padding: 12px 20px; border-left: 4px solid var(--blekit); border-radius: 8px; transition: all 0.3s ease; z-index: 1000; 
}
.info-msg.active { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.header-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; transition: all 0.4s ease; }

.theme-btn {
    background: rgba(2, 143, 205, 0.1); border: 1px solid var(--blekit); color: var(--tekst);
    cursor: pointer; border-radius: 50%; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; transition: all 0.3s ease; font-size: 1.1rem;
}
.theme-btn:hover { background: var(--blekit); color: white; box-shadow: 0 0 15px var(--glow); }

.linkedin-btn { border: 1px solid var(--szklo-ramka); background: transparent; color: var(--tekst); border-radius: 6px; transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
.linkedin-btn:hover { border-color: var(--blekit); background: var(--szklo-tlo); color: var(--blekit); }

/* HERO */
.hero { padding: 100px 40px; border-radius: 16px; text-align: center; margin: 20px 0 60px 0; border-top: 1px solid var(--szklo-ramka); }
.hero h1 { font-size: 3rem; margin-bottom: 20px; font-weight: 800; letter-spacing: -1px; line-height: 1.2; }
.hero p { font-size: 1.15rem; color: var(--szary); margin-bottom: 35px; max-width: 700px; margin-left: auto; margin-right: auto; }

/* PRZYCISKI */
.btn {
    display: inline-block; padding: 15px 35px; background-color: var(--blekit); color: white; text-decoration: none; border-radius: 8px; font-weight: 600;
    transition: all 0.3s ease; cursor: pointer; border: none; font-family: inherit; box-shadow: 0 4px 15px rgba(2, 143, 205, 0.3);
}
.btn:hover { background-color: #0076a9; transform: translateY(-3px); box-shadow: 0 8px 25px var(--glow); }
.btn-outline { background: transparent; border: 1px solid var(--szklo-ramka); color: var(--tekst); box-shadow: none; }
.btn-outline:hover { background: var(--szklo-tlo); border-color: var(--blekit); color: var(--blekit); transform: translateY(-2px); }

.btn-large {
    padding: 18px 45px;
    font-size: 1.15rem;
    border-radius: 10px;
}

/* SEKCJE */
.about-section { padding: 60px 50px; border-radius: 16px; margin-bottom: 80px; border-top: 1px solid var(--szklo-ramka); }
.about-content { font-size: 1.05rem; color: var(--szary); text-align: center; max-width: 850px; margin: 0 auto; }
.about-content strong { color: var(--tekst); font-weight: 600; }
.section-title { text-align: center; margin: 60px 0 40px 0; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.5px; }


/* === ROZWIJANE KARTY USŁUG (AKORDEON) === */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; margin-bottom: 50px; }

.card {
    position: relative; padding: 30px 30px 50px 30px; border-radius: 16px;
    border-top: 1px solid var(--szklo-ramka); border-left: 1px solid var(--szklo-ramka);
    transition: all 0.4s ease; display: flex; flex-direction: column; cursor: pointer;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px var(--cien), 0 0 15px var(--glow); border-color: rgba(2, 143, 205, 0.4); }

.card-header { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; transition: all 0.4s ease; }
.card-header i { font-size: 2.2rem; color: var(--blekit); transition: all 0.4s ease; margin: 0; }
.card-header h3 { font-size: 1.3rem; font-weight: 600; margin: 0; transition: all 0.4s ease; }

.card-short { color: var(--szary); font-weight: 600; font-size: 0.95rem; margin: 0; transition: all 0.3s ease; }

.card-details { max-height: 0; opacity: 0; overflow: hidden; transition: all 0.5s ease; color: var(--szary); font-size: 0.95rem; line-height: 1.6; }
.card-chevron { position: absolute; bottom: 20px; right: 25px; color: var(--blekit); font-size: 1.2rem; transition: transform 0.4s ease; opacity: 0.6; }

/* Stan po kliknięciu (Rozwinięta karta) */
.card.expanded .card-header { margin-bottom: 5px; }
.card.expanded .card-header i { font-size: 1.4rem; transform: scale(0.9); }
.card.expanded .card-header h3 { font-size: 1.1rem; color: var(--blekit); }
.card.expanded .card-short { opacity: 0; max-height: 0; margin: 0; overflow: hidden; }
.card.expanded .card-details { max-height: 300px; opacity: 1; padding-top: 15px; margin-top: 10px; border-top: 1px dashed var(--szklo-ramka); }
.card.expanded .card-chevron { transform: rotate(180deg); opacity: 1; }


/* === NOWA SEKCJA CTA CARD === */
.cta-card {
    display: flex; justify-content: space-between; align-items: center;
    padding: 50px 60px; border-radius: 20px; margin: 40px 0 80px 0; gap: 40px;
    border-top: 1px solid var(--szklo-ramka);
}
.cta-content { text-align: left; max-width: 650px; }
.cta-content h3 { font-size: 1.8rem; margin-bottom: 15px; color: var(--tekst); font-weight: 800; }
.cta-content p { color: var(--szary); font-size: 1.1rem; }


/* === MODAL KONTAKTOWY === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 10000;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    width: 90%; max-width: 800px; padding: 50px; border-radius: 16px; position: relative;
    transform: scale(0.95); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 1px solid var(--szklo-ramka); border-left: 1px solid var(--szklo-ramka);
    
    max-height: 90vh; 
    overflow-y: auto;
    margin-top: 5vh;
}
.modal-overlay.active .modal-content { transform: scale(1); }

.modal-close { position: absolute; top: 20px; right: 25px; font-size: 1.5rem; color: var(--szary); cursor: pointer; transition: color 0.2s; background: none; border: none; }
.modal-close:hover { color: var(--blekit); }

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }

/* FIX ZWIĘKSZENIA POLA TEKSTOWEGO I CZYTELNOŚCI */
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { 
    display: block; margin-bottom: 8px; font-size: 0.85rem; font-weight: 700; 
    text-transform: uppercase; letter-spacing: 1px; color: var(--tekst); opacity: 0.9;
}
.form-group input, .form-group textarea {
    width: 100%; padding: 12px 15px; border-radius: 8px; font-family: inherit; font-size: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--szklo-ramka); 
    color: var(--tekst); transition: all 0.3s;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--szary); opacity: 0.8; }
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--blekit); background: var(--szklo-tlo); box-shadow: 0 0 10px var(--glow);
}
.form-group textarea { 
    resize: vertical; 
    min-height: 160px; /* Duże pole do pisania */
}

.direct-contact { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; border-radius: 12px; border-top: 1px solid var(--szklo-ramka); }


/* === POPUP SUKCESU PO WYSŁANIU MAILA === */
.success-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 10005;
}
.success-overlay.active { opacity: 1; visibility: visible; }
.success-popup {
    width: 90%; max-width: 450px; padding: 40px; text-align: center; border-radius: 16px;
    transform: scale(0.9); transition: all 0.3s ease;
    border-top: 1px solid var(--szklo-ramka); border-left: 1px solid var(--szklo-ramka);
}
.success-overlay.active .success-popup { transform: scale(1); }

footer { text-align: center; padding: 40px 0; color: var(--szary); border-top: 1px solid var(--szklo-ramka); margin-top: 60px; font-size: 0.9rem; }

@media (max-width: 1024px) {
    .header-inner { padding: 15px 20px; }
    .nav-links { display: none; } 
    .hamburger-btn { display: block; } 
    header.scrolled .header-inner { padding: 8px 20px; } 
    .logo { font-size: 1.6rem; gap: 10px; }
    header.scrolled .logo { font-size: 1.4rem; }
    .logo-img { height: 45px; }
    header.scrolled .logo-img { height: 35px; }
}

@media (max-width: 900px) {
    .cta-card { flex-direction: column; text-align: center; padding: 40px 30px; }
    .cta-content { text-align: center; }
}

@media (max-width: 850px) {
    .info-msg { top: auto; bottom: 0; left: 0; width: 100%; max-width: none; border-radius: 0; border-top: 1px solid var(--szklo-ramka); transform: translateY(100%); }
    .modal-grid { grid-template-columns: 1fr; gap: 30px; } 
    .modal-content { padding: 30px; }
}

@media (max-width: 600px) {
    html { font-size: 15px; }

    .hero { padding: 60px 20px; }
    .hero h1 { font-size: 2.2rem; }
    .about-section { padding: 40px 20px; }
    .section-title { font-size: 1.8rem; margin: 40px 0 30px 0; }
    .grid { grid-template-columns: 1fr; gap: 20px; }
    .card { padding: 30px 20px; }
    .ln-text { display: none; }
    .linkedin-btn { padding: 10px 15px !important; }

    .modal-content { 
        padding: 40px 20px 25px 20px;
        max-height: 80vh;
        margin-top: 5vh;
    }
    .modal-close { 
        top: 12px; right: 15px; 
        font-size: 1.8rem;
        background: var(--szklo-tlo);
        border-radius: 50%;
        width: 35px; height: 35px;
        display: flex; justify-content: center; align-items: center;
    }
    
    .form-group textarea { 
        min-height: 80px; 
    }
}

section[id], h2[id] { scroll-margin-top: 120px; }