/* Force font-display: swap for all fonts */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    font-display: swap;
}

/* Main styles - Gradem.pl */

/* Allow text selection everywhere */
* {
    user-select: text;
}

/* Disable selection on buttons only */
button {
    user-select: none;
}

body {
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Skip link - visible on focus */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bg-dark);
    color: var(--text-light);
    padding: var(--space-sm) var(--space-md);
    z-index: var(--z-skip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Button base */
button {
    cursor: pointer;
    background: var(--brand-color);
    color: var(--text-light);
    padding: var(--space-xs) var(--space-sm);
    border: none;
    border-radius: 4px;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

button:hover {
    background: #cc6a15;
}

button:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    z-index: var(--z-navbar);
}

/* Navbar bottom line - constrained to 1400px */
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 2px;
    background: var(--brand-color);
}

.navbar__container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(0.5rem, 1.5vw, 1rem) clamp(1rem, 3vw, 2rem);
    min-height: 70px;
}

.navbar__logo img {
    height: auto;
    width: auto;
    max-height: clamp(50px, 8vw, 70px);
    max-width: clamp(150px, 20vw, 220px);
    display: block;
    object-fit: contain;
}

.navbar__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: var(--space-xs);
    min-width: 44px;
    min-height: 44px;
}

.navbar__menu {
    display: flex;
    gap: clamp(0.5rem, 2vw, 2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar__link {
    color: var(--text-light);
    background: transparent;
    text-decoration: none;
    padding: var(--space-xs) clamp(0.5rem, 1.5vw, 1rem);
    border-radius: 4px;
    transition: color 0.35s ease, background 0.35s ease;
    display: block;
    font-size: clamp(14px, 1.5vw, 16px);
    white-space: nowrap;
}

.navbar__link:hover,
.navbar__link:focus {
    color: var(--bg-dark);
    background: var(--text-light);
    text-decoration: none;
}

.navbar__link--active {
    background: var(--brand-color);
    color: #000000;  /* Black text on orange = passes 4.5:1 contrast ratio */
}

.navbar__link--active:focus {
    background: var(--brand-color);
    color: #000000;
}

.navbar__link--active:hover {
    color: var(--bg-dark);
    background: var(--text-light);
}

/* Mobile menu - activates below 992px */
@media (max-width: 991px) {
    .navbar__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .navbar__menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-dark);
        flex-direction: column;
        padding: var(--space-lg);
        gap: var(--space-md);
        transform: translateX(100%);
        opacity: 0;
        transition: transform var(--transition-normal),
                    opacity var(--transition-normal);
        overflow-y: auto;
        border-top: 2px solid var(--brand-color);
        z-index: calc(var(--z-navbar) - 1);
    }

    .navbar__menu--open {
        transform: translateX(0);
        opacity: 1;
    }

    .navbar__link {
        font-size: 18px;
        padding: var(--space-md);
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Offset for fixed navbar + divider spacing */
main {
    padding-top: calc(var(--navbar-height) + var(--space-xxl));
}

/* Projekt UE / Gallery / References: back button is above main, so no extra top padding */
main:has(.eu-project-page),
main:has(.gallery-page-section),
main:has(.references-page-section) {
    padding-top: 0;
}

/* Hero Section - Properly sized */
.hero-wrapper {
    background: #000;
}

.hero-container {
    position: relative;
    width: calc(100% - 2rem);
    max-width: 1400px;
    height: clamp(300px, 40vw, 600px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

@media (max-width: 576px) {
    .hero-container {
        height: clamp(250px, 50vw, 400px);
        margin: 0 auto;
        width: calc(100% - 1rem);
    }
}

@media (min-width: 1400px) {
    .hero-container {
        height: 600px;
    }
}

.hero__fallback-picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero__fallback-picture img.hero__fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.5s ease;
}

.hero-container.video-ready .hero__fallback-picture {
    opacity: 0;
    pointer-events: none;
}

.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.hero__content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-light);
    text-align: center;
}

.hero__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
}

.hero__slide--1 { animation: hero-slide-1 30s ease-in-out infinite; }
.hero__slide--2 { animation: hero-slide-2 30s ease-in-out infinite; }
.hero__slide--3 { animation: hero-slide-3 30s ease-in-out infinite; }

