/* ============================================================
   STYLES.CSS – WERSJA OCZYSZCZONA (jedno źródło prawdy)
   - bez duplikatów
   - spójne breakpointy
   - TOPBAR + hamburger zgodny z JS: .nav-toggle + #site-nav.nav--open
============================================================ */

/* ============================================================
   RESET + TYPOGRAFIA BAZOWA
============================================================ */
* { box-sizing: border-box; }
html { height: 100%; }
body, h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:root { --bg-shift: 0px; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  color: var(--white);

  /* Tło sterowane przez body::after (hybrid scroll-stop) */
  background: none;
  background-color: #0b1220;

  /* JS aktualizuje tę zmienną (px) */
  /*--bg-shift: 0px;*/
}


/* Tło dla podstron (np. kalendarz.html) */
/* Podstrony (np. kalendarz.html) – obraz tła jest w body.subpage::after */
body.subpage {
  background: none;
  background-color: #0b1220;
}


/* Stałe przyciemnienie tła */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 28, 0.30);
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   HYBRID BACKGROUND (scroll -> stop na końcu obrazka)
============================================================ */

/* warstwa obrazu */
body::after{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;

  /* domyślny obraz dla strony głównej */
  background-image: image-set(
    url("tlo.avif") type("image/avif"),
    url("tlo.webp") type("image/webp"),
    url("tlo.png")  type("image/png")
  );

  /* WAŻNE: cały obraz, bez cropu */
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-color: #0b1220;

  /* klucz: przesuwamy pozycję tła, nie element */
  background-position: 50% calc(0px - var(--bg-shift));
  will-change: background-position;
}

/* podstrony */
body.subpage::after{
  background-image: image-set(
    url("tlo_1.avif") type("image/avif"),
    url("tlo_1.webp") type("image/webp"),
    url("tlo_1.png")  type("image/png")
  );

  /* spójnie: też 100% auto (żeby dało się przewijać cały obraz) */
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-color: #0b1220;
  background-position: 50% calc(0px - var(--bg-shift));
  will-change: background-position;
}

/* ============================================================
   HYBRID BACKGROUND (scroll -> stop na końcu obrazu)
   - body::after to warstwa tła
   - JS ustawia --bg-shift (px), a my przesuwamy warstwę w górę
============================================================ */


p { margin: 0 0 14px; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h2 {
  margin-top: 10px;
  margin-bottom: 10px;
}

/* ============================================================
   SKIP LINK (A11Y)
============================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(10, 16, 28, 0.9);
  color: #fff;
  outline: 2px solid var(--gold);
}

/* ============================================================
   ZMIENNE
============================================================ */
:root {
  /* Kolory bazowe */
  --bg: #0f172a;
  --ink: #0b1220;
  --ink-soft: rgba(11, 18, 32, .82);
  --white: rgba(255, 255, 255, 0.80);

  /* Akcent */
  --gold: #b98b4a;
  --gold-2: #a67c00;

  /* Karty */
  --card-bg: rgba(255,255,255,.12);
  --card-border: rgba(255,255,255,.18);
  --radius: 18px;

  /* Cienie */
  --shadow: 0 18px 40px rgba(0,0,0,.25);

  /* Kontenery */
  --container: 1120px;
  --container-pad: 24px;

  /* ~10mm (użyteczne jako stała) */
  --shift-10mm: 38px;

  /* Sekcje */
  --section-pad: 20px;

  /* Hero overlay */
  --overlay-dark: rgba(11, 18, 32, .22);
  --overlay-soft: rgba(11, 18, 32, .18);

  /* Kontakt */
  --contact-form-maxw: 560px;

  /* HERO: dopasowanie karty do ilustracji */
  --hero-card-maxw: 420px;
  --hero-card-offset-x: 24px;
}

/* ============================================================
   UTIL / LAYOUT
============================================================ */
.container {
  width: min(var(--container), calc(100% - (var(--container-pad) * 2)));
  margin-inline: auto;
}

.container--content { padding-top: 0; }

.section {
  padding: 100px 0;
  min-height: auto;
  color: var(--white);
  background: transparent;
}

.section--soft { background: transparent; }

.lead {
  color: rgba(255,255,255,.80);
  max-width: 62ch;
}

.muted { color: rgba(255,255,255,.70); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

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

.list { margin: 0; padding-left: 16px; }
.list li { margin-bottom: 10px; }
.list strong { display: inline-block; min-width: 70px; }

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 600;
  letter-spacing: .2px;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
  user-select: none;
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: 1px solid var(--gold);
  color: #1a1208;
  position: relative;
  isolation: isolate;
  transform: translateZ(0);
}

.btn--primary:hover {
  background: rgba(184, 139, 65,.75);
  color: var(--white);
}

.btn--ghost {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1208;
  border: 1px solid var(--gold);
}

.btn--ghost:hover {
  background: rgba(184, 139, 65,.75);
  color: var(--white);
}

.btn--block { width: 100%; }

/* Premium halo – idle + hover/focus */
.btn--primary::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      120% 120% at 50% 55%,
      color-mix(in srgb, var(--gold-2) 62%, transparent) 0%,
      color-mix(in srgb, var(--gold)   38%, transparent) 28%,
      transparent 70%
    );
  opacity: .22;
  filter: blur(10px);
  transform: scale(0.985);
  transition: opacity .22s ease, filter .22s ease, transform .22s ease;
  animation: ctaHaloPulse 2.6s ease-in-out infinite;
}

