:root {
  --ink: #1b1e1a;
  --muted: #5e645c;
  --paper: #f3efe7;
  --paper-2: #e7e1d6;
  --card: #fffcf7;
  --line: #d8d0c3;
  --green: #3d6b34;
  --teal: #0e6e76;
  --blue: #1a4f9c;
  --accent: #3d6b34;
  --shadow: 0 18px 40px rgba(40, 36, 28, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(61, 107, 52, 0.08), transparent 60%),
    var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

body[data-brand="domy"] { --accent: var(--green); }
body[data-brand="wykonczenia"] { --accent: var(--teal); }
body[data-brand="nieruchomosci"] { --accent: var(--blue); }

img { max-width: 100%; display: block; }

a { color: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -120px;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
  z-index: 50;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(243, 239, 231, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  line-height: 1.2;
  font-family: var(--serif);
  font-weight: 620;
  letter-spacing: 0.14em;
  text-decoration: none;
  font-size: 18px;
}

.brand small {
  display: block;
  font-family: var(--sans);
  letter-spacing: 0.18em;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 5px;
  max-width: 230px;
  line-height: 1.4;
}

.top nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top nav a,
.tab {
  text-decoration: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 15px/1 var(--sans);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.top nav a:hover,
.tab:hover { background: var(--paper-2); }

.top nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.top nav.langs {
  margin-left: 4px;
  gap: 2px;
}

.langs a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 8px 9px;
}

.back {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
}

.back:hover { border-color: var(--ink); }

.tabs { display: flex; gap: 4px; }

.tab[aria-selected="true"] {
  background: var(--accent);
  color: white;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: end;
  padding: 64px 0 36px;
}

.kicker {
  margin: 0 0 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.02em; }

h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.96;
}

h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.05; margin: 0 0 12px; }

h3 { font-size: 26px; margin: 0 0 8px; }

.lead { font-size: 19px; color: #33382f; max-width: 46ch; }

.hero-photo {
  position: relative;
}

.hero-photo img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  border-radius: 6px 72px 6px 6px;
  box-shadow: var(--shadow);
}

.hero-photo figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(255, 252, 247, 0.92);
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
  padding: 13px 18px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--ink);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn:hover { transform: translateY(-1px); }

.section { padding: 28px 0 10px; }

.section p { max-width: 68ch; }

.brands {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 12px 0 28px;
}

.brand-card {
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.brand-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
}

.brand-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f7f4ee;
}

.brand-card h3 { margin-top: 14px; font-size: 28px; }

.brand-card p { color: var(--muted); margin: 0 0 14px; }

