/* ============================================================
   Encyklopedia Ezoteryki — nowy, czytelny layout bez bocznej ramki.
   Nagłówki: Cormorant Garamond (marka portalu), tekst: Manrope.
   Kolor systemu wjeżdża zmienną --c ustawianą inline na <body>/kartach.
   ============================================================ */

:root {
  --bg: #07061a;
  --panel: rgba(255, 255, 255, .028);
  --panel-2: rgba(255, 255, 255, .05);
  --ink: #f2edfb;
  --ink-soft: rgba(238, 233, 252, .9);
  --ink-mute: rgba(224, 218, 246, .76);
  --line: rgba(200, 188, 235, .14);
  --display: 'Cormorant Garamond', Georgia, serif;
  --text: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --radius: 18px;
  --maxw: 1120px;
  --violet: #9a7ce8;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.enc {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16.5px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* delikatna mgławica w kolorze systemu */
.enc-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 78% -8%, var(--c-14, rgba(154, 124, 232, .14)) 0%, transparent 70%),
    radial-gradient(45% 38% at 8% 18%, rgba(90, 160, 232, .07) 0%, transparent 70%),
    radial-gradient(120% 80% at 50% 115%, #0d0930 0%, transparent 60%);
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--c-light, #cdbaf6);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--c-35, rgba(154, 124, 232, .35)); }

/* ---------- górna belka ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 6, 26, .82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar__home {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: .04em;
  text-decoration: none;
  color: #f3e6c4;
  white-space: nowrap;
}
.topbar__home span { color: var(--ink); }
.topbar__home:hover span { color: #f3e6c4; }

.topbar__sep { color: var(--ink-mute); }

.topbar__enc {
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  white-space: nowrap;
}
.topbar__enc:hover { color: var(--ink); }

.topbar__nav {
  display: flex;
  gap: 4px;
  margin-left: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar__nav::-webkit-scrollbar { display: none; }
/* przewijany pasek działów — wygaszona prawa krawędź sygnalizuje, że jest ich więcej
   (bez tego ucięte „Numerolo…” wyglądało na błąd); pusty margines pod maską,
   gdy wszystko się mieści, więc na szerokim ekranie nic nie blednie */
.topbar__nav {
  padding-right: 28px;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink-mute);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color .18s, border-color .18s, background .18s;
}
.topbar__link .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 8px var(--dot);
  flex: none;
}
.topbar__link:hover { color: var(--ink); background: var(--panel-2); }
.topbar__link.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel-2);
}

.topbar__search {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  flex: 0 1 300px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink-mute);
  transition: border-color .18s;
}
.topbar__search:focus-within { border-color: var(--c-60, rgba(154, 124, 232, .6)); }
.topbar__search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font: inherit;
  font-size: .88rem;
}
.topbar__search input::placeholder { color: var(--ink-mute); }
.topbar__search input::-webkit-search-cancel-button { display: none; }
.topbar__kbd {
  font: 600 .66rem/1 var(--text);
  letter-spacing: .06em;
  color: var(--ink-mute);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 6px;
  white-space: nowrap;
}

.search-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(430px, 92vw);
  max-height: 62vh;
  overflow-y: auto;
  background: #100c2c;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  padding: 6px;
}
.search-pop__item {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  text-decoration: none;
}
.search-pop__item.is-hot,
.search-pop__item:hover { background: var(--panel-2); }
.search-pop__meta {
  display: block;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--acc, var(--ink-mute));
}
.search-pop__title { display: block; font-size: .9rem; font-weight: 500; }
.search-pop__empty { padding: 14px; font-size: .88rem; color: var(--ink-mute); }

/* pasek postępu czytania */
.readbar { height: 2px; background: transparent; }
.readbar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c, var(--violet)), var(--c-light, #cdbaf6));
}

/* ---------- okruszki ---------- */

