/* =========================================================================
   Invest Secure - arkusz główny
   1.  Tokeny            7.  Nagłówek i nawigacja   13. Zespół
   2.  Reset             8.  Sekcje - układy        14. Blog
   3.  Typografia        9.  Hero                   15. Artykuł
   4.  Motywy            10. Usługi                 16. Formularze
   5.  Utility           11. Karty, liczby, wartości 17. Stopka
   6.  Przyciski         12. Akordeon, rozdział     18. Animacje i druk
   ====================================================================== */

/* 1. TOKENY ============================================================ */

:root {
  /* Barwy */
  --navy-base: #071523;
  --navy-panel: #0b1c2d;
  --navy-deep: #04101c;
  --navy-raise: #103049;

  --gold: #ca9e67;
  --gold-light: #dfc092;
  --gold-dark: #9e865f;
  --gold-band: #d0b083;

  --ivory: #ede8de;
  --ivory-dim: #e4dfd4;

  --text-light: #f1ede5;
  --text-muted: #93a0ab;
  --text-dark: #071523;
  --text-dark-muted: #5f5749;

  --line: rgba(158, 134, 95, 0.35);
  --line-soft: rgba(202, 158, 103, 0.22);
  --line-light: rgba(7, 21, 35, 0.12);

  /* Typografia */
  --font-serif: 'Playfair Display', 'Times New Roman', serif;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --fs-h1: clamp(2.5rem, 1.4rem + 4.6vw, 6rem);
  --fs-h2: clamp(1.95rem, 1.3rem + 2.7vw, 3.6rem);
  --fs-h3: clamp(1.6rem, 1.2rem + 1.8vw, 2.8rem);
  --fs-h4: clamp(1.3rem, 1.1rem + 0.9vw, 2rem);
  --fs-lead: clamp(0.95rem, 0.9rem + 0.2vw, 1.0625rem);
  --fs-body: 0.9375rem;
  --fs-small: 0.8125rem;
  --fs-label: 0.6875rem;
  --fs-micro: 0.625rem;

  /* Przestrzeń */
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: clamp(3.5rem, 2rem + 6vw, 7rem);
  --space-3xl: clamp(4.5rem, 2rem + 9vw, 9rem);

  --container: 1440px;
  --gutter: 1.25rem;
  --header-h: 76px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.25s ease;
  --t-mid: 0.4s var(--ease);
  --t-slow: 0.8s var(--ease);
}

@media (min-width: 640px) {
  :root { --gutter: 1.75rem; }
}

@media (min-width: 1024px) {
  :root { --gutter: 3rem; --header-h: 88px; }
}

/* 2. RESET ============================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text-light);
  background-color: var(--navy-base);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img { height: auto; }

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

ul, ol { list-style: none; }

hr { border: 0; border-top: 1px solid var(--line); }

::selection {
  background-color: var(--gold);
  color: var(--navy-base);
}

/* Obrys tylko dla nawigacji klawiaturą. */
:focus:not(:focus-visible) { outline: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background-color: var(--gold);
  color: var(--navy-base);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: top var(--t-fast);
}

.skip-link:focus { top: 1rem; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 3. TYPOGRAFIA ======================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: inherit;
}

h1 i, h2 i, h3 i, h4 i {
  font-style: italic;
  color: var(--gold);
}

.text-h1 { font-size: var(--fs-h1); line-height: 0.98; }
.text-h2 { font-size: var(--fs-h2); }
.text-h3 { font-size: var(--fs-h3); line-height: 1.1; }
.text-h4 { font-size: var(--fs-h4); line-height: 1.15; }

.text-label {
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  line-height: 1.4;
  color: var(--gold);
}

.text-micro {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  line-height: 1.4;
}

.tabular-data {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 46ch;
  margin-top: var(--space-md);
  text-wrap: pretty;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: var(--space-md);
}

.eyebrow-rule {
  flex: 0 0 auto;
  width: 2rem;
  height: 1px;
  background-color: currentColor;
}

/* Treść z edytora */
.prose {
  font-size: var(--fs-lead);
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 62ch;
  text-wrap: pretty;
}

.prose > * + * { margin-top: 1.25em; }

.prose h2 {
  font-size: var(--fs-h3);
  margin-top: 2em;
  color: var(--text-light);
}

.prose h3 {
  font-size: var(--fs-h4);
  margin-top: 1.75em;
  color: var(--text-light);
}

.prose strong { color: var(--text-light); font-weight: 500; }
.prose em { color: var(--gold-light); }

.prose a {
  color: var(--gold);
  border-bottom: 1px solid currentColor;
}

.prose a:hover { color: var(--gold-light); }

.prose ul,
.prose ol { padding-left: 1.25rem; }

.prose ul li { list-style: none; position: relative; padding-left: 1.25rem; }

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 5px;
  height: 1px;
  background-color: var(--gold);
}

.prose ol { list-style: decimal; }
.prose ol li { list-style: decimal; padding-left: 0.375rem; }
.prose li + li { margin-top: 0.5em; }

.prose blockquote {
  border-left: 2px solid var(--gold);
  padding-left: 1.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25em;
  line-height: 1.4;
  color: var(--text-light);
}

