/* =========================================================
   ROOT
========================================================= */
:root {
    --green-500: #0ea538;
    --header-h: 64px;
    /* desktop */
    --max-width: 1100px;
}

/* =========================================================
   RESET
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

button {
    background: transparent;
    border: 0;
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================================
   BODY
========================================================= */
body {
    font-family: 'Poppins', Arial, sans-serif;
    background: #fff;
    color: #06220f;
    -webkit-font-smoothing: antialiased;
    line-height: 1.4;
}

/* =========================================================
   LOADER
========================================================= */
.loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 99999;
    transition: opacity .35s ease, transform .35s ease;
    will-change: opacity, transform;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(.98);
}

.loader-logo {
    width: 200px;
    height: auto;
    display: block;
    transform-origin: center;
    animation: loader-pop .9s cubic-bezier(.17, .8, .36, 1) both;
}

@keyframes loader-pop {
    0% {
        opacity: 0;
        transform: scale(.6);
    }

    70% {
        transform: scale(1.06);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================================
   HEADER (sticky + białe tło)
========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    height: var(--header-h);
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* elementy w headerze NIE mogą się ściskać */
.site-header>* {
    flex: 0 0 auto;
}

/* brand / logo */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    min-width: 48px;
    height: 100%;
}

.brand-logo {
    height: 32px;
    width: auto;
    flex-shrink: 0;
}

/* =========================================================
   NAV DESKTOP
========================================================= */
.main-nav {
    display: flex;
    gap: 22px;
    align-items: center;
    height: 100%;
}

.main-nav a {
    font-weight: 600;
    font-size: 15px;
    opacity: .9;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 6px;
}

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

/* =========================================================
   HAMBURGER (mobile)
========================================================= */
.hamburger {
    display: none;
    width: 48px;
    height: 100%;
    flex: 0 0 48px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: #06220f;
    margin: 3px 0;
    border-radius: 2px;
}

/* =========================================================
   HERO
========================================================= */
.hero {
    min-height: 460px;
    padding: 80px 20px;
    background: url('bg-hero.png') center/cover no-repeat;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero-inner {
    max-width: 980px;
}

.hero h1 {
    font-size: 56px;
    font-weight: 700;
    text-shadow: 0 6px 18px rgba(2, 28, 12, .35);
    margin-bottom: 12px;
}

.hero .lead {
    margin-bottom: 18px;
    font-size: 18px;
    opacity: .95;
}

.cta {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-weight: 600;
}

/* =========================================================
   MAIN + CONTENT
========================================================= */
.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 44px 20px;
}

.section {
    margin-bottom: 40px;
}

h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.muted {
    color: #234b25;
    opacity: .8;
}

/* =========================================================
   SERVICES GRID
========================================================= */
.services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.service {
    background: #fff;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid rgba(6, 34, 15, .05);
    box-shadow: 0 6px 18px rgba(2, 28, 12, .06);
}

.service h3 {
    color: var(--green-500);
    margin-bottom: 10px;
}

/* =========================================================
   CONTACT
========================================================= */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

/* =========================================================
   FOOTER
========================================================= */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    color: #3b6a45;
}

/* =========================================================
   TABLET ≤ 900px
========================================================= */
@media (max-width:900px) {
    .services {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================================
   MOBILE ≤ 720px (skonsolidowane reguły)
========================================================= */
@media (max-width:720px) {
    :root {
        --header-h: 56px;
    }

    .site-header {
        padding: 0 14px;
        height: var(--header-h);
    }

    .brand-logo {
        height: 28px;
    }

    /* desktop menu znika, hamburger widoczny */
    .main-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* podstawowe mobilne wysuwane menu */
    .main-nav.open {
        display: flex !important;
        position: absolute;
        top: var(--header-h);
        right: 14px;
        flex-direction: column;
        gap: 6px;
        padding: 10px 14px;
        background: #fff;
        border-radius: 10px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
        width: auto;
        max-width: 200px;
        z-index: 10000;
        overflow: hidden;
        box-sizing: border-box;
        transform: translateZ(0);
    }

    .main-nav.open a {
        font-size: 15px;
        padding: 6px 0;
        white-space: nowrap;
    }

    /* alternatywne mniejsze fonty (jeśli używana inna wersja) */
    .main-nav.open a[style*="font-size:14px"] {
        font-size: 14px;
    }

    .hero h1 {
        font-size: 34px;
    }

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

/* === GLOBAL FIX: usuwa biały pasek poziomy === */
html,
body {
    overflow-x: hidden !important;
}

/* loader nigdy nie będzie szerszy niż viewport */
.loader,
.loader * {
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
}

/* zabezpieczenie pseudo-elementów (np. hero::before) przed wychodzeniem poza viewport */
.hero::before,
.brand::after {
    max-width: 100vw;
    box-sizing: border-box;
    right: auto;
    transform: translateX(12vw);
}

.hero {
    overflow: hidden;
}

/* ========== ESTETYCZNE DODATKI ========== */
a,
.cta,
.service,
.brand-logo,
.hamburger span {
    transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease, color .18s ease;
}

.brand {
    position: relative;
}

.brand::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -6px;
    width: 48px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(14, 165, 56, 0.12), rgba(14, 165, 56, 0.28));
    pointer-events: none;
    filter: blur(6px);
    opacity: .95;
}

/* nav underline animation */
.main-nav a {
    position: relative;
    overflow: visible;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    height: 3px;
    width: 60%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--green-500), rgba(14, 165, 56, 0.7));
    transition: transform .22s cubic-bezier(.2, .9, .3, 1);
    opacity: .9;
}

