/* ==========================================================
   Małeccy Nieruchomości – arkusz stylów
   Kolory i typografia z brandbooka i makiet.
   Zmienne w :root możesz zmieniać w jednym miejscu.
   ========================================================== */

:root {
  --bg: #f9f5f1;
  --bg-soft: #f1e9e1;
  --sand: #e2d7ce;
  --line: #d9c7b8;
  --ink: #161616;
  --ink-soft: #4a4642;
  --navy: #0e1b45;
  --copper: #b38963;       /* linie, ikony, dekoracje */
  --copper-dark: #8f6a47;  /* przyciski i tekst – kontrast AA */
  --white: #ffffff;

  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;

  --wrap: 1180px;
  --header-h: 84px;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1.1em; max-width: 68ch; }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.2; font-weight: 400; }
ul { margin: 0; padding: 0; }

:focus-visible { outline: 2px solid var(--copper-dark); outline-offset: 3px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: var(--white); padding: .8rem 1.2rem;
}
.skip-link:focus { left: 0; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.center { text-align: center; }
.center p { margin-inline: auto; }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font: 500 .78rem/1 var(--font-sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--copper-dark);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-solid { background: var(--copper-dark); color: var(--white); }
.btn-solid:hover { background: #77563a; border-color: #77563a; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--copper); }
.btn-line:hover { background: var(--copper-dark); color: var(--white); border-color: var(--copper-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* ---------- Nagłówek ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(249, 245, 241, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 2rem;
}
.brand { display: block; flex: none; }
.brand img { width: 128px; }
.nav-toggle {
  display: none; background: none; border: 0; padding: .6rem; cursor: pointer; color: var(--ink);
}
.nav-toggle span { display: block; width: 26px; height: 1.5px; background: currentColor; margin: 6px 0; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.main-nav ul { list-style: none; display: flex; flex-wrap: nowrap; gap: .4rem 1.5rem; justify-content: flex-end; }
.main-nav a {
  display: block; padding: .5rem 0;
  font-size: .68rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  text-decoration: none; border-bottom: 1px solid transparent;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { border-bottom-color: var(--copper); }
.main-nav a[aria-current="page"] { color: var(--copper-dark); }

/* ---------- Hero (strona główna) ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, var(--bg) 0%, var(--bg) 42%, var(--sand) 100%);
}
.hero-inner {
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: end;
  min-height: min(78vh, 640px);
}
.hero-copy { align-self: center; padding: 4rem 0 4.5rem; position: relative; z-index: 2; }
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 300; letter-spacing: -.01em; line-height: 1.12;
  margin-bottom: 1.4rem; max-width: 15em;
}
.hero-lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 36em; }
.hero-photo { position: relative; align-self: stretch; }
.hero-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 18%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28%);
          mask-image: linear-gradient(to right, transparent 0, #000 28%);
}
.hero-photo { margin-right: calc((min(100vw - 2.5rem, var(--wrap)) - 100vw) / 2); }
.about-photo { margin-left: calc((min(100vw - 2.5rem, var(--wrap)) - 100vw) / 2); }
.hero-copy > * { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-copy > *:nth-child(2) { animation-delay: .08s; }
.hero-copy > *:nth-child(3) { animation-delay: .16s; }
.hero-copy > *:nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-block; margin-bottom: 1.6rem; padding-bottom: .9rem;
  font-size: .78rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--copper-dark); position: relative;
}
.eyebrow::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 1px; background: var(--copper); }

/* ---------- Sekcje ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-soft { background: var(--bg-soft); }
.section-title {
  font-size: clamp(1.4rem, 2.8vw, 2rem); font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5rem;
}
.section-sub { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 1.4rem; }

/* Wartości z ikonami */
.values {
  list-style: none; display: grid; grid-template-columns: repeat(5, 1fr);
  margin-top: 3rem;
}
.values li {
  padding: .5rem 1.2rem; text-align: center;
  font-size: .78rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; line-height: 1.6;
}
.values li + li { border-left: 1px solid var(--line); }
.icon { width: 46px; height: 46px; margin: 0 auto 1rem; stroke: var(--copper); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* Jak pracujemy */
.process { position: relative; background: linear-gradient(90deg, var(--bg-soft), var(--sand)); overflow: hidden; }
.process-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: stretch; }
.process-head { margin-bottom: 2.2rem; }
.steps { list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .4rem 1rem; padding: .9rem 0; }
.steps li::before {
  counter-increment: step; content: "0" counter(step);
  grid-row: span 2; font-size: 2.3rem; font-weight: 300; line-height: 1; color: var(--copper); padding-top: .15rem;
}
.steps h3 { font-size: 1.08rem; font-weight: 500; margin: 0; }
.steps p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.process-photo { position: relative; min-height: 420px; }
.process-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  clip-path: polygon(0 4%, 100% 0, 100% 100%, 0 100%);
}

/* Pas CTA */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 400; margin-bottom: .4rem; }
.cta-band p { margin-inline: auto; }
.cta-band .btn-row { justify-content: center; }

/* ---------- Podstrony ---------- */
.page-hero { padding: clamp(3rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem); background: linear-gradient(100deg, var(--bg) 40%, var(--bg-soft)); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 300; letter-spacing: -.005em; max-width: 20em; margin-bottom: 1rem; }
.page-hero .lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 42em; }
.breadcrumb { font-size: .78rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--copper); }
.breadcrumb a { text-decoration: none; border-bottom: 1px solid var(--line); }

.prose h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 400; margin-top: 2.4rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; font-weight: 500; margin-top: 1.8rem; }
.prose ul { margin: 0 0 1.4rem 1.2rem; max-width: 66ch; }
.prose li { margin-bottom: .45rem; }
.prose a { color: var(--copper-dark); text-underline-offset: 3px; }
.prose a.btn { text-underline-offset: 0; }
.prose a.btn-solid { color: var(--white); }
.prose a.btn-line { color: var(--ink); }
.prose a.btn-line:hover { color: var(--white); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.two-col.top { align-items: start; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 2.4rem; }
.cards.stack { grid-template-columns: 1fr; margin-top: 0; }
.card { padding: 2rem 1.8rem; background: var(--white); border-top: 2px solid var(--copper); }
.card h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: .5rem; }
.card { text-align: left; }
.card p { font-size: .95rem; color: var(--ink-soft); margin: 0; }
.card a { color: var(--copper-dark); text-underline-offset: 3px; }
.card .more { display: inline-block; margin-top: 1rem; font-size: .75rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--copper); padding-bottom: .15rem; }
.prose ol { margin: 0 0 1.4rem 1.2rem; max-width: 66ch; }

