/* ===========================================================================
   Komponenty stron ofertowych (segmentów).

   Wspólne dla: Rezydencje, Domy murowane, Domy szkieletowe i obu podstron
   projektów — pięć makiet używa dokładnie tych samych klas. Wyciągnięte
   z „Rezydencji" przy drugim użyciu.

   Wartości bazowe pochodzą z makiety „Rezydencje" (zweryfikowanej co do
   piksela); pojedyncze odchyłki pozostałych stron siedzą w ich arkuszach.
   =========================================================================== */

/* Skala nagłówków rodziny ofertowej. */
.section-head { max-width: 760px; margin-bottom: 60px; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 56px); }
.section-head p { margin-top: 20px; font-size: 18px; }

section { padding: 120px 0; }

/* Sekcja na tle przełamanym — wraca kilka razy na każdej z tych podstron. */
section.who { background: var(--bg-alt); }

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

/* Odstępu pionowego NIE zerujemy — w makietach hero jest zwykłą sekcją
   i bierze `padding` z reguły `section`. */
.hero-segment {
  position: relative;
  /* 82vh, nie pełna wysokość — pod hero ma być widoczna strzałka zachęty. */
  min-height: calc(82vh - var(--header-h));
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}
.hero-segment .hero-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
/* 130% wysokości daje zapas na paralaksę. */
.hero-segment .hero-media img { width: 100%; height: 130%; object-fit: cover; will-change: transform; }

.hero-segment::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .55) 34%, rgba(0, 0, 0, .26) 64%, rgba(0, 0, 0, .05) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55) 100%);
}

.hero-segment .container { width: 100%; }
.hero-segment .hero-inner { padding: 0 0 90px; max-width: 760px; }
.hero-segment .eyebrow { color: #e9dfce; }

/* Ścieżka okruszków w jasnym tekście na ciemnym tle hero — wzorzec z projekty.css. */
.crumbs { font-size: 13px; color: rgba(255, 255, 255, .8); margin-bottom: 16px; display: flex; align-items: center; }
.crumbs a { color: #e9dfce; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs span { margin: 0 8px; opacity: .5; }
.crumb-home { display: inline-flex; }
.crumb-home svg { width: 15px; height: 15px; }
.hero-segment h1 { font-size: clamp(40px, 6.4vw, 78px); font-weight: 200; margin-bottom: 26px; letter-spacing: -.03em; }
.hero-segment p { font-size: clamp(17px, 2vw, 21px); font-weight: 300; opacity: .9; margin-bottom: 36px; max-width: 600px; }
.hero-segment .hero-actions { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.hero-segment .hero-actions .link { color: #fff; }

/* --- Strzałka zachęty do przewinięcia ----------------------------------- */

/* `height: 0` — element nie zajmuje miejsca w układzie, tylko nachodzi na hero. */
.scroll-cue {
  position: relative;
  top: 6px;
  z-index: 5;
  display: flex;
  justify-content: center;
  height: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}
.scroll-cue .ar {
  width: 12px; height: 12px;
  border-right: 1.6px solid var(--beige);
  border-bottom: 1.6px solid var(--beige);
  transform: rotate(45deg);
  animation: cueBob 1.9s ease-in-out infinite;
}
.scroll-cue.hide { opacity: 0; }

@keyframes cueBob {
  0%, 100% { transform: rotate(45deg) translate(-2px, -2px); opacity: .5; }
  50%      { transform: rotate(45deg) translate(2px, 2px);   opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue .ar { animation: none; }
  .scroll-cue { transition: none; }
}

/* --- Karty „dla kogo" --------------------------------------------------- */

/* Karta ma dwa warianty nagłówka: numer (`.n`) albo ikona (`.ic`).
   Rezydencje numerują, pozostałe segmenty używają ikon. */
.who-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.who-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  padding: 38px 32px;
  clip-path: polygon(0 0, calc(100% - var(--skos-m)) 0, 100% var(--skos-m), 100% 100%, 0 100%);
  transition: border-color .5s ease, box-shadow .5s ease, transform .5s cubic-bezier(.2, 0, .2, 1);
}
.who-card > * { position: relative; z-index: 1; }
.who-card:hover { border-color: var(--beige); box-shadow: 0 16px 40px rgba(26, 26, 28, .06); transform: translateY(-5px) scale(1.02); }
.who-card .ic { width: 32px; height: 32px; stroke: var(--beige); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; display: block; }
.who-card h4 { font-size: 20px; margin: 12px 0 10px; }
.who-card p { font-size: 15px; color: var(--text); }

@media (max-width: 860px) { .who-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .who-card { transition: none; } }

/* --- Kafle podkategorii ------------------------------------------------- */

.subcats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.subcat {
  position: relative;
  display: block;
  color: inherit;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 44px, 100% 100%, 0 100%);
}
.subcat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, 0, .2, 1); }
.subcat:hover img { transform: scale(1.05); }
.subcat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .2) 0%, rgba(0, 0, 0, .42) 45%, rgba(0, 0, 0, .9) 100%);
}
.subcat .body { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px; color: #fff; z-index: 2; }
.subcat h3 { font-size: 23px; font-weight: 400; margin-bottom: 14px; padding-bottom: 14px; position: relative; }
.subcat h3::after { content: ''; position: absolute; left: 0; bottom: 0; width: 44px; height: 2px; background: var(--beige); }
.subcat p { font-size: 14.5px; color: rgba(255, 255, 255, .85); margin-bottom: 16px; }
.subcat .link { color: #fff; }
.subcat .link .chev { color: var(--beige); transition: transform .2s ease; display: inline-block; }
.subcat:hover .link .chev { transform: translateX(3px); }

@media (max-width: 860px) { .subcats { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .subcat img, .subcat .link .chev { transition: none; } }

/* --- Oś czasu ----------------------------------------------------------- */

/* Liczba kolumn idzie z atrybutu `data-kolumny`, nie z arkusza per podstrona —
   wynika z liczby etapów, a ta jest treścią. Wartości sterowane treścią
   przekazujemy atrybutem `data-*`, zgodnie z zasadą „żadnego CSS-a w HTML-u". */
.timeline { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 51px; margin-bottom: 120px; padding-top: 8px; }
.timeline[data-kolumny="3"] { grid-template-columns: repeat(3, 1fr); }
/* Od czterech kolumn oś jest gęstsza i wchodzi w rytm sekcji, nie zamyka
   jej — stąd inne odstępy i mniejszy gap (wartości z makiet). */
.timeline[data-kolumny="4"] { grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 26px; margin-bottom: 0; }
.timeline[data-kolumny="5"] { grid-template-columns: repeat(5, 1fr); gap: 20px; margin-top: 26px; margin-bottom: 0; }
.timeline[data-kolumny="6"] { grid-template-columns: repeat(6, 1fr); gap: 18px; margin-top: 26px; margin-bottom: 0; }

/* Linia biegnie od środka pierwszej kropki do środka ostatniej, więc wcięcie
   to połowa kolumny: 100 / (2 × liczba kolumn). Bez tego przy trzech etapach
   linia jest za krótka, a przy sześciu wystaje poza skrajne kropki. */
.timeline::before { content: ''; position: absolute; top: 15px; left: 16.66%; right: 16.66%; height: 1.5px; background: rgba(175, 151, 121, .4); }
.timeline[data-kolumny="3"]::before { left: 16.66%; right: 16.66%; }
.timeline[data-kolumny="4"]::before { left: 12.5%;  right: 12.5%; }
.timeline[data-kolumny="5"]::before { left: 10%;    right: 10%; }
.timeline[data-kolumny="6"]::before { left: 8.33%;  right: 8.33%; }

.tl-step { position: relative; text-align: center; padding: 0 12px; }
/* Podwójny `box-shadow` robi białą obwódkę i zewnętrzny pierścień —
   dzięki temu kropka „przecina" linię osi. */
.tl-step::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--beige);
  box-shadow: 0 0 0 5px #fff, 0 0 0 6.5px rgba(175, 151, 121, .4);
}
.tl-step .num { display: block; margin-top: 30px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--beige-dark); font-weight: 500; }
.tl-step h4 { font-size: 21px; margin: 10px 0 12px; letter-spacing: -.01em; }
.tl-step p { font-size: 15px; color: var(--text); max-width: 300px; margin: 0 auto; }