.main-nav a:hover::after,
.main-nav a:focus::after {
    transform: translateX(-50%) scaleX(1);
}

/* CTA hover */
.cta {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.7));
    box-shadow: 0 6px 18px rgba(2, 28, 12, 0.12);
}

.cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(2, 28, 12, 0.14);
}

/* services hover */
.service {
    transition: transform .22s cubic-bezier(.2, .9, .3, 1), box-shadow .22s ease;
    will-change: transform;
}

.service:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 36px rgba(2, 28, 12, 0.08);
}

/* hero decoration */
.hero::before {
    content: "";
    position: absolute;
    right: -10%;
    top: -6%;
    width: 40%;
    height: 60%;
    pointer-events: none;
    background:
        radial-gradient(closest-side, rgba(14, 165, 56, 0.10), transparent 40%),
        radial-gradient(closest-side, rgba(2, 28, 12, 0.05), transparent 30%);
    transform: translateZ(0);
    filter: blur(14px);
    opacity: .9;
}

/* header shadow when scrolled */
.site-header {
    transition: box-shadow .22s ease, background-color .18s ease, transform .18s ease;
}

.site-header.scrolled {
    box-shadow: 0 6px 18px rgba(2, 28, 12, 0.06);
    background: #ffffff;
    transform: translateZ(0);
}