.btn--primary:hover::after { opacity: .36; filter: blur(11px); transform: scale(1.01); }
.btn--primary:focus-visible { outline: none; }
.btn--primary:focus-visible::after { opacity: .48; filter: blur(12px); transform: scale(1.03); }

@keyframes ctaHaloPulse {
  0%   { opacity: .20; transform: scale(0.985); }
  45%  { opacity: .28; transform: scale(1.005); }
  100% { opacity: .20; transform: scale(0.985); }
}

@media (prefers-reduced-motion: reduce) {
  .btn--primary::after { animation: none; }
}

/* ============================================================
   TOPBAR / NAV – FINAL (zgodne z JS)
============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 16, 28, .55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.18);

  /* ~10mm max (zmniejsza się na mniejszych ekranach) */
  --edge-pad: clamp(16px, 2.8vw, 38px);
}

/* HTML: <div class="container topbar__inner"> …
   .container ogranicza do 1120px, a topbar ma być full-width */
.topbar__inner.container {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 18px);
  padding: 6px var(--edge-pad);
  position: relative;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.5vw, 40px);
  margin-left: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title {
  font-weight: 800;
  letter-spacing: .2px;
  color: color-mix(in srgb, var(--gold), transparent 5%);
}

.brand__subtitle {
  font-size: 13px;
  color: color-mix(in srgb, var(--gold), transparent 5%);
}

.brand-divider {
  width: 1px;
  height: 30px;
  background: color-mix(in srgb, var(--gold), transparent 5%);
}

/* Desktop nav (>=1101px) */
#site-nav.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.2vw, 16px);
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

.nav__link {
  font-weight: 600;
  color: color-mix(in srgb, var(--gold), transparent 5%);
  padding: 10px 12px;
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease;
}

.nav__link:hover {
  background: color-mix(in srgb, var(--gold), transparent 90%);
  color: color-mix(in srgb, var(--gold-2), transparent 5%);
}

.nav__link--btn {
  border: 1px solid color-mix(in srgb, var(--gold-2), transparent 5%);
  background: color-mix(in srgb, var(--gold), transparent 95%);
}

/* Hamburger button (desktop hidden) */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--gold), transparent 5%);
  color: color-mix(in srgb, var(--gold), transparent 5%);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.nav-toggle__icon {
  display: block;
  position: relative;
  width: 20px;
  height: 2px;
  background: color-mix(in srgb, var(--gold), transparent 5%);
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: color-mix(in srgb, var(--gold), transparent 5%);
}

.nav-toggle__icon::before { top: -6px; }
.nav-toggle__icon::after  { top:  6px; }