@keyframes hero-slide-1 {
    0% { opacity: 0; }
    4% { opacity: 1; }
    16% { opacity: 1; }
    20% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes hero-slide-2 {
    0% { opacity: 0; pointer-events: none; }
    33.33% { opacity: 0; pointer-events: none; }
    37.33% { opacity: 1; pointer-events: auto; }
    49.33% { opacity: 1; pointer-events: auto; }
    53.33% { opacity: 0; pointer-events: none; }
    100% { opacity: 0; pointer-events: none; }
}

@keyframes hero-slide-3 {
    0% { opacity: 0; }
    66.67% { opacity: 0; }
    70.67% { opacity: 1; }
    82.67% { opacity: 1; }
    86.67% { opacity: 0; }
    100% { opacity: 0; }
}

.hero__title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    min-height: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero__phone {
    margin: 0;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero__slide--3 {
    font-size: clamp(32px, 5vw, 56px);
}

.hero__logo {
    max-height: 15em;
    height: auto;
    width: auto;
    max-width: min(960px, 90vw);
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hero__slide--1 { opacity: 1; animation: none; }
    .hero__slide--2,
    .hero__slide--3 { opacity: 0; animation: none; }

    .hero__video {
        display: none;
    }

    .hero-container {
        background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    }
}

/* About Section */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.8;
    color: var(--text-light);
    margin: 0 0 var(--space-lg) 0;
}

.about-text:last-child {
    margin-bottom: 0;
}

/* Section overflow control */
section {
    overflow: visible;
    position: relative;
    z-index: 1;
}

/* Divider - Primary vertical spacing between sections */
.divider {
    height: 2px;
    margin: var(--space-xxl) 0;
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--brand-color) 15%,
        var(--brand-color) 85%,
        transparent 100%
    );
    box-shadow: 0 0 10px rgba(239, 127, 27, 0.3);
}

/* Divider variant - full width solid (for special cases) */
.divider--solid {
    background: var(--brand-color);
    box-shadow: none;
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 700;
    margin: 0 0 var(--space-xl) 0;
    color: var(--text-light);
}

/* Cards Grid - Oferta section (4 cards, 2 per row from 768px, matches Korzyści) */
.cards-grid,
.offer-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 767px) {
    .cards-grid,
    .offer-cards-grid {
        grid-template-columns: 1fr;
        max-width: 80%;
        margin: 0 auto;
    }
}

/* Flip Cards */
.flip-card {
    background: transparent;
    width: 100%;
    min-height: 300px;
    perspective: 1000px;
}

.flip-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    text-align: center;
    transition: transform 0.8s ease-in-out 0s; /* No delay on flip back */
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card__inner,
.flip-card:focus-within .flip-card__inner {
    transform: rotateY(180deg) !important;
    transition: transform 0.8s ease-in-out 0.25s !important;
}

.flip-card__front,
.flip-card__back {
    position: absolute;
    width: 100%;
    height: 100%;
    min-height: 300px;
    backface-visibility: hidden;
    border: 2px solid rgba(239, 127, 27, 0.3);
    border-radius: 8px;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    transition: border-color 0.3s ease-in-out, /* Border animates immediately */
                box-shadow 0.3s ease-in-out;
}

.flip-card__front {
    z-index: 2;
    transform: rotateY(0deg);
}

/* Hover state - border and glow appear immediately */
.flip-card:hover .flip-card__front,
.flip-card:focus-within .flip-card__front {
    border-color: rgba(239, 127, 27, 1);
    box-shadow: 0 8px 24px rgba(239, 127, 27, 0.4),
                0 0 20px rgba(239, 127, 27, 0.3);
}

.flip-card__back {
    transform: rotateY(180deg);
    border-color: rgba(239, 127, 27, 1);
    box-shadow: 0 8px 24px rgba(239, 127, 27, 0.4),
                0 0 20px rgba(239, 127, 27, 0.3);
}

.flip-card__icon {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    margin-bottom: var(--space-md);
    display: block;
    filter: invert(62%) sepia(89%) saturate(1459%) hue-rotate(359deg) brightness(101%) contrast(92%); /* Orange */
}

.flip-card__title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    padding-bottom: var(--space-xs);
    border-bottom: 2px solid var(--brand-color);
    color: var(--text-light);
    transition: color 0.3s ease-in-out; /* Title color animates immediately */
}

