/* ===== Zmienne (kolory, odstępy) – edytuj tutaj =====
   Paleta z koszulki Hantech: niebieski → zielony, z fioletowym akcentem */
:root {
    --blue: #2b93d1;
    --green: #93c73d;
    --violet: #3b2d7a;
    --violet-dark: #221a4d;
    --gradient: linear-gradient(120deg, var(--blue) 0%, var(--green) 100%);
    --gradient-dark: linear-gradient(135deg, var(--violet-dark) 0%, var(--violet) 55%, #2a6fa8 100%);

    --color-text: #1e1b33;
    --color-muted: #55526b;
    --color-bg: #ffffff;
    --surface: #ffffff;
    --card: rgba(255, 255, 255, .92);
    --accent: var(--violet);
    --color-bg-alt: #eef6f9;
    --color-border: #d8e3ea;

    --sw-w: 4.4rem;
    /* wymiary przełączników w menu (język i motyw) – identyczne */
    --sw-h: 2rem;
    --nav-h: 56px;
    --max-w: 1100px;
    --gap: 1.5rem;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(34, 26, 77, .10);
    --shadow-hover: 0 14px 34px rgba(34, 26, 77, .18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
}

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

a {
    color: var(--blue);
}

h1,
h2,
h3 {
    line-height: 1.2;
    margin: 0 0 .75rem;
    letter-spacing: -.01em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.7rem;
    padding-bottom: .75rem;
    position: relative;
    margin-bottom: 1.5rem;
}

/* gradientowa kreska pod nagłówkami sekcji */
h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 4px;
    border-radius: 4px;
    background: var(--gradient);
}

h3 {
    font-size: 1.15rem;
}

.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Tło strony: JEDNO zdjęcie przypięte do okna przeglądarki (nie powtarza się, nie zależy od wysokości strony).
   Widać je tylko tam, gdzie sekcje są przezroczyste (baner, menu i stopka mają własne tło).
   Plik: /images/site_background.jpg – najlepiej poziome 16:9 (np. 1920×1080); siłę tła reguluje opacity. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url("/images/site_background.jpg") center / cover no-repeat;
    opacity: .16;
    pointer-events: none;
}

.section {
    padding: 1.75rem 0;
}

/* wcięcie pierwszej linii akapitu (np. „O nas”) */
.lead-indent {
    text-indent: 2rem;
}

/* wyjustowane akapity treści („O nas” i opisy usług); bez dzielenia wyrazów sylabami (przenoszone są całe słowa) */
.section .container p,
.service-body p {
    text-align: justify;
    hyphens: manual;
    -webkit-hyphens: manual;
}

/* ostatni akapit w sekcji nie dokłada własnego marginesu – odstępy między sekcjami są równe.
   Ujemny margines kasuje pusty „oddech” pod ostatnią linią tekstu (line-height 1.7),
   którego nie mają sekcje kończące się kartami/zdjęciami. */
.section .container>p:last-child {
    margin-bottom: -.5rem;
}

/* „O nas”: biała karta pod tekstem dla czytelności na tle ze zdjęciem */
#o-nas .container>p {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--blue);
    padding: 1.5rem;
    margin: 0;
}

@media (min-width: 900px) {
    #o-nas .container>p {
        padding: 2rem 2.5rem;
    }
}

/* Strony prawne (polityka prywatności): biała karta pod całym tekstem */
.section--legal .container {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--blue);
    width: calc(100% - 2.5rem);
    padding: 1.5rem 1.5rem 1.25rem;
}

@media (min-width: 900px) {
    .section--legal .container {
        padding: 2rem 2.5rem 1.75rem;
    }
}

.section--alt {
    background: transparent;
    /* wszystkie sekcje mają to samo tło (obraz z main::before) */
}

.todo {
    background: #fff3cd;
    color: #4a3b00;
    padding: 0 .25em;
    border-radius: 3px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #fff;
    padding: .5rem 1rem;
    z-index: 200;
}

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

:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 2px;
}