/* ============================================================
   HERO
============================================================ */
.hero {
  position: relative;
  color: var(--white);
  padding: 20px 0 20px;
  overflow: hidden;
  background: transparent;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, var(--hero-card-maxw));
  gap: 32px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(34px, 4.4vw, 58px);
  letter-spacing: .2px;
  margin-bottom: 14px;
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 16px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.82);
  font-weight: 600;
  font-size: 13px;
}

.hero__card {
  margin-left: 0;
  width: 100%;
  max-width: var(--hero-card-maxw);
  justify-self: end;
  align-self: flex-start;
  margin-top: 85px;
  transform: translateX(var(--hero-card-offset-x));

  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: none;
}

.hero__card h3,
.hero__card p,
.hero__card li {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}

.checklist li {
  position: relative;
  padding-left: 22px;
  color: rgba(255,255,255,.84);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold-2);
  font-weight: 800;
}

/* ============================================================
   FORMY
============================================================ */
.form {
  display: grid;
  gap: 12px;
}

.form label span {
  display: block;
  font-weight: 700;
  color: rgba(255,255,255,.84);
  margin-bottom: 6px;
  font-size: 13px;
}

.form input,
.form textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  outline: none;
}

.form input:focus,
.form textarea:focus {
  border-color: rgba(198, 161, 97, .65);
}

/* ============================================================
   FOOTER
============================================================ */
.footer {
  padding: 12px 0;
  background: rgba(0,0,0,.80);
  color: color-mix(in srgb, var(--gold), transparent 5%);
  border-top: 1px solid rgba(255,255,255,.18);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer__copyright {
  color: color-mix(in srgb, var(--gold), transparent 15%);
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer__links a {
  color: color-mix(in srgb, var(--gold), transparent 15%);
}

.footer__links a:hover { text-decoration: underline; }

/* ============================================================
   PODSTRONY (Aktualności / Dokumenty / Kalendarz)
============================================================ */
.hero--subpage { padding: 28px 0 12px; }
.section--subpage { padding: 48px 0 72px; }

body.subpage .section--subpage + .section--subpage { margin-top: 40px; }

.container--subpage,
.container--subpage-box {
  width: min(var(--container), calc(100% - (var(--container-pad) * 2)));
  margin-inline: auto;
}

.section__head { margin-bottom: 18px; }

.embed {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: calc(var(--radius) - 6px);
  margin-bottom: 28px;
}

.embed iframe {
  display: block;
  width: 100%;
  height: min(72vh, 820px);
  border: 0;
}

.card--calendly { padding: 16px; }

/* ============================================================
   BADGE – OFICJALNY (PREMIUM)
============================================================ */
.badge--official {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
  color: #1a1a1a;
  background: linear-gradient(135deg, #e8c67a 0%, #d4a94f 40%, #f3d991 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #b8872b);
}

.card--official:hover .badge--official {
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Karty: akcje na dole */
.card .btn { margin-top: auto; }
.card .actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card.post { display: flex; flex-direction: column; }
.card.post .actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.card.post .actions .btn { width: auto; }

/* PODSTRONY – odstępy i akcje pod sekcjami */
.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 80px;
}

.actions--centered { justify-content: center; }

/* ============================================================
   DOKUMENTY – WSZYSTKIE PRZYCISKI ZŁOTE
============================================================ */
.section--subpage .btn--tiny {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1208;
  border: 1px solid var(--gold);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.section--subpage .btn--tiny:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.45);
  background: rgba(184, 139, 65,.75);
  color: var(--white);
}

/* ============================================================
   LUXURY HOVER (HOME + PODSTRONY)
============================================================ */
body.home #aktualnosci .card,
body.home #dokumenty .card,
.section--subpage .card {
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

body.home #aktualnosci .card:hover,
body.home #dokumenty .card:hover,
.section--subpage .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 60px rgba(212, 169, 79, 0.22);
  border-color: rgba(212, 169, 79, 0.45);
}

body.home #aktualnosci .card::before,
body.home #dokumenty .card::before,
.section--subpage .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}

body.home #aktualnosci .card:hover::before,
body.home #dokumenty .card:hover::before,
.section--subpage .card:hover::before {
  animation: shimmer 1.4s ease forwards;
}

@keyframes shimmer { 100% { left: 140%; } }

/* ============================================================
   ARTICLE (wpisy) – układ + typografia premium
============================================================ */
.article {
  max-width: 920px;
  margin: 0 auto;
  animation: articleFade 0.55s ease forwards;
  opacity: 0;
  transform: translateY(6px);
}

@keyframes articleFade { to { opacity: 1; transform: translateY(0); } }

.article h1 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.article p {
  margin-top: 10px;
  line-height: 1.75;
  max-width: 76ch;
}

.article ul { margin-top: 10px; padding-left: 18px; }
.article li { margin: 8px 0; }

.article__meta {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.article__meta .pill {
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
}

.article__rule {
  height: 1px;
  margin: 18px 0 10px;
  background: linear-gradient(90deg, rgba(212,169,79,.55), rgba(255,255,255,.10), rgba(212,169,79,.10));
}

.article h2 {
  margin-top: 28px;
  font-size: 20px;
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: 10px;
}

.article h2::after {
  content: "";
  display: block;
  height: 1px;
  width: 84px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--gold), rgba(212,169,79,0.18));
}

