/* INSTAL-MAT Usługi Hydrauliczne
   Motyw: rysunek instalacji. Niebieski = woda zimna, czerwony = woda ciepła i ogrzewanie, szary = kanalizacja. */

:root {
  --ink: #0b2233;
  --paper: #f1f6f9;
  --surface: #ffffff;
  --steel: #5a7284;
  --line: #c9d6de;
  --cold: #0f6db3;
  --cold-tint: #dcebf5;
  --hot: #c73a26;
  --hot-tint: #f8e2dd;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 72rem;
  --radius: 4px;
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  font-stretch: 100%;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-stretch: 125%;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.7rem); line-height: 1.03; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; font-stretch: 112%; font-weight: 700; line-height: 1.25; }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: var(--cold); text-underline-offset: 0.2em; }

:focus-visible {
  outline: 3px solid var(--cold);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #fff;
}
.skip:focus { left: 0; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 2.5rem; height: 2.5rem; flex: none; }
.brand-name {
  display: block;
  font-stretch: 125%;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1;
}
.brand-sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--steel);
}

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav-link {
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.nav-link:hover { border-bottom-color: var(--cold); }
.nav-link[aria-current="page"] { border-bottom-color: var(--ink); }

.nav-toggle {
  display: none;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 700 1rem var(--font);
  cursor: pointer;
}

@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .nav[data-open="true"] { display: flex; }
  .nav-link { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 1rem; }
}

/* ---------- Przyciski ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font: 700 1rem/1.2 var(--font);
  font-stretch: 110%;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--cold); border-color: var(--cold); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.btn-small { min-height: 2.5rem; padding: 0.5rem 1rem; font-size: 0.95rem; }

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

.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; }
.hero h1 { max-width: 15em; }
.lead { max-width: 38rem; font-size: 1.2rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.pipes { margin-top: clamp(2rem, 5vw, 3.5rem); overflow: hidden; }
.pipes svg { width: 100%; min-width: 700px; height: auto; }

/* Rysunek instalacji (SVG) */
.p-out { fill: none; stroke: var(--ink); stroke-width: 16; }
.p-in { fill: none; stroke: var(--surface); stroke-width: 11; }
.p-water {
  fill: none;
  stroke-width: 11;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: run 2.4s cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
}
.p-cold { stroke: var(--cold); animation-delay: 0.3s; }
.p-hot { stroke: var(--hot); animation-delay: 0.6s; }

.sv-line { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.sv-body { fill: var(--surface); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.sv-cold { fill: var(--cold-tint); }
.sv-hot { fill: var(--hot-tint); }
.sv-ink { fill: var(--ink); }
.sv-range { fill: none; stroke: var(--cold); stroke-width: 5; }
.sv-label { font: 600 18px var(--font); font-stretch: 100%; }
.sv-label-cold { fill: var(--cold); }
.sv-label-hot { fill: var(--hot); }
.sv-small { font: 600 11px var(--font); fill: var(--steel); }

.needle {
  transform-box: view-box;
  transform-origin: 560px 130px;
  transform: rotate(-120deg);
  animation: sweep 1.8s cubic-bezier(0.3, 0.1, 0.2, 1) 1.6s forwards;
}
.fin { fill: var(--hot-tint); stroke: var(--ink); stroke-width: 3; animation: warm 0.8s ease-out 3s forwards; }
.drop { fill: var(--cold); opacity: 0; animation: drip 0.6s ease-in 2.7s forwards; }

@keyframes run { to { stroke-dashoffset: 0; } }
@keyframes sweep {
  0% { transform: rotate(-120deg); }
  70% { transform: rotate(22deg); }
  85% { transform: rotate(4deg); }
  100% { transform: rotate(10deg); }
}
@keyframes warm { to { fill: var(--hot); } }
@keyframes drip {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .p-water, .needle, .fin, .drop { animation: none; }
  .p-water { stroke-dashoffset: 0; }
  .needle { transform: rotate(10deg); }
  .fin { fill: var(--hot); }
  .drop { opacity: 1; transform: translateY(8px); }
}

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

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-head { max-width: 44rem; margin-bottom: 2rem; }

.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) 1.5rem; }
.page-head h1 { max-width: 16em; font-size: clamp(2rem, 4.6vw, 3.3rem); }

/* Legenda i rury */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
}
.legend li { display: flex; align-items: center; gap: 0.6rem; }

.pipe {
  --c: var(--cold);
  display: inline-block;
  flex: none;
  width: 2.5rem;
  height: 0.75rem;
  background: var(--c);
  border: 2px solid var(--ink);
}
.pipe-cold { --c: var(--cold); }
.pipe-hot { --c: var(--hot); }
.pipe-drain { --c: var(--steel); }

/* Usługi jako odcinki instalacji */
.run-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 2.25rem clamp(2rem, 6vw, 5rem);
}
.run-list { margin: 0; padding: 0; list-style: none; }
.run { --c: var(--cold); position: relative; padding: 0 0 2.25rem 3.25rem; }
.run-cold { --c: var(--cold); }
.run-hot { --c: var(--hot); }
.run-drain { --c: var(--steel); }
.run::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.4rem;
  bottom: -0.4rem;
  width: 1rem;
  background: var(--c);
  border-inline: 2px solid var(--ink);
}
.run::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.2rem;
  width: 1.5rem;
  height: 0.5rem;
  background: var(--ink);
  border-radius: 1px;
}
.run:last-child { padding-bottom: 0; }
.run:last-child::before { bottom: 0; border-bottom: 2px solid var(--ink); }
.run h3 { margin: 0 0 0.25rem; }
.run p { margin: 0; }

