/* Base */
:root {
  --bg: #F7F3EC;
  --surface: #FFFFFF;
  --text: #1F1B16;
  --muted: #5E554B;
  --accent: #A64B22;
  --accent-text: #FFFFFF;
  --plate-bg: #1F1B16;
  --plate-text: #F7F3EC;
  --line: #E3DBCE;
  --radius-card: 16px;
  --radius-btn: 10px;
  --font-head: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --shadow-soft: 0 1px 2px rgb(31 27 22 / .06), 0 12px 32px rgb(31 27 22 / .08);
  --pad-side: clamp(16px, 4vw, 40px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 4.6vw + 0.6rem, 4.6rem); line-height: 1.06; }
h2 { font-size: clamp(1.8rem, 2.6vw + 0.8rem, 3rem); line-height: 1.15; }
h3 { font-size: clamp(1.2rem, 1vw + 0.6rem, 1.5rem); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

ul, ol { padding-left: 1.2em; }

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

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

.pmWrap {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--pad-side);
  padding-right: var(--pad-side);
}

.pmWrap.pmNarrow, .pmFormWrap { max-width: 720px; }

.pmSection {
  position: relative;
  padding: clamp(64px, 9vw, 128px) 0;
}

.pmSection:nth-of-type(even) { background: var(--surface); }

.pmText { max-width: 68ch; color: var(--text); }
.pmText a, .pmCardBody a, .pmPlate a { text-decoration: underline; }

.pmMuted { color: var(--muted); }

/* Skip link */
.pmSkip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--plate-bg);
  color: var(--plate-text);
  padding: 12px 20px;
  border-radius: var(--radius-btn);
}
.pmSkip:focus { left: 16px; top: 16px; }

/* Header */
.pmHead {
  position: sticky;
  top: 0;
  z-index: 70;
  background: transparent;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.pmHead.isScrolled {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line), 0 8px 24px rgb(31 27 22 / .06);
}
.pmHeadRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
}
.pmHeadMail {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  justify-self: start;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pmHeadMail a { color: var(--muted); text-decoration: none; }
.pmHeadMail a:hover { color: var(--accent); text-decoration: underline; }
.pmLogo {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  justify-self: center;
  white-space: nowrap;
}
.pmNavBtn {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  color: var(--text);
  font: 600 0.95rem var(--font-body);
  cursor: pointer;
  transition: border-radius .25s ease, background-color .25s ease;
}
.pmNavBtn:hover { border-radius: 20px; background: var(--surface); }
.pmNavBtn:active { box-shadow: none; }
.pmNavBtnBars { display: inline-flex; flex-direction: column; gap: 5px; }
.pmNavBtnBars span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease;
}
.pmNavBtn[aria-expanded="true"] .pmNavBtnBars span:first-child { transform: translateY(7px) rotate(45deg); }
.pmNavBtn[aria-expanded="true"] .pmNavBtnBars span:last-child { transform: translateY(-7px) rotate(-45deg); }

/* Nav overlay */
.pmNav {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 96px var(--pad-side) 48px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
.pmNav.isOpen { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.pmNavCols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}
.pmNavList { list-style: none; margin: 0; padding: 0; }
.pmNavList li { margin-bottom: 6px; }
.pmNavLink {
  display: inline-block;
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  color: var(--text);
  text-decoration: none;
  padding: 6px 0;
  transition: color .25s ease, transform .25s ease;
}
.pmNavLink:hover { color: var(--accent); transform: translateX(6px); }
.pmFootNav .pmNavLink {
  font-family: var(--font-body);
  font-size: 0.95rem;
  transform: none;
}
.pmFootNav .pmNavLink:hover { transform: none; }
.pmNavTitle { font-size: 1.1rem; margin-bottom: 12px; }
.pmNavAside ul { list-style: none; margin: 0 0 20px; padding: 0; }
.pmNavAside ul li { margin-bottom: 8px; color: var(--muted); }
.pmNavAside ul li span { color: var(--text); font-weight: 600; margin-right: 6px; }
.pmNavAsk { margin-top: 8px; }

/* Buttons */
.pmBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border: none;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, #B65A2C 0%, var(--accent) 55%, #8F3E1B 100%);
  background-size: 180% 180%;
  background-position: 0% 50%;
  color: var(--accent-text);
  font: 600 1rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(31 27 22 / .12);
  transition: background-position .3s ease, border-radius .25s ease, box-shadow .2s ease;
}
.pmBtn:hover { background-position: 100% 50%; border-radius: 18px; }
.pmBtn:focus-visible {
  outline: 3px solid var(--plate-bg);
  outline-offset: 2px;
  border-radius: var(--radius-btn);
}
.pmBtn:active { box-shadow: none; transform: none; }