/* Hover state - title turns orange immediately */
.flip-card:hover .flip-card__title,
.flip-card:focus-within .flip-card__title {
    color: var(--brand-color);
}

/* Auto-flip class (controlled by JavaScript) */
.flip-card.auto-flipped .flip-card__inner {
    transform: rotateY(180deg);
    transition: transform 0.8s ease-in-out;
}

/* Coming soon badge - text only, no border (WCAG contrast), scale pulse */
.flip-card__badge {
    position: absolute;
    top: 1.5rem;
    right: 2.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-light);
    background: transparent;
    padding: 0.25em 0;
    animation: badge-scale 2s ease-in-out infinite;
}

@keyframes badge-scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Ensure user hover takes precedence over auto-flip */
.flip-card:hover .flip-card__inner,
.flip-card:focus-within .flip-card__inner {
    transform: rotateY(180deg) !important;
    transition: transform 0.8s ease-in-out 0.25s !important;
}

.flip-card__list {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 1.8;
    font-size: 17px; /* Increased to match "O nas" section */
    color: var(--text-light);
}

.flip-card__list li {
    margin-bottom: var(--space-xs);
}

.flip-card__list li::before {
    content: "→ ";
    color: var(--brand-color);
    margin-right: var(--space-xs);
}

/* Font Awesome icon for Ekologia card */
.flip-card__icon-fa {
    font-size: 70px;
    color: var(--brand-color);
    margin-bottom: var(--space-md);
    display: block;
}

.flip-card__icon-fa.fa-recycle {
    font-weight: 300;
    opacity: 0.85;
}

/* Paragraph text on back of cards */
.flip-card__text {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-light);
    margin: 0;
    padding: var(--space-md);
}

/* Responsive cards */

/* Advantages Section - flip cards grid */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .advantages-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Section Subtitle */
.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: var(--text-gray);
    margin: calc(var(--space-md) * -1) 0 var(--space-xl) 0;
}

