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

/* ── DESIGN TOKENS ── */
:root {
  /* Stałe — nie zmieniają się z motywem */
  --sage:        #7a8c6e;
  --sage-light:  #a8b89a;
  --sage-pale:   #e8ede4;
  --terracotta:  #c4623a;
  --serif:       'Cormorant Garamond', Georgia, serif;
  --sans:        'DM Sans', system-ui, sans-serif;
  --max:         1200px;
  --gap:         clamp(16px, 3vw, 40px);

  /* Semantyczne — zmieniają się z motywem (light default) */
  --bg:          #faf8f4;
  --bg-surface:  #f5f0e8;
  --bg-subtle:   #e8ede4;
  --text:        #1c1c18;
  --text-muted:  #4a4a42;
  --text-faint:  #8a8a80;
  --border:      rgba(122,140,110,.2);
  --border-mid:  rgba(122,140,110,.35);
  --nav-bg:      #faf8f4;

  /* Przejścia */
  --transition:  background .25s ease, color .25s ease, border-color .25s ease;
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --bg:          #16181a;
  --bg-surface:  #1e2124;
  --bg-subtle:   #252a2d;
  --text:        #e8e4dc;
  --text-muted:  #a0a098;
  --text-faint:  #606058;
  --border:      rgba(160,185,154,.12);
  --border-mid:  rgba(160,185,154,.22);
  --nav-bg:      #16181a;
  --sage-pale:   #1e2a1c;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: var(--transition);
}

/* ── NAV ── */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 32px;
  padding: 0 clamp(20px,5vw,80px);
  height: 60px;
  transition: var(--transition);
}
.nav-logo {
  font-family: var(--serif); font-size: 20px; font-weight: 300;
  letter-spacing: .1em; color: var(--text); text-decoration: none;
  margin-right: auto;
  transition: color .2s;
}
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; font-weight: 400;
  transition: color .2s;
}
.nav-links a:hover { color: var(--sage); }

/* Przycisk dark mode */
.nav-theme-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 15px;
  transition: background .2s, color .2s, border-color .2s;
  flex-shrink: 0;
}
.nav-theme-btn:hover { background: var(--bg-subtle); color: var(--sage); border-color: var(--sage); }
.nav-theme-btn .icon-sun  { display: none; }
.nav-theme-btn .icon-moon { display: block; }
[data-theme="dark"] .nav-theme-btn .icon-sun  { display: block; }
[data-theme="dark"] .nav-theme-btn .icon-moon { display: none; }

.nav-admin {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); text-decoration: none;
  border: 1px solid var(--border-mid); padding: 5px 12px;
  transition: color .2s, border-color .2s;
}
.nav-admin:hover { color: var(--sage); border-color: var(--sage); }

main { min-height: 70vh; }

/* ── HERO ── */
.hero {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 82vh; gap: 0;
}
.hero-inner {
  background: var(--bg-surface);
  padding: clamp(48px,8vw,96px) clamp(24px,5vw,72px);
  display: flex; flex-direction: column; justify-content: center;
  transition: var(--transition);
}
.hero-eyebrow {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sage); font-weight: 500; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.hero-eyebrow::before {
  content: ''; display: block; width: 28px; height: 1px; background: var(--sage);
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(48px,6vw,80px); font-weight: 300;
  line-height: 1.07; letter-spacing: -.01em;
  margin-bottom: 24px;
  color: var(--text);
}
.hero-title em { font-style: italic; color: var(--sage); }
.hero-desc {
  font-size: 16px; line-height: 1.75; color: var(--text-muted);
  font-weight: 300; max-width: 380px;
}
.hero-card {
  background: var(--bg-subtle);
  padding: clamp(32px,5vw,56px) clamp(24px,4vw,48px);
  display: flex; flex-direction: column; justify-content: flex-end;
  text-decoration: none; color: inherit;
  transition: background .2s;
}
.hero-card:hover { background: var(--border-mid); }

/* ── REVEAL ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Staggered delay dla kart w gridzie */
.reveal-stagger > *        { opacity: 0; transform: translateY(24px); transition: opacity .5s ease, transform .5s ease; }
.reveal-stagger > *.visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > *:nth-child(2) { transition-delay: .08s; }
.reveal-stagger > *:nth-child(3) { transition-delay: .16s; }
.reveal-stagger > *:nth-child(4) { transition-delay: .24s; }
.reveal-stagger > *:nth-child(5) { transition-delay: .32s; }
.reveal-stagger > *:nth-child(6) { transition-delay: .40s; }
.reveal-stagger > *:nth-child(7) { transition-delay: .48s; }
.reveal-stagger > *:nth-child(8) { transition-delay: .56s; }
.reveal-stagger > *:nth-child(9) { transition-delay: .64s; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.section-header h2 {
  font-family: var(--serif); font-size: 34px; font-weight: 300;
  color: var(--text);
}

/* ── SEARCH + FILTER BAR ── */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 200px;
  font-family: var(--sans); font-size: 14px;
  background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border-mid); border-radius: 6px;
  padding: 9px 14px 9px 36px;
  outline: none; transition: border-color .2s, box-shadow .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a80' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; background-size: 14px;
}
.search-input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(122,140,110,.12); }
.search-input::placeholder { color: var(--text-faint); }