.brand-card span {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.why {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 36px;
  padding: 20px 0 10px;
}

.points { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.point {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 18px 18px 8px;
}

.point strong { display: block; font-size: 18px; margin-bottom: 6px; }

.path {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 28px 0 10px;
  border-top: 1px solid var(--line);
}

.path article {
  padding: 22px 22px 8px 0;
  border-right: 1px solid var(--line);
  padding-right: 22px;
  margin-right: 22px;
}

.path article:last-child { border: 0; margin: 0; }

.path em {
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}

.close {
  margin: 36px 0 20px;
  padding: 36px;
  background: var(--ink);
  color: #f6f1e8;
}

.close p { color: #ddd6c8; max-width: 60ch; }

.close .btn { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.contact,
.contact-band {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 32px;
  align-items: start;
}

.contact-band {
  margin: 12px 0 8px;
  padding: 28px 0 8px;
  border-top: 1px solid var(--line);
}

.contact-form {
  display: grid;
  gap: 12px;
  background: var(--card);
  color: var(--ink);
  padding: 20px;
  border: 1px solid var(--line);
  --accent: var(--green);
  min-width: 0;
}

.contact-form p { max-width: none; }
.contact-form .privacy-notice { color: var(--muted); margin: 0; }
.contact-form .btn { width: 100%; }
.contact-form .form-status { color: var(--ink); }
.contact-form .form-status.ok { color: #1d6b32; }
.contact-form .form-status.err { color: #8d2a2a; }
.top-home.is-scrolled .langs { display: none; }

.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font: 400 16px/1.4 var(--sans);
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  width: 100%;
  border-radius: 2px;
}

.contact-form textarea { resize: vertical; min-height: 120px; }

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-status { margin: 0; min-height: 1.4em; font-size: 15px; font-weight: 600; color: var(--ink); max-width: none; }
.form-status.ok { color: #1d6b32; }
.form-status.err { color: #8d2a2a; }

.contact-form button:disabled { opacity: 0.6; cursor: wait; }

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  width: 0;
  opacity: 0;
}

.site-footer {
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.offer-head {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: center;
  padding-top: 36px;
}

.offer-head img {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 8px;
}

.grid-2, .grid-3, .models, .standards {
  display: grid;
  gap: 14px;
}

.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3, .models, .standards { grid-template-columns: repeat(3, 1fr); }

.card, .model, .standard {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 18px 18px 12px;
}

.model header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.model header span, .meta {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.model ul, .checks { padding-left: 18px; margin: 8px 0 12px; }
.model li, .checks li { margin: 3px 0; }

.prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.prices div {
  background: var(--paper);
  padding: 10px;
}

.prices span { display: block; color: var(--muted); font-size: 12px; }
.prices strong { font-size: 16px; display: block; }
.prices strong.fx { font-size: 15px; font-weight: 600; margin-top: 2px; }

.note {
  font-size: 14px;
  color: var(--muted);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }

.chips span {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 20px;
}

.steps span {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 14px;
}

.steps span::before {
  content: counter(step) ". ";
  counter-increment: step;
  color: var(--accent);
  font-weight: 600;
}

.steps { counter-reset: step; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 28px;
}

.shot {
  border: 0;
  padding: 0;
  background: #e7e1d6;
  cursor: zoom-in;
  position: relative;
  min-height: 180px;
}

.shot img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.shot.plan img {
  object-fit: contain;
  background: #f7f5f1;
  height: 230px;
}

.shot figcaption, .shot span.cap {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 252, 247, 0.92);
  font-size: 13px;
  padding: 6px 8px;
  text-align: left;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 16, 0.88);
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
  align-items: center;
  gap: 14px;
  padding: 76px 24px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.lightbox[hidden] { display: none; }

.lightbox img {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox p {
  grid-column: 1 / -1;
  grid-row: 2;
  max-width: 900px;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  color: white;
  margin: 0;
}

.lb-controls {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* Keep navigation below the caption with older cached gallery markup too. */
.lightbox > .lb-prev { grid-column: 1; grid-row: 3; justify-self: end; }
.lightbox > .lb-next { grid-column: 2; grid-row: 3; justify-self: start; }

@media (max-width: 560px) {
  .lightbox { padding-left: 10px; padding-right: 10px; gap: 12px; }
  .lightbox p { font-size: 14px; }
}

.lb-btn {
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: auto;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
}

.band {
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border: 1px solid var(--line);
  padding: 20px;
  margin: 8px 0 24px;
}

@media (max-width: 860px) {
  .hero, .why, .offer-head, .grid-2, .grid-3, .models, .standards, .brands, .path, .points, .contact, .contact-band, .form-row {
    grid-template-columns: 1fr;
  }

  .path article { border-right: 0; border-bottom: 1px solid var(--line); margin: 0; }

  .hero-photo img { height: 280px; border-radius: 6px; }

  .top { flex-wrap: wrap; }

  .top nav, .tabs { margin-left: 0; width: 100%; overflow-x: auto; }

  .gallery { grid-template-columns: 1fr 1fr; }

  h1 { font-size: 40px; }
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
  .prices { grid-template-columns: 1fr; }
}

.privacy-notice { font-size: 14px; line-height: 1.5; }
.privacy-notice a { text-decoration: underline; }
.privacy-policy { max-width: 900px; padding-top: 40px; padding-bottom: 60px; }
.privacy-policy h2 { font-size: 26px; margin-top: 32px; }

.wrap > .tabs { margin: 24px 0 0; }
.quote-link { margin: 12px 0; }
#kontakt { scroll-margin-top: 120px; }
.privacy-notice { color: var(--muted); }

@media (max-width: 860px) {
  .top { gap: 12px; padding: 14px 20px; }
  .top .brand { font-size: 20px; letter-spacing: 0.1em; }
  .top .brand small { font-size: 10px; letter-spacing: 0.08em; max-width: 210px; }
  .top:not(.top-home) { flex-wrap: nowrap; justify-content: space-between; }
  .top:not(.top-home) .langs { display: none; }
  .top-offer .main-nav { width: auto; margin-left: auto; overflow: visible; }
  .top-offer .home-link { display: none; }
  .top-offer .contact-link { padding: 12px 14px; border: 1px solid var(--line); }
  .top-home > nav:not(.langs) { justify-content: space-between; }
  .top-home .langs { width: auto; margin: 0; }
  .wrap > .tabs { width: 100%; display: flex; gap: 4px; overflow: visible; }
  .wrap > .tabs .tab { flex: 1 1 0; min-width: 0; padding: 12px 6px; font-size: 14px; line-height: 1.3; }
}
