/* CSS Custom Properties (Variables) */
:root {
    /* Brand Colors */
    --color-bg-main: #060606;
    --color-bg-card: #111111;
    --color-text-main: #f5f5f7;
    --color-text-muted: #a1a1a6;

    /* Accents */
    --color-accent-primary: #E22718;
    /* Red - Primary CTA */
    --color-accent-secondary: #0066B1;
    /* Light Blue - details/hover */
    --color-accent-tertiary: #003D78;
    /* Navy Blue - details/hover */

    /* Gradients */
    /* Mobile gradient: Dark gradient overlay on the image uniformly */
    --gradient-hero-mobile: linear-gradient(0deg, rgba(6, 6, 6, 0.95) 0%, rgba(6, 6, 6, 0.4) 100%);
    /* Desktop gradient: Transparent on the left, darker fading to the right */
    --gradient-hero-desktop: linear-gradient(90deg, rgba(6, 6, 6, 0) 0%, rgba(6, 6, 6, 0.5) 40%, rgba(6, 6, 6, 1) 100%);

    /* Typography */
    --font-primary: 'Poppins', system-ui, -apple-system, sans-serif;
    --font-heading: 'Saira', system-ui, -apple-system, sans-serif;

    /* Layout & Utilities */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 1.2s cubic-bezier(0.4, 0, 0.2, 1), color 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography styles */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

p {
    color: var(--color-text-muted);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    display: block;
}

/* HEADER SECTION */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background-color: transparent;
    /* Fully transparent overlapping hero */
}

/* Grid layout for Mobile: toggle | center logo | space right */
.header-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

/* Toggle Menu Button - Mobile */
.mobile-toggle {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    /* Keep above nav menu for closing */
}

.mobile-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--color-text-main);
    transition: all var(--transition-base);
    border-radius: 2px;
}

.mobile-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

body.menu-active .mobile-toggle {
    position: fixed;
    right: 20px;
    top: 30px;
    z-index: 1100;
}

body.menu-active .mobile-toggle span {
    background-color: #000000;
}

/* Logos Wrapper */
.logo-wrapper {
    grid-column: 2;
    /* Center element */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    /* Stay above nav overlay */
}

.logo-desktop {
    display: none;
    /* Hide on mobile by default */
    height: 38px;
    object-fit: contain;
}

.logo-mobile {
    display: block;
    height: 60px;
    object-fit: contain;
}

/* Mobile Navigation Drawer */
.main-nav {
    position: fixed;
    top: 0;
    left: -100%;
    /* Hidden off-screen */
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background-color: #ffffff; /* White drawer requested by user */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: left var(--transition-base);
    z-index: 999;
    padding: 3rem 4rem;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.2);
    touch-action: pan-y; /* Pozwala na przewijanie góra-dół, ale przygotowuje pod JS swipe */
}

.main-nav.active {
    left: 0;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.nav-list a {
    color: #111111; /* Dark text for white background */
    font-size: 1.7rem;
    font-weight: 300;
    text-transform: uppercase;
    display: block;
    transition: color 0.3s ease;
}

.nav-list a:hover {
    color: var(--color-accent-secondary);
}

.dropdown {
    position: relative;
    display: block;
}

.dropdown-content {
    display: none;
    list-style: none;
    padding-top: 1rem;
    padding-left: 1.5rem;
    flex-direction: column;
    gap: 1.2rem;
}

.dropdown.open .dropdown-content {
    display: flex;
}

.dropdown-content a {
    font-size: 1.3rem;
    color: #444444; /* Darker grey text */
    text-transform: none;
}

.dropdown-content a:hover {
    color: var(--color-accent-secondary);
}

/* CTA Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--color-accent-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(226, 39, 24, 0.25);
}

.btn-primary:hover {
    background-color: #f13425;
    /* Slightly lighter red */
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(226, 39, 24, 0.4);
}

/* HERO SECTION */
.hero {
    position: relative;
    height: 100vh;
    height: 100dvh;
    min-height: 550px;
    display: flex;
    overflow: hidden;
}