/* 4. MOTYWY ============================================================ */

.theme-dark {
  background-color: var(--navy-base);
  color: var(--text-light);
}

.theme-panel {
  background-color: var(--navy-panel);
  color: var(--text-light);
}

.theme-light {
  background-color: var(--ivory);
  color: var(--text-dark);
  --text-muted: var(--text-dark-muted);
  --line: rgba(158, 134, 95, 0.4);
  --line-soft: rgba(7, 21, 35, 0.12);
}

.theme-light h1,
.theme-light h2,
.theme-light h3,
.theme-light h4 { color: var(--text-dark); }

.theme-light .prose strong { color: var(--text-dark); }
.theme-light .prose h2,
.theme-light .prose h3 { color: var(--text-dark); }
.theme-light .eyebrow,
.theme-light .text-label { color: var(--gold-dark); }

.theme-gold {
  background-color: var(--gold-band);
  color: var(--navy-base);
  --text-muted: #4d4436;
  --line: rgba(7, 21, 35, 0.2);
}

.theme-gold h1,
.theme-gold h2,
.theme-gold h3,
.theme-gold h4 { color: var(--text-dark); }

.theme-gold .eyebrow,
.theme-gold .text-label { color: var(--navy-base); }

/* Faktura papieru na jasnym tle. */
.theme-light { position: relative; isolation: isolate; }

.theme-light::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg width='400' height='400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02' numOctaves='5' stitchTiles='stitch' result='n'/%3E%3CfeColorMatrix type='matrix' values='1 0 0 0 0 0 0.98 0 0 0 0 0 0.94 0 0 0 0 0 0.1 0' in='n'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  background-size: 400px 400px;
}

/* Ziarno na całej stronie. */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Siatka techniczna. */
.terminal-grid {
  background-image:
    linear-gradient(rgba(202, 158, 103, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(202, 158, 103, 0.09) 1px, transparent 1px);
  background-size: 80px 80px;
}

.theme-light.terminal-grid {
  background-image:
    linear-gradient(rgba(7, 21, 35, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 21, 35, 0.05) 1px, transparent 1px);
}

/* 5. UTILITY =========================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; }

.section--space-none { padding-block: 0; }
.section--space-compact { padding-block: var(--space-xl); }
.section--space-normal { padding-block: var(--space-2xl); }
.section--space-roomy { padding-block: var(--space-3xl); }

.section-border-b { border-bottom: 1px solid var(--line); }

.section-head { margin-bottom: var(--space-xl); }
.section-head .lead { margin-top: var(--space-md); }

.hide-mobile { display: none; }
.hide-desktop { display: block; }

@media (min-width: 768px) {
  .hide-mobile { display: block; }
  .hide-desktop { display: none; }
}

.spacer--sm { height: var(--space-xl); }
.spacer--md { height: var(--space-2xl); }
.spacer--lg { height: var(--space-3xl); }
.spacer-rule { border-top-color: var(--line); }

/* Układ z szyną boczną. */
.layout-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.rail-col {
  padding-block: var(--space-md) var(--space-sm);
}

.content-col { padding-block: var(--space-sm) 0; }

/* Nagłówek sekcji potrzebuje oddechu przed treścią; elementy z własnym
   odstępem (kafelki, przyciski) zachowują swój. */
.content-col > :is(h2, h3) + :not(.tile-grid):not(.button-row) {
  margin-top: var(--space-md);
}

@media (min-width: 1024px) {
  .layout-rail { grid-template-columns: 3fr 9fr; }

  .rail-col {
    border-right: 1px solid var(--line);
    padding-block: 0;
    padding-right: var(--space-lg);
  }

  .content-col {
    padding-block: 0;
    padding-left: clamp(2rem, 4vw, 4rem);
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* 6. PRZYCISKI ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.9375rem 1.375rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
  background-color: transparent;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  min-height: 48px;
}

.btn .arrow {
  font-size: 1.05rem;
  line-height: 1;
  transition: transform var(--t-fast);
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--gold);
  color: var(--navy-base);
}

.btn:hover .arrow { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--navy-base);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--navy-base);
}

.theme-light .btn {
  border-color: var(--gold-dark);
  color: var(--navy-base);
}