/* ===== Logo (H1 w hero) ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.hero-logo {
    display: flex;
    justify-content: center;
    margin: 0;
    text-shadow: none;
}

.hero-logo img {
    height: auto;
    width: min(320px, 80%);
}

.logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(320px, 90%);
    height: 112px;
    padding: 0 1rem;
    border: 2px dashed rgba(255, 255, 255, .85);
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.lang-switch {
    display: inline-flex;
    width: var(--sw-w);
    height: var(--sw-h);
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    overflow: hidden;
    font-size: .85rem;
    font-weight: 600;
}

.lang-switch a,
.lang-switch [aria-current="true"] {
    padding: .35rem .85rem;
    text-decoration: none;
}

.lang-switch a {
    color: #fff;
}

.lang-switch a:hover {
    background: rgba(255, 255, 255, .18);
}

.lang-switch [aria-current="true"] {
    background: var(--gradient);
    color: #fff;
}

/* Przełącznik jest wewnątrz .main-nav – nadpisz style linków menu, żeby PL i EN były na jednym poziomie */
.main-nav .lang-switch a,
.main-nav .lang-switch [aria-current="true"] {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    line-height: 1;
    font-weight: 600;
}

.main-nav .lang-switch a::after {
    display: none;
}

/* ===== Menu poziome (sticky) ===== */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--gradient-dark);
    box-shadow: 0 4px 18px rgba(34, 26, 77, .25);
}

.nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: var(--nav-h);
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    height: var(--nav-h);
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.nav-toggle-bars {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle-bars span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.main-nav ul {
    display: none;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0 0 .75rem;
}

.main-nav.is-open ul {
    display: block;
}

.main-nav a {
    display: block;
    padding: .8rem .25rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.main-nav a:hover {
    color: var(--green);
}

.main-nav a.is-active {
    color: var(--green);
    font-weight: 700;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 3rem 0 1.5rem;
    background: var(--gradient);
}

/* warstwice terenu (nawiązanie do wzoru na koszulce) */
.hero::before {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        repeating-radial-gradient(circle at 78% 40%, transparent 0 34px, rgba(255, 255, 255, .16) 35px 36px),
        repeating-radial-gradient(circle at 15% 90%, transparent 0 46px, rgba(255, 255, 255, .12) 47px 48px);
    animation: drift 30s ease-in-out infinite alternate;
}

/* ciemniejące dołem, jak na koszulce, + falowany brzeg */
.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: var(--color-bg);
    clip-path: ellipse(75% 100% at 50% 100%);
    display: none;
    /* hero jest teraz nad menu – bez fali na dole */
}

.hero .container {
    position: relative;
    z-index: 1;
}

/* baner samego logo (strony polityki prywatności) – równe odstępy góra/dół */
.hero:not(:has(h1)) {
    padding: 2.25rem 0;
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .04em;
    text-align: center;
    text-wrap: balance;
    color: #0d0b1a;
    margin: 1rem 0 0;
    /* delikatna biała poświata dla czytelności na gradiencie */
    text-shadow: 0 1px 12px rgba(255, 255, 255, .45);
}

.hero p {
    max-width: 60ch;
    font-size: 1.1rem;
    margin: 0;
}

@keyframes drift {
    from {
        transform: translate3d(-2%, 0, 0) scale(1);
    }

    to {
        transform: translate3d(2%, -3%, 0) scale(1.08);
    }
}

/* ===== Oferta ===== */
.services {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
}

.service {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-top: 4px solid transparent;
    border-image: var(--gradient) 1;
    transition: transform .3s, box-shadow .3s;
}

.service:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.service img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: #dfe9ef;
}

.service-body {
    padding: 1.1rem 1.25rem 1.4rem;
}

/* Układ naprzemienny (zig-zag): zdjęcie i tekst obok siebie, co drugi rząd odwrócony */
@media (min-width: 700px) {
    .service {
        display: grid;
        grid-template-columns: 2fr 3fr;
        align-items: stretch;
    }

    .service img {
        height: 100%;
        aspect-ratio: auto;
        min-height: 260px;
    }

    /* pierwsze zdjęcie: na desktopie kadrowane od lewej strony (bez ucięcia wyśrodkowanego) */
    .service:first-child img {
        object-position: left center;
    }

    .service-body {
        padding: 1.75rem 2rem;
        align-self: center;
    }

    .service:nth-child(even) {
        grid-template-columns: 3fr 2fr;
    }

    .service:nth-child(even) img {
        order: 2;
    }

    .service:hover {
        transform: translateY(-4px);
    }
}

