/* ====== Zmienne kolorów ====== */
:root {
  --ivory: #fdfdfb;
  --sand-gray: #f3f4f6;
  --navy: #1d3557;
  --gold: #c9a96a;
  --steel: #5c6b73;
  --ink: #0b1b2b;
  --ring: rgba(29, 53, 87, 0.15);
  --radius: 16px;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  --header-h: 64px;
}

/* ====== Reset & typografia ====== */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--navy);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
}
h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3.25rem);
  color: var(--navy);
}
h2 {
  font-size: clamp(1.6rem, 2vw + 0.8rem, 2.5rem);
  color: var(--navy);
}
h3 {
  font-size: clamp(1.05rem, 0.6vw + 1rem, 1.25rem);
}
p {
  margin: 0.5rem 0 1rem;
}
.subtitle {
  color: var(--steel);
  max-width: 70ch;
}

.container {
  width: min(1140px, 92vw);
  margin-inline: auto;
}
.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.section--alt {
  background: var(--sand-gray);
}
.section-header {
  margin-bottom: 2rem;
}
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1rem 0;
}

/* ====== Header ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--ivory);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  backdrop-filter: saturate(120%) blur(6px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--navy);
}
.brand-mark {
  color: var(--gold);
  font-size: 1.1rem;
}
.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
}
.nav .btn {
  margin-left: 0.25rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle:focus-visible {
  outline: 3px solid var(--gold);
}
.nav-toggle .bar {
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle.open .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.open .bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--ivory);

  /* stan zamknięty */
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  overflow: hidden;

  /* płynność */
  transition:
    max-height 380ms cubic-bezier(.2,.7,.3,1),
    opacity    260ms ease,
    transform  320ms ease;
}
.mobile-menu.open {
  max-height: 420px;     /* wystarczająco, by zmieścić linki */
  opacity: 1;
  transform: translateY(0);
}
#mobile-menu[hidden] {
  display: none !important;
}
.mobile-menu a {
  padding: 0.6rem 0.8rem;
  border-radius: 12px;

  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity   260ms ease,
    transform 320ms ease;
}
.mobile-menu.open a { opacity: 1; transform: translateY(0); }
.mobile-menu.open a:nth-child(1) { transition-delay: 60ms;  }
.mobile-menu.open a:nth-child(2) { transition-delay: 120ms; }
.mobile-menu.open a:nth-child(3) { transition-delay: 180ms; }
.mobile-menu.open a:nth-child(4) { transition-delay: 240ms; }

/* ====== Przyciski ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--navy);
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 0.08s, box-shadow 0.2s, background 0.2s, color 0.2s,
    border-color 0.2s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}
.btn--primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn--primary:hover {
  background: #1b2f4d;
}
.btn--ghost {
  background: transparent;
  color: var(--navy);
}
.btn--ghost:hover {
  background: rgba(29, 53, 87, 0.06);
}

/* ====== HERO ====== */
.hero {
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__flex {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%; /* przenosi wysokość sekcji w dół */
  max-width: 1140px;
  padding: 0 2rem;
  margin: 0 auto;
  gap: clamp(40px, 6vw, 96px); /* było 250px – zabierało miejsce obrazowi */
}

.hero__left {
  flex: 0 0 44%; /* dajemy więcej miejsca na obraz */
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__media {
  flex: 0 0 56%; /* większa kolumna na grafikę */
  height: 100%;
  display: flex;
  align-items: stretch; /* rozciąga zawartość na całą wysokość */
  justify-content: flex-end;
}

.hero__content {
  max-width: 640px;
}

.hero__content h1 {
  max-width: 20ch;
  font-size: clamp(2.25rem, 3vw + 1rem, 3.25rem);
  line-height: 1.15;
}

.hero__media img {
  height: 100%; /* klucz: obraz = wysokość sekcji */
  width: auto;
  max-height: 100%;
  object-fit: contain; /* użyj cover, jeśli może się przyciąć */
}
/* ====== Kroki ====== */
.section--hero .steps {
  display: flex;
  flex-wrap: wrap; /* zawijanie wierszy */
  gap: 1.5rem;
  justify-content: center; /* wyśrodkowanie w poziomie */
  margin-top: 2rem;
}
.card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card.step {
  flex: 1 1 calc(25% - 1.5rem); /* 4 w rzędzie na dużym ekranie */
  max-width: 280px; /* ograniczenie szerokości */
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}
.step .step-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), #264d7e);
  display: grid;
  place-items: center;
  margin-bottom: 0.75rem;
}
.step .step-icon svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}
.cta-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* ====== Zespół ====== */
.team {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
}
.team-card .avatar {
  width: 104px;
  height: 104px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #fff;
  margin-bottom: 0.75rem;
}
.team-card .team-content {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.5rem;
  max-width: 36ch;
  width: 100%;
}
.team-card h3 {
  margin: 0;
  line-height: 1.25;
}
.team-content .role {
  color: var(--steel);
  margin: 0;
}

