:root {
  --paper: #f4f9fb;
  --surface: #ffffff;
  --ink: #35536a;
  --muted: #688092;
  --line: #c8dce6;
  --blue: #2f6fa7;
  --teal: #2e8f83;
  --coral: #df665f;
  --sky: #dceff7;
  --mint: #dff3ee;
  --rose: #fae5e3;
  --focus: #c64e49;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--blue); text-underline-offset: 4px; }
a:hover { color: var(--coral); }
a:active { color: var(--teal); }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-size: 40px; line-height: 1.08; letter-spacing: -0.035em; }
h2 { margin-bottom: 18px; font-size: 28px; line-height: 1.16; letter-spacing: -0.022em; }
h3 { margin-bottom: 10px; font-size: 20px; line-height: 1.25; }

.masthead,
.site-footer {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 17px 17px 5px 17px;
  background: var(--blue);
  color: var(--surface);
  font-weight: 800;
  letter-spacing: .08em;
}
.brand-city { color: var(--ink); font-weight: 800; font-size: 19px; }
.primary-nav { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.primary-nav a { color: var(--ink); font-weight: 700; text-decoration: none; }
.primary-nav a:hover { color: var(--coral); }
.overline,
.section-index,
.district-name {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

/* index.html — układ lokalny */
.local-page main {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}
.city-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .45fr);
  gap: clamp(34px, 7vw, 92px);
  align-items: end;
  padding: 84px 0 74px;
}
.lead-copy { max-width: 760px; }
.lead-text { max-width: 690px; margin-bottom: 0; font-size: 18px; }
.city-stamp {
  display: grid;
  gap: 10px;
  padding: 28px;
  border-top: 5px solid var(--coral);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.city-stamp strong { font-size: 26px; color: var(--blue); }
.city-stamp span { border-top: 1px solid var(--line); padding-top: 8px; color: var(--muted); }

.district-atlas {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(0, 1.28fr);
  gap: 34px 58px;
  padding: 62px 0 72px;
  border-top: 1px solid var(--line);
}
.atlas-heading { grid-row: 1 / span 3; position: sticky; top: 24px; align-self: start; }
.atlas-heading p:last-child { color: var(--muted); }
.district-feature {
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: 36px;
  padding: 34px 36px;
  border-radius: 34px 8px 34px 8px;
  background: var(--sky);
}
.district-feature h3 { font-size: 24px; }
.district-feature p:last-child { margin-bottom: 0; }
.district-pair { display: grid; grid-template-columns: 1fr .82fr; gap: 24px; }
.district-compact {
  padding: 28px;
  border-left: 5px solid var(--teal);
  background: var(--surface);
}
.district-compact-shifted { margin-top: 46px; border-left-color: var(--coral); }
.district-compact p:last-child { margin-bottom: 0; }
.district-register { margin: 0; display: grid; gap: 0; }
.district-register > div {
  display: grid;
  grid-template-columns: minmax(145px, .42fr) minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.district-register dt { font-weight: 800; color: var(--blue); }
.district-register dd { margin: 0; color: var(--muted); }

.appliance-ribbon {
  display: grid;
  grid-template-columns: 1.1fr repeat(4, minmax(0, .8fr));
  border: 1px solid var(--line);
  background: var(--surface);
}
.appliance-ribbon > * { padding: 28px 24px; }
.appliance-ribbon > * + * { border-left: 1px solid var(--line); }
.appliance-ribbon article:nth-of-type(2) { background: var(--mint); }
.appliance-ribbon article:nth-of-type(4) { background: var(--rose); }
.appliance-ribbon p { margin-bottom: 0; }
.ribbon-title { background: var(--blue); color: var(--surface); }
.ribbon-title .section-index { color: #d8f1eb; }
.ribbon-title h2 { margin-bottom: 0; }
.closing-note {
  display: grid;
  grid-template-columns: .35fr 1fr auto;
  gap: 32px;
  align-items: center;
  margin: 62px 0 20px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.closing-note p { margin-bottom: 0; }
.closing-note a { font-weight: 800; }

/* home.html — układ urządzeniowy */
.equipment-page { background: #f7fbfc; }
.equipment-main { overflow: hidden; }
.workbench {
  width: min(calc(100% - 40px), var(--max));
  margin: 58px auto 0;
  display: grid;
  grid-template-columns: minmax(250px, .55fr) minmax(0, 1.45fr);
  gap: 48px;
}
.equipment-intro {
  align-self: start;
  padding: 28px 0 34px;
  border-top: 6px solid var(--blue);
}
.equipment-intro p:last-child { color: var(--muted); }
.device-ledger { margin: 0; border-top: 1px solid var(--line); }
.device-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 30px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.device-row dt {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--coral);
}
.device-row dd { margin: 0; }
.device-row h2 { margin-bottom: 12px; }
.device-row p { max-width: 690px; color: var(--muted); }
.device-row span {
  display: inline-block;
  margin: 6px 8px 0 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
}
.device-row-wide { margin-left: -28px; padding-left: 28px; background: var(--surface); }
.device-row-reverse { margin-right: -42px; padding-right: 42px; background: var(--sky); }
.device-row-last { background: var(--rose); }

.fault-lines {
  margin-top: 84px;
  padding: 64px max(20px, calc((100vw - var(--max)) / 2));
  background: var(--blue);
  color: var(--surface);
}
.fault-lines header {
  display: grid;
  grid-template-columns: .35fr 1fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 22px;
}
.fault-lines .section-index { color: #d8f1eb; }
.fault-lines h2 { margin-bottom: 0; }
.fault-lines ol { margin: 0; padding: 0; list-style: none; counter-reset: faults; }
.fault-lines li {
  counter-increment: faults;
  display: grid;
  grid-template-columns: 58px minmax(180px, .7fr) minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding: 19px 0;
  border-top: 1px solid rgba(255,255,255,.34);
}
.fault-lines li::before { content: counter(faults, decimal-leading-zero); color: #cbe8e2; font-weight: 900; }
.fault-lines li span { color: #dbe9f2; }

.repair-context {
  width: min(calc(100% - 40px), var(--max));
  margin: 72px auto 24px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 34px;
  align-items: stretch;
}
.built-in-note { padding: 38px; background: var(--surface); border-bottom: 6px solid var(--teal); }
.built-in-note p:last-child { margin-bottom: 0; color: var(--muted); }
.city-thread {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px;
  background: var(--mint);
}
.city-thread strong { font-size: 22px; }
.city-thread p { color: var(--muted); }
.city-thread a { font-weight: 800; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding: 30px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer a { font-weight: 700; }

@media (max-width: 980px) {
  .district-atlas { grid-template-columns: 1fr; }
  .atlas-heading { grid-row: auto; position: static; max-width: 720px; }
  .appliance-ribbon { grid-template-columns: repeat(2, 1fr); }
  .appliance-ribbon > * + * { border-left: 0; }
  .appliance-ribbon > * { border-bottom: 1px solid var(--line); }
  .ribbon-title { grid-column: 1 / -1; }
  .appliance-ribbon article:nth-of-type(even) { border-left: 1px solid var(--line); }
  .workbench { grid-template-columns: 1fr; }
  .equipment-intro { max-width: 740px; }
  .device-row-wide, .device-row-reverse { margin-inline: 0; padding-inline: 24px; }
}

@media (max-width: 720px) {
  .masthead { align-items: flex-start; flex-direction: column; justify-content: center; gap: 14px; padding: 18px 0; }
  .primary-nav { gap: 12px 18px; justify-content: flex-start; }
  .city-lead { grid-template-columns: 1fr; padding: 56px 0 50px; }
  .city-stamp { grid-template-columns: repeat(2, 1fr); }
  .city-stamp strong { grid-column: 1 / -1; }
  .district-feature { grid-template-columns: 1fr; gap: 8px; padding: 28px; }
  .district-pair { grid-template-columns: 1fr; }
  .district-compact-shifted { margin-top: 0; }
  .district-register > div { grid-template-columns: 1fr; gap: 5px; }
  .appliance-ribbon { grid-template-columns: 1fr; }
  .appliance-ribbon article:nth-of-type(even) { border-left: 0; }
  .closing-note { grid-template-columns: 1fr; gap: 12px; }
  .device-row { grid-template-columns: 1fr; gap: 8px; }
  .fault-lines header { grid-template-columns: 1fr; gap: 8px; }
  .fault-lines li { grid-template-columns: 42px 1fr; }
  .fault-lines li span { grid-column: 2; }
  .repair-context { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 460px) {
  h1 { font-size: 40px; }
  .masthead, .site-footer, .local-page main, .workbench, .repair-context { width: min(calc(100% - 28px), var(--max)); }
  .city-stamp { grid-template-columns: 1fr; }
  .city-stamp strong { grid-column: auto; }
  .fault-lines { padding-inline: 14px; }
  .built-in-note, .city-thread { padding: 28px 22px; }
}
