/* Variables */
:root {
  --bg: #F2F7F7;
  --surface: #FFFFFF;
  --text: #0F2A2E;
  --muted: #46605F;
  --accent: #0B6E77;
  --accent-text: #FFFFFF;
  --plate-bg: #0B6E77;
  --plate-text: #FFFFFF;
  --line: #D5E4E5;
  --radius-card: 18px;
  --radius-btn: 10px;
  --shadow-soft: 0 1px 2px rgb(15 42 46 / .06), 0 12px 32px rgb(15 42 46 / .08);
  --shadow-lift: 0 2px 4px rgb(15 42 46 / .08), 0 18px 40px rgb(15 42 46 / .12);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --pad-frame: clamp(16px, 4vw, 40px);
  --gap-section: clamp(64px, 9vw, 128px);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
h1, h2, h3 {
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 4.6vw + 0.6rem, 4.6rem); line-height: 1.1; }
h2 { font-size: clamp(1.8rem, 2.6vw + 0.8rem, 3rem); line-height: 1.15; }
h3 { font-size: clamp(1.2rem, 1vw + 0.9rem, 1.5rem); }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
ul { padding-left: 1.2em; }
:focus-visible { outline: none; }
.frame { max-width: 1200px; margin: 0 auto; padding-inline: var(--pad-frame); }
.chapter { padding-block: clamp(72px, 8vw, 96px); position: relative; overflow: clip; }
.chapter + .chapter { border-top: 1px solid rgb(15 42 46 / .08); }
.column { max-width: 760px; }
.skipway {
  position: absolute; left: 16px; top: -64px;
  background: var(--accent); color: var(--accent-text);
  padding: 12px 20px; border-radius: var(--radius-btn);
  z-index: 200; transition: top .2s ease; text-decoration: none;
}
.skipway:focus { top: 12px; }

/* Background shapes */
.chapter::before, .chapter::after {
  content: ""; position: absolute; pointer-events: none; z-index: 0;
  border-radius: 50%; background: rgb(11 110 119 / .07);
}
.chapter::before { width: 340px; height: 340px; top: -120px; right: -140px; }
.chapter::after { width: 420px; height: 420px; bottom: -180px; left: -200px; border-radius: 420px 420px 0 0; }
.chapter > .frame { position: relative; z-index: 1; }

/* Header */
.topbar {
  position: sticky; top: 12px; z-index: 100;
  margin: 12px var(--pad-frame) 0;
  background: rgb(255 255 255 / .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 20px;
  min-height: 68px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 12px; padding: 8px clamp(12px, 2vw, 24px);
  box-shadow: var(--shadow-soft);
}
.topbar__brand {
  font-weight: 750; font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  color: var(--text); text-decoration: none;
  letter-spacing: -0.01em; justify-self: center; text-align: center;
}
.topbar__burger {
  width: 48px; height: 48px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-btn); cursor: pointer;
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  transition: border-color .2s ease;
}
.topbar__burger:hover { border-color: var(--accent); }
.topbar__burger-line { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.topbar__burger[aria-expanded="true"] .topbar__burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar__burger[aria-expanded="true"] .topbar__burger-line:nth-child(2) { opacity: 0; }
.topbar__burger[aria-expanded="true"] .topbar__burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.topbar__cta { justify-self: end; }

/* Side navigation */
.sidenav {
  position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw);
  background: var(--surface); z-index: 150;
  transform: translateX(-100%); transition: transform .3s ease;
  padding: 84px 28px 28px; box-shadow: var(--shadow-lift);
  overflow-y: auto;
}
.sidenav.is-open { transform: translateX(0); }
.sidenav__list { list-style: none; margin: 0; padding: 0; }
.sidenav__item { margin-bottom: 6px; }
.sidenav__link {
  position: relative; display: inline-block; padding: 12px 4px;
  color: var(--text); text-decoration: none; font-size: 17px; font-weight: 600;
}
.sidenav__link::before {
  content: ""; position: absolute; left: 0; bottom: 8px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s ease;
}
.sidenav__link:hover::before, .sidenav__link:focus-visible::before, .sidenav__link[aria-current="page"]::before { width: 100%; }
.sidenav__veil {
  position: fixed; inset: 0; background: rgb(15 42 46 / .5); z-index: 140;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.sidenav__veil.is-open { opacity: 1; visibility: visible; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 28px;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  background: linear-gradient(135deg, #0B6E77 0%, #12939E 100%);
  background-size: 160% 160%; background-position: 0% 50%;
  color: var(--accent-text); font: 700 1.05rem/1.2 var(--font);
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow-soft);
  transition: background-position .3s ease, box-shadow .2s ease, transform .1s ease;
}
.btn:hover { background-position: 90% 50%; box-shadow: var(--shadow-lift); }
.btn:focus-visible { outline: 3px solid #7A2E2E; outline-offset: 3px; }
.btn:active { box-shadow: none; transform: translateY(1px); }
.btn--ghost {
  background: transparent; color: var(--accent);
  border-color: var(--accent); box-shadow: none;
}
.btn--ghost:hover { background: rgb(11 110 119 / .08); box-shadow: none; }
.btn--ghost:active { background: rgb(11 110 119 / .16); }

/* Hero */
.opening__title { max-width: 720px; margin-bottom: 20px; }
.accentline {
  display: block; font-size: clamp(1.1rem, 1.6vw + 0.6rem, 1.6rem);
  font-weight: 750; letter-spacing: -0.02em; line-height: 1.25;
  color: var(--accent); max-width: 40ch; margin-bottom: 16px;
}
.opening__lead { font-size: clamp(1.05rem, 0.9vw + 0.85rem, 1.3rem); color: var(--muted); max-width: 56ch; margin-bottom: 28px; }
.opening__figure { margin: 40px 0 0; border-radius: var(--radius-card); overflow: hidden; }
.opening__figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-card); }