/* accessibility: focus visible */
a:focus,
button:focus {
    outline: 3px solid rgba(14, 165, 56, 0.14);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------------------------
   desktop: ukryj hamburger, pokaż nav
   (skonsolidowane i zachowane wartości)
   --------------------------- */
@media (min-width:721px) {
    .hamburger {
        display: none !important;
    }

    .main-nav {
        display: flex !important;
        position: static !important;
        top: auto !important;
        right: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        gap: 22px;
    }

    .main-nav.open {
        display: flex !important;
        position: static !important;
    }
}

/* ===== DESKTOP — dodatkowe ustawienia (ostatnie reguły mają pierwszeństwo) ===== */
@media (min-width:721px) {

    /* centrowanie kontentu headera jako punkt odniesienia */
    .site-header {
        justify-content: center !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    /* zgodnie z ostatnim blokiem: brand i main-nav zamienione miejscami (wartości zachowane) */
    .brand {
        order: 1;
        margin-right: auto;
        margin-left: 30px;
        gap: 12px !important;
    }

    .main-nav {
        order: 2;
        margin-left: auto;
        margin-right: 30px;
        align-items: center;
    }

    .site-header .brand-logo {
        height: 30px !important;
    }
}

/* MOBILE: zapewnij wewnętrzne przewijanie menu i limit wysokości */
@media (max-width:720px) {
    .main-nav.open {
        /* wysokość maksymalna: viewport minus header i mały margines */
        max-height: calc(100vh - var(--header-h) - 24px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* płynne scrollowanie na iOS */
        /* upewnij się, że box ma własne kontekstowanie i nie rozpycha layoutu */
        position: absolute;
        right: 14px;
        top: var(--header-h);
        box-sizing: border-box;
        /* optional: estetyczny padding wewnątrz przewijalnego obszaru */
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /* linki w menu - ustalona wysokość linii, żeby łatwo zobaczyć kilka pozycji */
    .main-nav.open a {
        display: block;
        line-height: 1.6;
        padding: 8px 10px;
    }

    /* upewnij się, że tło pozostałych elementów nie blokuje przewijania w menu */
    body.menu-open {
        /* nie używamy overflow:hidden tutaj (może blokować wewnętrzny scroll na iOS) */
        /* zamiast tego zamrażamy body przez position:fixed w JS (poniżej) */
        overflow: visible;
    }
}
/* === PEŁNE MENU MOBILNE – ZERO SCROLLA, ZERO PRZESUWANIA === */
@media (max-width:720px) {
    .main-nav.open {
        position: absolute;
        top: var(--header-h);
        right: 14px;

        display: flex !important;
        flex-direction: column;
        gap: 10px;

        background: #fff;
        border-radius: 10px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        padding: 14px 18px;

        /* najważniejsze */
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;

        /* szerokość bez kombinacji */
        width: auto;
        max-width: 200px;

        z-index: 10000;
    }

    .main-nav.open a {
        font-size: 15px;
        white-space: nowrap;
        padding: 6px 0;
    }
}
/* ============================================
   AUTO DARK MODE — prefers-color-scheme
   ============================================ */
@media (prefers-color-scheme: dark) {

  /* global */
  body {
    background: #0b0b0b;
    color: #e2e2e2;
  }

  .site-header {
    background: #111;
    border-bottom-color: rgba(255,255,255,0.08);
  }

  .site-header.scrolled {
    background: #0f0f0f;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  }

  /* hero */
  .hero {
    color: #fff;
  }

  /* teksty */
  .muted {
    color: #9abf9e;
  }

  /* karty usług */
  .service {
    background: #161616;
    border-color: rgba(255,255,255,0.05);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  }
  .service:hover {
    box-shadow: 0 18px 36px rgba(0,0,0,0.5);
  }

  /* footer */
  .site-footer {
    color: #b4d4b8;
  }

  /* CTA */
  .cta {
    background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.25));
    color: #fff;
  }

  /* MENU MOBILNE */
  .main-nav.open {
    background: #111;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 12px 28px rgba(0,0,0,0.6);
  }

  .main-nav a {
    color: #eaeaea;
  }

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

  /* hero dekoracja */
  .hero::before {
    opacity: 0.18;
    filter: blur(18px);
  }
}
@media (prefers-color-scheme: dark) {

    /* Loader tło + delikatny cień loga */
    .loader {
        background: #0c0c0c;
    }

    .loader-logo {
        filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.15));
    }
}
@media (prefers-color-scheme: dark) {
    .hamburger span {
        background: #e6e6e6 !important;
    }

    .hamburger:active span {
        opacity: .6;
    }
}
@media (prefers-color-scheme: dark) {
    .main-nav.open {
        background: #111 !important;
        border-color: rgba(255, 255, 255, 0.06) !important;
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.7) !important;
    }

    .main-nav.open a {
        color: #fafafa !important;
    }

    .main-nav.open a:hover {
        color: var(--green-500) !important;
        transform: translateX(3px);
    }
}
.hamburger {
    transition: transform .15s ease;
}

.hamburger:active {
    transform: scale(0.92);
}
@media (prefers-color-scheme: dark) {

    #logoLoader img,
    .loader-logo {
        content: url('iholo-w.png');
    }
}
/* ========== CONTACT GRID (3 kolumny desktop, 1 mobile) ========== */
.contact-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:18px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6px;
  box-sizing: border-box;
}

/* karta kontaktu */
.contact-card{
  display:flex;
  gap:14px;
  align-items:flex-start;
  background:#fff;
  padding:14px;
  border-radius:12px;
  border:1px solid rgba(6,34,15,0.04);
  box-shadow:0 8px 22px rgba(2,28,12,0.04);
  transition: transform .16s ease, box-shadow .18s ease;
}

/* hover (desktop) */
@media (hover: hover) and (pointer: fine) {
  .contact-card:hover{
    transform: translateY(-6px);
    box-shadow:0 18px 36px rgba(2,28,12,0.06);
  }
}

/* ikona w kółku */
.contact-icon{
  min-width:46px;
  min-height:46px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(180deg, rgba(14,165,56,0.06), rgba(14,165,56,0.02));
  color: #0b2f13; /* ikona używa currentColor */
  flex-shrink:0;
}