.theme-light .btn:hover { background-color: var(--gold-dark); color: var(--ivory); }
.theme-light .btn-primary { background-color: var(--gold-dark); color: var(--ivory); border-color: var(--gold-dark); }
.theme-light .btn-primary:hover { background-color: var(--navy-base); border-color: var(--navy-base); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.link-arrow .arrow {
  font-size: 1.05rem;
  line-height: 1;
  transition: transform var(--t-fast);
}

.link-arrow:hover { color: var(--gold-light); }
.link-arrow:hover .arrow { transform: translateX(4px); }

.theme-light .link-arrow { color: var(--gold-dark); }
.theme-light .link-arrow:hover { color: var(--navy-base); }

/* 7. NAGŁÓWEK ========================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: transform var(--t-mid), background-color var(--t-mid), border-color var(--t-mid);
  border-bottom: 1px solid transparent;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background-color: rgba(7, 21, 35, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  transition: opacity var(--t-mid);
}

.theme-light .site-header::before,
body.theme-light .site-header::before { background-color: rgba(237, 232, 222, 0.82); }

.site-header.is-stuck::before { opacity: 1; }
.site-header.is-stuck { border-bottom-color: var(--line-soft); }
.site-header.is-hidden { transform: translateY(-100%); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header::before { background-color: rgba(7, 21, 35, 0.96); }
  body.theme-light .site-header::before { background-color: rgba(237, 232, 222, 0.98); }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
}

.header-logo { display: flex; align-items: center; }

.header-logo img {
  height: 34px;
  width: auto;
}

@media (min-width: 1024px) {
  .header-logo img { height: 40px; }
}

.logo-fallback {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.header-nav { display: none; }

@media (min-width: 1024px) {
  .header-nav {
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 2vw, 2.25rem);
  }
}

.nav-link {
  position: relative;
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8c6bf;
  padding-block: 0.375rem;
  white-space: nowrap;
}

body.theme-light .nav-link { color: #59524a; }

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t-mid);
}

.nav-link:hover,
.nav-link.is-current { color: var(--gold); }

.nav-link:hover::after,
.nav-link.is-current::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-cta { display: none; }

@media (min-width: 560px) {
  .header-cta {
    display: inline-flex;
    padding: 0.75rem 1.125rem;
    min-height: 42px;
  }
}

/* Panel rozwijany usług. */
.nav-dropdown-wrap { position: relative; }

.nav-dropdown-trigger { display: inline-flex; align-items: center; gap: 0.5rem; }

.nav-dropdown-trigger::after {
  content: '';
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--t-fast);
}

.nav-dropdown {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  top: calc(var(--header-h) - 6px);
  max-width: calc(var(--container) - var(--gutter) * 2);
  margin-inline: auto;
  padding-top: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--t-mid), transform var(--t-mid), visibility var(--t-mid);
  z-index: 1002;
}

.nav-dropdown-wrap:hover .nav-dropdown,
.nav-dropdown-wrap:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-wrap:hover .nav-dropdown-trigger::after,
.nav-dropdown-wrap:focus-within .nav-dropdown-trigger::after {
  transform: rotate(-135deg) translateY(-2px);
}

.nav-dropdown-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  background-color: rgba(7, 21, 35, 0.9);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}

body.theme-light .nav-dropdown-panel {
  background-color: rgba(240, 236, 228, 0.96);
  border-color: var(--line-light);
}

.nav-mega-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.75rem 1.5rem 1.5rem;
  border-left: 1px solid var(--line-soft);
  transition: background-color var(--t-fast);
}

.nav-mega-item:first-child { border-left: 0; }
.nav-mega-item:hover { background-color: rgba(202, 158, 103, 0.09); }

.nav-mega-num {
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.nav-mega-title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  margin-top: 0.875rem;
  color: var(--text-light);
  transition: color var(--t-fast);
}

body.theme-light .nav-mega-title { color: var(--navy-base); }

.nav-mega-item:hover .nav-mega-title { color: var(--gold); }

.nav-mega-sub {
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-top: 0.5rem;
}

.nav-mega-arrow {
  margin-top: 1.25rem;
  color: var(--gold);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.nav-mega-item:hover .nav-mega-arrow { opacity: 1; transform: none; }

/* Przełącznik menu mobilnego. */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0 8px;
  align-items: flex-end;
}

@media (min-width: 1024px) { .menu-toggle { display: none; } }

.menu-toggle-bar {
  display: block;
  height: 1px;
  background-color: var(--text-light);
  transition: transform var(--t-mid), width var(--t-mid), opacity var(--t-fast);
}

body.theme-light .menu-toggle-bar { background-color: var(--navy-base); }

.menu-toggle-bar:nth-child(1) { width: 26px; }
.menu-toggle-bar:nth-child(2) { width: 18px; }

.menu-toggle[aria-expanded='true'] .menu-toggle-bar:nth-child(1) {
  width: 24px;
  transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle[aria-expanded='true'] .menu-toggle-bar:nth-child(2) {
  width: 24px;
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Menu pełnoekranowe. */
.mega-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: rgba(4, 16, 28, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-mid), visibility var(--t-mid);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mega-menu.is-open { opacity: 1; visibility: visible; }

.mega-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 3rem;
  min-height: 100%;
}

.mega-menu-link {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  line-height: 1.2;
  color: var(--text-light);
  padding-block: 0.5rem;
  border-bottom: 1px solid rgba(202, 158, 103, 0.15);
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.4s ease, color var(--t-fast);
}

.mega-menu.is-open .mega-menu-link { transform: none; opacity: 1; }

.mega-menu-link:hover { color: var(--gold); }

.mega-menu-label {
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 0;
  padding-top: 1.5rem;
}

.mega-menu-sub {
  font-size: 0.9375rem;
  color: #c8c6bf;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 1px solid var(--line-soft);
  margin-left: 0.25rem;
  opacity: 0;
  transform: translateY(10px);
  transition: transform 0.5s var(--ease), opacity 0.4s ease, color var(--t-fast);
}

.mega-menu.is-open .mega-menu-sub { opacity: 1; transform: none; }
.mega-menu-sub span { color: var(--text-muted); }
.mega-menu-sub:hover { color: var(--gold); }

.mega-menu-cta {
  margin-top: auto;
  padding-top: 2rem;
  border-bottom: 0;
  color: var(--gold);
  font-size: clamp(1.25rem, 5vw, 1.75rem);
}

.header-spacer { height: var(--header-h); }

/* 8. PRELOADER ========================================================= */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--navy-base);
}