/* Wniosek specific */
body.wniosek-page {
    background-image: linear-gradient(rgba(10, 10, 10, 0.8), rgba(10, 10, 10, 0.95)), url('porsche_przod.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Subpages Background */
body.subpage-bg {
    background-image: linear-gradient(rgba(10, 10, 10, 0.8), rgba(10, 10, 10, 0.95)), url('porsche_przod.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero-mobile);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    /* Mobile content placed at the bottom */
    padding-bottom: 8rem;
    padding-top: 6rem;
    justify-content: center;
    width: 100%;
}

.hero-content {
    max-width: 600px;
    text-align: center;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 1.25rem;
    color: #ffffff;
}

.hero-content p {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    color: #d1d1d6;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

/* Dynamic Body Theme Light */
body.theme-light {
    background-color: #ffffff;
    color: #060606;
}

body.theme-light .section-header h2 {
    color: #060606;
}

body.theme-light .section-header p {
    color: #555555;
}

body.theme-light .service-card,
body.theme-light .contact-card {
    background-color: #f6f6f6;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.theme-light .service-card:hover,
body.theme-light .contact-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .service-card h3,
body.theme-light .contact-card h3 {
    color: #060606;
}

body.theme-light .service-card:hover h3,
body.theme-light .contact-card:hover h3 {
    color: var(--color-accent-primary);
}

body.theme-light .service-card p,
body.theme-light .contact-card p,
body.theme-light .contact-card a {
    color: #444444;
}

body.theme-light .service-card:hover p,
body.theme-light .contact-card:hover p {
    color: var(--color-accent-primary);
}

/* SERVICES SECTION */
.services {
    padding: 5rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    color: #fff;
}

.section-header p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.service-card {
    background-color: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Subtle glow / border effect on card hover */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--color-accent-secondary);
    /* Light blue accent */
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.service-card:hover::before {
    height: 100%;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-icon {
    width: 64px;
    height: 64px;
    background: rgba(0, 102, 177, 0.08);
    /* Faded accent color */
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    color: var(--color-accent-secondary);
    transition: all var(--transition-base);
}

.service-card:hover .card-icon {
    background: var(--color-accent-tertiary);
    /* Navy blue on hover */
    color: #ffffff;
}

.card-icon svg {
    width: 32px;
    height: 32px;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

/* CONTACT SECTION */
.contact {
    padding: 6rem 0;
    position: relative;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
}

.contact-card {
    display: block;
    text-decoration: none;
    background-color: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    transition: all var(--transition-base);
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.contact-card h3 {
    font-size: 1rem;
    color: var(--color-accent-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
}

.contact-card p,
.contact-card a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.contact-card p.contact-address {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
}

.contact-card:hover h3,
.contact-card:hover p {
    color: var(--color-accent-primary);
}

/* Legacy classes moved to body.theme-light above */

/* DESKTOP STYLES (Min 992px) */
@media (min-width: 992px) {
    .container {
        padding: 0 4rem;
    }

    /* Header Desktop */
    .mobile-toggle {
        display: flex; /* Keep the menu toggle visible on desktop */
    }
    
    body.menu-active .mobile-toggle {
        right: auto;
        left: 330px; /* Inside the 400px wide menu on the left side */
        top: 40px;
    }

    .logo-desktop {
        display: block;
        /* Show Desktop logo */
    }

    .logo-mobile {
        display: none;
        /* Hide mobile logo */
    }

    /* Hero Desktop */
    .hero-bg-overlay {
        /* On desktop, gradient comes from right side, pushing fading to transparey on left over image */
        background: var(--gradient-hero-desktop);
    }

    .hero-container {
        align-items: center;
        /* Center horizontally (content floats right) */
        justify-content: flex-end;
        /* Desktop text fully to the right */
        padding-bottom: 0;
        padding-top: 0;
    }

    .hero-content {
        text-align: right;
        max-width: 700px;
    }

    .hero-content p {
        background: transparent;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 2.5rem;
        font-size: 1.25rem;
    }

    /* Services Desktop */
    .services {
        padding: 8rem 0;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Contact Desktop */
    .contact {
        padding: 8rem 0;
    }

    .contact-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* === NEW STYLES === */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0;
    animation: videoFadeInBlur 2.5s ease-out 0.5s forwards;
}

@keyframes videoFadeInBlur {
    0% {
        opacity: 0;
        filter: blur(20px);
    }

    100% {
        opacity: 1;
        filter: blur(0px);
    }
}

/* FOOTER */
.footer {
    background-color: var(--color-bg-main);
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
}

.footer-abbreviations h4 {
    color: var(--color-text-main);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-abbreviations ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

@media(min-width: 768px) {
    .footer-abbreviations ul {
        grid-template-columns: 1fr 1fr;
    }
}

.footer-abbreviations li strong {
    color: var(--color-accent-secondary);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media(min-width: 768px) {
    .footer-links {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
}

.footer-links a:hover {
    color: var(--color-accent-primary);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    font-size: 0.875rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Theme light for footer */
body.theme-light .footer {
    background-color: #f6f6f6;
    border-top-color: rgba(0, 0, 0, 0.1);
    color: #555;
}

body.theme-light .footer-abbreviations h4 {
    color: #060606;
}

body.theme-light .footer-links,
body.theme-light .footer-bottom {
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .footer-abbreviations li strong {
    color: var(--color-accent-tertiary);
}

/* --- EFEKT PRZYCIEMNIENIA TŁA (Tryb nocny dla reszty strony) --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Intensywne przyciemnienie */
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

body.menu-active::after {
    opacity: 1;
}

/* --- LOGO W MENU I UKRYWANIE LOGO GŁÓWNEGO --- */
.menu-logo-container {
    display: none; /* Domyślnie ukryte */
    text-align: center;
    margin: 0 auto 20px auto;
    width: fit-content;
    order: -1;
}

.menu-logo-container img {
    width: 65%; /* Duże responsywne logo w menu */
    max-width: 250px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.main-nav.active .menu-logo-container {
    display: block;
}
.menu-logo-container img {
    filter: invert(1) brightness(0); /* Zmiana białego logo na czarne w białym menu */
}

/* Ukrywanie środkowego logo w headerze, gdy menu jest otwarte */
body.menu-active .logo-wrapper {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* CTA BOX do podstron SEO */
.cta-box {
    background: rgba(0, 102, 177, 0.08);
    border: 1px solid var(--color-accent-secondary);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    margin: 4rem auto;
    max-width: 800px;
    text-align: center;
    color: var(--color-text-main);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cta-box strong {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 1rem;
    color: #ffffff;
}

.cta-box a {
    color: var(--color-accent-primary);
    font-weight: 800;
    text-decoration: none;
}

.cta-box a:hover {
    text-decoration: underline;
    color: #f13425;
}

/* Photo placeholders na podstronach SEO */
.image-placeholder {
    width: 100%;
    max-width: 800px;
    margin: 3rem auto;
    border-radius: 16px;
    overflow: hidden;
    background: #111;
    display: flex;
    justify-content: center;
    border: 8px solid #1a1a1a;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 102, 177, 0.2);
    position: relative;
}

.image-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    pointer-events: none;
}

.image-placeholder img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}



/* --- WIDOCZNOŚĆ IKONY MENU (IKRESAK / KRZYŻYKA) NA BIAŁYM TLE --- */
.mobile-toggle.active span {
    background-color: #111111; /* Zmiana koloru na czarny, gdy menu (białe) jest otwarte */
}