/* ============================================================
   Ape sp. z o.o. — system wizualny
   Mobile-first, jasny układ techniczny, jeden akcent z logo.
   ============================================================ */

:root {
  --navy: #01265b;
  --navy-deep: #01183d;
  --ink: #122033;
  --muted: #5c6d82;
  --line: rgba(1, 38, 91, 0.1);
  --paper: #f4f7fb;
  --white: #ffffff;
  --blue: #009ee8;
  --blue-deep: #0077be;
  --link: #0468ad;
  --shadow: 0 16px 40px rgba(1, 24, 61, 0.08);
  --radius: 20px;
  --header: 76px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Outfit", "Manrope", sans-serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--navy);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus {
  top: 12px;
}

/* Treść ukrywana animacją tylko gdy JS działa — bez JS zostaje widoczna. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s ease forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Pasek kontaktowy ---------- */

.topbar {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.84rem;
}

.topbar-inner,
.header-inner,
.wrap,
.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 0;
}

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

.topbar a:hover {
  color: #fff;
}

.topbar span[aria-hidden="true"] {
  opacity: 0.45;
}

/* ---------- Nagłówek ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px rgba(1, 24, 61, 0.05);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}

.brand img {
  height: 46px;
  width: auto;
}

.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.nav-toggle,
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.nav-toggle {
  display: grid;
}

.site-nav {
  display: none;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav,
.btn.nav-cta {
  flex-shrink: 0;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  background: rgba(0, 158, 232, 0.1);
  color: var(--navy);
}

.btn.nav-cta {
  display: none;
  background: var(--navy) !important;
  color: #fff !important;
  padding: 10px 14px !important;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--blue-deep) !important;
  color: #fff !important;
}

/* Menu mobilne jako panel pod nagłówkiem. */
.site-nav.is-open {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header);
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 8px 16px 18px;
}

.site-nav.is-open ul {
  flex-direction: column;
}

.site-nav.is-open a {
  display: block;
  padding: 12px 10px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(800px 380px at 100% -10%, rgba(0, 158, 232, 0.45), transparent 55%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 70%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, #000 20%, transparent 95%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 72px;
  display: grid;
  gap: 36px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.hero .kicker {
  color: #7fd4ff;
}

h1,
h2,
h3,
.brand-name {
  font-family: var(--display);
  letter-spacing: -0.03em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 8vw, 4.4rem);
  line-height: 0.98;
  font-weight: 600;
  max-width: 12ch;
}

.hero-lead {
  margin: 18px 0 0;
  max-width: 42rem;
  font-size: 1.12rem;
  color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.98rem;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: #21b0f5;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-navy {
  background: var(--navy);
  color: #fff;
}

.btn-navy:hover {
  background: var(--blue-deep);
  color: #fff;
}

.btn-line {
  background: #fff;
  color: var(--navy);
  border-color: var(--line);
}

.hero-panel {
  display: grid;
  gap: 12px;
}

.fact {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 16px 18px;
  backdrop-filter: blur(8px);
}

.fact-partner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fact-mark {
  flex: 0 0 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  line-height: 0;
}

.fact-mark img {
  width: 100%;
  height: auto;
  display: block;
}

.fact-copy {
  min-width: 0;
}

.fact strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.fact span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

/* ---------- Sekcje ---------- */

.section {
  padding: 72px 0;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  max-width: 40rem;
}

.section-head h2,
.page-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
  color: var(--navy);
}

.section-head p,
.lead {
  margin: 0;
  color: var(--muted);
}

.section.alt {
  background: var(--paper);
}

.service-grid,
.card-grid,
.offer-grid,
.module-grid {
  display: grid;
  gap: 16px;
}

.service-card,
.info-card,
.offer-card,
.module-card,
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 0 rgba(1, 38, 91, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.service-card,
a.offer-card,
a.module-card,
a.product-card {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

a.service-card:hover,
a.offer-card:hover,
a.module-card:hover,
a.product-card:hover,
.info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 158, 232, 0.45);
  box-shadow: var(--shadow);
}

.service-card h3,
.product-card h3,
.offer-card h3,
.module-card h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--navy);
}

.service-card p,
.product-card p,
.offer-card p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.more {
  color: var(--blue-deep);
  font-weight: 700;
  font-size: 0.92rem;
}

.icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(0, 158, 232, 0.1);
  color: var(--blue-deep);
}

.icon-badge svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- O firmie ---------- */

.split {
  display: grid;
  gap: 28px;
}

.checklist {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.checklist li {
  padding-left: 28px;
  position: relative;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 14px;
  height: 3px;
  border-radius: 99px;
  background: var(--blue);
}

/* ---------- Partnerzy i pomoc ---------- */

.partner-row {
  display: grid;
  gap: 16px;
}

.partner-card {
  border-radius: var(--radius);
  padding: 24px;
  background: var(--navy);
  color: #fff;
}

.partner-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.partner-card p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.8);
}