html.js #preloader { display: flex; }
body.theme-light #preloader { background-color: var(--ivory); }

/* Specyficzność musi przebić regułę html.js powyżej. */
html.js #preloader.is-done { display: none; }

.preloader-logo {
  position: relative;
  z-index: 2;
  width: min(200px, 50vw);
  opacity: 0;
  transform: translateY(16px);
  animation: preloader-in 0.7s var(--ease) 0.05s forwards;
}

.preloader-curtain {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: var(--navy-base);
  transform-origin: top;
}

body.theme-light .preloader-curtain { background-color: var(--ivory); }

@keyframes preloader-in {
  to { opacity: 1; transform: none; }
}

#preloader.is-leaving .preloader-logo {
  animation: preloader-out 0.4s ease forwards;
}

#preloader.is-leaving .preloader-curtain {
  animation: curtain-up 0.7s var(--ease) 0.15s forwards;
}

@keyframes preloader-out {
  to { opacity: 0; transform: translateY(-16px); }
}

@keyframes curtain-up {
  to { transform: scaleY(0); }
}

/* 9. HERO ============================================================== */

.section--hero_home { padding: 0; }

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100svh;
  overflow: hidden;
  background-color: var(--navy-deep);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media picture,
.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg {
  opacity: var(--hero-opacity, 0.65);
  filter: sepia(0.18) contrast(1.08) brightness(0.92);
  animation: hero-zoom 24s ease-out both;
}

@keyframes hero-zoom {
  from { transform: scale(1.001); }
  to { transform: scale(1.07); }
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, var(--navy-base) 2%, rgba(7, 21, 35, 0.35) 45%, rgba(7, 21, 35, 0.55) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding-top: calc(var(--header-h) + var(--space-xl));
  padding-bottom: clamp(9rem, 22vw, 11rem);
}

.hero-title {
  max-width: 18ch;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.45);
}

.hero-lead {
  margin-top: var(--space-lg);
  max-width: 52ch;
  font-size: var(--fs-lead);
  line-height: 1.8;
  color: #d9d5cc;
  text-wrap: pretty;
}

.hero-buttons { margin-top: var(--space-lg); }

.hero-band {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid rgba(232, 228, 220, 0.18);
  background-color: rgba(6, 21, 39, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  color: #d9d5cc;
}

.hero-band-item {
  flex: 1 1 auto;
  min-width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8125rem 1rem;
  border-right: 1px solid rgba(232, 228, 220, 0.12);
  border-bottom: 1px solid rgba(232, 228, 220, 0.12);
}

.hero-band-item.is-accent { color: var(--gold); }

@media (min-width: 640px) {
  .hero-band-item { min-width: 33.333%; }
}

@media (min-width: 1024px) {
  .hero-band-item {
    min-width: 0;
    border-bottom: 0;
    padding: 1rem 1.5rem;
  }

  .hero-band-item:last-child { border-right: 0; }
}

/* 10. USŁUGI =========================================================== */

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.section--services { overflow: hidden; }

.section--services::before {
  content: '';
  position: absolute;
  width: 42rem;
  height: 42rem;
  right: -16rem;
  top: -18rem;
  border: 1px solid rgba(214, 184, 131, 0.07);
  transform: rotate(45deg);
  pointer-events: none;
}

.services-grid { border-top: 1px solid var(--line); }

.service-row {
  display: grid;
  grid-template-columns: 2.25rem 1fr 1.25rem;
  grid-template-areas:
    'num title arrow'
    'num figure arrow';
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--t-mid), padding var(--t-mid);
}

.service-num {
  grid-area: num;
  align-self: start;
  color: var(--gold);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  padding-top: 0.375rem;
}

.service-figure {
  grid-area: figure;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 110px;
  opacity: 0.5;
  margin-top: -1.5rem;
  pointer-events: none;
}

.service-figure svg {
  width: 100%;
  max-width: 160px;
  height: 100%;
  overflow: visible;
  transition: transform 0.6s var(--ease), filter 0.6s ease;
}

.service-title {
  grid-area: title;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  z-index: 1;
  max-width: 12ch;
}

.service-subtitle {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-sans);
  letter-spacing: 0.14em;
  color: var(--gold);
}

.service-desc { display: none; }

.service-arrow {
  grid-area: arrow;
  justify-self: end;
  color: var(--gold);
  font-size: 1.125rem;
  transition: transform var(--t-fast);
}