/* Od czterech kolumn w górę kolumna jest wąska, więc typografia schodzi
   o stopień — tak samo jak w makietach rodziny „Projekty…". */
.timeline[data-kolumny="4"] .num,
.timeline[data-kolumny="5"] .num,
.timeline[data-kolumny="6"] .num { font-size: 12px; }
.timeline[data-kolumny="4"] h4,
.timeline[data-kolumny="5"] h4,
.timeline[data-kolumny="6"] h4 { font-size: 16px; margin: 9px 0 8px; }
.timeline[data-kolumny="4"] p,
.timeline[data-kolumny="5"] p,
.timeline[data-kolumny="6"] p { font-size: 13.5px; line-height: 1.5; max-width: none; }

/* Na wąskim ekranie oś kładzie się pionowo — niezależnie od `data-kolumny`. */
@media (max-width: 860px) {
  .timeline,
  .timeline[data-kolumny="3"],
  .timeline[data-kolumny="4"],
  .timeline[data-kolumny="5"],
  .timeline[data-kolumny="6"] { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  /* Klient poprosił o usunięcie łączącej linii na mobile (19.08.2026) —
     same kropki bez osi, prościej wizualnie na wąskim ekranie. */
  .timeline::before { display: none; }
  .tl-step { text-align: left; padding: 0 0 40px 40px; }
  .tl-step:last-child { padding-bottom: 0; }
  .tl-step::before { top: 4px; left: 0; transform: none; }
  .tl-step .num { margin-top: 0; }
  .tl-step p { margin: 0; }
}

/* --- Portfolio ---------------------------------------------------------- */

.portfolio { background: var(--bg); }

.port-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: clamp(280px, 27vw, 400px); gap: 20px; }
.port-card { position: relative; display: block; color: inherit; overflow: hidden; height: 100%; }
.port-card.cut { clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 44px, 100% 100%, 0 100%); }
.port-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, 0, .2, 1); }
.port-card:hover img { transform: scale(1.04); }
.port-card .cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 34px 18px 15px;
  color: #fff;
  font-size: 13px;
  font-weight: 300;
  background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent);
}
.port-card .cap b { font-weight: 500; }

.p8 { grid-column: span 8; }
.p6 { grid-column: span 6; }
.p4 { grid-column: span 4; }

/* Wyśrodkowany przycisk pod siatką. */
.port-cta { text-align: center; margin-top: 48px; }

@media (max-width: 860px) {
  .port-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: clamp(190px, 42vw, 260px); }
  .p8, .p6, .p4 { grid-column: span 1; }
}
@media (prefers-reduced-motion: reduce) { .port-card img { transition: none; } }