/* ====== Dlaczego (layout + sticky ilustracja) ====== */
.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  grid-template-areas: "prose ill" "aside ill";
  gap: 2rem;
  align-items: start;
}
.prose {
  grid-area: prose;
}
.aside {
  grid-area: aside;
}
.aside {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  padding: 1.1rem;
  border-radius: 20px;
  background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(201, 169, 106, 0.55), rgba(29, 53, 87, 0.25))
      border-box;
  border: 1px solid transparent;
  box-shadow: 0 8px 28px rgba(13, 27, 43, 0.06);
}
.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 0.9rem;
  align-items: center;
}
.stat-value {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sand-gray);
  border: 2px solid var(--gold);
  color: var(--navy);
  font-weight: 800;
  font-size: 1.5rem;
}
.stat-label {
  font-weight: 600;
}
.stat-label strong {
  color: var(--navy);
}
.benefits {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.benefit {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid #e9ecf0;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(13, 27, 43, 0.02);
}
.benefit:hover {
  border-color: var(--gold);
}

/* ====== Kontakt ====== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.contact-card h3 {
  margin-bottom: 0.25rem;
}

/* ====== Stopka ====== */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--ivory);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.fineprint {
  color: var(--steel);
  margin: 0;
}

/* ====== Dostępność ====== */
.skip-link {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  background: var(--navy);
  color: #fff;
  padding: 0.5rem;
  border-radius: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ====== RWD ====== */
@media (max-width: 1100px) {
  .hero {
    height: auto;
    padding-bottom: 30px;
  }
  .hero__flex {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .hero__media {
    order: -1;
    width: 100%;
    justify-content: center;
  }
  .hero__media img {
    width: clamp(320px, 64vw, 520px);
  }
  .cta-row {
    justify-content: center;
  }
}
@media (max-width: 980px) {
  .nav {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .mobile-menu {
    display: flex;
  }

  .section--hero .steps {
    justify-content: center;
  }
  .team {
    grid-template-columns: 1fr 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    grid-template-areas: "prose" "ill" "aside";
  }
  .aside {
    position: static;
  }
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
  .card.step {
    flex: 1 1 calc(50% - 1.5rem); /* po 2 w rzędzie */
    max-width: 100%; /* pozwala elastycznie dopasować */
  }
}
@media (max-width: 720px) {
  .section--hero .steps,
  .team,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .section--hero .steps {
    justify-content: center;
  }
  .card.step {
    align-items: center;
    text-align: center;
    flex: 1 1 100%; /* 1 w rzędzie */
    max-width: 100%;
  }
}

/* ===== How it works (tytuły) ===== */
.hiw-title,
.hiw-split-title {
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 1.25rem;
}

/* Szyna z krokami */
.hiw-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-bottom: clamp(32px, 6vw, 72px);
  padding-top: clamp(24px, 3vw, 32px);
}
.hiw-rail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 38px;
  height: 8px;
  border-radius: 8px;
  background: #2a4bd9;
  opacity: 0.25;
}
.hiw-step {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.hiw-step p {
  color: var(--steel);
  margin: 0;
  max-width: 40ch;
}
.hiw-badge {
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  background: var(--navy);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(47, 92, 245, 0.25);
  border: 6px solid #d9e2ff;
}
.hiw-badge svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}
@media (max-width: 980px) {
  .hiw-rail {
    grid-template-columns: 1fr;
  }
  .hiw-rail::before {
    left: 28px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 8px;
    height: calc(100% - 8px);
  }
  .hiw-badge {
    margin: 0 0 0.5rem;
  }
  .hiw-step {
    padding-left: 72px;
    position: relative;
  }
  .hiw-step .hiw-badge {
    position: absolute;
    left: 0;
    top: 0;
  }
}

/* ===== Ilustracje – wspólny wygląd karty ===== */
.illustration {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
}
.illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== Sekcja „Jeden ekosystem…” — FLEXBOX ===== */
.hiw-split {
  display: flex;
  gap: clamp(24px, 4vw, 64px);
  align-items: stretch; /* ta sama wysokość obu kolumn */
}
.hiw-left {
  flex: 1 1 58%;
  display: flex;
  flex-direction: column;
}
.hiw-art {
  flex: 1 1 42%;
  display: flex;
  align-items: stretch; /* obraz rozciąga się na pełną wysokość kolumny */
  justify-content: flex-end;
}
.hiw-art .illustration {
  width: 100%;
  height: 100%; /* wysokość = wysokość lewej kolumny */
}

/* Lewa kolumna – B2C i B2B pionowo */
.hiw-columns {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 1rem;
}
.hiw-col-title {
  color: var(--ink);
  font-size: clamp(1.15rem, 0.9vw + 1rem, 1.75rem);
  margin: 0 0 0.5rem;
}
.hiw-col p {
  color: var(--steel);
  margin: 0;
  max-width: 62ch;
}

/* Mobile: porządek — tytuł, ilustracja, tekst */
@media (max-width: 980px) {
  .hiw-split {
    flex-direction: column;
  }
  .hiw-art {
    order: 2;
  }
  .hiw-left {
    order: 3;
  }
  .hiw-art .illustration {
    height: auto;
  }
}

/* ===== Ilustracja w sekcji „Dlaczego” ===== */
.illustration--right {
  grid-area: ill;
  max-width: 520px;
  margin-left: auto;
  margin-right: 0;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
@media (max-width: 980px) {
  .illustration--right {
    position: static;
    max-width: 100%;
    margin: 1rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .mobile-menu a {
    transition: none !important;
    transform: none !important;
  }
}