@media (min-width: 900px) {
  .service-row {
    grid-template-columns: 3rem minmax(120px, 180px) minmax(200px, 1.1fr) minmax(240px, 1fr) 2rem;
    grid-template-areas: 'num figure title desc arrow';
    gap: 1.5rem;
    min-height: 178px;
    padding: 0.75rem 0;
  }

  .service-num { align-self: center; padding-top: 0; }

  .service-figure {
    height: 150px;
    opacity: 1;
    margin-top: 0;
    justify-content: center;
  }

  .service-figure svg { max-width: 180px; }

  .service-title { max-width: none; }

  .service-desc {
    grid-area: desc;
    display: block;
    max-width: 44ch;
    font-size: var(--fs-small);
    line-height: 1.75;
    color: #b8c0c8;
  }

  .service-desc-link {
    display: flex;
    margin-top: 1.125rem;
    color: var(--gold);
  }

  .service-row:hover {
    background-color: rgba(16, 40, 60, 0.9);
    padding-inline: 1rem;
  }

  .service-row:hover .service-figure svg {
    transform: translateY(-7px) scale(1.035);
    filter: brightness(1.08);
  }
}

.service-row:hover .service-arrow { transform: translateX(4px); }
.service-row:hover .service-title { color: var(--gold-light); }

/* 11. KARTY, LICZBY, WARTOŚCI, KAFELKI ================================= */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  margin-top: var(--space-xl);
  background-color: var(--line);
  border: 1px solid var(--line);
}

.tile {
  background-color: var(--navy-base);
  padding: 1.75rem 1.5rem;
}

.theme-light .tile { background-color: var(--ivory); }
.theme-panel .tile { background-color: var(--navy-panel); }

.tile-label { color: var(--gold); margin-bottom: 1rem; }
.tile-text { font-size: var(--fs-small); line-height: 1.75; color: var(--text-muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg) var(--space-md);
}

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }
}

.stat-value {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1;
  color: var(--gold);
}

.stat-label {
  margin-top: 0.875rem;
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(var(--card-columns, 3), 1fr); gap: var(--space-xl); }
}

.card {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.card-title { margin-bottom: 0.875rem; }
.card-text { font-size: var(--fs-small); line-height: 1.8; color: var(--text-muted); }
.card-link { margin-top: 1.25rem; }

.numbered-list {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.numbered-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 640px) {
  .numbered-item { grid-template-columns: 4rem 1fr; gap: 1.5rem; }
}

.numbered-index {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  color: var(--gold);
  padding-top: 0.375rem;
}

.numbered-title { margin-bottom: 0.75rem; }
.numbered-text { font-size: var(--fs-small); line-height: 1.8; color: var(--text-muted); max-width: 60ch; }

.values-list { display: grid; gap: var(--space-xl); }

.value-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 768px) {
  .value-item { grid-template-columns: 5rem 1fr; gap: 2rem; }
}

.value-index {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  color: var(--gold);
}

.value-title { margin-bottom: 1rem; }

.value-practice {
  margin-top: 1.25rem;
  font-size: var(--fs-small);
  line-height: 1.8;
  color: var(--text-muted);
  border-left: 1px solid var(--gold);
  padding-left: 1.125rem;
  max-width: 60ch;
}

.value-practice .text-micro {
  display: block;
  color: var(--gold);
  margin-bottom: 0.375rem;
}

/* Manifest. */
.statement { max-width: 1100px; }

.statement-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.5rem, 1rem + 2.6vw, 2.7rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: inherit;
  text-wrap: balance;
}

.statement-quote i { font-style: normal; color: var(--gold-dark); }

.statement-lead {
  margin-top: var(--space-lg);
  max-width: 58ch;
  font-size: var(--fs-lead);
  line-height: 1.8;
}

.statement-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.25rem;
  margin-top: var(--space-lg);
}

.statement-tags li { color: var(--gold-dark); }

.statement-meta {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: var(--space-lg);
  color: var(--gold-dark);
}

.statement-meta .eyebrow-rule { background-color: currentColor; }

/* Winieta. */
.vignette {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

@media (min-width: 1024px) {
  .vignette { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
  .vignette--right .vignette-media { order: 2; }
}

.vignette-media { overflow: hidden; border-radius: var(--radius-md); }

.vignette-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.vignette:hover .vignette-img { transform: scale(1.03); }

/* 12. AKORDEON I ROZDZIAŁ ============================================== */

.faq-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 1024px) {
  .faq-layout { grid-template-columns: 4fr 7fr; gap: clamp(3rem, 6vw, 6rem); }
}

.faq-note {
  margin-top: var(--space-md);
  font-size: var(--fs-lead);
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 36ch;
}

.faq-list { border-top: 1px solid var(--line-soft); }
.faq-item { border-bottom: 1px solid var(--line-soft); }

.faq-heading { font-family: inherit; letter-spacing: normal; }

.faq-question {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: start;
  gap: 0.875rem;
  width: 100%;
  padding: 1.5rem 0;
  text-align: left;
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 3.5vw, 1.55rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: inherit;
  transition: color var(--t-fast);
  min-height: 56px;
}

@media (min-width: 640px) {
  .faq-question { grid-template-columns: 2rem 1fr auto; gap: 1.5rem; padding: 1.875rem 0; }
}

.faq-question:hover { color: var(--gold-light); }
.theme-light .faq-question:hover { color: var(--gold-dark); }

.faq-index {
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  color: var(--gold);
  padding-top: 0.4em;
}

.faq-marker {
  position: relative;
  width: 14px;
  height: 14px;
  margin-top: 0.5em;
  flex: 0 0 auto;
}

.faq-marker::before,
.faq-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1px;
  background-color: var(--gold);
  transform: translate(-50%, -50%);
  transition: transform var(--t-mid);
}