.more { margin-top: 2.5rem; }

/* Awaria */
.alert { background: var(--hot-tint); border-block: 2px solid var(--hot); }
.alert-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem 3rem;
  align-items: center;
}
.alert h2 { margin-bottom: 1rem; }
.alert ol { margin: 0; padding-left: 1.3rem; max-width: 40rem; }
.alert li { margin-bottom: 0.5rem; }
.alert-call p { margin-bottom: 0.4rem; }
.phone-big {
  display: block;
  color: var(--ink);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.1;
  text-decoration: none;
}
.phone-big:hover { text-decoration: underline; }
@media (max-width: 52rem) {
  .alert-grid { grid-template-columns: 1fr; }
}

/* Etapy współpracy */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; padding-top: 1rem; border-top: 2px solid var(--ink); }
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.6rem;
  color: var(--cold);
  font-stretch: 125%;
  font-weight: 900;
  font-size: 2.4rem;
  line-height: 1;
}
.steps h3 { margin-bottom: 0.3rem; }
.steps p { margin: 0; }

/* Wezwanie do kontaktu */
.cta { background: var(--cold-tint); }
.cta h2 { max-width: 20em; }

/* ---------- Strona usług ---------- */

.service-list { border-top: 2px solid var(--ink); }
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1rem 3rem;
  padding-block: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.service-title { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.service h2 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.service ul { margin: 0; padding-left: 1.2rem; }
.service li { margin-bottom: 0.4rem; }
.service p { margin-bottom: 0.8rem; }
@media (max-width: 52rem) {
  .service { grid-template-columns: 1fr; }
}

/* ---------- O firmie, kontakt ---------- */

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
@media (max-width: 52rem) {
  .two-col { grid-template-columns: 1fr; gap: 2.5rem; }
}

.principles { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.5rem; }
.principles li { padding-top: 0.9rem; border-top: 2px solid var(--ink); }
.principles h3 { margin-bottom: 0.25rem; }
.principles p { margin: 0; }

.facts { margin: 0; display: grid; gap: 1.25rem; }
.facts div { padding-top: 0.7rem; border-top: 2px solid var(--ink); }
.facts dt { font-stretch: 112%; font-weight: 700; }
.facts dd { margin: 0; }
.facts a { color: var(--ink); }

/* Formularz */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.4rem; }
.field-row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.field label { font-weight: 700; }
.hint { margin: 0; font-size: 0.9rem; font-weight: 400; color: var(--steel); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.8rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.field textarea { min-height: 9rem; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 0.7rem; }
.check input { flex: none; width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; accent-color: var(--ink); }
.check label { max-width: 58ch; font-size: 0.95rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status {
  max-width: none;
  margin: 0;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border-left: 6px solid var(--steel);
}
.status:empty { display: none; }
.status[data-state="ok"] { border-left-color: var(--cold); }
.status[data-state="error"] { border-left-color: var(--hot); }

/* Tekst prawny */
.prose h2 { margin-top: 2.25rem; font-size: 1.4rem; }
.prose ul { max-width: 62ch; padding-left: 1.2rem; }

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

.site-footer { padding-block: 3rem 2rem; background: var(--ink); color: #d7e3ea; }
.site-footer a { color: #fff; }
.site-footer h2 { margin-bottom: 0.75rem; color: #fff; font-size: 1rem; font-stretch: 112%; }
.site-footer p { margin-bottom: 0.4rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.foot-links { margin: 0; padding: 0; list-style: none; }
.foot-links li { margin-bottom: 0.4rem; }
.foot-legal {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #9fb3c0;
  font-size: 0.9rem;
}
.foot-legal p { max-width: none; margin: 0; }
@media (max-width: 52rem) {
  .foot-grid { grid-template-columns: 1fr; }
}

/* ---------- Galeria: Nasze prace ---------- */

.gallery-status { max-width: none; margin: 0 0 1.25rem; color: var(--steel); }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 52rem) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 26rem) { .gallery { gap: 0.5rem; } }

.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--cold-tint);
  overflow: hidden;
  cursor: zoom-in;
}
.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.shot:hover img { transform: scale(1.04); }

/* Powiększenie zdjęcia */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(7, 20, 30, 0.94);
  color: #fff;
}
.lightbox::backdrop { background: rgba(7, 20, 30, 0.94); }
.lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 3.5rem 1rem;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
}
.lb-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0 0 0.2rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(11, 34, 51, 0.7);
  color: #fff;
  font: 400 2rem/1 var(--font);
  cursor: pointer;
}
.lb-btn:hover { background: var(--cold); border-color: var(--cold); }
.lb-btn:focus-visible { outline-color: #fff; }
.lb-close { top: 0.75rem; right: 0.75rem; }
.lb-prev { left: 0.75rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.75rem; top: 50%; transform: translateY(-50%); }
.lb-count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.9rem;
  max-width: none;
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  color: #d7e3ea;
}
@media (max-width: 40rem) {
  .lb-stage { padding: 4rem 0.5rem 3rem; }
  .lb-prev, .lb-next { top: auto; bottom: 0.5rem; transform: none; }
  .lb-prev { left: 0.75rem; }
  .lb-next { right: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .shot img { transition: none; }
  .shot:hover img { transform: none; }
}