/* ============================================================
   BREADCRUMBS – glass premium
============================================================ */
.breadcrumbs {
  margin-top: 18px;
  padding: 12px 18px;
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  background: rgba(12, 18, 32, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(212,169,79,0.25);
  border-radius: 8px;
  animation: breadcrumbsFade 0.6s ease forwards;
  opacity: 0;
  transform: translateY(4px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

@keyframes breadcrumbsFade { to { opacity: 1; transform: translateY(0); } }

.breadcrumbs:hover {
  background: rgba(12, 18, 32, 0.55);
  border-color: rgba(212,169,79,0.45);
}

.breadcrumbs__link {
  position: relative;
  color: rgba(255,255,255,0.82);
  transition: color 0.25s ease;
}

.breadcrumbs__link:hover { color: var(--gold); }

.breadcrumbs__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 1px;
  background: var(--gold);
  transition: width 0.35s ease;
}

.breadcrumbs__link:hover::after { width: 100%; }

.breadcrumbs__sep { color: rgba(212,169,79,0.85); }

.breadcrumbs__current {
  color: rgba(255,255,255,0.92);
  max-width: 52ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   CTA – wspólne (home + wpisy + inne)
============================================================ */
.card--cta {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card--cta .btn { margin-top: 16px; }

.card--cta,
.article__cta,
.cta-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 169, 79, 0.40);
  background: linear-gradient(145deg, rgba(212, 169, 79, 0.15), rgba(212, 169, 79, 0.05));
  box-shadow: 0 18px 60px rgba(0,0,0,0.30);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.card--cta:hover,
.article__cta:hover,
.cta-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 60px rgba(212, 169, 79, 0.35);
  border-color: rgba(212, 169, 79, 0.50);
}

.card--cta::before,
.article__cta::before,
.cta-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
}

.card--cta:hover::before,
.article__cta:hover::before,
.cta-card:hover::before {
  animation: shimmer 1.4s ease forwards;
}

.article__cta {
  margin-top: 36px;
  padding: 28px 32px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.article__cta p { margin-top: 0; max-width: 80ch; }
.article__cta .btn { margin-top: 12px; }

/* Subtelny halo pulse – primary CTA w artykule */
.article__cta .btn.btn--primary {
  position: relative;
}

.article__cta .btn.btn--primary::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  border: 1px solid rgba(212,169,79,0.35);
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  animation: haloPulse 3.6s ease-in-out infinite;
}

@keyframes haloPulse {
  0%, 70% { opacity: 0; transform: scale(0.98); }
  80% { opacity: 0.55; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.05); }
}

/* ============================================================
   TO TOP – premium
============================================================ */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(212,169,79,0.45);
  background: rgba(12,18,32,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--gold);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, border-color .25s ease;
}

