/* wysokość sceny podstron powiązana z rzeczywistą wysokością headera HOME */
:root { --header-h: calc(min(calc(100vh / 828), calc(100vw / 1899 * 1.4)) * 81); }
@media (max-width: 900px), (max-aspect-ratio: 1/1) { :root { --header-h: 72px; } }

/* HEADER – dokładna kopia systemu headera HOME (css/style.css), zmienne zawężone do .hm-header */
.hm-header {
  --px: calc(100vw / 1899);
  --py: min(calc(100vh / 828), calc(var(--px) * 1.4));
  --pf: min(var(--px), var(--py));
  --lime: #8fe000;
  --lime-hi: #9dfc0c;
  --cond: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  color: #fff;
}
.hm-header img, .hm-header svg { display: block; max-width: 100%; }
.hm-header a { color: inherit; text-decoration: none; }
.hm-header ul { list-style: none; margin: 0; padding: 0; }

/* ---------- NAGŁÓWEK ---------- */
.hm-header {
  position: relative; z-index: 20;
  height: calc(var(--py) * 81);
  background: #011206;
  border-bottom: 1px solid #24723a;
}
.hm-header > * { position: absolute; top: 50%; transform: translateY(-50%); }
.hm-brand { left: calc(var(--px) * 70); }
.hm-brand img { width: auto; height: calc(var(--pf) * 66); }
.hm-sep {
  width: 2px; height: calc(var(--py) * 58);
  background: linear-gradient(180deg, transparent, #f4ff95 30%, #f4ff95 70%, transparent);
  opacity: .85;
}
.hm-sep-1 { left: calc(var(--px) * 381); }
.hm-sep-2 { left: calc(var(--px) * 1646); }

.hm-nav { left: calc(var(--px) * 433); margin-top: calc(var(--py) * 2); }
.hm-nav ul { display: flex; gap: calc(var(--px) * 50.8); }
.hm-nav a {
  position: relative; display: block;
  font-family: var(--cond); font-weight: 500;
  font-size: calc(var(--pf) * 22.8); line-height: 1.2;
  white-space: nowrap; transition: color .2s;
}
.hm-nav a:hover, .hm-nav a.is-active { color: var(--lime); }
.hm-nav a.is-active::before,
.hm-nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; border-radius: 2px; }
.hm-nav a.is-active::before { top: calc(var(--py) * -17); height: 1px; background: rgba(143, 224, 0, .45); }
.hm-nav a.is-active::after {
  bottom: calc(var(--py) * -14); height: calc(var(--pf) * 3.5); min-height: 2px;
  background: var(--lime-hi); box-shadow: 0 0 calc(var(--pf) * 6) rgba(157, 252, 12, .6);
}

.hm-wa { left: calc(var(--px) * 1427); display: flex; align-items: center; gap: calc(var(--px) * 15); }
.hm-wa svg { width: calc(var(--pf) * 36); height: calc(var(--pf) * 36); color: var(--lime-hi); flex-shrink: 0; }
.hm-wa span { font-family: var(--cond); font-weight: 700; font-size: calc(var(--pf) * 20); white-space: nowrap; }

.hm-lang { left: calc(var(--px) * 1692); display: flex; gap: calc(var(--px) * 26); font-family: var(--cond); font-weight: 700; font-size: calc(var(--pf) * 22); }
.hm-lang a { position: relative; transition: color .2s; }
.hm-lang a:hover, .hm-lang a.is-active { color: var(--lime-hi); }
.hm-lang a.is-active::before, .hm-lang a.is-active::after { content: ""; position: absolute; left: 0; right: 0; height: calc(var(--pf) * 2.5); min-height: 2px; background: var(--lime-hi); }
.hm-lang a.is-active::before { top: calc(var(--py) * -11); }
.hm-lang a.is-active::after { bottom: calc(var(--py) * -10); }