.faq-marker::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item.is-open .faq-marker::after { transform: translate(-50%, -50%) rotate(0deg); }

.faq-answer { overflow: hidden; }

html.js .faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}

html.js .faq-item.is-open .faq-answer { grid-template-rows: 1fr; }
html.js .faq-answer > * { min-height: 0; }
html.js .faq-answer[hidden] { display: grid; }

.faq-answer-inner { padding-bottom: 1.75rem; }

/* Wiersz 0fr nie ściśnie dopełnienia elementu siatki - zdejmujemy je na czas
   zamknięcia, inaczej zwinięta odpowiedź zostawia pusty pasek. */
html.js .faq-answer-inner {
  padding-bottom: 0;
  transition: padding-bottom 0.45s var(--ease);
}

html.js .faq-item.is-open .faq-answer-inner { padding-bottom: 1.75rem; }

@media (min-width: 640px) {
  .faq-answer-inner { padding-left: 2.625rem; }
}

@media (min-width: 1024px) {
  .faq-answer-inner { padding-left: 3.5rem; }
}

.faq-answer-inner p {
  font-size: var(--fs-lead);
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 60ch;
}

.faq-answer-inner p + p { margin-top: 1em; }
.faq-link { margin-top: 1.25rem; }

/* Rozdział ze zdjęciem. */
.section--chapter { padding: 0; }

.chapter {
  position: relative;
  overflow: hidden;
  background-color: var(--navy-deep);
  min-height: min(620px, 88svh);
  display: flex;
  align-items: center;
}

@media (min-width: 1024px) {
  .chapter { min-height: 700px; }
}

.chapter-media { position: absolute; inset: 0; }

.chapter-media picture,
.chapter-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter-img {
  opacity: 0.85;
  transition: transform 1.6s ease-out;
}

.chapter:hover .chapter-img { transform: scale(1.03); }

.chapter-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(6, 21, 39, 0.95), rgba(6, 21, 39, 0.62) 55%, rgba(6, 21, 39, 0.25));
}

.chapter--right .chapter-scrim { transform: scaleX(-1); }

.chapter-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
  padding-block: var(--space-2xl);
}

@media (min-width: 768px) {
  .chapter-content { grid-template-columns: 100px 1fr; gap: 0; align-items: center; }
}

.chapter-num {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  color: var(--gold-light);
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(207, 177, 139, 0.35);
}

@media (min-width: 768px) {
  .chapter-num {
    align-self: stretch;
    border-bottom: 0;
    border-right: 1px solid rgba(207, 177, 139, 0.35);
    padding: 0 0 0 0;
    display: flex;
    align-items: flex-start;
    padding-top: 2rem;
  }
}

.chapter-body { display: flex; align-items: center; }

@media (min-width: 768px) {
  .chapter-body { padding-left: clamp(1.5rem, 4vw, 3.5rem); }
}

.chapter-inner {
  max-width: 34rem;
  border-left: 1px solid var(--gold);
  padding-left: 1.25rem;
  color: var(--text-light);
}

@media (min-width: 768px) {
  .chapter-inner { padding-left: 2rem; }
}

.chapter--right .chapter-body { justify-content: flex-end; }

@media (min-width: 1024px) {
  .chapter--right .chapter-inner {
    text-align: right;
    border-left: 0;
    border-right: 1px solid var(--gold);
    padding-left: 0;
    padding-right: 2rem;
  }

  .chapter--right .eyebrow { justify-content: flex-end; }
  .chapter--right .button-row { justify-content: flex-end; }
}

.chapter-inner h2 { color: var(--text-light); }

.chapter-text {
  margin-top: var(--space-md);
  font-size: var(--fs-lead);
  line-height: 1.8;
  color: #cfd4d9;
  text-wrap: pretty;
}

/* 13. ZESPÓŁ =========================================================== */

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 640px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
}

@media (min-width: 1024px) {
  .team-grid { grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 3vw, 3.5rem); }
}

.team-photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--navy-panel);
  margin-bottom: var(--space-md);
}

.team-photo picture,
.team-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: grayscale(32%) contrast(1.05);
  transition: transform 0.9s var(--ease), filter 0.6s ease;
}

.team-card:hover .team-photo img { transform: scale(1.03); filter: grayscale(0%) contrast(1.05); }

.team-photo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 21, 35, 0.6), transparent 48%);
  pointer-events: none;
}

.team-role { color: var(--gold); margin-bottom: 0.5rem; }
.team-name { margin-bottom: 0.5rem; }
.team-area { color: var(--text-muted); margin-bottom: 1rem; }
.team-bio { font-size: var(--fs-small); line-height: 1.8; color: var(--text-muted); }

.team-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.125rem;
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
}

.team-contact a { color: var(--gold); }
.team-contact a:hover { color: var(--gold-light); }

/* 14. BLOG ============================================================= */

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: var(--space-lg);
}

.blog-filter {
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  min-height: 40px;
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}

