/* ============================================================
   SlubProsto - design system
   Paleta: butelkowa zieleń (botanical wedding, elegancja,
   zaufanie) + szampańskie złoto (świąteczność, prestiż) +
   terakota (ciepło, energia) + kremowe tło (ivory).
   Typografia: Bodoni Moda (display, edytorialna elegancja) +
   Spline Sans (body, nowoczesna czytelność).
   Signature: splecione obrączki ze złotym przebłyskiem w hero.
   ============================================================ */

:root {
  --pine-900: #0c2b23;
  --pine-800: #12372c;
  --pine-700: #1d4a3e;
  --pine-600: #27604f;
  --pine-500: #33755f;
  --pine-100: #d9e7df;
  --pine-50: #eef4ef;

  --gold-700: #8f6f14;
  --gold-600: #a8861b;
  --gold-500: #c9a227;
  --gold-400: #dcb84c;
  --gold-100: #f7edd0;

  --clay-700: #8f452c;
  --clay-500: #b45a3a;
  --clay-100: #f2dfd4;

  --cream: #faf6ee;
  --cream-2: #f1e9d9;
  --paper: #ffffff;

  --ink: #2b2821;
  --ink-soft: #4c463a;
  --muted: #6e6555;

  --dark-bg: #0d1712;
  --dark-surface: #142019;
  --dark-surface-2: #1b2a21;
  --dark-text: #eae3d1;
  --dark-muted: #a9a18c;

  --border: #e4dac6;
  --border-dark: #2c4136;

  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 64px;
  --sidebar-w: 300px;

  --font-display: "Bodoni Moda", Georgia, serif;
  --font-body: "Spline Sans", "Segoe UI", sans-serif;

  --shadow-card: 0 1px 2px rgba(45, 42, 38, 0.05), 0 4px 16px rgba(45, 42, 38, 0.06);
  --shadow-card-hover: 0 2px 4px rgba(45, 42, 38, 0.06), 0 10px 28px rgba(29, 74, 62, 0.14);

  --transition: all 0.2s ease-out;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse 60% 45% at 88% -5%, rgba(201, 162, 39, 0.10), transparent 60%),
    radial-gradient(ellipse 55% 40% at -5% 105%, rgba(29, 74, 62, 0.10), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--pine-700); }
a:hover { color: var(--pine-600); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
  color: var(--ink);
}

::selection { background: var(--gold-100); color: var(--ink); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--pine-700);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(29, 74, 62, 0.25), transparent);
  opacity: 0.6;
  pointer-events: none;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.menu-btn span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: var(--transition);
}
.menu-btn:hover { border-color: var(--pine-600); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pine-700), var(--pine-500));
  font-size: 19px;
  box-shadow: 0 2px 8px rgba(29, 74, 62, 0.30);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-name em {
  font-style: normal;
  color: var(--pine-700);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: var(--transition);
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  outline: none;
  border-color: var(--pine-600);
  box-shadow: 0 0 0 3px rgba(29, 74, 62, 0.16);
}
.search-wrap::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-55%);
  border: 2px solid var(--muted);
  border-radius: 50%;
}
.search-wrap::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 7px;
  height: 2px;
  transform: translateY(4px) rotate(45deg);
  background: var(--muted);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card-hover);
  overflow: hidden;
  display: none;
  z-index: 120;
}
.search-results.open { display: block; }
.search-item {
  display: block;
  padding: 11px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--pine-50); }
.si-title { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.si-section { font-size: 0.78rem; color: var(--muted); margin-top: 1px; }
.search-empty { padding: 14px 16px; color: var(--muted); font-size: 0.9rem; }

.header-tagline {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 24px) 20px 40px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 32px;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding: 6px 16px 16px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.side-group { margin-bottom: 6px; }
.side-group-title {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 10px 6px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.side-group-title::-webkit-details-marker { display: none; }
.side-group-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--pine-600);
  border-bottom: 2px solid var(--pine-600);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  opacity: 0.7;
}
.side-group[open] > .side-group-title::before { transform: rotate(-135deg); }

.side-group-items { padding-bottom: 6px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-link .s-icon { font-size: 0.85rem; opacity: 0.85; flex-shrink: 0; }
.sidebar-link:hover {
  background: var(--pine-50);
  color: var(--pine-700);
  transform: translateX(2px);
}
.sidebar-link.active {
  background: var(--pine-100);
  color: var(--pine-800);
  font-weight: 600;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 31, 29, 0.5);
  z-index: 90;
}