.partner-card a.btn {
  background: #fff;
  color: var(--navy);
}

.help-band {
  display: grid;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, rgba(0, 158, 232, 0.12), rgba(1, 38, 91, 0.05));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px 22px;
}

/* ---------- Podstrony ---------- */

.page-hero {
  background:
    radial-gradient(500px 180px at 100% 0%, rgba(0, 158, 232, 0.18), transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 36px 0 28px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--navy);
}

.page-body {
  padding: 36px 0 80px;
}

.page-body > .wrap.prose:not(.wide) {
  width: min(78ch, calc(100% - 32px));
}

.prose {
  max-width: 78ch;
}

.prose.wide {
  max-width: none;
}

.prose h2 {
  margin: 1.6em 0 0.4em;
  font-size: 1.55rem;
  color: var(--navy);
}

.prose h3 {
  margin: 1.3em 0 0.3em;
  color: var(--navy);
  font-size: 1.2rem;
}

.prose p,
.prose li {
  color: var(--ink);
}

.prose .lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.25rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  background: #fff;
}

.prose th,
.prose td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  background: var(--paper);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}

.prose tr:last-child td {
  border-bottom: 0;
}

.promo-frame {
  width: min(100%, 750px);
  height: 200px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  margin-top: 12px;
}

.layout-modules {
  display: grid;
  gap: 22px;
}

.module-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.module-nav a {
  flex: 0 0 auto;
  scroll-snap-align: start;
  text-decoration: none;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
}

.module-nav a[aria-current="page"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.catalog-group {
  margin: 2rem 0 0.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.catalog-block {
  margin-top: 22px;
}

.catalog-block h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.contact-grid {
  display: grid;
  gap: 14px;
}

.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.contact-card h2 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.contact-card p,
.contact-card a {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
}

.remote-panel {
  display: grid;
  gap: 16px;
  padding: 28px 22px;
  border-radius: 28px;
  background: var(--navy);
  color: #fff;
}

.remote-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

/* ---------- Wyszukiwarka ---------- */

.search-dialog {
  width: min(640px, calc(100% - 24px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(1, 24, 61, 0.25);
}

.search-dialog::backdrop {
  background: rgba(1, 24, 61, 0.46);
}

.search-form {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search-form input {
  flex: 1;
  border: 0;
  font: inherit;
  font-size: 1.05rem;
  padding: 8px;
  color: var(--ink);
}

.search-form input:focus {
  outline: none;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: min(420px, 60vh);
  overflow: auto;
}

.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
}

.search-results a:hover,
.search-results a.is-active {
  background: var(--paper);
}

.search-results small {
  display: block;
  color: var(--muted);
}

.search-empty {
  padding: 18px;
  color: var(--muted);
}

/* ---------- Stopka ---------- */

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
  padding: 48px 0 20px;
}

.footer-grid {
  display: grid;
  gap: 28px;
}

.footer-logo {
  background: #fff;
  border-radius: 12px;
  padding: 6px 8px;
  width: fit-content;
  margin-bottom: 12px;
}

.footer-logo img {
  height: 40px;
  width: auto;
}

.site-footer h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 0.95rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.legal {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.88rem;
}

/* ---------- Szerokości ---------- */

@media (max-width: 800px) {
  .topbar-inner > span {
    display: none;
  }

  .header-inner {
    gap: 8px;
  }

  .brand-name {
    font-size: 0.92rem;
  }

  .brand img {
    height: 40px;
  }
}

@media (max-width: 420px) {
  .brand img {
    height: 36px;
  }
}

@media (min-width: 720px) {
  .service-grid,
  .offer-grid,
  .contact-grid,
  .partner-row {
    grid-template-columns: 1fr 1fr;
  }

  .card-grid,
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-inner {
    grid-template-columns: 1.3fr 0.7fr;
    align-items: end;
    padding: 88px 0 96px;
  }

  .help-band {
    grid-template-columns: 1.4fr auto;
    padding: 32px;
  }

  .footer-grid {
    grid-template-columns: 1.3fr 0.8fr 1fr 0.9fr;
  }
}

.nav-mobile-only {
  display: none;
}

@media (max-width: 979px) {
  .site-nav.is-open .nav-mobile-only {
    display: block;
  }
}

@media (min-width: 980px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
  }

  .btn.nav-cta {
    display: inline-flex;
  }

  .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .split {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .layout-modules {
    grid-template-columns: 250px 1fr;
    align-items: start;
  }

  .module-nav {
    flex-direction: column;
    overflow: visible;
    position: sticky;
    top: calc(var(--header) + 16px);
  }

  .card-grid.products {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
