:root {
  --ink: #0f2e44;
  --ink-2: #1c4766;
  --sea: #e4efed;
  --paper: #f8f9f7;
  --amber: #f0b13a;
  --amber-deep: #a35f00;
  --link: #17575c;
  --text: #22303a;
  --muted: #4b5a63;
  --line: #d3dedc;
  --card: #ffffff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(48px, 8vw, 96px);
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  overflow-x: hidden;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 700;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

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

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

:focus-visible {
  outline: 3px solid var(--amber-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.on-dark :focus-visible {
  outline-color: var(--amber);
}

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

.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  padding: var(--section) 0;
}

.lead-in {
  max-width: 62ch;
  color: var(--muted);
  margin-bottom: 2.2rem;
}

.bg-sea {
  background: var(--sea);
}

.todo {
  background: #fff1b8;
  color: #4d3b00;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: .9em;
  overflow-wrap: anywhere;
}

/* Ogłoszenie */
.announce {
  background: var(--ink-2);
  color: #fff;
  font-size: .94rem;
}

.announce .container {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.announce strong {
  color: var(--amber);
  white-space: nowrap;
}

.announce p {
  margin: 0;
}

/* Nagłówek */
header.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: .66rem;
  font-weight: 800;
  flex-shrink: 0;
}

.brand small {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: .76rem;
  color: var(--muted);
}

nav {
  min-width: 0;
}

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

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

nav a:hover {
  background: var(--sea);
}

@media (max-width: 1200px) {
  .topbar {
    flex-wrap: wrap;
    padding-top: 8px;
  }

  nav {
    flex: 1 1 100%;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 8px;
    -webkit-overflow-scrolling: touch;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  :root {
    --header-h: 104px;
  }
}

/* Hero */
.hero {
  background: var(--ink);
  color: #fff;
  padding: clamp(40px, 7vw, 88px) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  margin-bottom: .4em;
}

.hero .lead {
  font-size: 1.15rem;
  color: #dbe8ec;
  max-width: 52ch;
  margin-bottom: 1.8rem;
}

.hero-facts {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, .25);
}

.hero-facts li {
  padding: 14px 16px 0 0;
  min-width: 0;
}

.hero-facts span {
  display: block;
  font-size: .85rem;
  color: #b7cbd3;
}

.hero-facts strong {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
}

.hero-photo {
  margin: 0;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 20px;
  box-shadow: 12px 12px 0 var(--amber);
}

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .98rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}

.btn-primary {
  background: var(--amber);
  color: var(--ink);
}

.btn-primary:hover {
  background: #ffc457;
  color: var(--ink);
}

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

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

/* Układy */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.split>* {
  min-width: 0;
}

.split-media img {
  width: 100%;
  border-radius: 20px;
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checks li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-top: 1px solid var(--line);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.1em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}

/* Kroki diagnozy: to realna sekwencja */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
  counter-reset: step;
}

.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0 20px;
  padding-bottom: 28px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  position: relative;
  z-index: 1;
}

.steps li::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 48px;
  bottom: 0;
  width: 2px;
  background: var(--ink-2);
  opacity: .25;
}

.steps li:last-child {
  padding-bottom: 0;
}

.steps li:last-child::after {
  display: none;
}

.steps h3 {
  margin: 8px 0 4px;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

.note {
  margin-top: 2rem;
  padding: 16px 20px;
  border-left: 4px solid var(--amber);
  background: #fff;
  color: var(--muted);
  max-width: 760px;
}

.note p {
  margin: 0;
}

/* Dla kogo */
.audience {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 0 32px;
}

.audience li {
  border-top: 2px solid var(--ink);
  padding: 14px 0 22px;
  min-width: 0;
}

.audience h3 {
  margin-bottom: 4px;
}

.audience p {
  margin: 0;
  color: var(--muted);
  font-size: .97rem;
}

/* Zapisy */
.contact-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.contact-box p {
  margin: 0 0 .7em;
}

.contact-box .small {
  color: var(--muted);
  font-size: .92rem;
  margin: 0;
}

/* Lokalizacja */
.loc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}

.loc-left {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.photo-ph {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: 16px;
  overflow: hidden;
  background: repeating-linear-gradient(45deg, #d5e5e2, #d5e5e2 12px, #cadddb 12px, #cadddb 24px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--ink);
}

.photo-ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-ph strong {
  display: block;
}

.photo-ph small {
  color: var(--muted);
}

.map-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}

.map-wrap iframe {
  display: block;
  border: 0;
  width: 100%;
  height: clamp(300px, 46vw, 440px);
}

.map-wrap p {
  margin: 0;
  padding: 10px 16px;
  font-size: .85rem;
}

/* Zespół */
.team {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 28px;
}

.team li {
  min-width: 0;
}

.team .photo-ph {
  aspect-ratio: 4/5;
  margin-bottom: 14px;
}

.team h3 {
  margin-bottom: 2px;
}

.team p {
  margin: 0;
  color: var(--muted);
  font-size: .97rem;
}

/* FAQ */
.faq {
  max-width: 780px;
}

details {
  border-top: 1px solid var(--line);
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sea);
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 1.2rem;
  line-height: 1;
}

details[open] summary::after {
  content: "\2212";
  background: var(--amber);
}

details p {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 62ch;
}

/* Kontakt */
.contact {
  background: var(--ink);
  color: #e6eff2;
}

.contact h2,
.contact h3 {
  color: #fff;
}