/* Hero */
.pmHero { padding-top: clamp(48px, 6vw, 88px); overflow: hidden; }
.pmHeroTitle {
  max-width: 20ch;
  margin-bottom: 24px;
}
.pmHeroLead {
  max-width: 58ch;
  font-size: clamp(1.05rem, 0.5vw + 0.9rem, 1.25rem);
  color: var(--muted);
  margin-bottom: 28px;
}
.pmHeroFrame {
  margin-top: 40px;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.pmHeroFrame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Background shapes */
.pmSection::before, .pmSection::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
}
.pmHero::before {
  top: -80px; right: -120px;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(166 75 34 / .14), transparent 70%);
}
.pmHero::after {
  bottom: -60px; left: -160px;
  width: 320px; height: 320px;
  border-radius: 320px 320px 0 0;
  background: rgb(166 75 34 / .10);
}
#uslugi::before {
  top: 40px; left: -180px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: rgb(166 75 34 / .09);
}
#cennik::after {
  bottom: 0; right: -140px;
  width: 300px; height: 300px;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: rgb(31 27 22 / .07);
}
#pytania::before {
  top: 60px; right: -100px;
  width: 260px; height: 130px;
  border-radius: 130px 130px 0 0;
  background: rgb(166 75 34 / .10);
}

/* Tabs */
.pmTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 24px;
}
.pmTab {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--muted);
  font: 600 0.95rem var(--font-body);
  cursor: pointer;
  transition: border-radius .25s ease, color .25s ease, background-color .25s ease;
}
.pmTab:hover { border-radius: 18px; color: var(--text); }
.pmTab:focus-visible { outline: 3px solid var(--plate-bg); outline-offset: 2px; }
.pmTab:active { box-shadow: none; }
.pmTab[aria-selected="true"] {
  background: var(--plate-bg);
  border-color: var(--plate-bg);
  color: var(--plate-text);
}

/* Cards */
.pmCardGrid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 24px;
}
.pmCard {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}
.pmCard:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
}
.pmCard > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pmCardWide > img { aspect-ratio: 16 / 10; }
.pmCardBody { padding: clamp(24px, 3vw, 32px); }
.pmCardBody h3 { margin-bottom: 10px; }

/* Split layout */
.pmSplit {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.pmSteps { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: step; }
.pmSteps li {
  counter-increment: step;
  position: relative;
  padding: 18px 0 18px 56px;
  border-top: 1px solid var(--line);
}
.pmSteps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 20px;
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--accent);
}
.pmSteps h3 { font-size: 1.15rem; margin-bottom: 4px; }
.pmSteps p { color: var(--muted); margin: 0; }

.pmArched {
  margin: 0;
  border-radius: 999px 999px var(--radius-card) var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.pmArched img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

/* Pricing */
.pmPriceGrid { margin-top: 32px; }
.pmPrice { text-align: left; }
.pmPriceTag {
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--accent);
  margin: -4px 0 12px;
}
.pmPriceFeatured {
  border: 2px solid var(--accent);
  background: var(--bg);
}

