/* ============================================================
   STRONA-LESNA — uzupełnienie Tailwind CDN (ciemny motyw)

   Animacje scroll-reveal: USUNIĘTE.
   Jedyna animacja w pliku to hero entry (na load) — kaskada
   fade-up dla nagłówka i jego sąsiadów.
   ============================================================ */

html {
  scroll-behavior: smooth;
  background-color: #0b1410;
}

body {
  background-color: #0b1410;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Sticky header offset dla kotwic */
section[id] {
  scroll-margin-top: 80px;
}

/* ============================================================
   MOBILE MENU — wymuszony display żeby Tailwind nie blokował
   ============================================================ */
#mobile-menu {
  display: none;
  background-color: #0b1410;  /* ink-925 — żeby nie świeciło przez tło hero */
}
#mobile-menu.is-open {
  display: block !important;
}

/* Na desktop NIGDY nie pokazujemy mobile menu */
@media (min-width: 768px) {
  #mobile-menu,
  #mobile-menu.is-open {
    display: none !important;
  }
}

/* Hamburger button — touch-friendly + visual feedback */
#mobile-menu-btn {
  -webkit-tap-highlight-color: rgba(94, 154, 94, 0.3);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
#mobile-menu-btn:active {
  background-color: rgba(94, 154, 94, 0.15);
  border-radius: 8px;
}

/* Header — zmiana tła przy scrollu */
#site-header.scrolled {
  background-color: rgba(11, 20, 16, 0.97);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border-bottom-color: rgba(31, 51, 41, 0.8);
}

/* ============================================================
   LANGUAGE SWITCHER (PL / EN / DE)
   ============================================================ */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background-color: rgba(31, 51, 41, 0.4);
  border: 1px solid rgba(31, 51, 41, 0.8);
  border-radius: 8px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #7d9785;
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
  text-transform: uppercase;
}
.lang-btn:hover {
  color: #b9d7b9;
  background-color: rgba(94, 154, 94, 0.15);
}
.lang-btn.lang-active {
  color: #ffffff;
  background-color: #2e612e;
  box-shadow: inset 0 0 0 1px rgba(94, 154, 94, 0.5);
}
.lang-btn .flag {
  width: 20px;
  height: 15px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  pointer-events: none; /* żeby kliknięcie w obrazek dało event na <button>, nie na <img> */
}
.lang-btn span {
  pointer-events: none; /* to samo dla starych span (gdyby cache się trzymał) */
}
.mobile-lang-switcher {
  display: flex;
  gap: 6px;
  padding: 12px 4px 4px 4px;
  border-top: 1px solid #1f3329;
  margin-top: 12px;
}
.mobile-lang-switcher .lang-btn {
  flex: 1;
  height: 36px;
  font-size: 13px;
}

/* ============================================================
   NAV — link aktywny (current page) ma podkreślenie + jaśniejszy kolor
   ============================================================ */
.nav-link {
  color: rgb(209, 213, 219);
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}
.nav-link:hover {
  color: rgb(142, 188, 142);
}
.nav-link.active {
  color: rgb(142, 188, 142);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: #5e9a5e;
  border-radius: 1px;
}

/* Mobilne menu — aktywny link */
.mobile-nav-link.active {
  background-color: rgba(46, 97, 46, 0.2);
  color: rgb(142, 188, 142);
}

/* ============================================================
   SCROLL ANIMATIONS — subtelne fade-up na elementach z .anim-in
   Trigger 150px przed wejściem w viewport — kiedy widać element,
   animacja już jest w połowie (brak efektu "ładowania").
   ============================================================ */
.anim-in {
  opacity: 0;
  transform: translateY(48px) scale(0.96);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.anim-in.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.anim-in.visible {
  opacity: 1;
  transform: none;
}

/* Drobny zoom przy hover na zdjęciach galerii / kafelków */
.img-zoom {
  overflow: hidden;
}
.img-zoom > img {
  transition: transform 0.6s ease-out;
}
.img-zoom:hover > img {
  transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
  .anim-in { opacity: 1 !important; transform: none !important; }
  .img-zoom > img { transition: none !important; }
  .img-zoom:hover > img { transform: none !important; }
}

/* ============================================================
   A11Y — focus rings (zielony pop na ciemnym)
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #5e9a5e;
  outline-offset: 2px;
}

/* ============================================================
   IMG defaults
   ============================================================ */
img {
  background-color: #101c16;
}

/* ============================================================
   FORM STATUS (dark-friendly)
   ============================================================ */
#form-status.success {
  display: block;
  color: #b9d7b9;
  background-color: rgba(46, 97, 46, 0.15);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #5e9a5e;
}
#form-status.error {
  display: block;
  color: #fca5a5;
  background-color: rgba(220, 38, 38, 0.12);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #dc2626;
}

/* Autofill — Chrome/Edge override (żeby nie świeciło białym) */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0b1410 inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
  transition: background-color 9999s ease-in-out 0s;
}

/* ============================================================
   SELEKCJA + SCROLLBAR
   ============================================================ */
::selection {
  background-color: rgba(94, 154, 94, 0.4);
  color: #ffffff;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #0b1410; }
::-webkit-scrollbar-thumb {
  background: #243329;
  border-radius: 6px;
  border: 2px solid #0b1410;
}
::-webkit-scrollbar-thumb:hover { background: #34463b; }
* { scrollbar-color: #243329 #0b1410; scrollbar-width: thin; }

/* ============================================================
   ✨ HERO ENTRY — JEDYNA ANIMACJA NA STRONIE
   Kaskada fade-up dla nagłówka "Profesjonalne usługi leśne"
   i sąsiadów (badge, opis, CTA, statystyki).
   Odpala się raz, na pierwszym ładowaniu.
   ============================================================ */
#home .max-w-3xl > * {
  opacity: 0;
  animation: heroFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#home .max-w-3xl > *:nth-child(1) { animation-delay: 0.05s; } /* badge "Działamy od 2004" */
#home .max-w-3xl > *:nth-child(2) { animation-delay: 0.15s; } /* h1 "Profesjonalne usługi leśne" */
#home .max-w-3xl > *:nth-child(3) { animation-delay: 0.25s; } /* opis pod h1 */
#home .max-w-3xl > *:nth-child(4) { animation-delay: 0.35s; } /* CTA buttons */
#home .max-w-3xl > *:nth-child(5) { animation-delay: 0.45s; } /* statystyki */

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ♿ REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #home .max-w-3xl > * {
    opacity: 1 !important;
    animation: none !important;
  }
}

/* ============================================================
   PRINT — wracamy do jasnych kolorów (klient drukuje ofertę)
   ============================================================ */
@media print {
  html, body {
    background-color: #ffffff !important;
    color: #000 !important;
  }
  #site-header,
  #mobile-menu,
  footer,
  #contact-form {
    display: none !important;
  }
  * {
    color: #000 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }
}
