* {
  box-sizing: border-box;
}
html:focus-within {
  scroll-behavior: smooth;
}

:root {
  --brand: #7c3aed;
  --brand-2: #22c55e;
  --radius: 18px;
  --radius-2: 26px;
  --max: 1200px;

  --bg: #0b1020;
  --surface: rgba(15, 23, 42, 0.78);
  --surface-2: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.22);
  --text: rgba(248, 250, 252, 0.96);
  --muted: rgba(226, 232, 240, 0.78);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef0f8;
    --surface: rgba(233, 236, 248, 0.96);
    --surface-2: rgba(222, 227, 245, 0.98);
    --border: rgba(15, 23, 42, 0.16);
    --text: rgba(15, 23, 42, 0.92);
    --muted: rgba(15, 23, 42, 0.68);
    --shadow: 0 18px 40px rgba(10, 18, 32, 0.12);
  }
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --surface: rgba(15, 23, 42, 0.78);
  --surface-2: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.22);
  --text: rgba(248, 250, 252, 0.96);
  --muted: rgba(226, 232, 240, 0.78);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}
html[data-theme="light"] {
  --bg: #eef0f8;
  --surface: rgba(233, 236, 248, 0.96);
  --surface-2: rgba(222, 227, 245, 0.98);
  --border: rgba(15, 23, 42, 0.16);
  --text: rgba(15, 23, 42, 0.92);
  --muted: rgba(15, 23, 42, 0.68);
  --shadow: 0 18px 40px rgba(10, 18, 32, 0.12);
}

html {
  font-size: calc(16px * var(--font-scale, 1));
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    "Noto Sans",
    "Liberation Sans",
    sans-serif;
  line-height: 1.6;
  color: var(--text);
  min-height: 100dvh;
}

html[data-theme="light"] body {
  background:
    radial-gradient(
      1200px 700px at 22% -10%,
      rgba(34, 197, 94, 0.14),
      transparent 55%
    ),
    radial-gradient(
      900px 600px at 82% 0%,
      rgba(59, 130, 246, 0.1),
      transparent 52%
    ),
    radial-gradient(
      700px 500px at 50% 110%,
      rgba(124, 58, 237, 0.1),
      transparent 58%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
    var(--bg);
}
html[data-theme="dark"] body {
  background:
    radial-gradient(
      1200px 700px at 18% -12%,
      rgba(34, 197, 94, 0.18),
      transparent 55%
    ),
    radial-gradient(
      900px 600px at 82% -4%,
      rgba(59, 130, 246, 0.14),
      transparent 52%
    ),
    radial-gradient(
      800px 520px at 55% 112%,
      rgba(124, 58, 237, 0.14),
      transparent 58%
    ),
    var(--bg);
}

a {
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
.muted {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: 10px;
  top: 10px;
  transform: translateY(-140%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid rgba(34, 197, 94, 0.55);
  outline-offset: 2px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.86);
}
@supports (background: color-mix(in srgb, black 50%, transparent)) {
  .header {
    background: color-mix(in srgb, var(--bg) 86%, transparent);
  }
}
.header__bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 220px;
  text-decoration: none;
}
.brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.92),
    rgba(59, 130, 246, 0.78)
  );
  box-shadow: 0 12px 25px rgba(34, 197, 94, 0.2);
}
.brand__title {
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand__sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: -2px;
  display: block;
}

.icon-btn,
.menu-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.icon-btn:hover,
.menu-btn:hover {
  background: var(--surface-2);
}
.icon-btn:focus-visible,
.menu-btn:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.55);
  outline-offset: 2px;
}
.icon-btn--font {
  font-weight: 950;
  min-width: 44px;
  justify-content: center;
}

.menu-btn__label {
  font-weight: 700;
  font-size: 14px;
}
.menu-btn__lines {
  width: 18px;
  height: 12px;
  display: inline-block;
  position: relative;
}
.menu-btn__lines::before,
.menu-btn__lines::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.menu-btn__lines::before {
  top: 0;
}
.menu-btn__lines::after {
  bottom: 0;
}