.service-body h3 {
    color: var(--accent);
}

.service-body p {
    margin: 0;
    color: var(--color-muted);
}

.service-body ul {
    margin: .75rem 0;
    padding-left: 1.2rem;
    color: var(--color-muted);
}

.service-body li {
    margin-bottom: .25rem;
}

.service-body li::marker {
    color: var(--blue);
}

.service-body ul+p {
    margin-top: .75rem;
}

/* ===== Galeria ===== */
.gallery {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}

.gallery a {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.gallery a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(59, 45, 122, .55), transparent 60%);
    opacity: 0;
    transition: opacity .3s;
}

.gallery a:hover::after,
.gallery a:focus-visible::after {
    opacity: 1;
}

.gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #dfe9ef;
    transition: transform .4s;
}

.gallery a:hover img {
    transform: scale(1.08);
}

/* Lightbox */
.lightbox {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    touch-action: pan-y pinch-zoom;
}

.lightbox::backdrop {
    background: rgba(20, 14, 50, .92);
}

.lightbox-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-img.is-in {
    animation: lb-fade .18s ease-out;
}

@keyframes lb-fade {
    from {
        opacity: .25;
        transform: scale(.985);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-img.is-in {
        animation: none;
    }
}

.lightbox-caption {
    position: absolute;
    bottom: .75rem;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: .9rem;
}

.lightbox button {
    position: absolute;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    border: 0;
    cursor: pointer;
    width: 48px;
    height: 48px;
    font-size: 1.75rem;
    line-height: 1;
    border-radius: 50%;
    transition: background .2s;
}

.lightbox button:hover {
    background: var(--blue);
}

.lightbox .lb-close {
    top: .75rem;
    right: .75rem;
}

.lightbox .lb-prev {
    left: .5rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox .lb-next {
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ===== Kontakt ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.contact-list {
    margin: 0;
    padding: 1.25rem 1.5rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--blue);
}

.contact-list dt {
    font-weight: 700;
    margin-top: .9rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
}

.contact-list dt:first-child {
    margin-top: 0;
}

.contact-list dd {
    margin: 0;
}

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

.contact-address strong {
    display: block;
    font-size: 1.05rem;
}

.contact-lines {
    display: flex;
    align-items: flex-end;
    gap: .6rem;
    margin-top: .2rem;
    margin-bottom: .9rem;
    /* minimalnie większy odstęp między adresem a danymi kontaktowymi */
}

.contact-line {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: fit-content;
    margin-top: .25rem;
    color: inherit;
    text-decoration: none;
    text-decoration-color: var(--green);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    transition: color .25s;
}

.contact-line:hover,
.contact-line:focus-visible {
    color: var(--blue);
    text-decoration: underline;
    text-decoration-color: var(--green);
    text-decoration-thickness: 2px;
}

.contact-icon {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    fill: var(--accent);
    transition: transform .25s, fill .25s;
}

.contact-line:hover .contact-icon,
.contact-line:focus-visible .contact-icon {
    fill: var(--blue);
    transform: scale(1.15) rotate(-8deg);
}

.map-link {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.7em;
    /* wysokość = jedna linijka tekstu, ikona centrowana w jej wysokości */
    transition: transform .25s;
}

.map-link svg {
    width: 100%;
    height: 1.1rem;
    fill: var(--accent);
    /* fiolet marki */
}

.map-link:active {
    transform: scale(.92);
}

.map-link:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

@media (hover: hover) {
    .map-link:hover {
        transform: scale(1.2);
    }
}

.contact-ids {
    margin: 1.15rem 0 0;
    /* odstęp ok. jednej linijki przed NIP/REGON */
}

.contact-ids>div {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    margin-top: .25rem;
}

.contact-ids>div:first-child {
    margin-top: 0;
}

.contact-ids dt {
    margin-top: 0;
}

.map-box {
    display: flex;
    flex-direction: column;
    /* pasek i mapa tworzą jedną kartę (baner nad mapą), bez przerwy */
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    /* stała wysokość całego bloku = wysokość placeholdera; pasek zabiera ją mapie */
    min-height: 320px;
}

.map-box .map-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    border-radius: 0;
    box-shadow: none;
}

.map-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .9rem;
    padding: .6rem 1rem;
    background: var(--surface);
    border-left: 5px solid var(--blue);
    font-size: .95rem;
}