/* O nas */
.about-hero { position: relative; background: linear-gradient(100deg, var(--bg) 30%, var(--bg-soft)); overflow: hidden; }
.about-grid { display: grid; grid-template-columns: .95fr 1.05fr; align-items: center; min-height: 600px; }
.about-photo { align-self: stretch; position: relative; min-height: 420px; }
.about-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 22%); mask-image: linear-gradient(to left, transparent 0, #000 22%); }
.about-copy { padding: 4rem 0 4rem 3rem; }
.wordmark { font-family: var(--font-serif); font-weight: 700; font-size: clamp(2.8rem, 6vw, 4.6rem); line-height: 1; color: var(--navy); margin: 0 0 .5rem; letter-spacing: -.01em; }
.wordmark-sub { display: block; font-family: var(--font-sans); font-weight: 300; font-size: clamp(1rem, 2vw, 1.5rem); letter-spacing: .5em; text-transform: uppercase; margin-top: .6rem; margin-bottom: 2rem; color: var(--ink); }
.about-values { border-left: 1px solid var(--copper); padding-left: 2rem; }
.about-values h2 { font-family: var(--font-serif); font-size: 1.35rem; color: var(--navy); font-weight: 500; }
.about-values ul { list-style: none; }
.about-values li { display: flex; align-items: center; gap: 1.1rem; padding: .55rem 0; }
.about-values .icon { width: 34px; height: 34px; margin: 0; flex: none; }
.about-layout { display: grid; grid-template-columns: 1.3fr .9fr; gap: 3.5rem; align-items: start; }
.quote {
  font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--navy);
  font-size: clamp(1.5rem, 3.4vw, 2.5rem); line-height: 1.25; margin: 0; max-width: 24ch;
  border-top: 1px solid var(--copper); border-bottom: 1px solid var(--copper); padding: 1.6rem 0;
}
.team { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.4rem; max-width: 760px; }
.team figure { margin: 0; }
.team img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 25%; }
.team figcaption { margin-top: .8rem; font-size: .92rem; color: var(--ink-soft); }

/* Opinie */
.reviews-empty { padding: 2rem; border: 1px dashed var(--copper); background: var(--white); }

/* Blog */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.8rem; margin-top: 2rem; }
.post-card { background: var(--white); padding: 2rem 1.8rem; border-top: 2px solid var(--copper); }
.post-card time { font-size: .8rem; color: var(--ink-soft); }
.post-card h2, .post-card h3 { font-size: 1.2rem; font-weight: 500; margin: .5rem 0 .7rem; }
.post-card a { text-decoration: none; }
.post-card a:hover { color: var(--copper-dark); }
.post-card p { font-size: .95rem; color: var(--ink-soft); }
.article { max-width: 720px; }
.article .meta { font-size: .85rem; color: var(--ink-soft); margin-bottom: 2rem; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; max-width: 780px; }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--copper-dark); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .8rem 0 0; color: var(--ink-soft); }