/* Plate */
.pmPlate {
  background: var(--plate-bg);
  color: var(--plate-text);
  border-radius: var(--radius-card);
  padding: clamp(28px, 4vw, 48px);
  max-width: 900px;
}
.pmPlate .pmSectionTitle, .pmPlate h2 { color: var(--plate-text); }
.pmPlate a { color: #E8A87F; }
.pmGuarantees { margin: 20px 0 0; padding-left: 1.2em; }
.pmGuarantees li { margin-bottom: 10px; }
.pmGuarantees li::marker { color: #E8A87F; }

/* FAQ */
.pmQa { max-width: 760px; margin-top: 24px; }
.pmQa details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .25s ease;
}
.pmQa details[open] { border-color: var(--accent); }
.pmQa summary {
  cursor: pointer;
  padding: 18px 24px;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  list-style-position: inside;
}
.pmQa summary:hover { color: var(--accent); }
.pmQa summary:focus-visible { outline: 3px solid var(--plate-bg); outline-offset: -3px; }
.pmQa details p { padding: 0 24px 20px; color: var(--muted); margin: 0; }

/* Form */
.pmInquiry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 28px;
}
.pmField { display: grid; gap: 6px; }
.pmLabel { font-weight: 600; font-size: 0.95rem; }
.pmInput, .pmArea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font: 400 1rem var(--font-body);
  transition: border-color .25s ease, border-radius .25s ease;
}
.pmArea { min-height: 120px; resize: vertical; }
.pmInput::placeholder { color: var(--muted); opacity: 1; }
.pmInput:hover { border-color: var(--muted); }
.pmInput:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pmField.isInvalid .pmInput, .pmField.isInvalid .pmArea { border-color: #B3261E; }
.pmCheck { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; color: var(--muted); }
.pmCheck input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.pmHint { font-size: 0.9rem; color: var(--muted); margin: 0; }
.pmSend { justify-self: start; }
.pmInquiry.isSending .pmSend { opacity: .6; pointer-events: none; }

/* Mobile dock */
.pmDock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 12px var(--pad-side) calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: none;
}
.pmDockLink { width: 100%; }

