:root {
    /* Typography - Scale 1.25 (Major Third) */
    --font-base: 16px;
    --text-sm: calc(var(--font-base) / 1.25);
    --text-p: var(--font-base);
    --text-h4: calc(var(--text-p) * 1.25);
    --text-h3: calc(var(--text-h4) * 1.25);
    --text-h2: calc(var(--text-h3) * 1.25);
    --text-h1: calc(var(--text-h2) * 1.25);

    /* Spacing - 8pt Grid */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 40px;
    --space-6: 48px;
    --space-8: 64px;
    --space-12: 96px;
    --space-16: 128px;

    /* Color pallete */
    --primary: #0A2647;
    --primary-light: #144272;
    --accent: #E67E22;
    --accent-hover: #D35400;
    --bg-light: #F9FAF8;
    --bg-alt: #E8EFEA;
    --text-dark: #1E252C;
    --text-muted: #536472;
    --white: #FFFFFF;

    /* UI Elements */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-organic: 16px 64px 16px 16px;
    --shadow-soft: 0 16px 32px rgba(10, 38, 71, 0.08);
    --shadow-hover: 0 24px 48px rgba(10, 38, 71, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-size: var(--text-p);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-3);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); position: relative; }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }
p { margin-bottom: var(--space-2); }

hr {
    margin: var(--space-4) 0;
    border: none;
    border-top: 1px solid var(--bg-alt);
}

h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    background-color: var(--accent);
    margin-top: var(--space-2);
    border-radius: var(--radius-sm);
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.container-flex {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-padding {
    padding: var(--space-12) 0;
}

/* Utility Classes - Layouts & Backgrounds */
.bg-white { background-color: var(--white); }
.bg-alt { background-color: var(--bg-alt); }
.center-text { text-align: center; }
.center-text h2::after { margin: var(--space-2) auto 0; }

.bg-dark {
    background-color: var(--primary);
    color: var(--white);
}
.bg-dark h2, .bg-dark h3, .bg-dark p { color: var(--white); }
.bg-dark h2::after { background-color: var(--accent); }

.bg-dark-gradient {
    color: var(--white);
    background: 
        radial-gradient(circle at 85% 85%, rgba(230, 126, 34, 0.15), transparent 50%),
        radial-gradient(circle at 15% 15%, rgba(20, 66, 114, 0.4), transparent 50%),
        linear-gradient(135deg, var(--primary) 0%, #051425 100%);
    position: relative;
}
.bg-dark-gradient h2, .bg-dark-gradient h3, .bg-dark-gradient p { color: var(--white); }
.bg-dark-gradient h2::after { background-color: var(--accent); }

/* Max Width Utilities */
.max-w-424 { max-width: 424px; }
.max-w-448 { max-width: 448px; }
.max-w-480 { max-width: 480px; }
.max-w-512 { max-width: 512px; }
.max-w-600 { max-width: 600px; }
.max-w-640 { max-width: 640px; }
.max-w-800 { max-width: 800px; }

/* Buttons */
button, .btn {
    display: inline-block;
    background-color: var(--accent);
    color: var(--white);
    border: none;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-p);
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

button:hover, .btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(230, 126, 34, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--white);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--primary);
}

/* Navbar Component */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-3) 0;
    z-index: 1000;
    transition: all 0.3s ease;
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 38, 71, 0.95);
    padding: var(--space-2) 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--white);
    font-size: var(--text-h4);
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 1px;
}

.logo-img {
    margin-top: 12px;
}

.nav-links {
    display: flex;
    gap: var(--space-4);
    list-style: none;
}

.nav-links a { 
    position: relative;
    color: var(--white); 
    text-decoration: none; 
    font-weight: 500; 
    transition: color 0.3s ease; 
    padding-bottom: 12px;
}

.nav-links a:hover, .nav-links a.active { 
    color: var(--accent); 
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 16px;
}