/* Kontakt / formularz */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-list { list-style: none; }
.contact-list li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.contact-list strong { display: block; font-weight: 500; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--copper-dark); margin-bottom: .2rem; }
.contact-list a { text-decoration: none; }
.form { background: var(--white); padding: clamp(1.5rem, 4vw, 2.5rem); border-top: 2px solid var(--copper); }
.form h2 { font-size: 1.2rem; }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .85rem 1rem; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--copper-dark); outline-offset: 1px; border-color: var(--copper-dark); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .82rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.check input { margin-top: .25rem; accent-color: var(--copper-dark); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.form-note { padding: 1rem 1.2rem; margin-bottom: 1.4rem; border-left: 3px solid var(--copper-dark); background: var(--bg-soft); }
.form-note[hidden] { display: none; }

/* ---------- Stopka ---------- */
.site-footer { background: var(--sand); padding: 3.5rem 0 1.6rem; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.1fr; gap: 2.5rem; }
.footer-grid img { width: 150px; margin-bottom: 1rem; }
.footer-grid h2 { font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: .45rem; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.footer-bottom a { text-decoration: none; border-bottom: 1px solid var(--copper); }

/* ---------- Responsywność ---------- */
@media (max-width: 1080px) {
  .values { grid-template-columns: repeat(3, 1fr); row-gap: 2rem; }
  .values li:nth-child(4) { border-left: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1180px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1.4rem;
    visibility: hidden; opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
  }
  .main-nav.open {
    visibility: visible; opacity: 1; transform: none; pointer-events: auto;
    transition: opacity .25s ease, transform .25s ease, visibility 0s;
  }
  .main-nav ul { flex-direction: column; gap: 0; align-items: stretch; }
  .main-nav a { padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
}
@media (max-width: 960px) {
  .hero-photo, .about-photo { margin-inline: 0 !important; }
  .hero-inner, .process-grid, .about-grid, .about-layout, .two-col, .contact-grid { grid-template-columns: 1fr; }
  .hero-photo { min-height: 380px; order: -1; }
  .hero-photo img { -webkit-mask-image: linear-gradient(to top, transparent 0, #000 30%); mask-image: linear-gradient(to top, transparent 0, #000 30%); object-position: 50% 12%; }
  .hero-copy { padding: 1rem 0 3rem; }
  .process-photo { min-height: 380px; }
  .about-photo { min-height: 460px; order: -1; }
  .about-photo img { -webkit-mask-image: linear-gradient(to top, transparent 0, #000 25%); mask-image: linear-gradient(to top, transparent 0, #000 25%); }
  .about-copy { padding: 1rem 0 3rem; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .values { grid-template-columns: 1fr 1fr; }
  .values li { border-left: 0 !important; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; text-align: center; }
}
/* ---------- Płynne przejścia i animacje ---------- */
/* Przejścia między podstronami (Chrome, Edge, Safari; reszta przeglądarek po prostu je pomija) */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; transition: box-shadow .35s ease; }
.site-header.scrolled { box-shadow: 0 8px 28px rgba(14, 27, 69, .08); }
::view-transition-old(root) { animation: .2s ease both vt-out; }
::view-transition-new(root) { animation: .4s cubic-bezier(.2, .7, .2, 1) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* Pojawianie się sekcji przy przewijaniu (klasy dodaje js/main.js) */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* Wejście zdjęć w górnej części strony */
.hero-photo img, .about-photo img { animation: photo-in 1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes photo-in { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }

/* Delikatne reakcje na najechanie */
.card, .post-card { transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s ease; }
.card:hover, .post-card:hover { transform: translateY(-5px); box-shadow: 0 16px 36px rgba(14, 27, 69, .09); }
.btn { transition: background-color .25s, color .25s, border-color .25s, transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(143, 106, 71, .22); }
.btn:active { transform: translateY(0); box-shadow: none; }
.main-nav a { transition: border-color .3s ease, color .3s ease; }
.card .more { transition: border-color .3s ease, letter-spacing .3s ease; }
.card:hover .more { letter-spacing: .14em; }
.prose a, .footer-grid a, .post-card a { transition: color .25s ease; }
.field input, .field select, .field textarea { transition: border-color .25s ease, outline-color .25s ease, background-color .25s ease; }
.field input:focus, .field select:focus, .field textarea:focus { background: var(--white); }
.faq details[open] p { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *, .hero-photo img, .about-photo img, .faq details[open] p { animation: none; }
  .reveal { opacity: 1; transform: none; }
  * { transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