.main-content { min-width: 0; }
.app-content { animation: fadeUp 0.25s ease-out; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Hero ---------- */
.home-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--pine-900) 0%, var(--pine-700) 55%, var(--pine-600) 100%);
  border-radius: 18px;
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  box-shadow: 0 8px 32px rgba(12, 43, 35, 0.30);
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 85% 15%, rgba(220, 184, 76, 0.16), transparent 65%),
    radial-gradient(ellipse 45% 55% at 8% 95%, rgba(51, 117, 95, 0.42), transparent 60%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 2; max-width: 640px; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-500);
  background: rgba(250, 247, 242, 0.08);
  border: 1px solid rgba(220, 184, 76, 0.40);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.home-hero h1 {
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  margin: 0 0 14px;
}
.home-hero h1 .accent-word {
  color: var(--gold-400);
  font-style: italic;
}
.hero-sub {
  color: rgba(250, 246, 238, 0.92);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 26px;
  max-width: 580px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--gold-600);
  color: #0d1712;
  box-shadow: 0 2px 10px rgba(168, 134, 27, 0.40);
}
.btn-primary:hover {
  background: var(--gold-500);
  color: #0d1712;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 134, 27, 0.45);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: translateY(-2px);
}

/* Breathing circle - signature element */
.hero-visual {
  position: relative;
  z-index: 1;
  width: 250px;
  height: 250px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.rings {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 24px 10px 8px;
  text-align: center;
}
.rings svg {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 8px 22px rgba(12, 43, 35, 0.28));
}
.rings .ring-a { fill: none; stroke: var(--gold-500); stroke-width: 7; }
.rings .ring-b { fill: none; stroke: var(--clay-500); stroke-width: 7; }
.rings .ring-sheen {
  fill: none; stroke: #fdf6e3; stroke-width: 3; opacity: 0;
  stroke-dasharray: 12 320;
  animation: ringSheen 5.5s ease-in-out infinite;
}
@keyframes ringSheen {
  0% { stroke-dashoffset: 360; opacity: 0; }
  12% { opacity: 0.9; }
  30% { stroke-dashoffset: -80; opacity: 0; }
  100% { stroke-dashoffset: -80; opacity: 0; }
}
.rings-float { animation: ringsFloat 7s ease-in-out infinite; }
@keyframes ringsFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.rings-caption {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--cream);
  letter-spacing: 0.02em;
}

/* ---------- Home sections ---------- */
.home-section { margin-top: 44px; }
.home-section h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: var(--pine-900);
}
.sec-count {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--pine-100);
  color: var(--pine-700);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sec-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 18px 52px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.home-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background: linear-gradient(90deg, var(--pine-600), var(--gold-600));
  border-radius: 0 0 3px 3px;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.home-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: #d8cdba;
  color: var(--ink);
}
.home-card:hover::before { opacity: 1; }

.hc-icon {
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 12px;
  display: inline-block;
  transition: transform 0.2s ease-out;
}
.home-card:hover .hc-icon { transform: scale(1.12) rotate(-4deg); }

.home-card h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0 0 8px;
  color: var(--pine-900);
}
.home-card p {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 14px;
  flex-grow: 1;
}
.hc-more {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pine-700);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hc-more .arrow { transition: transform 0.2s ease-out; }
.home-card:hover .hc-more .arrow { transform: translateX(4px); }

/* ---------- Article ---------- */
.article-header { margin-bottom: 30px; }
.breadcrumbs {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.breadcrumbs a { color: var(--pine-700); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 7px; color: var(--border); }

.article-header h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  color: var(--pine-900);
  margin: 0 0 12px;
}
.article-excerpt {
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 760px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.tag {
  background: var(--pine-100);
  color: var(--pine-800);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.article-body {
  max-width: 780px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
}

.article-body h2 {
  font-size: 1.45rem;
  color: var(--pine-900);
  margin: 34px 0 14px;
  padding-top: 6px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.article-body h2:first-child { margin-top: 0; }
.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--pine-800);
  margin: 24px 0 10px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.article-body p { margin: 0 0 16px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--ink); }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }

.article-toc {
  background: var(--pine-50);
  border: 1px solid var(--pine-100);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 26px;
}
.article-toc summary {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--pine-800);
  cursor: pointer;
  user-select: none;
}
.article-toc ol {
  margin: 10px 0 0;
  padding-left: 20px;
}
.article-toc li { margin-bottom: 4px; font-size: 0.9rem; }
.article-toc a { color: var(--pine-700); text-decoration: none; }
.article-toc a:hover { text-decoration: underline; }

.info-box {
  background: var(--gold-100);
  border-left: 4px solid var(--gold-600);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}
.info-box strong { color: var(--pine-800); }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 0.92rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.compare-table th {
  background: var(--pine-700);
  color: #fff;
  text-align: left;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 0.88rem;
}
.compare-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.compare-table tr:nth-child(even) td { background: var(--cream-2); }
.compare-table td:first-child { font-weight: 600; color: var(--pine-800); white-space: nowrap; }

.faq-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--pine-600);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 0 0 14px;
  background: var(--paper);
}
.faq-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--pine-900);
}
.faq-item p { margin: 0; font-size: 0.95rem; }

.article-body dl {
  margin: 0 0 20px;
}
.article-body dt {
  font-weight: 700;
  color: var(--pine-800);
  margin-top: 14px;
  font-size: 1rem;
}
.article-body dd {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* prev / next */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.article-nav a {
  display: block;
  text-decoration: none;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: var(--transition);
}
.article-nav a:hover {
  background: var(--pine-50);
  border-color: var(--pine-100);
  transform: translateY(-2px);
}
.article-nav a.next { text-align: right; }
.an-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.an-title { font-weight: 600; font-size: 0.92rem; color: var(--pine-800); }

/* ---------- Footer ---------- */
.app-footer {
  margin-top: 48px;
  background: var(--pine-900);
  color: rgba(250, 247, 242, 0.85);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.footer-inner p { margin: 0 0 10px; }
.footer-inner strong { color: #fff; font-family: var(--font-display); font-weight: 500; }
.footer-note { color: rgba(250, 247, 242, 0.68); font-size: 0.82rem; }
.footer-copy { color: rgba(250, 247, 242, 0.5); font-size: 0.8rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .header-tagline { display: none; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding-top: calc(var(--header-h) + 16px);
  }
  .menu-btn { display: flex; }
  .sidebar {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    width: min(320px, 85vw);
    max-height: none;
    background: var(--cream);
    border-right: 1px solid var(--border);
    padding: 12px 16px 24px;
    transform: translateX(-105%);
    transition: transform 0.25s ease-out;
    z-index: 95;
    box-shadow: 8px 0 24px rgba(13, 31, 29, 0.12);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .search-wrap { max-width: none; }
  .home-hero {
    flex-direction: column;
    padding: 40px 28px;
    text-align: left;
  }
  .hero-visual { width: 100%; height: 250px; }
  .sec-desc { margin-left: 0; }
  .article-body { padding: 28px 24px; }
}

@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .header-inner { padding: 0 12px; gap: 10px; }
  .brand-name { font-size: 1.1rem; }
  .brand-mark { width: 34px; height: 34px; font-size: 17px; }
  .home-hero { padding: 32px 20px; border-radius: 14px; }
  .home-hero h1 { font-size: 1.65rem; }
  .hero-cta { flex-direction: column; }
  .btn { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav a.next { text-align: left; }
  .compare-table { font-size: 0.85rem; }
  .compare-table th, .compare-table td { padding: 8px 10px; }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  body {
    color: var(--dark-text);
    background-color: var(--dark-bg);
    background-image:
      radial-gradient(ellipse 60% 45% at 88% -5%, rgba(201, 162, 39, 0.08), transparent 60%),
      radial-gradient(ellipse 55% 40% at -5% 105%, rgba(51, 117, 95, 0.11), transparent 60%);
  }
  h1, h2, h3 { color: var(--dark-text); }
  a { color: #85c2a9; }
  a:hover { color: #a8d9c4; }
  ::selection { background: rgba(220, 184, 76, 0.35); color: var(--dark-text); }

  .app-header {
    background: rgba(13, 31, 29, 0.92);
    border-bottom-color: var(--border-dark);
  }
  .brand-name { color: var(--dark-text); }
  .menu-btn span { background: var(--dark-text); }
  .menu-btn { border-color: var(--border-dark); }
  .search-input {
    background: var(--dark-surface);
    color: var(--dark-text);
    border-color: var(--border-dark);
  }
  .search-input::placeholder { color: var(--dark-muted); }
  .search-results {
    background: var(--dark-surface);
    border-color: var(--border-dark);
  }
  .search-item { border-bottom-color: var(--border-dark); }
  .search-item:hover { background: var(--dark-surface-2); }
  .si-title { color: var(--dark-text); }
  .si-section { color: var(--dark-muted); }
  .header-tagline { color: var(--dark-muted); border-left-color: var(--border-dark); }

  .sidebar { background: var(--dark-bg); }
  .side-group-title { color: var(--dark-muted); }
  .sidebar-link { color: #c9c4b6; }
  .sidebar-link:hover { background: var(--dark-surface); color: #a8d9c4; }
  .sidebar-link.active { background: rgba(51, 117, 95, 0.28); color: #a8d9c4; }

  .home-section h2 { color: #d5e8e4; }
  .sec-count { background: rgba(51, 117, 95, 0.28); color: #a8d9c4; }
  .sec-desc { color: var(--dark-muted); }

  .home-card {
    background: var(--dark-surface);
    border-color: var(--border-dark);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  }
  .home-card:hover {
    border-color: #2d514b;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  }
  .home-card h3 { color: #d5e8e4; }
  .home-card p { color: #b3ad9f; }
  .hc-more { color: #a8d9c4; }

  .article-header h1 { color: #d5e8e4; }
  .article-excerpt { color: #b3ad9f; }
  .article-meta { color: var(--dark-muted); }
  .tag { background: rgba(51, 117, 95, 0.28); color: #a8d9c4; }

  .article-body {
    background: var(--dark-surface);
    border-color: var(--border-dark);
  }
  .article-body h2 { color: #d5e8e4; }
  .article-body h3 { color: #a8d9c4; }
  .article-body strong { color: var(--dark-text); }
  .article-body a { color: #85c2a9; }

  .article-toc { background: rgba(51, 117, 95, 0.14); border-color: rgba(51, 117, 95, 0.30); }
  .article-toc summary { color: #a8d9c4; }
  .article-toc a { color: #85c2a9; }

  .info-box {
    background: rgba(220, 184, 76, 0.12);
    border-left-color: var(--gold-600);
  }
  .info-box strong { color: var(--gold-500); }

  .compare-table { background: var(--dark-surface); border-color: var(--border-dark); }
  .compare-table th { background: var(--pine-800); }
  .compare-table td { border-top-color: var(--border-dark); }
  .compare-table tr:nth-child(even) td { background: var(--dark-surface-2); }
  .compare-table td:first-child { color: #a8d9c4; }

  .faq-item { background: var(--dark-surface); border-color: var(--border-dark); }
  .faq-item h3 { color: #d5e8e4; }
  .faq-item p { color: #b3ad9f; }

  .article-body dt { color: #a8d9c4; }
  .article-body dd { color: #b3ad9f; }

  .article-nav { border-top-color: var(--border-dark); }
  .article-nav a { background: var(--dark-surface-2); border-color: var(--border-dark); }
  .article-nav a:hover { background: rgba(51, 117, 95, 0.22); }
  .an-label { color: var(--dark-muted); }
  .an-title { color: #a8d9c4; }

  .app-footer { background: #081612; }
  .footer-note { color: rgba(250, 247, 242, 0.45); }

  @media (max-width: 900px) {
    .sidebar { background: var(--dark-bg); border-right-color: var(--border-dark); }
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Glossary (slownik) ---------- */
.glossary { margin: 24px 0; }
.glossary-item {
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 16px;
  align-items: baseline;
}
.glossary-item:first-child { border-top: 1px solid var(--border); }
.glossary-item dt { font-weight: 600; color: var(--pine-800); font-size: 1rem; }
.glossary-item dd { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 600px) {
  .glossary-item { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Checklist (checklista) ---------- */
.checklist { list-style: none; padding: 0; margin: 20px 0; }
.checklist li {
  padding: 10px 14px 10px 42px;
  margin-bottom: 8px;
  background: var(--pine-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  font-size: 0.98rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 13px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold-500);
  border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
  .glossary-item { border-bottom-color: var(--border-dark); }
  .glossary-item:first-child { border-top-color: var(--border-dark); }
  .glossary-item dt { color: var(--gold-500); }
  .glossary-item dd { color: var(--dark-muted); }
  .checklist li { background: var(--dark-surface); border-color: var(--border-dark); }
}
