/* Reset & Variables */
* { box-sizing: border-box }

:root {
  --pad: clamp(24px, 6vw, 96px);
  --header-h: clamp(56px, 6vw, 72px);
  --shade: 0.42;
}

html { 
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) { 
  html { scroll-behavior: auto } 
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: #fff;
  background: #000;
  padding-top: var(--header-h);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #fff;
  text-decoration: none;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 200;
}

.skip-link:focus {
  top: 0;
}

/* Header */
header {
  position: fixed;
  inset: 0 0 auto;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.95;
  color: #fff;
  flex-shrink: 0;
}

nav {
  display: flex;
  align-items: center;
}

nav ul {
  display: flex;
  gap: clamp(8px, 2vw, 16px);
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  color: #fff;
  font-weight: 600;
  opacity: 0.9;
  padding: 0.45em 0.8em;
  border-radius: 999px;
  outline: none;
  transition: background 0.2s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.14);
}

nav a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 16px;
  margin-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  opacity: 1;
}

a.lang-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  transition: 0.3s;
}

/* Hero Sections */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: var(--pad);
  scroll-margin-top: calc(var(--header-h) + 8px);
  background:
    linear-gradient(0deg, rgba(0, 0, 0, var(--shade)), rgba(0, 0, 0, var(--shade))),
    var(--img) center / cover no-repeat;
}

.hero .inner {
  max-width: min(60ch, 100%);
}

.hero.center {
  justify-content: center;
  text-align: center;
}

.hero.left {
  justify-content: flex-start;
  text-align: left;
}

.hero.right {
  justify-content: flex-end;
  text-align: right;
}

/* Post sections - wyższy kontrast */
.post-section {
  min-height: 75vh;
}

.post-section .inner {
  max-width: min(50ch, 100%);
}

/* Typography */
.kicker {
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 0.95rem;
  margin-bottom: 0.8em;
}

h1 {
  margin: 0 0 0.4em;
  font-size: clamp(28px, 6vw, 64px);
  line-height: 1.1;
  font-weight: 900;
  text-wrap: balance;
}

.hero.center .inner {
  width: 100%;
  max-width: min(900px, 100%);
  text-align: center;
}

.hero.center .btn {
  margin-top: 4rem;
}

.hero.center h1 {
  text-wrap: unset;
  overflow-wrap: normal;
  word-break: normal;
}

h2 {
  margin: 0 0 clamp(12px, 3vh, 24px);
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

h3 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0 0 1.2em;
  font-size: clamp(16px, 2.2vw, 20px);
  opacity: 0.9;
}

.lead {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

time {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 0.5em;
}

/* Buttons */
.cta,
.btn {
  display: inline-block;
  padding: 0.9em 1.4em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  margin-top: 0.6rem;
  transition: background 0.2s ease;
}

.cta:hover,
.btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.cta:focus-visible,
.btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

/* Pills */
.pillbar {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
}

/* Sections */
.section {
  padding: var(--pad);
  scroll-margin-top: calc(var(--header-h) + 8px);
}

.section .inner,
.wrap {
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 28px);
}

.section-title {
  text-align: center;
}

.banner-section {
  padding-block: clamp(16px, 3vw, 32px);
}

/* Grid */
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: clamp(16px, 2.2vw, 24px);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.card p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  font-size: 0.95rem;
}

.card a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card a:hover {
  color: #fff;
}

/* Banner */
.banner {
  padding: 18px;
  text-align: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.banner a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Highlight Section */
.highlight {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: clamp(16px, 3vw, 24px);
  align-items: center;
  padding: clamp(20px, 3vw, 32px);
  margin: clamp(32px, 5vw, 64px) auto;
  max-width: min(900px, 100%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.highlight:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.hl-thumb {
  width: 160px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.hl-copy {
  flex: 1;
}

.hl-kicker {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4em;
}

.hl-title {
  display: block;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5em;
  color: #fff;
  text-decoration: none;
}

.hl-title:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hl-desc {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}

.hl-cta {
  padding: 0.7em 1.2em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.hl-cta:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Category badge (shared across pages) */
.cat-badge {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Archive filter chips */
.archive-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

/* Archive grid */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.archive-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.archive-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
}

.archive-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.archive-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  transition: transform 0.4s ease;
}

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

.archive-card-placeholder {
  background: rgba(255,255,255,0.06);
}

.archive-card-body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.archive-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.archive-card-meta time {
  display: inline;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.archive-card h2,
.archive-card h3 {
  font-size: clamp(1rem, 2vw, 1.12rem);
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0;
}

.archive-card p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.62);
  margin: 0;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 1;
}

.archive-card[hidden] {
  display: none !important;
}

/* Footer */
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 36px 0;
  color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  font-size: 14px;
}

footer .inner {
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 28px);
}

footer a {
  color: rgba(255, 255, 255, 0.9);
}

footer p {
  margin: 0;
  font-size: 14px;
}

/* Fade animations */
.fade .inner > * {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
  will-change: opacity, transform;
}

.fade.in .inner > * {
  opacity: 1;
  transform: none;
}

.fade.in .inner > *:nth-child(2) {
  transition-delay: 0.2s;
}

.fade.in .inner > *:nth-child(3) {
  transition-delay: 0.4s;
}

.fade.in .inner > *:nth-child(4) {
  transition-delay: 0.6s;
}

/* Fade for highlight (no .inner wrapper) */
.fade.highlight > * {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
  will-change: opacity, transform;
}

.fade.highlight.in > * {
  opacity: 1;
  transform: none;
}

.fade.highlight.in > *:nth-child(2) {
  transition-delay: 0.2s;
}

.fade.highlight.in > *:nth-child(3) {
  transition-delay: 0.4s;
}

@media (prefers-reduced-motion: reduce) {
  .fade .inner > *,
  .fade.highlight > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }
}

/* Performance optimization */
.hero:not(:first-of-type) {
  content-visibility: auto;
  contain-intrinsic-size: 88vh;
}

/* Mobile */
@media (max-width: 960px) {
  .burger {
    display: flex;
  }

  nav {
    position: absolute;
    right: 0;
  }

  nav ul {
    display: none;
  }

  body.menu-open nav ul {
    display: flex;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px 16px;
    gap: 8px;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 50;
    margin: 0;
  }

  body.menu-open nav ul li {
    width: 100%;
  }

  body.menu-open nav a {
    display: block;
    width: 100%;
  }

  body.menu-open nav .lang-switcher {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 0;
    padding-top: 10px;
    margin-left: 0;
    margin-top: 4px;
    width: 100%;
  }

  body.menu-open nav a.lang-btn {
    display: inline-flex;
    width: auto;
  }

  .hero.left,
  .hero.right {
    justify-content: center;
    text-align: center;
  }

  .post-section {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

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

  .highlight {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }

  .hl-thumb {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 11;
  }

  .hl-copy {
    text-align: left;
  }

  .hl-kicker {
    text-align: left;
  }

  .hl-title {
    text-align: left;
  }

  .hl-desc {
    text-align: left;
  }

  .hl-cta {
    width: 100%;
    display: block;
    text-align: center;
  }
}