/* Wabi Design — strona główna (index.html).
 * Paleta każdej sekcji: tokeny --p-* na sekcji (jedno źródło prawdy).
 * Bez JS: każda sekcja maluje własne tło (html:not(.js-blend)).
 * Z JS: js/blend.js ustawia --bg, --fg, --sub, --cta-bg, --cta-fg na <html> i mieszanie tła. */

/* ---------- Palety sekcji ---------- */
#A { --p-bg: #f6f2eb; --p-fg: #574631; --p-sub: #766656; --p-cta-bg: #66685a; --p-cta-fg: #f6f2eb; }
#B { --p-bg: #625039; --p-fg: #f6f2eb; --p-sub: #e4d8c9; --p-cta-bg: #66685a; --p-cta-fg: #f6f2eb; }
#C { --p-bg: #f6f2eb; --p-fg: #574631; --p-sub: #766656; --p-cta-bg: #66685a; --p-cta-fg: #f6f2eb; }
#D { --p-bg: #eee8de; --p-fg: #574631; --p-sub: #766656; --p-cta-bg: #574631; --p-cta-fg: #eee8de; }
#E, footer { --p-bg: #66685a; --p-fg: #f6f2eb; --p-sub: #f1eee6; --p-cta-bg: #f6f2eb; --p-cta-fg: #4b3c2d; }

/* Bez mieszania: każda sekcja pokazuje swoje tło i kolory. */
html:not(.js-blend) section,
html:not(.js-blend) footer {
  --bg: var(--p-bg);
  --fg: var(--p-fg);
  --sub: var(--p-sub);
  --cta-bg: var(--p-cta-bg);
  --cta-fg: var(--p-cta-fg);
  background: var(--bg);
  color: var(--fg);
}

/* Z mieszaniem: jedno tło na <body>, sekcje przezroczyste. */
html.js-blend {
  --bg: color-mix(in oklab, var(--from-bg, #f6f2eb), var(--to-bg, #f6f2eb) calc(var(--t, 0) * 100%));
}
html.js-blend body { background: var(--bg); color: var(--fg); }
html.js-blend section,
html.js-blend footer { background: transparent; }
html.js-blend body,
html.js-blend .cta { transition: color .2s, background-color .2s; }

/* ---------- Nagłówek ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: transparent;
  color: var(--fg);
  transition: transform .2s, background-color .2s;
}
.site-header.is-scrolled { background: var(--bg); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header .wordmark {
  font: 400 15px/1 var(--serif);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
}
.site-header .cta { min-height: 40px; padding: 10px 18px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}

/* ---------- Wspólne ---------- */
.micro {
  font: 500 10px/1.6 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--sub);
}
h1, h2, h3 { text-wrap: balance; }
section > *, footer > * { min-width: 0; }

/* ---------- A — hero ---------- */
#A {
  position: relative;
  display: grid;
  grid-template-columns: 49% 51%;
  align-items: stretch;
  min-height: 780px;
  overflow: hidden;
  padding-top: calc(64px + env(safe-area-inset-top, 0px));
}
.hero-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 14px;
  position: relative;
  min-height: 770px;
  padding: 25px 0 25px 24px;
}
.hero-gallery::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 21%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--bg));
}
.tile { overflow: hidden; border-radius: 10px; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  padding: 70px 7% 70px 5%;
}
.hero-copy h1 {
  font: 400 clamp(45px, 4.3vw, 77px)/1.12 var(--serif);
  letter-spacing: -0.035em;
  margin: 24px 0;
  color: var(--fg);
}
.hero-copy p {
  font-size: 16px;
  line-height: 1.8;
  max-width: 390px;
  margin: 0 0 30px;
  color: var(--sub);
}