.crumbs { max-width: var(--maxw); margin: 18px auto 0; padding: 0 20px; }
.crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: .8rem;
  color: var(--ink-mute);
}
.crumbs li + li::before { content: '›'; margin: 0 7px; opacity: .55; }
.crumbs a { color: var(--ink-mute); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span[aria-current] { color: var(--ink-soft); }

/* ---------- wspólne ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px 90px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-light, #cdbaf6);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--c-60, rgba(154, 124, 232, .6));
  background: var(--c-14, rgba(154, 124, 232, .14));
  color: var(--ink);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  transition: background .18s, transform .18s, box-shadow .18s;
}
.btn:hover {
  background: var(--c-22, rgba(154, 124, 232, .22));
  transform: translateY(-1px);
  box-shadow: 0 8px 26px var(--c-22, rgba(154, 124, 232, .22));
}

.tag {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .18s, color .18s, background .18s;
}
.tag span { font-size: .7rem; color: var(--ink-mute); }
.tag:hover {
  color: var(--ink);
  border-color: var(--c-60, rgba(154, 124, 232, .6));
  background: var(--c-08, rgba(154, 124, 232, .08));
}

/* ---------- strona główna encyklopedii ---------- */

.hero { padding: clamp(40px, 7vw, 84px) 0 clamp(26px, 4vw, 48px); text-align: center; }
.hero--slim { padding-bottom: 10px; }

.hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.5rem, 6.2vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: .01em;
}
.hero__title em {
  font-style: italic;
  background: linear-gradient(100deg, #f3e6c4 10%, var(--c-light, #cdbaf6) 55%, #9ec8f2 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  font-weight: 300;
}
.hero__lead a { color: var(--c-light, #cdbaf6); }

.hero__stats {
  display: flex;
  justify-content: center;
  gap: clamp(26px, 6vw, 70px);
  margin: 34px 0 0;
}
.hero__stats div { text-align: center; }
.hero__stats dt {
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1;
  color: #f3e6c4;
}
.hero__stats dd {
  margin: 6px 0 0;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.realms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: clamp(20px, 4vw, 44px);
}

.realm {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-22);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--c-08) 0%, var(--panel) 55%);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.realm:hover {
  transform: translateY(-3px);
  border-color: var(--c-60);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .4), 0 0 0 1px var(--c-22) inset;
}

.realm__link {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 22px;
  text-decoration: none;
  flex: 1;
}
.realm__glyph { width: 64px; height: 64px; color: var(--c-light); }
.realm__glyph .sigil { width: 100%; height: 100%; filter: drop-shadow(0 0 14px var(--c-35)); }
.realm__name {
  display: block;
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1.1;
}
.realm__desc {
  display: block;
  margin-top: 6px;
  font-size: .86rem;
  font-weight: 300;
  color: var(--ink-soft);
}
.realm__meta {
  display: block;
  margin-top: 10px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-light);
}
.realm__arrow { color: var(--c-light); font-size: 1.2rem; transition: transform .2s; }
.realm:hover .realm__arrow { transform: translateX(4px); }

.realm__start {
  display: block;
  padding: 12px 22px;
  border-top: 1px solid var(--c-22);
  font-size: .82rem;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color .18s, background .18s;
}
.realm__start:hover { color: var(--ink); background: var(--c-08); }

.cloud { margin-top: clamp(40px, 7vw, 70px); text-align: center; }
.cloud__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.6rem;
  margin: 0 0 18px;
}
.cloud__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- strona systemu ---------- */

.shero {
  display: grid;
  grid-template-columns: minmax(110px, 150px) 1fr;
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
  padding: clamp(30px, 5vw, 60px) 0 clamp(24px, 4vw, 44px);
}
.shero__glyph { color: var(--c-light); }
.shero__glyph .sigil { width: 100%; height: auto; filter: drop-shadow(0 0 22px var(--c-35)); }
.shero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.4vw, 3.8rem);
  line-height: 1.05;
}
.shero__lead {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-weight: 300;
}
.shero__meta {
  margin: 12px 0 18px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

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

.chapter {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px 22px 14px;
  scroll-margin-top: 90px;
  transition: border-color .2s;
}
.chapter:hover { border-color: var(--c-35); }

.chapter__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.chapter__no {
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--c-light);
  opacity: .85;
}
.chapter__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.32rem;
  line-height: 1.25;
}

.chapter__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  counter-reset: art;
}
.chapter__item {
  counter-increment: art;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px;
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s;
}
.chapter__item::before {
  content: counter(art, decimal-leading-zero);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--ink-mute);
  flex: none;
}
.chapter__item:hover { background: var(--c-08); }
.chapter__itemTitle { flex: 1; font-size: .93rem; font-weight: 500; color: var(--ink-soft); }
.chapter__item:hover .chapter__itemTitle { color: var(--ink); }
.chapter__itemMeta { font-size: .72rem; color: var(--ink-mute); white-space: nowrap; }
.chapter__list li + li .chapter__item { border-top: 1px solid rgba(200, 188, 235, .07); }

/* ---------- artykuł ---------- */

.wrap--article { max-width: 880px; }

.art__head { padding: clamp(20px, 4vw, 44px) 0 6px; }

.art__kicker { margin: 0 0 10px; }
.art__kicker a {
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-light, #cdbaf6);
  text-decoration: none;
}
.art__kicker a:hover { text-decoration: underline; text-underline-offset: 4px; }

.art__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: .005em;
}