/* Form */
.inquiry__wrap { display: grid; gap: clamp(32px, 4vw, 56px); align-items: center; }
.inquiry__intro { max-width: 560px; align-self: center; }
.inquiry {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: clamp(24px, 3vw, 36px);
  box-shadow: var(--shadow-soft);
}
.inquiry__row { margin-bottom: 20px; }
.inquiry__tag { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.inquiry__box {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid rgb(15 42 46 / .18); border-radius: var(--radius-btn);
  font: 400 1rem var(--font); color: var(--text); background: #F7FAFA;
}
.inquiry__box::placeholder { color: var(--muted); }
.inquiry__box:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.inquiry__area { resize: vertical; min-height: 120px; }
.inquiry__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 20px 0; }
.inquiry__consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.inquiry__footnote { font-size: 14px; color: var(--muted); }
.inquiry__alert { color: #8C2F2F; font-size: 15px; font-weight: 600; margin: -12px 0 16px; }
.inquiry.is-locked .inquiry__submit { opacity: .6; pointer-events: none; }

/* Rubrics */
.rubryki__filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.rubryki__filter {
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-btn);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 600 15px var(--font); cursor: pointer; white-space: nowrap; flex: 0 0 auto;
  transition: border-color .2s ease, background .2s ease;
}
.rubryki__filter:hover { border-color: var(--accent); }
.rubryki__filter:focus-visible { outline: 3px solid #7A2E2E; outline-offset: 2px; }
.rubryki__filter.is-active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.rubryki__grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: stretch; }
.rubryki__grid .tile { display: flex; flex-direction: column; }
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: clamp(24px, 3vw, 32px);
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease, box-shadow .25s ease;
}
.tile:hover, .tile:focus-within { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.tile--lead, .tile--featured { background: var(--plate-bg); color: var(--plate-text); border-color: transparent; }
.tile--lead h3, .tile--featured h3 { color: var(--plate-text); }
.tile--lead a, .tile--featured a { color: #FFFFFF; }
.tile--lead .tile__more, .tile--featured .tile__more { color: #D9F2F4; }
.tile__more { font-weight: 600; text-decoration: none; display: inline-block; margin-top: auto; padding-top: 16px; }
.tile__more:hover { text-decoration: underline; }
.tile[hidden] { display: none; }

/* Magazine layout */
.kolumna { display: grid; gap: 32px; }
.jak-pracujemy__layout { display: grid; gap: 28px; align-items: start; }
.jak-pracujemy__figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-card); }

/* Packages */
.pakiety__grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 32px; }
.pakiety__card { display: flex; flex-direction: column; }
.pakiety__price { font-size: 1.15rem; font-weight: 750; color: var(--accent); margin-bottom: 16px; }
.pakiety__list { margin: 0 0 24px; padding-left: 1.2em; }
.pakiety__list li { margin-bottom: 8px; }
.pakiety__card .btn { margin-top: auto; align-self: flex-start; }
.tile--featured .pakiety__price { color: #D9F2F4; }
.tile--featured .btn--ghost { border-color: #FFFFFF; color: #FFFFFF; }
.tile--featured .btn--ghost:hover { background: rgb(255 255 255 / .12); }

/* Guarantees plate */
.plate {
  display: grid; gap: 32px; align-items: center;
  background: var(--plate-bg); color: var(--plate-text);
  border-radius: var(--radius-card); padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--shadow-lift);
}
.plate h2, .plate h3 { color: var(--plate-text); }
.plate p { color: #EAF6F7; }
.plate a { color: #FFFFFF; text-decoration-thickness: 2px; }
.gwarancje__figure img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-card); }

/* FAQ */
.queries { margin-top: 32px; display: grid; gap: 14px; }
.queries__item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 18px 24px;
}
.queries__item summary {
  cursor: pointer; font-weight: 650; font-size: 1.05rem; list-style-position: outside;
}
.queries__item summary:focus-visible { outline: 3px solid #7A2E2E; outline-offset: 2px; border-radius: 6px; }
.queries__item p { margin: 12px 0 0; color: var(--muted); }

/* Footer */
.basement { background: var(--text); color: #E3EEEF; padding: clamp(48px, 6vw, 80px) 0 0; margin-top: 0; }
.basement__inner { display: grid; grid-template-columns: 1fr; gap: 40px; }
.basement__brand { color: #FFFFFF; justify-self: start; text-align: left; }
.basement__note { color: #B9CDD0; font-size: 15px; max-width: 40ch; }
.basement__heading { font-size: 1.05rem; color: #FFFFFF; margin-bottom: 14px; }
.basement__list { list-style: none; margin: 0; padding: 0; }
.basement__item { margin-bottom: 10px; }
.basement__link { color: #D5E4E5; text-decoration: none; font-size: 16px; }
.basement__link:hover { text-decoration: underline; color: #FFFFFF; }
.basement address { font-style: normal; }
.basement address p { margin: 0 0 8px; font-size: 15px; }
.basement address ul { list-style: none; margin: 0; padding: 0; }
.basement address li { margin-bottom: 8px; font-size: 15px; }
.basement address li span { color: #B9CDD0; margin-right: 6px; }
.basement address a { color: #D5E4E5; }
.basement a { color: #D5E4E5; }
.basement a:hover { color: #FFFFFF; }
.basement__base { border-top: 1px solid rgb(255 255 255 / .15); margin-top: 40px; padding-block: 24px; }
.basement__copy { font-size: 14px; color: #B9CDD0; margin: 0; }

/* Inner pages */
.pagehead { padding-top: clamp(40px, 6vw, 72px); }
.pagehead p { font-size: clamp(1.05rem, 0.9vw + 0.85rem, 1.25rem); color: var(--muted); }

/* Prose */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ol, .prose ul { margin: 0 0 1.2em; }
.prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95em; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: var(--surface); font-weight: 650; }
.prose .keydata {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-btn); padding: 20px 24px; margin: 0 0 32px;
}

/* Gallery */
.gallery { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 32px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; object-fit: cover; border-radius: var(--radius-card); }
.gallery img[data-ratio="1-1"] { aspect-ratio: 1 / 1; }
.gallery img[data-ratio="16-9"] { aspect-ratio: 16 / 9; }
.gallery img[data-ratio="4-3"] { aspect-ratio: 4 / 3; }
.gallery img[data-ratio="3-4"] { aspect-ratio: 3 / 4; border-radius: 999px 999px var(--radius-card) var(--radius-card); }
.gallery figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.arched img, img.arched { border-radius: 999px 999px var(--radius-card) var(--radius-card); }

/* Thanks & 404 */
.confirm { text-align: center; padding-block: clamp(64px, 12vw, 140px); }
.confirm h1 { margin-inline: auto; }
.confirm p { margin-inline: auto; }
.confirm__links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }

/* Reveal */
html.is-live .chapter--hidden { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
html.is-live .chapter--hidden.is-shown { opacity: 1; transform: none; }
html.is-live .opening__figure img { transform: scale(1.04); transition: transform .8s ease; }
html.is-live .opening__figure.is-shown img { transform: scale(1); }

/* Breakpoints */
@media (max-width: 479px) {
  .topbar__cta { padding: 0 16px; font-size: 15px; }
  .rubryki__filter { flex: 1 1 auto; }
}
@media (min-width: 480px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery .gallery__wide { grid-column: span 2; }
}
@media (min-width: 640px) {
  .rubryki__grid { grid-template-columns: repeat(2, 1fr); }
  .pakiety__grid { grid-template-columns: repeat(2, 1fr); }
  .jak-pracujemy__layout { grid-template-columns: 1fr 1fr; }
  .basement__inner { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .inquiry__wrap { grid-template-columns: 1fr 1.2fr; }
  .plate { grid-template-columns: 1.2fr 1fr; }
}
@media (min-width: 1024px) {
  .pakiety__grid { grid-template-columns: repeat(3, 1fr); }
  .basement__inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .jak-pracujemy__layout { gap: 40px; }
}
@media (min-width: 1280px) {
  .frame { max-width: 1200px; }
  .kolumna { grid-template-columns: 360px 1fr; align-items: start; }
  .kolumna .column:first-child { position: sticky; top: 104px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  html.is-live .chapter--hidden { opacity: 1; transform: none; }
  html.is-live .opening__figure img { transform: none; }
}

/* Rhythm */
.chapter > .frame > h2 { margin-bottom: 16px; }
.chapter > .frame > h2 + p { margin-bottom: 24px; }
@media (max-width: 639px) {
  .opening__figure img { aspect-ratio: 4 / 3; }
}