.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  font-weight: 500; padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border-mid); background: transparent;
  color: var(--text-muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  font-family: var(--sans);
}
.chip:hover  { background: var(--bg-subtle); color: var(--text); }
.chip.active { background: var(--sage); border-color: var(--sage); color: #fff; }

/* Pusta lista po filtrowaniu */
.no-results {
  grid-column: 1 / -1;
  padding: 40px 0; text-align: center;
  color: var(--text-faint); font-size: 15px;
  display: none;
}
.no-results.visible { display: block; }

/* ── ARTICLE CARDS ── */
.articles-section { padding: clamp(40px,6vw,80px) clamp(20px,5vw,80px); }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
}

.article-card {
  background: var(--bg-surface);
  padding: 28px 24px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 10px;
  transition: background .2s, opacity .2s;
  min-height: 220px;
}
.article-card:hover { background: var(--bg-subtle); }
.article-card[data-hidden="true"] { display: none; }

.card-category {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 500; color: var(--sage);
}
.card-title {
  font-family: var(--serif); font-size: 20px; font-weight: 400;
  line-height: 1.25; color: var(--text);
}
.card-excerpt {
  font-size: 13px; color: var(--text-muted); font-weight: 300;
  line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 11px; letter-spacing: .04em; color: var(--text-faint);
  margin-top: auto;
}

/* ── PILLARS ── */
.pillars-section { padding: clamp(40px,6vw,80px) clamp(20px,5vw,80px); background: var(--bg-surface); transition: var(--transition); }
.pillars-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 2px;
}
.pillar-card {
  background: var(--bg);
  padding: 32px 28px;
  text-decoration: none; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  transition: background .2s;
}
.pillar-card:hover { background: var(--bg-subtle); }
.pillar-card h3 { font-family: var(--serif); font-size: 20px; font-weight: 400; }
.pillar-arrow { font-size: 20px; color: var(--sage); transition: transform .2s; }
.pillar-card:hover .pillar-arrow { transform: translateX(4px); }

/* ── ARTICLE PAGE ── */
.article-page {
  max-width: 740px; margin: 0 auto;
  padding: clamp(40px,6vw,72px) clamp(20px,5vw,40px);
}
.article-header { margin-bottom: 48px; }
.article-category {
  display: inline-block;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--sage); font-weight: 500; text-decoration: none;
  margin-bottom: 16px;
}
.article-title {
  font-family: var(--serif);
  font-size: clamp(36px,5vw,58px); font-weight: 300;
  line-height: 1.1; margin-bottom: 20px; color: var(--text);
}
.article-excerpt {
  font-size: 18px; color: var(--text-muted); font-weight: 300;
  line-height: 1.65; margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.article-meta { display: flex; align-items: center; gap: 14px; }
.author-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 18px; color: var(--sage);
  flex-shrink: 0;
}
.article-author strong { display: block; font-size: 14px; font-weight: 500; color: var(--text); }
.article-author span   { font-size: 12px; color: var(--text-faint); }

/* ── PROSE ── */
.prose { font-size: 17px; line-height: 1.8; color: var(--text-muted); }
.prose p        { margin-bottom: 1.4em; }
.prose h2       { font-family: var(--serif); font-size: 32px; font-weight: 300;
                  color: var(--text); margin: 2em 0 .6em; line-height: 1.2; }
.prose h3       { font-family: var(--serif); font-size: 24px; font-weight: 400;
                  color: var(--text); margin: 1.6em 0 .5em; }
.prose strong   { color: var(--text); font-weight: 500; }
.prose em       { font-style: italic; }
.prose ul       { padding-left: 1.4em; margin-bottom: 1.4em; }
.prose li       { margin-bottom: .4em; }

/* ── RELATED ── */
.related-section {
  margin-top: 64px; padding-top: 40px;
  border-top: 1px solid var(--border);
}
.related-section h3 {
  font-family: var(--serif); font-size: 24px; font-weight: 300;
  margin-bottom: 20px; color: var(--text);
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 2px; }
.related-card {
  background: var(--bg-surface); padding: 20px;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px;
  transition: background .2s;
}
.related-card:hover { background: var(--bg-subtle); }
.related-card h4 { font-family: var(--serif); font-size: 17px; font-weight: 400; line-height: 1.3; color: var(--text); }

/* ── EMPTY / ERROR ── */
.empty-state { padding: 40px 0; color: var(--text-faint); font-size: 15px; }
.error-page {
  max-width: 500px; margin: 80px auto; padding: 0 24px; text-align: center;
}
.error-page h1 { font-family: var(--serif); font-size: 80px; font-weight: 300; color: var(--sage); }
.error-page p  { color: var(--text-muted); margin: 12px 0 28px; }
.error-page a  { color: var(--sage); text-decoration: none; border-bottom: 1px solid var(--sage-light); }

/* ── FOOTER ── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  padding: clamp(40px,5vw,60px) clamp(20px,5vw,80px) 32px;
  margin-top: 80px;
  transition: var(--transition);
}
.footer-inner { max-width: var(--max); margin: 0 auto; }
.footer-brand { margin-bottom: 28px; }
.footer-logo {
  font-family: var(--serif); font-size: 24px; font-weight: 300;
  letter-spacing: .1em; color: var(--text); text-decoration: none;
  display: inline-block; margin-bottom: 8px;
}
.footer-brand p { font-size: 13px; font-weight: 300; max-width: 280px; line-height: 1.6; }
.footer-links {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  margin-bottom: 28px; padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.footer-links a {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); text-decoration: none; transition: color .2s;
}
.footer-links a:hover { color: var(--sage-light); }
.footer-legal { font-size: 11px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; }
  .hero-card { min-height: 200px; }
  .nav-links { display: none; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
}