.art__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 18px 0 0;
  font-size: .8rem;
  color: var(--ink-mute);
}
.art__badge {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--c-60);
  color: var(--c-light);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.art__body {
  max-width: 700px;
  margin: clamp(22px, 4vw, 40px) auto 0;
  font-size: 1.06rem;
  line-height: 1.85;
  color: var(--ink-soft);
}
.art__body p { margin: 0 0 1.5em; }
.art__body em { color: var(--ink); }

.art__lead {
  font-size: 1.17rem;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.75;
}
.art__lead::first-letter {
  font-family: var(--display);
  font-size: 3.4em;
  line-height: .82;
  float: left;
  padding: 6px 12px 0 0;
  color: var(--c-light, #cdbaf6);
}

.art__foot { max-width: 700px; margin: 34px auto 0; }

.art__tags { display: flex; flex-wrap: wrap; gap: 9px; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 30px;
}
.pager__link {
  display: block;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-decoration: none;
  transition: border-color .18s, background .18s;
}
.pager__link:hover { border-color: var(--c-60); background: var(--c-08); }
.pager__link--next { text-align: right; }
.pager__dir {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.pager__title { display: block; margin-top: 5px; font-size: .89rem; font-weight: 500; }

/* spis rozdziału pod artykułem */

.toc {
  max-width: 700px;
  margin: clamp(34px, 6vw, 60px) auto 0;
  border: 1px solid var(--c-22, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--c-08, var(--panel)) 0%, var(--panel) 60%);
  padding: 24px 26px;
}
.toc__title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3rem;
}
.toc__list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc__list li { counter-increment: toc; }
.toc__item {
  display: flex;
  gap: 12px;
  padding: 8px 4px;
  font-size: .92rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 8px;
}
.toc__item::before {
  content: counter(toc, decimal-leading-zero);
  font-size: .7rem;
  font-weight: 600;
  color: var(--ink-mute);
  line-height: 1.9;
}
a.toc__item:hover { color: var(--ink); background: var(--c-08); }
.toc__item.is-current { color: var(--c-light, #cdbaf6); font-weight: 600; }
.toc__all {
  display: inline-block;
  margin-top: 12px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--c-light, #cdbaf6);
  text-decoration: none;
}
.toc__all:hover { text-decoration: underline; text-underline-offset: 4px; }

/* powiązane */

.also { margin-top: clamp(34px, 6vw, 60px); }
.also__title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
}
.also__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 13px;
}
.also__grid--page { margin-top: 26px; }

.mini {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-decoration: none;
  transition: border-color .18s, background .18s, transform .18s;
}
.mini:hover {
  border-color: var(--c-60);
  background: var(--c-08);
  transform: translateY(-2px);
}
.mini__meta {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-light);
}
.mini__title { font-size: .95rem; font-weight: 500; line-height: 1.4; }
.mini__more { margin-top: auto; font-size: .76rem; color: var(--ink-mute); }

/* CTA wróżby */

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(34px, 6vw, 60px);
  padding: 26px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--c-35, var(--line));
  background:
    radial-gradient(120% 160% at 100% 0%, var(--c-14, rgba(154, 124, 232, .14)) 0%, transparent 60%),
    var(--panel);
}
.cta__title { margin: 0; font-family: var(--display); font-weight: 500; font-size: 1.45rem; }
.cta__lead { margin: 6px 0 0; font-size: .9rem; color: var(--ink-soft); }

/* ---------- stopka ---------- */

.enc-footer { border-top: 1px solid var(--line); background: rgba(255, 255, 255, .015); }
.enc-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.enc-footer__brand { font-family: var(--display); font-size: 1.05rem; color: #f3e6c4; }
.enc-footer__nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.enc-footer__nav a {
  font-size: .84rem;
  color: var(--ink-mute);
  text-decoration: none;
}
.enc-footer__nav a:hover { color: var(--ink); }
.enc-footer__note { font-size: .76rem; color: var(--ink-mute); }

/* ---------- responsywność ---------- */

@media (max-width: 900px) {
  .topbar__nav { order: 3; width: 100%; margin-left: 0; }
  .topbar__search { flex: 1 1 160px; }
  .topbar__kbd { display: none; }
}

@media (max-width: 640px) {
  body.enc { font-size: 16px; }
  .shero { grid-template-columns: 1fr; text-align: center; }
  .shero__glyph { width: 96px; margin: 0 auto; }
  .shero .btn { margin: 0 auto; }
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { text-align: left; }
  .realm__link { grid-template-columns: 52px 1fr auto; padding: 18px; }
  .realm__glyph { width: 52px; height: 52px; }
  .hero__stats { gap: 30px; }
  .cta { padding: 22px; }
  .art__lead::first-letter { font-size: 2.8em; }
}