.map-bar[hidden] {
    display: none;
}

.map-revoke-btn {
    font: inherit;
    font-weight: 700;
    font-size: .9rem;
    padding: .45rem 1rem;
    border: 2px solid var(--accent);
    border-radius: 999px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.map-revoke-btn:active {
    background: var(--accent);
    color: #fff;
}

.map-revoke-btn:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

@media (hover: hover) {
    .map-revoke-btn:hover {
        background: var(--accent);
        color: #fff;
    }
}

.map-wrap {
    min-height: 320px;
    background: #dfe9ef;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.map-consent {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 1rem 1.25rem;
    text-align: center;
    background: var(--gradient-dark);
    color: #fff;
}

.map-consent h3 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: .06em;
    color: #fff;
}

.map-consent p {
    margin: 0;
    max-width: 38rem;
    font-size: .95rem;
    text-align: center;
    color: #e9e6ff;
}

.map-consent-btn {
    font: inherit;
    font-weight: 700;
    padding: .7rem 1.6rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--violet-dark);
    cursor: pointer;
}

.map-consent-btn:active {
    background: var(--gradient);
    color: #fff;
}

.map-consent-btn:focus-visible,
.map-consent-link:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 3px;
}

.map-consent-link {
    font-size: .9rem;
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--green);
    text-underline-offset: 4px;
}

@media (hover: hover) {
    .map-consent-btn:hover {
        background: var(--gradient);
        color: #fff;
    }

    .map-consent-link:hover {
        color: var(--green);
    }
}

/* ===== Przycisk „na górę” (prawy dolny róg) ===== */
.to-top {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gradient-dark);
    box-shadow: var(--shadow-hover);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .3s, transform .3s;
}

.to-top.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.to-top svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

/* mysz: zmiana koloru po najechaniu; telefon: zmiana koloru tylko w momencie dotknięcia (:active),
   bo :hover na ekranie dotykowym „przykleja się” po tapnięciu */
.to-top:active {
    background: var(--gradient);
}

@media (hover: hover) {
    .to-top:hover {
        background: var(--gradient);
    }
}

/* ===== Footer ===== */
.site-footer {
    background: var(--gradient-dark);
    color: #e9e6ff;
    padding: 2rem 0;
    font-size: .9rem;
    border-top: 4px solid var(--green);
}

/* ===== Animacje wejścia (klasy dodaje JS) ===== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* karta z hover-em zachowuje własny transform po pojawieniu się */
.service.reveal.is-visible {
    transition: opacity .7s ease, transform .3s, box-shadow .3s;
}

/* ===== Tablet ===== */
@media (min-width: 600px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 2rem;
    }

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

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