.to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.to-top:hover { border-color: rgba(212,169,79,0.65); }

/* ============================================================
   Sticky CTA – desktop only
============================================================ */
.sticky-cta { display: none; }

@media (min-width: 1101px) {
  .sticky-cta {
    display: block;
    position: sticky;
    top: 110px;
    align-self: start;
    margin-left: 24px;
  }

  .section--subpage .container--subpage.article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
  }

  .sticky-cta__box {
    padding: 18px 18px;
    border-radius: 16px;
    border: 1px solid rgba(212,169,79,0.35);
    background: rgba(12,18,32,0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 18px 60px rgba(0,0,0,0.30);
  }

  .sticky-cta__title { font-weight: 700; letter-spacing: -0.01em; }
  .sticky-cta__text { margin-top: 8px; opacity: 0.85; line-height: 1.6; }

  .sticky-cta__box .btn {
    margin-top: 14px;
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   Expert box – premium
============================================================ */
.expert-box {
  margin-top: 26px;
  padding: 22px 26px;
  border-radius: 16px;
  border: 1px solid rgba(212,169,79,0.35);
  background: linear-gradient(145deg, rgba(212,169,79,0.10), rgba(12,18,32,0.35));
  box-shadow: 0 18px 60px rgba(0,0,0,0.28);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.expert-box__title { font-weight: 800; letter-spacing: -0.01em; }
.expert-box__text { margin-top: 10px; opacity: 0.88; line-height: 1.75; max-width: 78ch; }
.expert-box .btn { margin-top: 14px; }

.expert-box::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -120%;
  width: 80%;
  height: 200%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.06) 40%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0.06) 60%,
    rgba(255,255,255,0) 100%
  );
  transform: rotate(20deg);
  transition: all 0.9s ease;
}

.expert-box:hover::after { left: 130%; }

/* ============================================================
   Author signature – premium + reveal on scroll
============================================================ */
.author-sign {
  margin-top: 12px;
  margin-bottom: 24px;
  text-align: left;
  opacity: 0;
  transform: translateY(14px);
  filter: blur(2px);
  transition: opacity .6s ease, transform .6s ease, filter .6s ease;
  will-change: opacity, transform, filter;
}

.author-sign.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.author-sign__name {
  position: relative;
  display: inline-block;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(212,169,79,0.18);
}

.author-sign.is-visible .author-sign__name {
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 62%, transparent 100%);
  -webkit-mask-size: 240% 100%;
  -webkit-mask-position: 120% 0;
  mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 62%, transparent 100%);
  mask-size: 240% 100%;
  mask-position: 120% 0;
  animation: inkRevealText 1.05s ease forwards;
}

@keyframes inkRevealText {
  to {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

.author-sign__role {
  position: relative;
  display: block;
  font-size: 0.95rem;
  opacity: 0.85;
}

.author-sign__role::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  bottom: -10px;
  width: 64%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(212,175,55,0) 0%,
    rgba(212,175,55,0.95) 50%,
    rgba(212,175,55,0) 100%
  );
  opacity: 0;
}

.author-sign.is-visible .author-sign__role::after {
  opacity: 1;
  animation: inkStroke 0.85s ease forwards 0.35s;
}

@keyframes inkStroke {
  to { transform: translateX(-50%) scaleX(1); }
}

/* ============================================================
   NUMERACJA H2 (opcjonalnie) – post--numbered
============================================================ */
body.post--numbered #post-content { counter-reset: h2count; }

body.post--numbered #post-content h2 {
  counter-increment: h2count;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  position: relative;
  padding-left: 0;
  margin: 26px 0 14px;
}

body.post--numbered #post-content h2::before {
  content: counter(h2count) ".";
  color: var(--gold);
  font-weight: 700;
  flex: 0 0 auto;
}

body.post--numbered #post-content h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 120px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(212,175,55,0.95) 0%,
    rgba(212,175,55,0.35) 70%,
    rgba(212,175,55,0) 100%
  );
  opacity: 0.95;
}