.contact a {
  color: var(--amber);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(24px, 4vw, 48px);
}

.contact-grid>div {
  min-width: 0;
}

.contact dl {
  margin: 0;
}

.contact dt {
  font-size: .85rem;
  color: #b7cbd3;
  margin-top: 14px;
}

.contact dd {
  margin: 0;
  font-size: 1.08rem;
}

footer {
  background: #0a2132;
  color: #a9bdc6;
  padding: 28px 0;
  font-size: .88rem;
}

footer p {
  margin: 0 0 6px;
}

footer .todo {
  background: #fff1b8;
}

@media (max-width: 860px) {

  .hero-grid,
  .split,
  .loc-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-photo {
    order: -1;
  }

  .hero-photo img {
    aspect-ratio: 16/10;
    box-shadow: 8px 8px 0 var(--amber);
  }

  .announce .container {
    flex-direction: column;
    gap: 2px;
  }
}

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

  * {
    transition: none !important;
  }
}

/* Pasek zaufania */
.trust {
  padding: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.trust-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 20px 0;
  min-width: 0;
  color: var(--ink-2);
}

.trust-list svg {
  flex-shrink: 0;
  color: var(--amber-deep);
}

.trust-list strong {
  display: block;
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.25;
}

.trust-list span {
  display: block;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Schemat regionu */
.regfig {
  margin: 0;
  min-width: 0;
}

.regmap {
  display: block;
  width: 100%;
  height: auto;
}

.regfig figcaption {
  margin-top: 8px;
  font-size: .85rem;
  color: var(--muted);
}

.rm-bg {
  fill: #fff;
  stroke: var(--line);
}

.rm-sea {
  fill: #5d7f93;
  font: italic 15px var(--serif);
}

.rm-d {
  fill: var(--ink-2);
}

.rm-hq {
  fill: var(--amber);
  opacity: .45;
}

.rm-hqc {
  fill: var(--ink);
}

.rm-t {
  font: 600 15px var(--sans);
  fill: var(--ink);
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
}

.rm-tb {
  font-weight: 800;
}

/* Pasek szybkich akcji (telefon) */
.quickbar {
  display: none;
}

.btn-sea {
  background: var(--sea);
  color: var(--ink);
}

.btn-sea:hover {
  background: #d3e4e1;
  color: var(--ink);
}

@media (max-width: 860px) {
  .quickbar {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(15, 46, 68, .12);
  }

  .quickbar .btn {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    font-size: .93rem;
  }

  body {
    padding-bottom: 72px;
  }
}

/* Animacje: spokojne, tylko opacity i transform. Wyłączone przy prefers-reduced-motion. */
:root {
  interpolate-size: allow-keywords;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(28px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: .45;
  }

  50% {
    transform: scale(2.1);
    opacity: .15;
  }

  100% {
    transform: scale(1);
    opacity: .45;
  }
}

@media (prefers-reduced-motion: no-preference) {

  /* 1. Wejście hero (raz, przy ładowaniu) */
  .hero-grid>div>* {
    animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
  }

  .hero-grid>div>h1 {
    animation-delay: .05s;
  }

  .hero-grid>div>.lead {
    animation-delay: .15s;
  }

  .hero-grid>div>.btns {
    animation-delay: .25s;
  }

  .hero-grid>div>.hero-facts {
    animation-delay: .35s;
  }

  .hero-photo {
    animation: slide-in .8s cubic-bezier(.2, .7, .2, 1) .2s both;
  }

  /* 2. Kroki diagnozy: numer zapala się, linia rysuje się w dół */
  .js-anim .steps li::before {
    opacity: 0;
    transform: scale(.6);
    transition: opacity .4s ease, transform .4s ease;
    transition-delay: calc(var(--n, 0) * 60ms);
  }

  .js-anim .steps li h3,
  .js-anim .steps li p {
    opacity: 0;
    transition: opacity .5s ease;
    transition-delay: calc(var(--n, 0) * 60ms + 150ms);
  }

  .js-anim .steps li::after {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .6s ease .3s;
  }

  .js-anim .steps li.in::before {
    opacity: 1;
    transform: none;
  }

  .js-anim .steps li.in h3,
  .js-anim .steps li.in p {
    opacity: 1;
  }

  .js-anim .steps li.in::after {
    transform: scaleY(1);
  }

  /* 3. Mapa: punkty pojawiają się po kolei, siedziba pulsuje raz */
  .js-anim .regmap .rm-d,
  .js-anim .regmap .rm-hqc,
  .js-anim .regmap .rm-t {
    opacity: 0;
    transition: opacity .45s ease;
    transition-delay: var(--d, 0ms);
  }

  .js-anim .regmap.in .rm-d,
  .js-anim .regmap.in .rm-hqc,
  .js-anim .regmap.in .rm-t {
    opacity: 1;
  }

  .regmap .rm-hq {
    transform-box: fill-box;
    transform-origin: center;
  }

  .js-anim .regmap.in .rm-hq {
    animation: pulse 1.4s ease-in-out 1s 1;
  }

  /* 4. Reakcje na działanie: FAQ i pola formularza */
  details::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size .25s ease, content-visibility .25s allow-discrete;
  }

  details[open]::details-content {
    block-size: auto;
  }

  summary::after {
    transition: background-color .2s ease;
  }

  a,
  .btn,
  input,
  select,
  textarea {
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: .15s;
  }
}