/* ---------- B — oferta i realizacje ---------- */
#B {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 8%;
  min-height: 760px;
  padding: 110px 8%;
}
#B .micro { color: var(--sub); }
#B h2 {
  font: 400 clamp(45px, 4.1vw, 74px)/1.15 var(--serif);
  letter-spacing: -0.03em;
  margin: 20px 0 28px;
  max-width: 650px;
  color: var(--fg);
}
#B p { font-size: 15px; margin: 0 0 35px; color: var(--sub); }
.carousel-wrap { width: 100%; max-width: 540px; justify-self: center; position: relative; }
.carousel-box {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #d2c6b7;
  touch-action: pan-y;
}
.carousel-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s;
}
.carousel-photo.active { opacity: 1; }
/* Karuzela ma stałe kolory (nie bierze udziału w mieszaniu). */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 43px;
  height: 43px;
  border: 0;
  border-radius: 50%;
  background: #f6f2eb;
  color: #574631;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 16px #4838262c;
}
.arrow.prev { left: -20px; }
.arrow.next { right: -20px; }
.dots { display: flex; justify-content: center; gap: 12px; margin-top: 21px; }
.dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d0c5b6;
  cursor: pointer;
}
.dot.active { background: #f6f2eb; }

/* ---------- C — dlaczego Wabi Design ---------- */
#C {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 760px;
  padding: 130px 7%;
  overflow: hidden;
}
#C::before {
  content: '';
  position: absolute;
  right: -12%;
  top: -45%;
  width: 65%;
  height: 110%;
  opacity: .14;
  filter: blur(45px);
  transform: rotate(-25deg);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #fff8e5 15%, transparent 25%, #fff8e5 38%, transparent 50%, #fff8e5 61%, transparent 76%);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 1450px;
  width: 100%;
  margin: auto;
  position: relative;
}
/* Karty mają stałe kolory (nie biorą udziału w mieszaniu). */
.card {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  padding: 36px 32px 30px;
  border-radius: 16px;
  background: #625039;
  color: #f6f2eb;
  box-shadow: 0 10px 28px #30241422;
}
.card.middle {
  background: #66685a;
  color: #fff9f1;
  box-shadow: 0 10px 26px #30241418;
}
.card svg {
  width: 35px;
  height: 35px;
  margin-bottom: 33px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
.card h3 {
  font: 400 clamp(26px, 2.15vw, 37px)/1.14 var(--serif);
  letter-spacing: -0.02em;
  margin: 0 0 21px;
}
.card p { font-size: 15px; line-height: 1.7; margin: 0 0 26px; }
.card .mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 48px;
  margin-top: auto;
  padding: 13px 20px;
  align-self: flex-start;
  border: 1px solid currentColor;
  border-radius: 8px;
  color: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: filter .2s, transform .2s;
}
.card .mini-button span { font-size: 18px; line-height: 1; font-weight: 400; }
.card .mini-button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.card.middle .mini-button { background: #f6f2eb; border: 0; color: #493a2e; }

/* ---------- D — o mnie ---------- */
#D {
  position: relative;
  display: grid;
  grid-template-columns: 43% 57%;
  gap: 7%;
  align-items: center;
  min-height: 730px;
  padding: 130px 11%;
}
.about-photo {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 3px;
  background: linear-gradient(130deg, #c2b19d, #9f8b78 45%, #776a5d);
  box-shadow: 0 18px 35px #55472f16;
}
.about-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 75% 20%, #f8f1e9ad, transparent 55%), linear-gradient(90deg, #d9c8b5b0, transparent 55%);
}
.about-photo-placeholder {
  position: relative;
  z-index: 1;
  width: 72%;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 25px;
  border: 1px solid #fff9;
  border-radius: 160px 160px 8px 8px;
  color: #fff9f1;
  text-align: center;
}
.about-photo-placeholder svg { width: 62px; height: 62px; stroke: currentColor; fill: none; stroke-width: 1; }
.about-photo-placeholder span { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.7; }
.about-copy { max-width: 560px; }
#D h2 {
  font: 400 clamp(44px, 4.15vw, 72px)/1.14 var(--serif);
  letter-spacing: -0.03em;
  margin: 22px 0 30px;
  color: var(--fg);
}
#D p { font-size: 16px; line-height: 1.9; margin: 0 0 18px; color: var(--sub); }
#D .text-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  align-self: flex-start;
  min-height: 48px;
  margin-top: 26px;
  padding: 12px 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: none;
  color: var(--cta-bg);
  box-shadow: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}
#D .text-link:hover { filter: none; transform: none; }

/* ---------- E — kontakt ---------- */
#E {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 580px;
  padding: 110px 20px;
  text-align: center;
}
#E .micro { color: var(--sub); }
#E h2 {
  font: 400 clamp(44px, 5vw, 80px)/1.14 var(--serif);
  letter-spacing: -0.025em;
  max-width: 880px;
  margin: 26px 0;
  color: var(--fg);
}
#E > p { max-width: 580px; line-height: 1.85; margin: 0 0 34px; font-size: 16px; color: var(--sub); }
.contact-extra {
  margin-top: 56px;
  padding-top: 25px;
  width: min(650px, 100%);
  border-top: 1px solid #f7f1e74d;
  font-size: 14px;
  color: var(--sub);
}
.contact-extra a { color: inherit; text-underline-offset: 5px; }

/* ---------- Stopka (paleta E, bez oddzielnego tła) ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 26px 8%;
  font-size: 12px;
  color: var(--sub);
}
.footer a { color: inherit; text-underline-offset: 3px; }

/* ---------- Responsywność ---------- */
@media (max-width: 860px) {
  #A { grid-template-columns: 1fr; min-height: 0; }
  .hero-gallery { min-height: 400px; height: 50vh; padding: 15px 15px 0; }
  .hero-gallery::after { top: auto; left: 0; right: 0; width: auto; height: 30%; background: linear-gradient(0deg, var(--bg), transparent); }
  .hero-copy { padding: 25px 7% 90px; }
  #B { grid-template-columns: 1fr; gap: 55px; padding: 95px 8%; }
  .carousel-wrap { max-width: 500px; }
  .arrow.prev { left: 8px; }
  .arrow.next { right: 8px; }
  #C { padding: 95px 7%; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 350px; }
  #D { grid-template-columns: 1fr; gap: 45px; padding: 95px 8%; }
  .about-photo { max-width: 460px; margin: 0 auto; }
  #D h2 { font-size: 45px; }
  #E { padding: 95px 8%; }
}
@media (min-width: 861px) and (max-width: 1120px) {
  .hero-copy h1 { font-size: 48px; }
  .card { padding: 28px 23px; }
  .card h3 { font-size: 26px; }
}
@media (max-width: 400px) {
  .hero-copy { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}