/* Realizacje Carousel - PRACE approach */
.carousel-container-realizacje {
    position: relative;
    margin: 0 auto;
    max-width: 1200px;
    overflow: hidden;
    border: 4px solid rgba(239, 127, 27, 0.3);
    border-radius: 8px;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.carousel-container-realizacje:hover {
    border-color: rgba(239, 127, 27, 1);
    box-shadow: 0 8px 24px rgba(239, 127, 27, 0.4),
                0 0 20px rgba(239, 127, 27, 0.3);
}

.carousel-realizacje {
    width: 100%;
    overflow: hidden;
    /* height set by JS = smallest image height at current width */
}

.carousel-track-realizacje {
    display: flex;
    gap: 0;
    height: 100%;
    transition: transform 1.2s ease-in-out;
}

.carousel-item-realizacje {
    flex: 0 0 100%;
    flex-shrink: 0;
    min-width: 100%;
    height: 100%;  /* Fill viewport height (set by JS from min image height) */
    background: var(--bg-dark);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-start;  /* Top-align: only bottom cropped when image taller than viewport */
}

.carousel-item-realizacje picture {
    display: block;
    width: 100%;
    height: 100%;
}
.carousel-item-realizacje img {
    width: 100%;
    height: auto;
    display: block;
    transform: scale(1.04);  /* Zoom 4% to crop borders */
    transform-origin: center center;  /* Center the scaling */
}

/* Referencje Carousel */
.carousel-container-referencje {
    position: relative;
    margin: 0 auto;
    max-width: 1200px;
    overflow: hidden;
    border: 5px solid rgba(239, 127, 27, 0.3);
    border-radius: 8px;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.carousel-container-referencje:hover {
    border-color: rgba(239, 127, 27, 1);
    box-shadow: 0 8px 24px rgba(239, 127, 27, 0.4),
                0 0 20px rgba(239, 127, 27, 0.3);
}

.carousel-referencje {
    width: 100%;
    overflow: hidden;
    /* height set by JS = smallest image height at current width */
}

.carousel-track-referencje {
    display: flex;
    gap: 0;
    height: 100%;
    transition: transform 1.2s ease-in-out;
}

.carousel-item-referencje {
    flex: 0 0 100%;
    flex-shrink: 0;
    min-width: 100%;
    height: 100%;  /* Fill viewport height (set by JS from min image height) */
    background: var(--bg-dark);
    overflow: hidden;
    display: flex;
    align-items: flex-start;  /* Top-align: only bottom cropped when image taller than viewport */
}

.carousel-item-referencje picture {
    display: block;
    width: 100%;
    height: 100%;
}
.carousel-item-referencje img {
    width: 100%;  /* No oversizing for portrait images */
    height: auto;
    display: block;
}

@media (min-width: 992px) {
    .carousel-container-referencje {
        width: 80%;
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Carousel arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--text-light);
    color: var(--text-light);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    transition: all var(--transition-fast);
}

.carousel-arrow:hover {
    background: var(--brand-color);
    border-color: var(--brand-color);
    transform: translateY(-50%) scale(1.15);
}

.carousel-arrow--prev {
    left: 8px;
}

.carousel-arrow--next {
    right: 8px;
}

/* Responsive arrows */
@media (min-width: 576px) {
    .carousel-arrow {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .carousel-arrow--prev { left: 12px; }
    .carousel-arrow--next { right: 12px; }
}

@media (min-width: 992px) {
    .carousel-arrow {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .carousel-arrow--prev { left: 20px; }
    .carousel-arrow--next { right: 20px; }
}

/* Realizacje section: link to gallery page */
.gallery-cta-wrap {
    text-align: center;
    margin-top: var(--space-xl);
    margin-bottom: 0;
}

.gallery-cta {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    font-size: 1.125rem;
    background: transparent;
    border: 2px solid rgba(239, 127, 27, 0.6);
    border-radius: 8px;
    color: var(--brand-color);
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.3s ease-in-out, background 0.3s ease-in-out, color 0.3s ease-in-out;
}

.gallery-cta:hover {
    border-color: var(--brand-color);
    background: var(--brand-color);
    color: var(--bg-dark);
    text-decoration: none;
}

/* Gallery page: back link */
.gallery-back-wrap {
    margin-bottom: var(--space-md);
}

.gallery-back {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 15px;
}

.gallery-back:hover {
    color: var(--brand-color);
}

/* Gallery grid – repair images, click opens lightbox */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    flex: 0 0 calc((100% - 2 * var(--space-md)) / 3);
    border: 4px solid rgba(239, 127, 27, 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    background: var(--bg-dark);
}

.gallery-item:hover {
    border-color: rgba(239, 127, 27, 1);
    box-shadow: 0 8px 24px rgba(239, 127, 27, 0.4),
                0 0 20px rgba(239, 127, 27, 0.3);
}

.gallery-item picture {
    display: block;
    width: 100%;
}
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
}

@media (max-width: 992px) {
    .gallery-item {
        flex: 0 0 calc((100% - var(--space-md)) / 2);
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        gap: var(--space-sm);
    }

    .gallery-item {
        flex: 0 0 100%;
    }
}

/* Lightbox modal – full-size image, prev/next, close */
.lightbox-modal {
    display: none;
    opacity: 0;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-normal);
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-modal.active ~ * {
    /* body scroll locked via JS */
}

.lightbox-wrapper {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: calc(95vh - 4rem);
    object-fit: contain;
    display: block;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--text-light);
    color: var(--text-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-fast);
    z-index: 11;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--brand-color);
    border-color: var(--brand-color);
    transform: scale(1.1);
}

.lightbox-close {
    top: -48px;
    right: 0;
    width: 44px;
    height: 44px;
}

.lightbox-prev {
    left: -56px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
    right: -56px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

@media (max-width: 900px) {
    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-close {
        top: 8px;
        right: 8px;
    }
}

/* Shared carousel base (References & Technology still use Carousel component) */
.carousel-container {
    margin: 0 auto;
    max-width: 100%;
}

/* Technology carousel: same container rules as repairs (Realizacje) */
.carousel-container-technology {
    max-width: 1200px;
    position: relative;
    overflow: hidden;
}

.carousel {
    position: relative;
    overflow: hidden;
    border: 4px solid rgba(239, 127, 27, 0.3);
    border-radius: 8px;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.carousel:hover {
    border-color: rgba(239, 127, 27, 1);
    box-shadow: 0 8px 24px rgba(239, 127, 27, 0.4),
                0 0 20px rgba(239, 127, 27, 0.3);
}

.carousel__viewport {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.carousel__track {
    display: flex;
    width: 100%;
    transition: transform 1.2s ease-in-out;
}

.carousel__slide {
    flex: 0 0 100%;
    min-width: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.carousel__slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 600px;
    transform: scale(1.01);
    transform-origin: center;
}

.carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--text-light);
    color: var(--text-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-fast);
    z-index: 10;
}

.carousel__btn .carousel__icon svg,
.carousel__btn svg {
    width: 1em;
    height: 1em;
    display: block;
}

.carousel__btn:hover,
.carousel__btn:focus {
    background: var(--brand-color);
    border-color: var(--brand-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel__btn--prev {
    left: var(--space-md);
}

.carousel__btn--next {
    right: var(--space-md);
}

.carousel__btn--pause {
    top: auto;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.carousel__btn--pause:hover,
.carousel__btn--pause:focus {
    transform: translateX(-50%) scale(1.1);
}

.carousel__indicators {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md) 0;
}

.carousel__indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.carousel__indicator:hover,
.carousel__indicator:focus {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.carousel__indicator--active {
    background: var(--brand-color);
}

@media (max-width: 480px) {
    .carousel__btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .carousel__btn--prev { left: 6px; }
    .carousel__btn--next { right: 6px; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .carousel__btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    .carousel__btn--prev { left: 10px; }
    .carousel__btn--next { right: 10px; }
}

/* Technology Grid */
.technology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

/* Tech Card */
.tech-card {
    background: var(--bg-dark);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.tech-card:hover,
.tech-card:focus-within {
    transform: translateY(-4px);
    border-color: var(--brand-color);
    box-shadow: 0 8px 24px rgba(239, 127, 27, 0.2);
}

.tech-card picture {
    display: block;
    width: 100%;
}
.tech-card__image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

.tech-card__content {
    padding: var(--space-lg);
}

.tech-card__title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 var(--space-sm) 0;
    color: var(--text-light);
}

.tech-card__description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-gray);
    margin: 0;
}

@media (min-width: 768px) {
    .technology-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1092px) {
    .technology-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Technology Carousel - Card Layout */
.carousel--technology .carousel__slide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: var(--bg-dark);
}

.carousel--technology .tech-card {
    background: var(--bg-dark);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.carousel--technology .tech-card:hover,
.carousel--technology .tech-card:focus-within {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.carousel--technology .tech-card__image {
    width: 100%;
    height: 300px;
    object-fit: contain;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

.carousel--technology .tech-card__content {
    padding: var(--space-lg);
    text-align: center;
}

.carousel--technology .tech-card__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 var(--space-md) 0;
    color: var(--text-light);
}

.carousel--technology .tech-card__description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-gray);
    margin: 0;
}

/* Technology carousel below 800px: constrain card and image so one slide fits, no fragment of next */
@media (max-width: 800px) {
    .carousel--technology .carousel__slide {
        padding: var(--space-sm);
    }

    .carousel--technology .tech-card {
        max-width: 100%;
    }

    .carousel--technology .tech-card__image {
        height: 220px;
        object-fit: contain;
    }

    .carousel--technology .tech-card__content {
        padding: var(--space-md);
    }

    .carousel--technology .tech-card__title {
        font-size: 20px;
    }

    .carousel--technology .tech-card__description {
        font-size: 14px;
    }
}

/* Footer */
/* Footer */
footer {
    background: linear-gradient(180deg, #000000 0%, #1a0a0a 100%);
    padding: var(--space-xxl) 0 var(--space-lg) 0;
    margin-top: var(--space-xxl);
    position: relative;
}

/* Footer top line - constrained to 1400px */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 3px;
    background: var(--brand-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: calc(var(--space-xl) * 0.5);
}

.footer-column {
    color: var(--text-light);
}

.footer-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: var(--space-md);
}

.footer-tagline {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.6;
}

.footer-heading {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 var(--space-md) 0;
    color: var(--brand-color);
}

.footer-contact {
    font-style: normal;
}

.footer-contact p {
    margin: 0 0 var(--space-sm) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-contact i {
    color: var(--brand-color);
    width: 20px;
}

.footer-contact a {
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-contact a:hover,
.footer-contact a:focus {
    color: var(--brand-color);
    text-decoration: underline;
}

.footer-hours p {
    margin: 0 0 var(--space-md) 0;
    line-height: 1.6;
}

.footer-hours strong {
    color: var(--text-light);
}

.footer-info p {
    margin: 0 0 var(--space-sm) 0;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0 0 0;
}

.footer-list li {
    padding: 4px 0;
    color: var(--text-gray);
}

.footer-list li::before {
    content: "→ ";
    color: var(--brand-color);
    margin-right: var(--space-xs);
}

/* Footer notice – between grid and map */
.footer-notice {
    text-align: center;
    margin: var(--space-lg) 0 var(--space-xl);
    color: var(--brand-color);
    font-size: 1.3rem;
    line-height: 1.5;
}

/* Footer map – Gradem location */
.footer-map {
    margin-bottom: var(--space-xl);
}

.footer-map__heading {
    margin-bottom: var(--space-md);
    text-align: center;
}

.footer-map__wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 4px solid rgba(239, 127, 27, 0.3);
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.footer-map__wrapper:hover {
    border-color: rgba(239, 127, 27, 1);
    box-shadow: 0 8px 24px rgba(239, 127, 27, 0.4),
                0 0 20px rgba(239, 127, 27, 0.3);
}

.footer-map__wrapper iframe {
    display: block;
    width: 100%;
    height: 360px;
    max-width: 100%;
}

.footer-map__link-wrap {
    text-align: center;
    margin-top: var(--space-sm);
    margin-bottom: 0;
}

.footer-map__link {
    color: var(--brand-color);
    text-decoration: underline;
    transition: opacity var(--transition-fast);
}

.footer-map__link:hover,
.footer-map__link:focus {
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    font-size: 14px;
}

.footer-credits {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.footer-seo-link {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.footer-seo-logo {
    height: 1.25em;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

/* EU Footer Banner */
.eu-footer-banner {
    text-align: center;
    margin: var(--space-xl) 0 var(--space-lg) 0;
    transition: opacity var(--transition-normal);
}

.eu-footer-banner:hover {
    opacity: 0.9;
}

.eu-footer-banner__back {
    margin: 0 0 var(--space-md) 0;
}

.eu-footer-banner__back-btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 2px solid rgba(239, 127, 27, 0.6);
    border-radius: 8px;
    color: var(--brand-color);
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.3s ease-in-out, background 0.3s ease-in-out, color 0.3s ease-in-out;
}

.eu-footer-banner__back-btn:hover {
    border-color: var(--brand-color);
    background: var(--brand-color);
    color: var(--bg-dark);
}

.eu-footer-logo {
    max-width: min(100%, 1200px);
    height: auto;
    display: block;
    margin: 0 auto;
}

.footer-link {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;  /* Vertically center text */
    padding: 0 var(--space-xs);
    color: var(--brand-color);
    text-decoration: underline;
    transition: opacity var(--transition-fast);
}

.footer-link:hover,
.footer-link:focus {
    opacity: 0.8;
}

#cookie-settings-link {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 var(--space-xs);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 50px;
    height: 50px;
    background: var(--brand-color);
    color: var(--text-light);
    border: 2px solid var(--text-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-normal);
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top:hover,
.back-to-top:focus {
    background: #cc6a15;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.back-to-top[hidden] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

    .footer-column {
        text-align: center;
    }

    .footer-logo {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-contact p {
        justify-content: center;
    }

    .eu-footer-logo {
        max-width: 90%;
    }
}

/* Modal – z-index below cookie consent (10002) so cookie manager can overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), 
                visibility var(--transition-normal);
}

.modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.modal__backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.85);
}

.modal__container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    overflow-y: auto;
}

.modal__content {
    background: var(--bg-dark);
    border: 3px solid var(--brand-color);
    border-radius: 8px;
    padding: var(--space-xl);
    position: relative;
    overflow: visible;
}

.modal .modal__content .modal__close {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 2;
    background-color: transparent;
    background-image: none;
    border: 2px solid var(--brand-color);
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding: 0;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.modal .modal__content .modal__close:hover,
.modal .modal__content .modal__close:focus-visible {
    background: #cc6a15;
    border-color: #cc6a15;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 106, 21, 0.5);
}

.modal .modal__content .modal__close:focus {
    outline: none;
}

.modal__title {
    text-align: center;
    margin: 0 0 var(--space-lg) 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-light);
    padding-right: var(--space-xl);
}

.modal__body {
    text-align: center;
    line-height: 1.8;
    color: var(--text-light);
}

.modal__body p {
    margin: 0 0 var(--space-md) 0;
}

.modal__body p:last-child {
    margin-bottom: 0;
}

.modal__body a {
    color: var(--text-light);
    text-decoration: underline;
}

.modal__body a:hover,
.modal__body a:focus {
    opacity: 0.85;
}

.modal__footer {
    margin-top: var(--space-lg);
    text-align: center;
}

.modal__button {
    background: var(--brand-color);
    color: #000000;  /* Black text on orange = passes 4.5:1 easily */
    border: 2px solid var(--brand-color);
    padding: var(--space-sm) var(--space-xl);
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.modal__button:hover,
.modal__button:focus {
    background: #cc6a15;
    border-color: #cc6a15;
    color: #000000;
    transform: translateY(-2px);
}

/* Prevent body scroll when modal open */
body.modal-open {
    overflow: hidden;
}

/* Visually hidden (for screen readers) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ====================================
   EU PROJECT PAGE STYLES
   ==================================== */

.eu-project-page {
    padding: var(--space-lg) 0 0 0;
    background: var(--bg-dark);
}

.eu-logo-banner {
    text-align: center;
    margin-bottom: var(--space-xxl);
}

.eu-logo {
    max-width: min(100%, 1200px);
    height: auto;
    display: block;
    margin: 0 auto;
}

.eu-title {
    text-align: center;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: calc(var(--space-xxl) / 2);
    line-height: 1.3;
}

/* EU Hashtags - Prominent Display */
.eu-hashtags-hero {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-color);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-xl);
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .eu-hashtags-hero {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
}

.eu-section {
    margin-bottom: var(--space-xxl);
}

.eu-heading {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--brand-color);
}

.eu-details {
    display: grid;
    gap: var(--space-md);
}

.eu-details dt {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    font-size: 17px;
}

.eu-details dd {
    color: var(--text-light);
    margin: 0 0 var(--space-md) var(--space-md);
    line-height: 1.7;
    font-size: 17px;
}

.eu-section p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 17px;
}

.eu-equipment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.eu-equipment-list li {
    padding: var(--space-sm) 0;
    padding-left: var(--space-lg);
    position: relative;
    color: var(--text-light);
    line-height: 1.7;
    font-size: 17px;
}

.eu-equipment-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--brand-color);
    font-weight: bold;
}

.eu-equipment-list strong {
    color: var(--text-light);
}

.eu-financing {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: var(--space-lg);
}

.eu-finance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.eu-finance-item:last-child {
    border-bottom: none;
}

.eu-finance-label {
    color: var(--text-light);
    font-size: 17px;
}

.eu-finance-value {
    color: var(--text-light);
    font-weight: 600;
    font-size: 19px;
}

.eu-finance-value--highlight {
    color: var(--text-light);
    font-size: 20px;
    font-weight: 700;
}

.eu-back-top {
    padding-top: calc(var(--navbar-height) + var(--space-md));
    padding-bottom: var(--space-md);
    text-align: center;
}

@media (min-width: 992px) {
    .eu-back-top {
        padding-top: calc(var(--navbar-height) + var(--space-xl));
    }
}

/* References page: less gap between back button and content */
.eu-back-top--compact {
    padding-bottom: var(--space-sm);
}

.eu-back {
    text-align: center;
    margin-top: var(--space-xxl);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--brand-color);
    color: #000000;  /* Black text on orange = passes 4.5:1 contrast ratio */
    padding: var(--space-md) var(--space-xl);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(239, 127, 27, 0.3);
    white-space: nowrap;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #d16d17;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 127, 27, 0.5);
    text-decoration: none;
}

.btn-primary svg {
    flex-shrink: 0;
}

.btn-primary i {
    margin-right: var(--space-xs);
}

@media (max-width: 768px) {
    .eu-finance-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .eu-logo {
        max-width: 90%;
    }
}