/* tekst w karcie */
.contact-body strong{display:block;margin-bottom:6px;font-size:1.05rem;color:#06220f}
.contact-line a{color:#06220f;text-decoration:none;font-weight:600}
.contact-line a:hover{color:var(--green-500)}

/* responsywność: mobile 1 kolumna, mniejsze paddingi */
@media (max-width: 720px){
  .contact-grid{
    grid-template-columns: 1fr;
    gap:12px;
    padding: 6px 4px;
  }
  .contact-card{
    padding:12px;
    border-radius:10px;
  }
  .contact-icon{min-width:40px;min-height:40px}
  .contact-body strong{font-size:1rem}
  .contact-line a{font-size:1rem}
}

/* dark-mode adjustments (prefers-color-scheme: dark) */
@media (prefers-color-scheme: dark){
  .contact-card{
    background:#121212;
    border-color: rgba(255,255,255,0.03);
    box-shadow: 0 8px 22px rgba(0,0,0,0.45);
  }
  .contact-icon{
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    color: #e8f6ea;
  }
  .contact-body strong, .contact-line a{
    color:#e6f3e9;
  }
  .contact-line a:hover{color: var(--green-500)}
}
/* ========== GALERIA (CSS Masonry Auto Layout) ========== */

.gallery-grid{
  column-count: 3;
  column-gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 12px;
}

.gallery-grid img{
  width: 100%;
  margin-bottom: 16px;
  border-radius: 12px;
  display: block;
  break-inside: avoid;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform .22s ease, box-shadow .22s ease;
}

.gallery-grid img:hover{
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}

/* mobile */
@media (max-width: 720px){
  .gallery-grid{
    column-count: 1;
    padding: 12px;
  }
}

/* tablet */
@media (max-width: 1020px){
  .gallery-grid{
    column-count: 2;
  }
}

/* DARK MODE */
@media (prefers-color-scheme: dark){
  .gallery-grid img{
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  }
  .gallery-grid img:hover{
    box-shadow: 0 18px 36px rgba(0,0,0,0.8);
  }
}
/* ========== GALERIA — KWADRATY, ANIMACJE, LIGHTBOX ========== */

/* układ: 3 kolumny desktop */
.gallery-grid{
  column-count: 3;
  column-gap: 16px;
}

/* miniatury — kwadratowe */
.gallery-grid img{
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
  display: block;
  break-inside: avoid;

  /* animacja wejścia */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.2,.9,.3,1), box-shadow .22s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  cursor: zoom-in;
}

.gallery-grid img.in-view{
  opacity: 1;
  transform: translateY(0);
}

@media (max-width:1020px){
  .gallery-grid{ column-count: 2; }
}
@media (max-width:720px){
  .gallery-grid{ column-count: 1; }
}

/* hover (desktop only) */
@media (hover:hover){
  .gallery-grid img:hover{
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 32px rgba(0,0,0,0.12);
  }
}

/* ========== LIGHTBOX ========== */

.gallery-lightbox{
  position: fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:10000;
  background: rgba(0,0,0,0.65);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.gallery-lightbox.active{
  display:flex;
}

.gallery-lightbox img{
  max-width: 96vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  cursor: zoom-out;
  opacity:0;
  transform: scale(1.04);
  transition: opacity .28s ease, transform .32s cubic-bezier(.2,.9,.3,1);
}

.gallery-lightbox img.show{
  opacity:1;
  transform: scale(1);
}

/* close button */
.lb-close{
  position:absolute;
  top:20px;
  right:20px;
  height:42px;
  width:42px;
  border-radius:8px;
  background: rgba(255,255,255,0.1);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  color:#fff;
  cursor:pointer;
  backdrop-filter: blur(4px);
}
/* ============================================
   GALERIA — FIX NA TELEFONY (GRID ZAMIENIA COLUMN-COUNT)
   ============================================ */

.gallery-grid{
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-grid img{
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 10px;
  display: block;

  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.2,.9,.3,1), box-shadow .22s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  cursor: zoom-in;
}

.gallery-grid img.in-view{
  opacity: 1;
  transform: translateY(0);
}

/* tablet */
@media (max-width: 1020px){
  .gallery-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* telefon */
@media (max-width: 720px){
  .gallery-grid{
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
  }
  .gallery-grid img{
    margin-bottom: 0;
  }
}

/* END */