/* Footer */
.pmFoot {
  background: var(--plate-bg);
  color: var(--plate-text);
  padding: clamp(48px, 6vw, 80px) 0 24px;
  margin-top: 0;
}
.pmFootGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}
.pmFoot .pmLogo { color: var(--plate-text); }
.pmFootBrand { max-width: 420px; }
.pmFootLead { color: #B9B0A4; margin-top: 14px; font-size: 0.95rem; }
.pmFootTitle {
  color: var(--plate-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.pmFootNav ul { list-style: none; margin: 0; padding: 0; }
.pmFootNav li { margin-bottom: 8px; }
.pmFootNav .pmNavLink { color: #D9D2C7; font-size: 0.95rem; }
.pmFootNav .pmNavLink:hover { color: #E8A87F; }
.pmFootOwner address { font-style: normal; color: #B9B0A4; font-size: 0.92rem; }
.pmFootOwner address p { margin-bottom: 10px; }
.pmFoot .pmFootOwner address p:first-child { color: var(--plate-text); }
.pmFootBase {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgb(247 243 236 / .18);
}
.pmFootCopy { color: #B9B0A4; font-size: 0.9rem; margin: 0; }

/* Reveal */
html.isJs .pmReveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
html.isJs .pmReveal.isShown { opacity: 1; transform: none; }

/* Page head (inner pages) */
.pmPageHead {
  padding: clamp(48px, 6vw, 88px) 0 0;
}
.pmPageHead h1 { max-width: 22ch; }
.pmPageLead { max-width: 60ch; color: var(--muted); font-size: clamp(1.05rem, 0.5vw + 0.9rem, 1.2rem); }

/* Prose for policies */
.pmText h2 { font-size: clamp(1.4rem, 1.6vw + 0.8rem, 2rem); margin-top: 2em; }
.pmText h3 { margin-top: 1.5em; }
.pmText ol, .pmText ul { margin: 0 0 1em; }
.pmText li { margin-bottom: 8px; }
.pmText table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}
.pmText th, .pmText td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--line);
}
.pmText th { background: var(--surface); font-family: var(--font-head); }

/* Key data block */
.pmKeyBox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: clamp(24px, 3vw, 32px);
  margin-bottom: 40px;
}
.pmKeyBox h2 { margin-top: 0; }

/* Contacts block */
.pmContacts {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: clamp(24px, 3vw, 32px);
}
.pmContacts ul { list-style: none; margin: 0; padding: 0; }
.pmContacts li { margin-bottom: 12px; }
.pmContacts li span { font-weight: 600; margin-right: 8px; }
.pmContacts address { font-style: normal; color: var(--muted); }

/* Confirmation and 404 */
.pmConfirm, .pmError { text-align: left; }
.pmConfirm .pmPlate { margin: 32px 0; }
.pmBigNote {
  font-family: var(--font-head);
  font-size: clamp(5rem, 14vw, 9rem);
  line-height: 1;
  color: var(--accent);
  margin: 0 0 16px;
}
.pmNextLinks { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.pmNextLinks a { text-decoration: none; font-weight: 600; }
.pmNextLinks a:hover { text-decoration: underline; }

/* Breakpoints */
@media (min-width: 480px) {
  .pmInquiry { grid-template-columns: 1fr 1fr; }
  .pmInquiry .pmField:nth-child(n+4), .pmInquiry .pmCheck, .pmInquiry .pmHint, .pmInquiry .pmSend, .pmInquiry button[type="submit"] { grid-column: 1 / -1; }
  .pmDockLink { width: auto; }
}

@media (min-width: 640px) {
  .pmCardGrid { grid-template-columns: repeat(2, 1fr); }
  .pmCardWide { grid-column: span 2; }
  .pmFootGrid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  .pmSplit { grid-template-columns: 1.1fr 0.9fr; }
  .pmDock { display: none; }
}

@media (min-width: 1024px) {
  .pmCardGrid { grid-template-columns: repeat(3, 1fr); }
  .pmCardWide { grid-column: span 2; }
  .pmPriceGrid { grid-template-columns: repeat(3, 1fr); }
  .pmPriceFeatured { transform: scale(1.02); }
}

@media (max-width: 767px) {
  .pmDock { display: block; }
  body { padding-bottom: 84px; }
  .pmNavCols { grid-template-columns: 1fr; overflow-y: auto; }
}

@media (min-width: 1280px) {
  .pmWrap { max-width: 1200px; }
  .pmHeadRow { min-height: 80px; }
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html.isJs .pmReveal { opacity: 1; transform: none; }
}

/* Anchor offset */
section[id] { scroll-margin-top: 88px; }

@media (max-width: 767px) {
  section[id] { scroll-margin-top: 76px; }
  .pmHeroTitle { font-size: clamp(34px, 9vw, 44px); line-height: 1.15; }
  .pmTabs {
    flex-wrap: wrap;
    gap: 8px;
  }
  .pmTab {
    white-space: nowrap;
    padding: 8px 16px;
    flex: none;
  }
  .pmDock { display: block; }
  body { padding-bottom: 84px; }
  .pmNavCols { grid-template-columns: 1fr; overflow-y: auto; }
}

/* Decorative shapes clipping */
.pmSection { overflow: clip; }
.pmHero::before, .pmHero::after { pointer-events: none; }
@media (max-width: 479px) {
  .pmHero::before { right: -60px; width: 220px; height: 220px; }
  .pmHero::after { left: -80px; width: 200px; height: 200px; }
  #uslugi::before { left: -90px; width: 220px; height: 220px; }
  #cennik::after { right: -70px; width: 180px; height: 180px; }
  #pytania::before { right: -50px; width: 160px; height: 80px; border-radius: 80px 80px 0 0; }
}