/* ============================================================
   RELATED POSTS
============================================================ */
.related .section__head { margin-bottom: 18px; }
.related .card.post { transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease; }
.related .card.post:hover { transform: translateY(-4px); box-shadow: 0 18px 60px rgba(0,0,0,0.28); }

/* ============================================================
   AUTO DRAW GOLD UNDERLINE – .list strong (opcjonalnie)
============================================================ */
.list strong { position: relative; display: inline-block; }

.list strong::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, #c8a63a 0%, #fef3c7 50%, #c8a63a 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease;
}

.list strong::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, #d4af37 0%, #fcf6ba 50%, #d4af37 100%);
  filter: blur(3px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.list-animate strong::after { transform: scaleX(1); }
.list-animate strong::before { opacity: 0.6; }

.list-animate li:nth-child(1) strong::after,
.list-animate li:nth-child(1) strong::before { transition-delay: 0.00s; }

.list-animate li:nth-child(2) strong::after,
.list-animate li:nth-child(2) strong::before { transition-delay: 0.14s; }

.list-animate li:nth-child(3) strong::after,
.list-animate li:nth-child(3) strong::before { transition-delay: 0.28s; }

/* ============================================================
   RESPONSIVE STRUCTURE – desktop -> tablet -> mobile
============================================================ */

/* ============================================================
   <= 1200px | small desktop / laptop
============================================================ */
@media (max-width: 1200px) {
  .topbar__inner {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ============================================================
   <= 1100px | tablet landscape / mobile nav
============================================================ */
@media (max-width: 1100px) {
  .nav-toggle {
    display: inline-flex;
  }

  #site-nav.nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    width: min(360px, calc(100vw - (2 * var(--edge-pad))));
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 10px;
    border-radius: 16px;
    background: rgba(10, 16, 28, .96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.18);
    z-index: 1001;
    white-space: normal;
  }

  #site-nav.nav.nav--open {
    display: flex;
  }

  #site-nav.nav .nav__link {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
  }

  #site-nav.nav .nav__link--btn {
    align-self: flex-start;
    width: auto;
    border: 1px solid color-mix(in srgb, var(--gold-2), transparent 5%);
    background: color-mix(in srgb, var(--gold), transparent 95%);
    border-radius: 999px;
    padding: 10px 12px;
  }

  #site-nav.nav .nav__link--btn:hover {
    background: color-mix(in srgb, var(--gold), transparent 90%);
    color: color-mix(in srgb, var(--gold-2), transparent 5%);
  }

  #site-nav.nav .nav__link--btn:active {
    transform: translateY(1px);
  }
}

/* ============================================================
   <= 1024px | tablet
============================================================ */
@media (max-width: 1024px) {
  .grid3,
  .grid2 {
    grid-template-columns: 1fr;
  }

  .hero__card {
    margin-left: 0;
    transform: none;
  }

  .hero__grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   <= 768px | large mobile / small tablet
============================================================ */
@media (max-width: 768px) {
  body::after,
  body.subpage::after {
    inset: 0 auto auto 0;
    width: 100%;
    height: var(--bg-layer-height, 100vh);

    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: top center;

    transform: translate3d(0, calc(-1 * var(--bg-shift)), 0);
    will-change: transform;
  }

  .brand-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .brand-divider {
    display: none;
  }
}

/* ============================================================
   <= 640px | consent modal mobile
============================================================ */
@media (max-width: 640px) {
  .consent-modal {
    padding: 12px;
  }

  .consent-modal__dialog {
    width: calc(100vw - 24px);
    padding: 20px 16px;
  }

  .consent-modal__actions {
    flex-direction: column-reverse;
  }

  .consent-modal__actions .btn {
    width: 100%;
  }
}

/* ============================================================
   <= 600px | mobile
============================================================ */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 28px;
  }

  .section {
    padding: 60px 0;
  }

  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

/* ============================================================
   <= 400px | small mobile
============================================================ */
@media (max-width: 400px) {
  .topbar__inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-toggle {
    padding: 7px 10px;
  }

  .brand__subtitle {
    font-size: 12px;
  }
}

/* ============================================================
   CONSENT MODAL – UX FINAL
============================================================ */