#themeToggle {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#themeToggle .theme-ico {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor !important;
}
#themeToggle .theme-ico--sun {
  display: none;
}
#themeToggle .theme-ico--moon {
  display: block;
}
html[data-theme="dark"] #themeToggle .theme-ico--sun {
  display: block;
}
html[data-theme="dark"] #themeToggle .theme-ico--moon {
  display: none;
}

.topnav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 14px;
  display: none;
  gap: 8px;
  flex-wrap: wrap;
}
.topnav.is-open {
  display: flex;
}
.topnav__link {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.topnav__link:hover {
  background: var(--surface-2);
}
.topnav__hint {
  font-weight: 600;
  color: var(--muted);
}

/* Layout */
.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .content {
    order: 1;
  }
}

/* Panels */
.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel__head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.panel__title {
  font-weight: 900;
}
.panel__meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Sidebar groups */
.sidegroups {
  padding: 10px;
  display: grid;
  gap: 10px;
}
.sgrp {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  overflow: clip;
}
.sgrp__sum {
  list-style: none;
  cursor: pointer;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}
.sgrp__sum::-webkit-details-marker {
  display: none;
}
.sgrp__title {
  font-size: 13px;
  letter-spacing: 0.2px;
}
.sgrp__chev {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  position: relative;
}
.sgrp__chev::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -2px;
}
.sgrp[open] .sgrp__chev::before {
  transform: rotate(-135deg);
  margin-top: 2px;
}
.sgrp__content {
  padding: 6px 8px 10px;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--border);
}

.sidenav__link {
  text-decoration: none;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 800;
  font-size: 14px;
}
.sidenav__link:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.sidenav__link.is-active {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.32);
}

/* Sidebar info */
.side-quote {
  margin: 10px;
  border: 1px solid var(--border);
  background: rgba(34, 197, 94, 0.1);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.side-quote__mark {
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  opacity: 0.9;
}
.side-quote__text {
  font-weight: 950;
  letter-spacing: 0.15px;
  margin-top: 6px;
}
.side-quote__meta {
  margin-top: 6px;
  font-size: 13px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.hero__text {
  border: 1px solid var(--border);
  background:
    radial-gradient(
      900px 520px at 18% 0%,
      rgba(34, 197, 94, 0.12),
      transparent 60%
    ),
    radial-gradient(
      700px 420px at 90% 10%,
      rgba(59, 130, 246, 0.1),
      transparent 60%
    ),
    var(--surface);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow);
  padding: 18px;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 2vw + 14px, 34px);
  letter-spacing: 0.2px;
}
.lead {
  margin: 0 0 12px;
  color: var(--muted);
}

.hero__card {
  border: 1px solid var(--border);
  background:
    radial-gradient(
      900px 480px at 15% 0%,
      rgba(59, 130, 246, 0.12),
      transparent 60%
    ),
    radial-gradient(
      700px 420px at 95% 10%,
      rgba(34, 197, 94, 0.1),
      transparent 60%
    ),
    var(--surface-2);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.hero-stat {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: 12px;
  text-align: center;
}
.hero-stat__big {
  font-weight: 950;
  font-size: 28px;
  letter-spacing: 0.6px;
}
.hero-stat__small {
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
  margin-top: 2px;
}

.quote-chip {
  border: 1px solid rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.12);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.quote-chip__mark {
  font-size: 20px;
}
.quote-chip__title {
  font-weight: 950;
  letter-spacing: 0.1px;
}
.quote-chip__meta {
  font-weight: 800;
  font-size: 13px;
  margin-top: 4px;
}

.btn {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(34, 197, 94, 0.2);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  filter: brightness(1.05);
}
.btn--ghost {
  background: var(--surface);
}
.btn--ghost:hover {
  background: var(--surface-2);
}
.mini-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.story__body {
  padding: 14px;
}

/* Tools: chips + search */
.tools {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 950;
  cursor: pointer;
}
.chip:hover {
  background: var(--surface-2);
}
.chip.is-active {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.32);
}

.search {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}
.search__ico {
  opacity: 0.9;
  font-weight: 950;
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
}

/* News list */
.news-list {
  display: grid;
  gap: 14px;
}