/* Hero Component */
.hero {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(to right, rgba(10, 38, 71, 0.9) 0%, rgba(10, 38, 71, 0.4) 100%), url('img/biogazownia-parczew-panorama.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    color: var(--white);
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: var(--space-12);
}

.hero h1 {
    color: var(--white);
    margin-bottom: var(--space-3);
}

.hero p {
    font-size: var(--text-h4);
    margin-bottom: var(--space-5);
    color: rgba(255, 255, 255, 0.9);
}

.hero-buttons {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin: 0;
    justify-content: center;
}


/* Split Layout Structures */
.split-section {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.split-section.reverse {
    flex-direction: row-reverse;
}

.split-text {
    flex: 1;
}

.split-media {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.split-media img, .split-media video {
    width: 100%;
    border-radius: var(--radius-organic);
    box-shadow: var(--shadow-soft);
    object-fit: cover;
}

/* Features Component Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-8);
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
}

.highlight-number {
    font-size: var(--text-h2);
    font-weight: 800;
    color: var(--accent);
    margin: var(--space-2) 0;
}

/* Service & Offer Components */
.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    list-style: none;
}

.benefits-grid li {
    position: relative;
    padding-left: var(--space-4);
    font-size: var(--text-sm);
}

.benefits-grid li::before {
    content: '✓';
    color: var(--accent);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 800;
    font-size: var(--text-p);
}

.offer-summary {
    font-size: var(--text-h4);
    color: var(--primary);
    margin-bottom: var(--space-4);
}

.video-square {
    width: 100%;
    aspect-ratio: 5 / 4;
    object-fit: cover;
    border-radius: var(--radius-organic);
    box-shadow: var(--shadow-soft);
}

/* Innovation & Glassmorphism Section */
/* Zaktualizowana sekcja innowacji w harmonii z bg-dark-gradient */
.glass-section {
    /* Trzywarstwowy, głęboki gradient premium zsynchronizowany z paletą strony */
    background: 
        radial-gradient(circle at 80% 80%, rgba(243, 156, 18, 0.12), transparent 55%),
        radial-gradient(circle at 20% 20%, rgba(39, 70, 54, 0.35), transparent 60%),
        linear-gradient(135deg, var(--primary) 0%, #051425 100%);
    position: relative;
}

.glass-card {
    /* Szklana tafla (Light Glass) dająca maksymalny kontrast na ciemnym tle */
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    
    padding: var(--space-6);
    border-radius: var(--radius-md);
    box-shadow: 0 32px 64px rgba(4, 15, 28, 0.25);
    max-width: 1140px;
    margin: 0 auto;
}

.glass-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    align-items: center;
}

.glass-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Dostosowanie kolorów tekstów na jasnej karcie dla idealnego kontrastu */
.glass-text h2 {
    color: var(--primary);
}

.glass-text p {
    color: var(--text-dark);
}

.glass-text .text-sm {
    font-size: var(--text-sm);
    margin-top: var(--space-2);
    color: var(--text-muted);
}

.glass-media {
    width: 100%;
    height: 100%;
    min-height: 350px;
    display: flex;
}

/* YouTube Lazy Loading Player */
.youtube-lazy {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-organic);
    box-shadow: var(--shadow-soft);
}

.youtube-play-btn {
    position: absolute;
    z-index: 2;
    width: 72px;
    height: 72px;
    background-color: var(--white);
    color: var(--primary);
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(10, 38, 71, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.youtube-play-btn svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.youtube-lazy:hover .youtube-play-btn {
    background-color: var(--accent);
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(230, 126, 34, 0.3);
}

.youtube-lazy iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 3;
    border-radius: var(--radius-organic);
}

.mr-3 {
    margin-right: 16px;
}

.ceo-card {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 24px 48px rgba(4, 15, 28, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ceo-image {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}

.ceo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.5s ease;
}

.ceo-card:hover .ceo-image img {
    transform: scale(1.03);
}

.ceo-content {
    padding: var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ceo-content h2 {
    color: var(--white);
    margin-bottom: var(--space-1);
}

.ceo-content h3 {
    color: var(--accent); 
    font-size: var(--text-h4);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.ceo-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-p);
}

.ceo-content a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* CTA & Contact Structures */
.cta-banner {
    background: linear-gradient(135deg, var(--accent) 0%, #D35400 100%);
    color: var(--white);
    padding: var(--space-6) var(--space-4);
    border-radius: var(--radius-md);
    text-align: center;
    margin-top: var(--space-6);
}

.cta-banner h3 {
    color: var(--white);
    margin-bottom: var(--space-2);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-6);
    margin-top: var(--space-6);
}

.contact-info {
    background: var(--white);
    padding: var(--space-6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.contact-info a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: var(--radius-md);
    border: none;
}

/* Modal Window System */
dialog.modal {
    margin: auto;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    max-width: 800px;
    width: 95%;
    padding: 0;
}

dialog.modal::backdrop {
    background: rgba(10, 38, 71, 0.7);
    backdrop-filter: blur(8px);
}

.modal-body {
    padding: var(--space-6);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: var(--bg-alt);
    color: var(--primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: var(--text-h4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: var(--accent);
    color: var(--white);
    transform: rotate(90deg);
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    background: var(--bg-alt);
    color: var(--primary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    margin: 0 var(--space-2) var(--space-3) 0;
    transition: 0.3s;
}

.btn-pdf:hover {
    background: var(--primary);
    color: var(--white);
}

/* Footer Section */
footer {
    background: var(--primary);
    color: var(--white);
    padding: var(--space-4) 0;
    text-align: center;
}

/* Responsive Structural Adjustments (Media Queries) */
@media (min-width: 993px) {
    .split-section .split-media {
        align-self: center;
    }
}

@media (min-width: 1024px) {
    :root {
        --text-h1: calc(var(--text-h2) * 1.563);
    }
}

@media (max-width: 992px) {
    .split-section, .split-section.reverse {
        flex-direction: column;
        gap: var(--space-6);
    }

        .mr-3 {
    margin-right: 0;
}

    .split-media {
        width: 100%;
    }

    .glass-split {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .glass-media {
        min-height: 250px;
    }

    .video-ambient {
    width: 100%;
    height: 100%;       
    object-fit: cover; 
    display: block;
}

    .glass-text h2::after {
        margin: var(--space-2) auto 0;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .ceo-card {
        flex-direction: column;
        max-width: 480px; /* Zawężenie na mobile dla zachowania ładnego portretu */
    }
    .ceo-image {
        flex: 0 0 auto;
        height: 320px; /* Stała wysokość zdjęcia na telefonie */
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .stats-section {
        margin-top: 0;
        padding-top: var(--space-6);
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .hero p {
        font-size: var(--text-p);
    }

    .max-w-320, .max-w-400, .max-w-480, .max-w-512 {
        width: 100%;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform; 
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}