.blog-filter:hover { color: var(--gold); border-color: var(--gold); }

.blog-filter.is-active {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--navy-base);
}

.blog-list { border-top: 1px solid var(--line); }

.blog-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--line);
}

.blog-card[hidden] { display: none; }

@media (min-width: 768px) {
  .blog-card {
    grid-template-columns: 300px 1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    padding-block: var(--space-xl);
  }
}

.blog-card-media {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
}

.blog-card-media picture,
.blog-card-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

@media (min-width: 768px) {
  .blog-card-media img { aspect-ratio: 3 / 2; }
}

.blog-card:hover .blog-card-media img { transform: scale(1.05); }

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  margin-bottom: 0.875rem;
}

.blog-card-title { margin-bottom: 0.875rem; }
.blog-card-title a { transition: color var(--t-fast); }
.blog-card:hover .blog-card-title a { color: var(--gold-light); }

.blog-card-excerpt {
  font-size: var(--fs-small);
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 68ch;
}

.blog-card-link { margin-top: 1.25rem; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: var(--space-xl);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--t-fast), border-color var(--t-fast);
}

.pagination .page-numbers:hover { color: var(--gold); border-color: var(--gold); }

.pagination .page-numbers.current {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--navy-base);
}

/* 15. ARTYKUŁ ========================================================== */

.article { padding-top: var(--space-2xl); }

.article-header { text-align: center; padding-bottom: var(--space-lg); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.article-meta-sep { color: var(--gold); }

.article-title { max-width: 20ch; margin-inline: auto; }

.article-lead {
  max-width: 60ch;
  margin: var(--space-md) auto 0;
  font-size: var(--fs-lead);
  line-height: 1.8;
  color: var(--text-muted);
  text-wrap: pretty;
}

.article-cover {
  margin-block: var(--space-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article-cover picture,
.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

@media (min-width: 768px) {
  .article-cover img { aspect-ratio: 21 / 9; }
}

.article-body {
  max-width: 44rem;
  margin-inline: auto;
  padding: 0 var(--gutter) var(--space-2xl);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.85;
  color: #3a3833;
}

.article-body > * + * { margin-top: 1.4em; }

.article-body h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  margin-top: 2.2em;
  margin-bottom: -0.4em;
  color: var(--text-dark);
}

.article-body h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  margin-top: 1.8em;
  margin-bottom: -0.5em;
  color: var(--text-dark);
}

.article-body a {
  color: var(--gold-dark);
  border-bottom: 1px solid currentColor;
}

.article-body a:hover { color: var(--navy-base); }

.article-body ul li,
.article-body ol li { margin-left: 1.25rem; }

.article-body ul li { list-style: none; position: relative; padding-left: 1rem; }

.article-body ul li::before {
  content: '';
  position: absolute;
  left: -0.25rem;
  top: 0.8em;
  width: 6px;
  height: 1px;
  background-color: var(--gold-dark);
}

.article-body ol { list-style: decimal; }
.article-body ol li { list-style: decimal; }

.article-body blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.875rem);
  line-height: 1.3;
  color: var(--gold-dark);
  border-left: 2px solid var(--gold);
  padding-left: 1.5rem;
  margin-block: 2em;
}

.article-body img { border-radius: var(--radius-md); }
.article-body figcaption {
  margin-top: 0.75rem;
  font-size: var(--fs-small);
  color: var(--text-dark-muted);
}

.article-body.has-drop-cap > p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 4.5rem;
  line-height: 0.82;
  float: left;
  margin: 0.06em 0.7rem 0 0;
  color: var(--gold-dark);
}

.article-author {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.article-author-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(35%) contrast(1.05);
}

.article-author picture { flex: 0 0 auto; }
.article-author-role { color: var(--gold-dark); margin-bottom: 0.25rem; }
.article-author-name { font-family: var(--font-serif); font-size: 1.25rem; }

.article-related {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.article-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: 1rem;
}

.article-nav { margin-top: 2.5rem; }

.post-siblings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background-color: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (min-width: 768px) {
  .post-siblings-grid { grid-template-columns: 1fr 1fr; }

  /* Pierwszy i ostatni wpis mają tylko jednego sąsiada - druga kolumna
     zostałaby pustą, złotą płachtą tła siatki. */
  .post-siblings-grid:has(> .post-sibling:only-child) { grid-template-columns: 1fr; }
}

.post-sibling {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  background-color: var(--navy-base);
  transition: background-color var(--t-fast);
}

.post-sibling:hover { background-color: var(--navy-panel); }
.post-sibling .text-micro { color: var(--gold); }

.post-sibling-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.25;
}

.post-sibling--next { text-align: right; align-items: flex-end; }

/* 16. FORMULARZE ======================================================= */

.contact-details { margin-top: var(--space-lg); }

@media (min-width: 1024px) {
  .contact-details { margin-top: var(--space-xl); }
}

.contact-detail + .contact-detail { margin-top: var(--space-md); }
.contact-detail-label { color: var(--text-muted); margin-bottom: 0.375rem; }

.contact-detail-value a {
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-lead);
}

.contact-detail-value a:hover { border-color: currentColor; color: var(--gold-dark); }

.contact-address {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  line-height: 1.35;
}