.ncard {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ncard__head {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ncard__title {
  margin: 0;
  font-weight: 950;
  letter-spacing: 0.2px;
  font-size: 18px;
}
.ncard__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
}
.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.12);
  font-weight: 950;
  font-size: 12px;
  color: var(--text);
}
.badge--gray {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.ncard__body {
  padding: 12px;
}
.ncard__body p {
  margin: 0 0 10px;
}
.ncard__body p:last-child {
  margin-bottom: 0;
}

.links {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 950;
  color: var(--text);
}
.link-pill:hover {
  filter: brightness(1.07);
}
.link-pill .muted {
  font-weight: 900;
}

/* Carousel */
.carousel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
  overflow: hidden;
}
/* .carousel__main {
  position: relative;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
} */
.carousel__main {
  position: relative;

  /* ✅ zamiast wielkiego 16:9 robimy mniejszy box */
  aspect-ratio: auto; /* kasujemy stałe proporcje */
  height: auto;

  /* ✅ ustawiamy mniejszą wysokość — ~60% poprzedniego wrażenia */
  padding: 12px 0; /* trochę oddechu */
  background: rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
}

/* ✅ docelowa wysokość głównego pola galerii (nad miniaturami) */
.carousel__main {
  max-height: 400px; /* dostosuj jeśli chcesz: 240–320px */
  min-height: 240px;
}

/* obraz dopasowany do nowej wysokości */
.carousel__main img {
  max-height: 400px;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.carousel__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .carousel__main {
    max-height: 340px;
    min-height: 220px;
  }
  .carousel__main img {
    max-height: 320px;
  }
}

.car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.car-btn:hover {
  background: rgba(15, 23, 42, 0.82);
}
.car-btn:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.55);
  outline-offset: 2px;
}
.car-btn--prev {
  left: 10px;
}
.car-btn--next {
  right: 10px;
}

.thumbs {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow: auto;
  border-top: 1px solid var(--border);
}
.thumb {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  min-width: 92px;
  height: 62px;
  cursor: pointer;
  position: relative;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb.is-active {
  outline: 2px solid rgba(34, 197, 94, 0.55);
  outline-offset: 2px;
}

/* Journal embeds */
.embed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px) {
  .embed-grid {
    grid-template-columns: 1fr;
  }
}
.embed {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.embed iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  display: block;
}
.embed__cap {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-weight: 900;
  color: var(--muted);
}

/* Footer */
.footer {
  margin: 18px 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.footer__grid {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.footer__title {
  font-weight: 950;
}
.footer__links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.footer__links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 900;
}
.footer__links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Cookie */
.cookie {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: var(--max);
  margin: 0 auto;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow);
  padding: 12px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.cookie__text {
  display: grid;
  gap: 4px;
}
.cookie__text a {
  color: var(--muted);
  font-weight: 900;
}
.cookie__text a:hover {
  color: var(--text);
}
.cookie__actions {
  display: flex;
  gap: 10px;
}

/* To top */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 86px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.to-top:hover {
  background: var(--surface-2);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 200;
}
.lightbox.is-open {
  display: block;
}
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.lightbox__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1060px, calc(100vw - 26px));
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
}
@media (max-width: 720px) {
  .lightbox__panel {
    grid-template-columns: 1fr;
  }
  .lightbox__nav {
    display: none;
  }
}
.lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.lightbox__close:hover {
  background: var(--surface-2);
}

.lightbox__nav {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 950;
  font-size: 26px;
}
.lightbox__nav:hover {
  background: var(--surface-2);
}

.lightbox__figure {
  margin: 0;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.lightbox__figure img {
  width: 100%;
  max-height: min(72vh, 680px);
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.lightbox__cap {
  text-align: center;
  font-weight: 900;
  font-size: 13px;
}

/* SR only */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Note */
.mini-note {
  margin-top: 12px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  border-radius: 18px;
  padding: 12px;
  font-weight: 800;
}
.mini-note code {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-weight: 950;
}

/* Print */
@media print {
  .header,
  .sidebar,
  .cookie,
  .to-top,
  .mini-actions,
  .tools,
  .lightbox {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .panel,
  .hero__text,
  .hero__card,
  .footer,
  .ncard,
  .embed {
    box-shadow: none !important;
    background: #fff !important;
    border-color: #ddd !important;
  }
}
