/* ---------------------------------------------------------------------------
   glowna.css - sekcje strony głównej: hero, oferta, opinie, realizacje,
   o mnie, FAQ i formularz kontaktowy. Wspólne tokeny i typografia siedzą
   w strona.css - ten plik tylko je wykorzystuje.
   --------------------------------------------------------------------------- */

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

/* Zamiast jednego dużego zdjęcia - mozaika z różnych dziedzin, żeby od razu
   było widać, że to nie jest strona jednej specjalizacji. */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 78% 18%, rgb(var(--accent-rgb) / .10), transparent 58%),
    radial-gradient(ellipse at 8% 92%, rgb(var(--accent-rgb) / .06), transparent 55%),
    var(--bg-deep);
}

/* Żłobkowanie jak na damianopiola.pl, ale ledwie widoczne: hero ma tu nieść
   zdjęcia i tekst, nie teksturę. Biel i czerń o niskiej alfie działają
   w obu motywach bez osobnych wartości. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    29deg,
    rgb(255 255 255 / 0) 0,
    rgb(255 255 255 / .016) 6px,
    rgb(255 255 255 / 0) 12px,
    rgb(0 0 0 / .012) 18px,
    rgb(255 255 255 / 0) 24px);
}

/* Treść musi być nad fakturą: ::before jest pozycjonowane, a .hero__inner nie. */
.hero__inner { position: relative; }

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  align-items: center;
  gap: clamp(30px, 5vw, 68px);
  padding-block: clamp(40px, 7vw, 88px);
}
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: 30px; }
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(32px, 5.4vw, 58px);
  letter-spacing: -.025em;
  line-height: 1.03;
  text-wrap: balance;
}

.hero__lead {
  margin-top: 18px;
  max-width: 48ch;
  font-size: clamp(15px, 2.1vw, 18px);
  color: var(--hero-lead);
}

.hero__mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.hero__mosaic figure {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.hero__mosaic img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(.4, 0, .2, 1);
}
.hero__mosaic figure:hover img { transform: scale(1.04); }
.hero__mosaic figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 14px 11px;
  background: linear-gradient(180deg, transparent, rgba(8, 10, 11, .85));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #dfe6e2;
}
.hero__mosaic figure:nth-child(odd) { transform: translateY(-12px); }
.hero__mosaic figure:nth-child(even) { transform: translateY(12px); }

/* Rotacja kadrów: w HTML-u jest ich więcej, widać cztery pierwsze. Skrypt
   wygasza kafelek, przenosi na jego miejsce kolejny z puli i wgasza go. */
.hero__mosaic figure:nth-child(n + 5) { display: none; }
.hero__mosaic figure > * { transition: opacity 600ms ease; }
.hero__mosaic figure.is-out > * { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .hero__mosaic figure > * { transition: none; }
}

@media (max-width: 520px) {
  .hero__mosaic { gap: 10px; }
  .hero__mosaic figure:nth-child(odd),
  .hero__mosaic figure:nth-child(even) { transform: none; }
  .hero__mosaic figcaption { font-size: 10px; padding: 20px 10px 8px; }
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
  font-size: 13px;
  color: var(--muted);
}
.hero__note b { color: var(--text); font-weight: 600; }

/* --- Nagłówki sekcji ------------------------------------------------------- */

.section__head { max-width: 62ch; margin-bottom: clamp(24px, 4vw, 40px); }

/* Pojedyncza kolumna treści (np. FAQ) wyśrodkowana w kontenerze. */
.prose--center { margin-inline: auto; }
.section__head h2 { margin-top: 10px; }
.section__head p { margin-top: 12px; color: var(--muted); }

/* --- Oferta --------------------------------------------------------------- */

.oferta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 18px;
  list-style: none;
}

.oferta__item {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--transition), transform var(--transition);
}
.oferta__item:hover { border-color: rgb(var(--accent-rgb) / .45); transform: translateY(-3px); }

.oferta__icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.oferta__icon svg { width: 20px; height: 20px; }

.oferta__item h3 { font-size: 17px; }
.oferta__item > p { margin-top: 8px; color: var(--muted); font-size: 14px; }

.oferta__list {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 13.5px;
  color: var(--muted);
}
.oferta__list li { position: relative; padding-left: 20px; }
.oferta__list li + li { margin-top: 7px; }
.oferta__list li::before {
  content: '';
  position: absolute;
  left: 2px; top: .55em;
  width: 8px; height: 4px;
  border-left: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}