.contact-registry {
  font-size: var(--fs-small);
  line-height: 2;
  color: var(--text-muted);
}

.rail-col--flush { padding-block: 0 var(--space-lg); }
.content-col--flush { padding-block: 0; }

.contact-form {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gold);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-group { margin-bottom: var(--space-lg); }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 var(--space-lg);
}

@media (min-width: 640px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.form-label {
  display: block;
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}

.form-control {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(139, 115, 89, 0.6);
  border-radius: 0;
  padding: 0.625rem 0;
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  color: inherit;
  transition: border-color var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-bottom-color: var(--gold-dark);
  border-bottom-width: 1px;
}

.form-control:focus-visible { outline: none; }

.theme-dark .form-control,
.theme-panel .form-control { border-bottom-color: rgba(202, 158, 103, 0.45); }

.theme-dark .form-control:focus,
.theme-panel .form-control:focus { border-bottom-color: var(--gold); }

textarea.form-control { min-height: 96px; resize: vertical; line-height: 1.5; }

.form-control::placeholder { color: var(--text-muted); opacity: 0.6; }

.form-control[aria-invalid='true'] { border-bottom-color: #b3261e; }

.form-error {
  margin-top: 0.5rem;
  font-size: var(--fs-small);
  color: #b3261e;
  min-height: 0;
}

.form-error:empty { display: none; }

.form-topics { border: 0; }

.form-topics legend { padding: 0; }

.topic-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .topic-tiles { grid-template-columns: 1fr 1fr; }
}

.topic-tile { position: relative; display: block; cursor: pointer; }

.topic-tile input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.topic-content {
  display: block;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.125rem 1.25rem;
  color: var(--text-muted);
  transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}

.topic-tile:hover .topic-content { border-color: var(--gold); }

.topic-tile input:checked + .topic-content {
  border-color: var(--gold);
  background-color: rgba(202, 158, 103, 0.13);
  color: inherit;
}

.topic-tile input:focus-visible + .topic-content {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.topic-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.2;
  margin-bottom: 0.375rem;
  color: inherit;
}

.topic-tile input:checked + .topic-content .topic-title { color: var(--gold-dark); }
.theme-dark .topic-tile input:checked + .topic-content .topic-title { color: var(--gold); }

.topic-desc { display: block; font-size: var(--fs-small); line-height: 1.6; }

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--text-muted);
  cursor: pointer;
}

.consent-label input {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  accent-color: var(--gold-dark);
}

.btn-submit {
  width: 100%;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  letter-spacing: 0.18em;
  min-height: 60px;
}

.btn-submit[disabled] { opacity: 0.6; cursor: progress; }

.form-feedback {
  margin-top: 1rem;
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
}

.form-feedback:empty { display: none; }
.form-feedback.is-success { color: #1a7f37; }
.form-feedback.is-error { color: #b3261e; }

.theme-dark .form-feedback.is-success { color: #6ee7a8; }
.theme-dark .form-feedback.is-error { color: #ff9b91; }

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: flex-end;
  margin-top: var(--space-lg);
}

.search-form .form-control { flex: 1 1 240px; }

/* 17. STOPKA =========================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-lg) var(--space-md);
  background-color: var(--navy-base);
  color: var(--text-light);
}

body.theme-light .site-footer { background-color: var(--ivory); color: var(--text-dark); }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-xl) var(--space-lg); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-lg); }
  .footer-brand { padding-right: var(--space-lg); }
}

.footer-logo { height: 36px; width: auto; margin-bottom: var(--space-md); }

.footer-brand-data {
  font-size: var(--fs-small);
  line-height: 1.9;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.footer-brand-data a:hover { color: var(--gold); }

.footer-heading { margin-bottom: var(--space-md); }
body.theme-light .footer-heading { color: var(--text-dark); }

.footer-links { display: flex; flex-direction: column; gap: 0.625rem; }

.footer-links a {
  font-size: var(--fs-small);
  color: var(--text-muted);
  padding-block: 0.125rem;
}

.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid var(--line-soft);
  padding-top: var(--space-md);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* 18. RÓŻNE ============================================================ */

.richtext--reading { max-width: 44rem; margin-inline: auto; }
.richtext--wide { max-width: 68rem; }
.richtext .prose { max-width: none; }
.richtext > * + * { margin-top: var(--space-md); }

.cta { max-width: 56rem; }

.error-404-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  margin-top: var(--space-lg);
}

/* Ujawnianie przy przewijaniu. */
html.js .reveal-up {
  opacity: 0;
  transform: translateY(28px);
}

html.js .reveal-up.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.9s var(--ease);
}

/* Ograniczenie ruchu. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html.js .reveal-up { opacity: 1; transform: none; }
  html.js .mega-menu-link,
  html.js .mega-menu-sub { opacity: 1; transform: none; }
  .hero-bg { animation: none; transform: none; }
  #preloader { display: none !important; }
}

@media print {
  .site-header,
  .mega-menu,
  .noise-overlay,
  #preloader,
  .site-footer,
  .button-row,
  .blog-filters { display: none !important; }

  body { background: #fff; color: #000; }
  .section { padding-block: 1rem; border: 0; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.75em; }
}
