/* =========================================================
   HOME – wzorzec: „HOME_FINAL_SPOJNY.png” (1899 × 828)
   --px = 1 px wzorca w poziomie, --py = 1 px wzorca w pionie
   (całość wypełnia 100vh), --pf = rozmiar fontów i elementów.
   Typografia bazowa: Open Sans 700 (tytuł), Roboto Condensed (reszta).
   ========================================================= */
:root {
  --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;
  --text: #ffffff;
  --head: "Open Sans", Arial, sans-serif;
  --cond: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.hm { margin: 0; background: #010d04; color: var(--text); font-family: var(--cond); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, p { margin: 0; }

.hm-page { position: relative; height: calc(var(--py) * 828); overflow-x: clip; }

/* ---------- 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; }

/* ---------- SCENA ---------- */
.hm-stage { position: absolute; left: 0; right: 0; top: calc(var(--py) * 81); bottom: 0; }
.hm-scene { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; }

/* pozycje w jednostkach wzorca; y liczone od górnej krawędzi sceny (y wzorca − 81) */
.hm-hero > * { position: absolute; left: calc(var(--px) * 70); }

.hm-title {
  top: calc(var(--py) * 59);
  font-family: var(--head); font-weight: 700;
  font-size: calc(var(--pf) * 69.5); line-height: 1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}
.hm-swash {
  top: calc(var(--py) * 146); left: calc(var(--px) * 72);
  width: calc(var(--px) * 285); height: calc(var(--pf) * 9);
  background: linear-gradient(90deg, rgba(160, 255, 26, .55) 0%, #a8ff1c 12%, #94fc10 55%, rgba(141, 252, 16, .25) 85%, rgba(141, 252, 16, 0) 100%);
  clip-path: polygon(0 45%, 100% 0, 100% 18%, 0 100%);
  filter: drop-shadow(0 0 calc(var(--pf) * 5) rgba(141, 252, 16, .7));
}
.hm-lead {
  top: calc(var(--py) * 180);
  font-family: var(--cond); font-weight: 400;
  font-size: calc(var(--pf) * 33.2); line-height: calc(var(--py) * 39);
  color: #eef0ee; text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}

.hm-btn {
  display: flex; align-items: center;
  width: calc(var(--px) * 370); height: calc(var(--py) * 75);
  padding: 0 calc(var(--px) * 28);
  border-radius: calc(var(--pf) * 8);
  transition: filter .2s, box-shadow .2s;
}
.hm-btn-wa {
  top: calc(var(--py) * 288);
  color: #0c4219;
  background: linear-gradient(90deg, #4cfb69 0%, #3cf95a 45%, #06f224 100%);
  box-shadow: 0 0 calc(var(--pf) * 18) rgba(47, 240, 74, .45);
}
.hm-btn-outline {
  top: calc(var(--py) * 381);
  background: rgba(0, 21, 4, .72);
  border: 2px solid #37d741;
  box-shadow: 0 0 calc(var(--pf) * 10) rgba(55, 215, 65, .25);
}
.hm-btn:hover { filter: brightness(1.08); }
.hm-btn-icon { width: calc(var(--pf) * 42); height: calc(var(--pf) * 42); flex-shrink: 0; }
.hm-btn-wa .hm-btn-icon { color: #fff; }
.hm-btn-outline .hm-btn-icon { width: calc(var(--pf) * 44); height: calc(var(--pf) * 44); }
.hm-btn-text {
  display: flex; flex-direction: column;
  margin-left: calc(var(--px) * 28);
  font-family: var(--cond); font-weight: 500;
  font-size: calc(var(--pf) * 23); line-height: calc(var(--pf) * 29);
}
.hm-btn-outline .hm-btn-text { margin-left: calc(var(--px) * 25); font-size: calc(var(--pf) * 24.7); }
.hm-btn-text strong { font-weight: 700; }
.hm-btn-arrow { width: calc(var(--pf) * 30); height: calc(var(--pf) * 30); margin-left: auto; flex-shrink: 0; }

/* ---------- ZALETY ---------- */
.hm-features { position: absolute; left: 0; right: 0; top: calc(var(--py) * 479); }
.hm-features li {
  position: absolute; top: 0;
  width: calc(var(--px) * 220); margin-left: calc(var(--px) * -110);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hm-features li:nth-child(1) { left: calc(var(--px) * 475); }
.hm-features li:nth-child(2) { left: calc(var(--px) * 769); }
.hm-features li:nth-child(3) { left: calc(var(--px) * 1079); }
.hm-features li:nth-child(4) { left: calc(var(--px) * 1392); }
.hm-features li:not(:first-child)::before {
  content: ""; position: absolute; top: calc(var(--py) * 50);
  width: 2px; height: calc(var(--py) * 50);
  background: linear-gradient(180deg, transparent, #d9ff1d 45%, transparent);
  opacity: .7;
}
.hm-features li:nth-child(2)::before { left: calc(var(--px) * -37); }
.hm-features li:nth-child(3)::before { left: calc(var(--px) * -41); }
.hm-features li:nth-child(4)::before { left: calc(var(--px) * -28); }
.hm-ring {
  display: flex; align-items: center; justify-content: center;
  width: calc(var(--pf) * 51); height: calc(var(--pf) * 51);
  border: calc(var(--pf) * 2.6) solid var(--lime);
  border-radius: 50%;
  background: rgba(0, 18, 4, .55);
  box-shadow: 0 0 calc(var(--pf) * 8) rgba(143, 224, 0, .35);
}
.hm-ring svg { width: calc(var(--pf) * 22); height: calc(var(--pf) * 22); color: #fff; }
.hm-label {
  margin-top: calc(var(--py) * 7);
  font-family: var(--cond); font-weight: 700;
  font-size: calc(var(--pf) * 19.5); line-height: calc(var(--py) * 22);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
}

/* ---------- DOLNY PANEL ---------- */
.hm-panel {
  position: absolute;
  left: calc(var(--px) * 291); top: calc(var(--py) * 606);
  width: calc(var(--px) * 1318); height: calc(var(--py) * 75);
  display: grid; grid-template-columns: 437fr 427fr 454fr;
  border: 1.5px solid #74af01;
  border-radius: calc(var(--pf) * 12);
  background: linear-gradient(180deg, rgba(1, 24, 4, .78), rgba(0, 16, 2, .86));
  box-shadow: 0 0 calc(var(--pf) * 10) rgba(143, 224, 0, .35), inset 0 0 calc(var(--pf) * 14) rgba(143, 224, 0, .08);
}
.hm-panel li { position: relative; display: flex; align-items: center; justify-content: center; gap: calc(var(--px) * 26); }
.hm-panel li + li::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 1.5px;
  background: linear-gradient(180deg, transparent, #d9ff1d 50%, transparent);
}
.hm-panel-icon { width: calc(var(--pf) * 42); height: calc(var(--pf) * 42); color: var(--lime-hi); flex-shrink: 0; }
.hm-panel-pl { width: calc(var(--pf) * 50); height: calc(var(--pf) * 46); }
.hm-panel span { font-family: var(--cond); font-weight: 400; font-size: calc(var(--pf) * 25.5); white-space: nowrap; }

/* ---------- FALA ---------- */
.hm-wave {
  position: absolute; left: 0; width: 100%;
  top: calc(var(--py) * 687); height: calc(var(--py) * 60);
  overflow: visible;
  filter: drop-shadow(0 0 calc(var(--pf) * 4) rgba(141, 252, 16, .9)) drop-shadow(0 0 calc(var(--pf) * 12) rgba(141, 252, 16, .45));
}

/* ---------- MOBILE / PIONOWE ---------- */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
  :root { --px: 1px; --py: 1px; --pf: 1px; }
  .hm-page { height: auto; }
  .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; }

  .hm-stage { position: relative; top: 0; display: flex; flex-direction: column; overflow: hidden; }
  .hm-scene { height: 520px; object-position: 70% 0; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
  .hm-hero { position: relative; display: flex; flex-direction: column; padding: 34px 18px 10px; }
  .hm-hero > * { position: relative; left: auto; top: auto; }
  .hm-title { font-size: clamp(2.4rem, 12vw, 3.6rem); }
  .hm-swash { left: auto; width: 200px; height: 5px; margin-top: 12px; }
  .hm-lead { margin-top: 18px; font-size: 1.2rem; line-height: 1.35; text-shadow: 0 1px 2px rgba(0, 0, 0, .75), 0 0 8px rgba(0, 0, 0, .55); }
  .hm-btn { width: 100%; max-width: 360px; height: 64px; margin-top: 14px; padding: 0 18px; border-radius: 10px; }
  .hm-btn-wa { margin-top: 170px; }
  .hm-btn-icon, .hm-btn-outline .hm-btn-icon { width: 34px; height: 34px; }
  .hm-btn-text, .hm-btn-outline .hm-btn-text { margin-left: 14px; font-size: 1.1rem; line-height: 1.25; }
  .hm-btn-arrow { width: 26px; height: 26px; }
  .hm-features { position: relative; top: auto; display: grid; grid-template-columns: 1fr 1fr; row-gap: 26px; padding: 30px 12px 10px; }
  .hm-features li { position: static; width: auto; margin: 0; }
  .hm-features li::before { display: none; }
  .hm-ring { width: 56px; height: 56px; border-width: 3px; }
  .hm-ring svg { width: 26px; height: 26px; }
  .hm-label { margin-top: 10px; font-size: 1.05rem; line-height: 1.3; }
  .hm-panel { position: relative; left: auto; top: auto; width: auto; height: auto; margin: 28px 16px 40px; grid-template-columns: 1fr; border-radius: 14px; }
  .hm-panel li { justify-content: flex-start; gap: 16px; padding: 16px 20px; }
  .hm-panel li + li::before { left: 18%; right: 18%; top: 0; bottom: auto; width: auto; height: 1px; background: linear-gradient(90deg, transparent, #d9ff1d, transparent); }
  .hm-panel-icon { width: 34px; height: 34px; }
  .hm-panel-pl { width: 38px; }
  .hm-panel span { font-size: 1.2rem; }
  .hm-wave { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* 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)); }
}