.oferta__price {
  margin-top: auto;
  padding-top: 18px;
  font-size: 13px;
  color: var(--muted-dim);
}
.oferta__price b { display: block; color: var(--text); font-size: 15px; font-weight: 700; }

/* --- Social proof ---------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-bottom: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
  list-style: none;
}
.stats li { padding: 26px 20px; background: var(--surface); text-align: center; }
.stats b {
  display: block;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stats span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

.opinie {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  list-style: none;
}

.opinia {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.opinia__stars { display: flex; gap: 3px; color: var(--accent); margin-bottom: 14px; }
.opinia__stars svg { width: 15px; height: 15px; }
.opinia blockquote { font-size: 15px; line-height: 1.65; color: var(--text); }
.opinia figcaption { margin-top: 16px; font-size: 13px; color: var(--muted); }
.opinia figcaption b { display: block; color: var(--text); font-weight: 600; }

/* Wyraźne oznaczenie miejsc na prawdziwe opinie - do usunięcia po uzupełnieniu. */
.opinia--placeholder { border-style: dashed; border-color: var(--line-strong); }
.opinia--placeholder blockquote { color: var(--muted-dim); font-style: italic; }

/* --- Realizacje ------------------------------------------------------------ */

.realizacje {
  display: grid;
  /* auto-fill, nie auto-fit: po zawężeniu filtra jedna karta ma zostać
     w swoim rozmiarze, zamiast rozciągać się na całą szerokość. */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  list-style: none;
}

.realizacja {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
}
.realizacja img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(.4, 0, .2, 1), filter var(--transition);
  filter: saturate(.92);
}
.realizacja:hover img { transform: scale(1.05); filter: saturate(1.05); }

.realizacja__body {
  position: absolute;
  inset: auto 0 0;
  padding: 18px;
  /* Trzy przystanki zamiast dwóch: na jasnych kadrach (droga, śnieg, scena)
     przy dwóch przystankach linijka „Sport · trasa" gubiła się w tle. */
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(8, 10, 11, .55) 34%,
    rgba(8, 10, 11, .92) 68%);
  color: var(--on-photo);
}
.realizacja__meta {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  /* Ta linijka siedzi najwyżej, czyli tam, gdzie gradient jest jeszcze słaby -
     cień ratuje ją na jasnych kadrach (droga, śnieg, scena). */
  text-shadow: 0 1px 6px rgba(8, 10, 11, .9);
}
.realizacja__body h3 { margin-top: 5px; font-size: 16px; }
.realizacja__body p { margin-top: 3px; font-size: 13px; color: var(--on-photo-muted); }

.realizacja--soon {
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 14px;
}

/* --- O mnie ---------------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 260px; }
}

.about__photo {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.about__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.about__sign {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* --- Formularz ------------------------------------------------------------- */

.kontakt {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}
@media (max-width: 860px) { .kontakt { grid-template-columns: 1fr; } }

.form { display: grid; gap: 16px; }

.form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text); }
.field > label span { color: var(--muted-dim); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color var(--transition), background var(--transition);
}
.field textarea { min-height: 130px; resize: vertical; }
.field select { appearance: none; cursor: pointer; }

.field input::placeholder,
.field textarea::placeholder { color: var(--muted-dim); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}

.field[data-invalid='true'] input,
.field[data-invalid='true'] select,
.field[data-invalid='true'] textarea { border-color: #d97066; }

.field__error { font-size: 12.5px; color: #e08c83; }

.field--consent {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}
.field--consent input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--accent); }
.field--consent label { font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.5; }
.field--consent .field__error { grid-column: 1 / -1; }

/* pułapka na roboty - użytkownik tego nie widzi */
.form__trap {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form__submit .btn[aria-busy='true'] { opacity: .6; pointer-events: none; }

.form__status { font-size: 14px; }
.form__status[data-state='ok'] { color: var(--accent-strong); }
.form__status[data-state='error'] { color: #e08c83; }

.kontakt__direct { display: grid; gap: 14px; }

.kontakt__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition);
}
.kontakt__link:hover { border-color: var(--accent); color: var(--text); }
.kontakt__link svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.kontakt__link span { display: block; font-size: 12px; color: var(--muted); }
.kontakt__link b { display: block; margin-top: 2px; font-size: 14.5px; font-weight: 600; }