/* ===== Desktop ===== */
@media (min-width: 900px) {
    .section {
        padding: 2.75rem 0;
    }

    .hero {
        padding: 5rem 0 2rem;
    }

    .nav-toggle {
        display: none;
    }

    .nav-inner {
        justify-content: center;
        position: static;
        /* przełączniki kotwiczą się do całego paska (.main-nav), nie do kontenera 1100px */
    }

    .lang-switch {
        position: absolute;
        right: calc(1.25rem + var(--sw-w) + .6rem);
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }

    .main-nav ul,
    .main-nav.is-open ul {
        display: flex;
        justify-content: center;
        gap: .5rem;
        padding: 0;
        width: auto;
    }

    .main-nav a {
        position: relative;
        border: 0;
        padding: 1rem 1.1rem;
    }

    /* animowane podkreślenie */
    .main-nav a::after {
        content: "";
        position: absolute;
        left: 1.1rem;
        right: 1.1rem;
        bottom: .55rem;
        height: 3px;
        border-radius: 3px;
        background: var(--gradient);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform .3s;
    }

    .main-nav a:hover::after,
    .main-nav a.is-active::after {
        transform: scaleX(1);
    }

    .gallery {
        grid-template-columns: repeat(4, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr 1.3fr;
        align-items: stretch;
    }

    .map-box {
        min-height: 280px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* kotwice w politykach: nagłówek nie chowa się pod sticky menu */
h2[id] {
    scroll-margin-top: calc(var(--nav-h) + 1rem);
}

/* ===== Przełącznik motywu (w menu) ===== */
.theme-toggle {
    position: relative;
    flex: none;
    width: var(--sw-w);
    height: var(--sw-h);
    margin-left: .6rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
}

/* suwak pod aktywną ikoną */
.theme-toggle::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(var(--sw-h) - 6px);
    height: calc(var(--sw-h) - 6px);
    border-radius: 50%;
    background: var(--gradient);
    transition: transform .25s;
}

:root[data-theme="dark"] .theme-toggle::before {
    transform: translateX(calc(var(--sw-w) - var(--sw-h)));
}

.theme-toggle svg {
    position: absolute;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -.5rem;
    fill: currentColor;
}

.theme-toggle .icon-sun {
    left: calc((var(--sw-h) - 6px) / 2 + 2px - .5rem);
}

.theme-toggle .icon-moon {
    right: calc((var(--sw-h) - 6px) / 2 + 2px - .5rem);
}

.theme-toggle:active {
    background: rgba(255, 255, 255, .2);
}

@media (hover: hover) {
    .theme-toggle:hover {
        background: rgba(255, 255, 255, .2);
    }
}

@media (min-width: 900px) {
    .theme-toggle {
        position: absolute;
        right: 1.25rem;
        top: 50%;
        margin: calc(var(--sw-h) / -2) 0 0;
    }

}

/* ===== Tryb ciemny (ciemny fiolet-granat) ===== */
:root[data-theme="dark"] {
    color-scheme: dark;
    --color-text: #e9e6ff;
    --color-muted: #b8b4d9;
    --color-bg: #14122b;
    --color-bg-alt: #1b1838;
    --color-border: #322d5c;
    --surface: #221e45;
    --card: rgba(34, 30, 69, .94);
    --accent: #b9a8ff;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --shadow-hover: 0 14px 34px rgba(0, 0, 0, .5);
}

:root[data-theme="dark"] body::before {
    background-image: url("/images/site_background_dark.jpg");
    opacity: .4;
}

/* baner w trybie ciemnym: ciemny gradient, białe logo i biały nagłówek */
.hero-logo .logo-dark {
    display: none;
}

:root[data-theme="dark"] .hero-logo .logo-light {
    display: none;
}

:root[data-theme="dark"] .hero-logo .logo-dark {
    display: block;
}

:root[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #14122b 0%, var(--violet-dark) 55%, #1d4d78 100%);
}

:root[data-theme="dark"] .hero::before {
    opacity: .45;
}

:root[data-theme="dark"] .hero h1 {
    color: #fff;
    text-shadow: none;
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3 {
    color: #fff;
}

:root[data-theme="dark"] .service-body h3 {
    color: var(--accent);
}

:root[data-theme="dark"] .contact-line:hover,
:root[data-theme="dark"] .contact-line:focus-visible {
    color: var(--green);
}

:root[data-theme="dark"] .contact-line:hover .contact-icon,
:root[data-theme="dark"] .contact-line:focus-visible .contact-icon {
    fill: var(--green);
}

:root[data-theme="dark"] .service img,
:root[data-theme="dark"] .gallery img {
    background: #2a2554;
}

:root[data-theme="dark"] .skip-link {
    background: var(--surface);
    color: var(--color-text);
}

:root[data-theme="dark"] .todo {
    background: #4a3b00;
    color: #fff3cd;
}

:root[data-theme="dark"] .map-revoke-btn:active {
    color: var(--violet-dark);
}

@media (hover: hover) {
    :root[data-theme="dark"] .map-revoke-btn:hover {
        color: var(--violet-dark);
    }
}