.consent-modal[hidden] {
  display: none !important;
}

.consent-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  z-index: 1200;
  overflow-y: auto;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.26s ease,
    visibility 0.26s ease;
}

.consent-modal.is-open,
.consent-modal.is-closing {
  visibility: visible;
}

.consent-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.consent-modal.is-closing {
  opacity: 0;
  pointer-events: none;
}

.consent-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 12, 22, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.26s ease;
}

.consent-modal.is-open .consent-modal__backdrop {
  opacity: 1;
}

.consent-modal.is-closing .consent-modal__backdrop {
  opacity: 0;
}

.consent-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 28px;
  border-radius: 16px;

  background: rgba(12,18,32,0.92);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);

  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 0.26s ease,
    transform 0.26s ease,
    box-shadow 0.26s ease;
  outline: none;
}

.consent-modal.is-open .consent-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.consent-modal.is-closing .consent-modal__dialog {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
}

.consent-modal__dialog:focus {
  outline: none;
}

.consent-modal__dialog:focus-visible {
  box-shadow:
    0 18px 60px rgba(0,0,0,.35),
    0 0 0 1px rgba(185, 139, 74, 0.25),
    0 0 0 4px rgba(185, 139, 74, 0.08);
}

.consent-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.consent-modal__close:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.consent-modal__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(185, 139, 74, 0.22);
}

.consent-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
}

.consent-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

#consentError {
  color: #ffb3b3;
  font-size: 13px;
  margin-top: 6px;
}

.consent-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

body.consent-modal-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .consent-modal,
  .consent-modal__backdrop,
  .consent-modal__dialog,
  .consent-modal__close {
    transition: none;
  }
}

/* ============================================================
   LOADING STATE – formularz kontaktowy
============================================================ */

#openConsentModal,
#confirmConsentSubmit {
  position: relative;
}

#openConsentModal.is-loading,
#confirmConsentSubmit.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0.92;
}

#openConsentModal:disabled,
#confirmConsentSubmit:disabled {
  cursor: not-allowed;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  flex: 0 0 16px;
  animation: btnSpinnerRotate 0.7s linear infinite;
}

@keyframes btnSpinnerRotate {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   INLINE VALIDATION – błędy pod polami
============================================================ */

.form label {
  display: block;
}

.form input.is-invalid,
.form textarea.is-invalid {
  border-color: rgba(255, 140, 140, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 140, 140, 0.18);
}

.form label.has-error span {
  color: #ffcccc;
}

.form-error {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.4;
  color: #ffb8b8;
}

.form-error[hidden] {
  display: none;
}

/* ============================================================
   SUCCESS / STATUS STATE – formularz kontaktowy
============================================================ */

#formMsg {
  margin-top: 14px;
  padding: 0;
  min-height: 0;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    background-color 0.28s ease,
    border-color 0.28s ease,
    color 0.28s ease,
    box-shadow 0.28s ease,
    padding 0.28s ease;
}

#formMsg.is-visible {
  opacity: 1;
  transform: translateY(0);
  padding: 12px 14px;
}

#formMsg.is-error {
  color: #ffd4d4;
  background: rgba(120, 24, 24, 0.22);
  border: 1px solid rgba(255, 140, 140, 0.28);
  border-radius: 12px;
}

#formMsg.is-success {
  color: #f4e7c7;
  background:
    linear-gradient(135deg, rgba(185, 139, 74, 0.20), rgba(166, 124, 0, 0.10));
  border: 1px solid rgba(185, 139, 74, 0.34);
  border-radius: 12px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(185, 139, 74, 0.06) inset;
}

.form.is-success {
  animation: formSuccessPulse 0.75s ease;
}

@keyframes formSuccessPulse {
  0% {
    transform: translateY(0);
    filter: brightness(1);
  }
  35% {
    transform: translateY(-2px);
    filter: brightness(1.04);
  }
  100% {
    transform: translateY(0);
    filter: brightness(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #formMsg {
    transition: none;
  }

  .form.is-success {
    animation: none;
  }
}