@media (max-width: 700px) {
  .hero__note { gap: 6px 14px; font-size: 12px; }
}

/* ===========================================================================
   Bloki przeniesione z szablonu OW-strona: odsłanianie sekcji, filtr
   portfolio, ikony przy liczbach, FAQ jako akordeon, sekcja domykająca
   i ikony w stopce. Wygląd - tokeny i typografia jak w reszcie serwisu.
   =========================================================================== */

/* --- Odsłanianie sekcji przy przewijaniu ---------------------------------- */

/* Stan początkowy tylko przy włączonym JS - bez skryptu sekcje są widoczne
   od razu. Klasę `js` dokłada znacznik w <head>. */
.js .fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms cubic-bezier(.4, 0, .2, 1),
              transform 520ms cubic-bezier(.4, 0, .2, 1);
}
.js .fade-in.visible { opacity: 1; transform: none; }

/* Przy wyłączonych animacjach nic nie chowamy. Globalna reguła w strona.css
   skraca same przejścia - to za mało, gdyby obserwator nie zdążył zadziałać. */
@media (prefers-reduced-motion: reduce) {
  .js .fade-in { opacity: 1; transform: none; }
}

/* --- Filtr portfolio ------------------------------------------------------ */

.filtr {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filtr__btn {
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.filtr__btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.filtr__btn[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-deep);
}

.filtr__licznik {
  margin-bottom: 18px;
  font-size: 12.5px;
  color: var(--muted-dim);
  /* rezerwa wysokości, żeby siatka nie skakała przy zmianie tekstu */
  min-height: 1.4em;
}

/* Na telefonie pasek kategorii przewija się w bok - tak samo jak listwa
   faktów nad galerią. */
@media (max-width: 700px) {
  .filtr {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(clamp(16px, 4vw, 32px) * -1);
    padding-inline: clamp(16px, 4vw, 32px);
    scrollbar-width: none;
  }
  .filtr::-webkit-scrollbar { display: none; }
  .filtr__btn { flex: none; }
}

/* Karty wchodzą kolejno po zmianie kategorii; odstęp ustawia glowna.js. */
.realizacje--anim li:not([hidden]) {
  animation: karta-wchodzi 340ms cubic-bezier(.4, 0, .2, 1) both;
  animation-delay: var(--opoznienie, 0ms);
}
@keyframes karta-wchodzi {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* --- Ikona w kafelku liczb ------------------------------------------------ */

.stats__ikona {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin: 0 auto 14px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.stats__ikona svg { width: 21px; height: 21px; }

/* --- FAQ jako akordeon ---------------------------------------------------- */

/* Rozwijaniem zajmuje się sam <details> - bez JavaScriptu. Atrybut `name`
   sprawia, że w nowszych przeglądarkach otwarta zostaje jedna odpowiedź;
   w starszych można otworzyć kilka naraz i to też jest w porządku. */
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 0;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { transition: color var(--transition); }
.faq summary:hover h3 { color: var(--accent-strong); }

.faq summary::after {
  content: '+';
  flex: none;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  transition: transform var(--transition);
}
.faq details[open] summary::after { transform: rotate(45deg); }

.faq details > p { margin-top: 10px; }

/* --- Sekcja domykająca ---------------------------------------------------- */

.cta {
  padding: clamp(38px, 6vw, 64px) clamp(20px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 50% 0%, rgb(var(--accent-rgb) / .16), transparent 62%),
    var(--surface);
  text-align: center;
}
.cta h2 { max-width: 22ch; margin-inline: auto; }
.cta p { margin-top: 12px; max-width: 52ch; margin-inline: auto; color: var(--muted); }
.cta .btn-row { justify-content: center; }

/* Formularz wewnątrz wyśrodkowanego bloku CTA: własna szerokość, tekst do lewej,
   a reguły .cta p (kolor, szerokość) nie mogą nadpisać komunikatów pól. */
.cta__form { max-width: 680px; margin: 32px auto 0; text-align: left; }
.cta__form p { max-width: none; margin-top: 0; color: inherit; }
.cta__form .field__error,
.cta__form .form__status[data-state='error'] { color: #e08c83; }
.cta__form .form__status[data-state='ok'] { color: var(--accent-strong); }

/* --- Ikony w stopce ------------------------------------------------------- */

.social { display: flex; gap: 8px; }
.social a {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: all var(--transition);
}
.social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.social svg { width: 17px; height: 17px; }