.hm-burger {
  left: calc(var(--px) * 1818);
  display: flex; flex-direction: column; justify-content: space-between;
  width: calc(var(--pf) * 35); height: calc(var(--pf) * 26);
  padding: 0; border: 0; background: none; cursor: pointer;
}
.hm-burger span { height: calc(var(--pf) * 4); min-height: 2px; border-radius: 2px; background: #fff; transition: transform .25s, opacity .25s; }


@media (max-width: 900px), (max-aspect-ratio: 1/1) {
  .hm-header { --px: 1px; --py: 1px; --pf: 1px; }
  .hm-header { display: flex; align-items: center; height: 72px; padding: 0 16px; }
  .hm-header > * { position: static; transform: none; }
  .hm-brand img { height: 46px; }
  .hm-sep { display: none; }
  .hm-wa { margin-left: auto; }
  .hm-wa span { display: none; }
  .hm-wa svg { width: 32px; height: 32px; }
  .hm-lang { margin-left: 16px; gap: 14px; font-size: 1.05rem; }
  .hm-lang a.is-active::before { display: none; }
  .hm-burger { margin-left: 18px; width: 30px; height: 22px; }
  .hm-burger span { height: 3px; }
  .hm-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
  .hm-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .hm-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }
  .hm-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    padding: 8px 18px 18px; background: rgba(0, 8, 3, .98);
    border-bottom: 1px solid rgba(143, 224, 0, .25);
  }
  .hm-nav.is-open { display: block; }
  .hm-nav ul { flex-direction: column; gap: 0; }
  .hm-nav a { padding: 12px 0; font-size: 1.15rem; }
  .hm-nav a.is-active::before { display: none; }
  .hm-nav a.is-active::after { right: auto; width: 56px; bottom: 6px; }
}

/* mobile: niewidoczny obszar kliknięcia ~44 px dla EN / PL / hamburgera (wygląd bez zmian) */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
  .hm-lang a::before,
  .hm-lang a.is-active::before {
    content: ""; display: block; position: absolute;
    top: -12px; bottom: -12px; left: -7px; right: -7px;
    height: auto; min-height: 0; background: transparent;
  }
  .hm-lang a:first-child::before { left: -11px; }
  .hm-lang a:last-child::before { right: -11px; }
  .hm-burger { position: relative; top: auto; left: auto; }
  .hm-burger::after { content: ""; position: absolute; top: -11px; bottom: -11px; left: -7px; right: -7px; }
}

/* ===== Nagłówek z 3 językami (PL | EN | DE) – tylko desktop:
   separator języków i przełącznik przesunięte w lewo o 16 jedn. projektu ===== */
.hm-header-3lang .hm-sep-2 { left: calc(var(--px) * 1630); }
.hm-header-3lang .hm-lang  { left: calc(var(--px) * 1676); }

/* ===== Nagłówek z 3 językami – MOBILE: WhatsApp dosuwa się do logo (margin-left:auto),
   a odstępy WhatsApp → języki → hamburger i PL/EN/DE zmniejszają się proporcjonalnie
   tylko wtedy, gdy brakuje miejsca (330.6px = logo + WhatsApp + napisy + hamburger + marginesy) ===== */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
  .hm-header-3lang {
    --g-wa: clamp(0px, calc((100vw - 330.6px) * 0.25806), 16px);   /* WhatsApp → języki */
    --g-in: clamp(0px, calc((100vw - 330.6px) * 0.22581), 14px);   /* PL → EN → DE */
    --g-bu: clamp(0px, calc((100vw - 330.6px) * 0.29032), 18px);   /* DE → hamburger */
  }
  .hm-header-3lang .hm-lang   { margin-left: var(--g-wa); gap: var(--g-in); }
  .hm-header-3lang .hm-burger { margin-left: var(--g-bu); }

  /* strefy dotyku języków (niewidoczne): sąsiednie strefy stykają się w połowie odstępu,
     skrajne nie wchodzą na WhatsApp ani na strefę hamburgera (która sięga 7px w lewo) */
  .hm-header-3lang .hm-lang a::before,
  .hm-header-3lang .hm-lang a.is-active::before { left: calc(var(--g-in) / -2); right: calc(var(--g-in) / -2); }
  .hm-header-3lang .hm-lang a:first-child::before { left: calc(-1 * clamp(0px, calc(var(--g-wa) - 1px), 11px)); }
  .hm-header-3lang .hm-lang a:last-child::before  { right: calc(-1 * clamp(0px, calc(var(--g-bu) - 7px), 11px)); }
}
