/* ─────────────────────────────────────────────────────────────────────────
   Trupa "Cztery Deski" — arkusz stylów
   Estetyka: klepsydra (nekrolog prasowy) × afisz teatralny.
   Motyw: brutal — papier, tusz, akcent krwi. Mobile-first.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #efe9da;
  --bg-tint: #e8e1cf;
  --fg: #0a0807;
  --fg-mute: #4a4239;
  --fg-fade: #6e6456;        /* #82786a dawało 3.58:1 na papierze — poniżej WCAG AA */
  --rule: #0a0807;
  --rule-mute: rgba(10, 8, 7, .28);
  --side-bg: #0a0807;
  --side-fg: #efe9da;
  --side-fade: #857d72;      /* #7a7268 dawało 4.22:1 na czerni — poniżej WCAG AA */
  --side-rule: rgba(239, 233, 218, .4);
  --accent: #7d1414;
  --accent-fg: #efe9da;      /* tekst na ciemnym chromie (sidebar) — nigdy nie flipuje */
  --on-accent: #efe9da;      /* tekst/grafika NA tle akcentu w treści głównej */
  --paper-grain: 0.04;
  color-scheme: light;

  --font-display: "JetBrains Mono", "Courier New", monospace;
  --font-body: "EB Garamond", Garamond, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;
  --display-weight: 700;

  --pad-page: clamp(20px, 5vw, 64px);
  --h-topbar: 54px;
  --w-sidebar: 304px;
  --h-audio: 64px;

  /* Minima czytelności dla mikrotypografii (wersaliki, mono). */
  --fs-label: 0.75rem;       /* 12px: przyciski, daty, role, podpisy */
  --fs-ornament: 0.6875rem;  /* 11px: ozdobniki bez treści informacyjnej */
  --fs-prose: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);       /* 18→20px: tekst ciągły */
  --fs-prose-sm: clamp(1.0625rem, 1rem + 0.15vw, 1.125rem);  /* 17→18px: krótkie notki */
  --w-content-max: 1480px;   /* szerokość treści przy 1920px */
}

/* ── Tryb ciemny ─────────────────────────────────────────────────────────────
   Przełącznikiem jest świeca w sidebarze: pali się w trybie jasnym,
   zdmuchnięcie gasi światło na stronie.
   Flipujemy WYŁĄCZNIE tokeny treści głównej — sidebar, topbar i belka
   odtwarzacza (--side-*) są ciemne zawsze, w obu motywach.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #17120f;
  --bg-tint: #201a15;
  --fg: #ece6d8;
  --fg-mute: #b5ab9b;
  --fg-fade: #8d8375;
  --rule: #9c9282;
  --rule-mute: rgba(236, 230, 216, .2);
  --accent: #e0645c;         /* jaśniejsza krew — na ciemnym tle musi być czytelna */
  --on-accent: #17120f;
  --paper-grain: 0.05;
  color-scheme: dark;
}
/* Ziarno: na papierze przyciemnia (multiply), na ciemnym rozjaśnia (screen). */
[data-theme="dark"] body::before { mix-blend-mode: screen; }
/* Logo w treści głównej jest czarne — w ciemnym motywie musi być kremowe. */
[data-theme="dark"] .paper-logo { filter: brightness(0) invert(1); }
/* Sama desaturacja rozjaśnia plakietkę Tomka ponad sąsiadów — przygaszamy. */
[data-theme="dark"] .friend-card--memoriam .plate { filter: grayscale(1) brightness(0.82); }

@media (prefers-reduced-motion: no-preference) {
  body, .show-card, .plate, .video-wrap, .scene-img, .gallery-img,
  .o-nas-foto .frame, .page-foot, .page-head, .memoriam-frame {
    transition: background-color .3s ease, border-color .3s ease, color .3s ease;
  }
}

/* ── Reset i baza ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.svg-defs { position: absolute; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Ziarno papieru — pseudo-szum, żeby tło nie było płaskim kolorem. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: var(--paper-grain);
  background-image:
    radial-gradient(circle at 25% 35%, currentColor 0.3px, transparent 0.6px),
    radial-gradient(circle at 75% 65%, currentColor 0.3px, transparent 0.6px);
  background-size: 3px 3px, 5px 5px;
  color: var(--fg);
  mix-blend-mode: multiply;
}

/* ── Górna belka (mobile) ────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--h-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: var(--side-bg);
  color: var(--side-fg);
  border-bottom: 1px solid var(--side-rule);
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-ornament);
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.topbar-mark { width: 24px; height: 22px; color: var(--side-fg); }
.menu-btn {
  background: transparent;
  border: 1px solid var(--side-rule);
  color: var(--side-fg);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

/* Scrim pod szufladą menu — aktywny tylko na mobile (wyspa <1024px). */
.menu-scrim { display: none; }

/* ── Sidebar: mobile = szuflada menu, desktop = stała kolumna ────────────── */
.sidebar {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--side-bg);
  color: var(--side-fg);
  display: flex;
  flex-direction: column;
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform .3s ease, visibility 0s linear .3s;
}
body.menu-open .sidebar {
  transform: none;
  visibility: visible;
  transition: transform .3s ease;
}
body.menu-open { overflow: hidden; }

.sidebar-inner {
  flex: 1;
  margin: 14px;
  border: 0.5px solid var(--side-rule);
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  position: relative;
}
.menu-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--side-rule);
  color: var(--side-fg);
  font-size: 0.9375rem;
  line-height: 1;
}
.sidebar-logo {
  display: flex;
  justify-content: center;
  padding: 8px 0 24px;
}
.sidebar-logo img {
  max-width: 132px;
  width: 44%;
  filter: brightness(0) invert(1);
}
.sidebar-title {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--side-fade);
  text-align: center;
  padding: 0 0 6px;
}
.sidebar-rule {
  height: 1px;
  background: var(--side-rule);
  margin: 10px -4px 16px;
}
.sidebar-rule.double {
  height: 4px;
  background: linear-gradient(
    to bottom,
    var(--side-rule) 0 1px,
    transparent 1px 3px,
    var(--side-rule) 3px 4px
  );
}

.nav {
  --nav-num-col: 2.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Mono w nagłówkach potrafi się rozlewać — pozycje menu celowo lżejsze
   (waga 400, umiar w rozmiarze), żeby nie traciły czytelności. */
.nav-item {
  display: grid;
  grid-template-columns: var(--nav-num-col) 1fr 28px;
  align-items: baseline;
  padding: 12px 4px;
  color: var(--side-fg);
  text-align: left;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.02em;
  position: relative;
  transition: color .15s ease;
}
.nav-item .num {
  font-family: var(--font-mono);
  font-size: var(--fs-ornament);
  letter-spacing: 0.04em;
  color: var(--side-fade);
}
.nav-item .glyph {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--side-fade);
  opacity: 0;
  transition: opacity .15s ease;
}
.nav-item[aria-current="page"] .glyph { opacity: 1; color: var(--side-fg); }
.nav-item[aria-current="page"] .num { color: var(--side-fg); }
.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -22px; right: -22px; top: -1px;
  border-top: 1px solid var(--side-rule);
}
.nav-item[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: -22px; right: -22px; bottom: -1px;
  border-bottom: 1px solid var(--side-rule);
}
/* Podsekcje rozwijane pod aktywną pozycją (O Nas). */
.nav-sub {
  display: none;
  list-style: none;
  margin: 10px 0 8px calc(var(--nav-num-col) + 4px);
  padding: 0 0 0 14px;
  border-left: 1px solid var(--side-rule);
}
.nav li:has(> .nav-item[aria-current="page"]) > .nav-sub { display: block; }
.nav-sub a {
  display: block;
  padding: 5px 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--side-fade);
  transition: color .15s ease;
}
.nav-sub a:hover,
.nav-sub a:focus-visible { color: var(--accent-fg); }
.nav-sub a { position: relative; text-wrap: balance; }
.nav-sub a[aria-current="page"] { color: var(--side-fg); }
/* Aktywna pozycja = pogrubiony odcinek pionowej linii podlisty. */
.nav-sub a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 4px;
  bottom: 4px;
  border-left: 3px solid var(--side-fg);
}

/* ── Ekrany ──────────────────────────────────────────────────────────────── */
.screen {
  padding: var(--pad-page);
  animation: screen-in 0.4s ease-out both;
  scroll-margin-top: var(--h-topbar);
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen--songs { padding-bottom: calc(var(--h-audio) + 40px); }

/* ── Prymitywy typograficzne ─────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin: 0 0 12px;
}
.body-prose {
  font-family: var(--font-body);
  font-size: var(--fs-prose);
  line-height: 1.6;
  color: var(--fg);
  max-width: 60ch;
  text-wrap: pretty;
  margin: 0;
}
.rule {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--fg-mute);
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.rule .orn { font-family: var(--font-body); font-size: 0.875rem; white-space: nowrap; }

/* ── Nagłówek podstrony ──────────────────────────────────────────────────── */
.page-head {
  display: grid;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.875rem, 8.5vw, 2.75rem);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.page-head .count {
  font-family: var(--font-mono);
  font-size: var(--fs-ornament);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-fade);
}

/* ── STRONA GŁÓWNA ───────────────────────────────────────────────────────── */
.screen--home {
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--h-topbar));
}

/* Gazeta na stronie głównej: winieta, artykuł główny, repertuar, archiwum. */
/* Rozkładówka: dwie kartki obok siebie z grzbietem (na wąskich jedna pod drugą). */
.paper-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  padding: clamp(16px, 3vh, 36px) clamp(14px, 3vw, 32px);
}
.paper {
  position: relative;
  display: grid;
  max-width: 1200px;
  margin-inline: auto;
  border: 1px solid var(--rule);
  background: var(--bg);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.4);
}
.paper::before {
  content: "";
  position: absolute;
  inset: clamp(6px, 1vh, 10px);
  border: 0.5px solid var(--rule);
  pointer-events: none;
  z-index: 2;
}
.paper-spine {
  display: none;
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 24px;
  transform: translateX(-50%);
  background: linear-gradient(to right,
    transparent 0%,
    var(--rule-mute) 46%,
    var(--rule) 50%,
    var(--rule-mute) 54%,
    transparent 100%);
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}
.paper-page {
  min-width: 0;
  padding: clamp(24px, 3.4vh, 40px) clamp(22px, 3vw, 44px);
  container-type: inline-size;
}
.paper-page--right { border-top: 0.5px solid var(--rule-mute); }
.paper-masthead { text-align: center; }
.paper-masthead::after {
  content: "";
  display: block;
  height: 3px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.paper-dateline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 0.5px solid var(--rule-mute);
  font-family: var(--font-mono);
  font-size: var(--fs-ornament);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-fade);
}
.paper-title { margin: clamp(20px, 3.4vh, 36px) 0 clamp(12px, 2vh, 18px); line-height: 0; }
.paper-logo {
  display: block;
  width: clamp(150px, 16vw, 210px);
  height: auto;
  margin-inline: auto;
  filter: brightness(0);
}
.paper-motto {
  margin: 0 0 clamp(16px, 2.5vh, 24px);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  color: var(--fg-mute);
  text-wrap: balance;
}
.paper-lead { padding-top: clamp(20px, 3vh, 28px); }
.paper-section {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg);
}
.paper-lead-body { display: grid; gap: 20px 28px; }
.paper-poster {
  display: block;
  max-width: 200px;
  border: 1px solid var(--rule);
  box-shadow: 0 18px 32px -22px rgba(0, 0, 0, 0.45);
}
.paper-poster img { display: block; width: 100%; height: auto; }
.paper-headline {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.875rem, 7cqi, 2.75rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.paper-headline a { transition: color .15s ease; }
.paper-when {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 3.6cqi, 1.25rem);
}
.paper-when::first-letter { text-transform: uppercase; }
.paper-where {
  margin: 0 0 16px;
  font-family: var(--font-body);
  font-size: var(--fs-prose);
  color: var(--fg-mute);
}
.paper-lead .show-tags { margin-bottom: 20px; }
.paper-lead .news-actions { margin: 0; align-items: center; gap: 10px; }
.paper-lead .news-tickets,
.paper-lead .news-fb { padding: 8px 14px; }
.paper-more {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  transition: color .15s ease;
}
.paper-repertoire { list-style: none; margin: 0; padding: 0; }
.paper-repertoire li + li { border-top: 0.5px solid var(--rule-mute); }
.paper-repertoire a { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; }
.paper-rep-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.15;
  transition: color .15s ease;
}
.paper-rep-status {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-fade);
}
.paper-headline a:hover,
.paper-more:hover,
.paper-repertoire a:hover .paper-rep-title { color: var(--accent); }
.paper-archive { margin-top: clamp(32px, 5vh, 48px); }
@media (max-width: 639px) {
  .paper-dateline { flex-direction: column; align-items: center; }
}
/* Plakat obok tekstu, gdy kartka jest dość szeroka (kontener = kartka). */
@container (min-width: 440px) {
  .paper-lead-body { grid-template-columns: minmax(130px, 170px) 1fr; align-items: start; }
  .paper-poster { max-width: none; }
}
/* Wąska kartka (laptopy ~1100px): data wpisu nad treścią, jak na telefonie. */
@container (max-width: 420px) {
  .paper-page .news-entry { grid-template-columns: 1fr; gap: 4px; }
  .paper-page .news-actions { margin-left: 0; }
}
@media (min-width: 900px) {
  .paper { grid-template-columns: 1fr 1fr; }
  .paper-spine { display: block; }
  .paper-page--right { border-top: 0; }
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.news-item { border-bottom: 0.5px solid var(--rule-mute); }
.news-item:last-child { border-bottom: 0; }
.news-entry {
  display: grid;
  /* 8.5rem: mieści pełną datę "27 · XI · 2026" (12px) bez stykania z etykietą. */
  grid-template-columns: 8.5rem 1fr;
  gap: 12px;
  align-items: baseline;
  width: 100%;
  padding: 12px 4px;
  transition: background .15s ease, padding-left .2s ease;
}
.news-date {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  color: var(--fg-mute);
  padding-top: 3px;
  white-space: nowrap;
}
.news-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.news-kind {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-fade);
}
.news-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.875rem, 3.8vw, 1.0625rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.news-arrow {
  font-family: var(--font-body);
  font-size: 0.8em;
  color: var(--fg-fade);
  opacity: 0;
  transition: opacity .15s ease;
}
.news-note {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--fg-mute);
}
.news-item.past .news-date,
.news-item.past .news-kind,
.news-item.past .news-title,
.news-item.past .news-note {
  color: var(--fg-fade);
  opacity: 0.65;
}
.news-item.past .news-title {
  text-decoration: line-through;
  text-decoration-thickness: 0.5px;
  text-decoration-color: var(--rule-mute);
}
/* Przyciski pod wpisem występu: bilety (wyróżnione) i wydarzenie na FB. */
.news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
}
.news-tickets {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 0.5px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.news-fb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 0.5px solid var(--rule);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.news-item.past .news-fb { opacity: 0.6; }
.news-fb svg { display: block; }

/* Świeca — czysty CSS, powolne migotanie. Mieszka w sidebarze i jest
   przełącznikiem motywu. Sidebar jest ciemny zawsze, więc świeca ma
   STAŁE kolory (nie tokeny motywu) — wygląda tak samo w obu trybach. */
.sidebar-candle {
  margin-top: auto;
  display: flex;
  justify-content: center;
  padding-top: 24px;
}
.candle {
  position: relative;
  width: 16px; height: 72px;
  display: block;
  flex-shrink: 0;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.candle > span { display: block; }
.candle .flame, .candle .glow { transition: opacity .4s ease; }
/* Świeca pali się w trybie JASNYM — zdmuchnięcie jej gasi światło
   na stronie (tryb ciemny). Stan wynika wprost z [data-theme] (bez
   klasy z JS, więc bez mignięcia płomienia przed startem skryptu).
   animation: none — inaczej migotanie nadpisuje opacity.
   Celowo bez :root — specyficzność (0,3,0) remisuje z klasami
   przejściowymi .is-dousing/.is-igniting, które stoją dalej w pliku
   i dzięki temu wygrywają na czas animacji. */
[data-theme="dark"] .candle .flame,
[data-theme="dark"] .candle .glow { opacity: 0; animation: none; }
.candle .stick {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 54px;
  background: linear-gradient(
    to right,
    #ddd6c4 0%,
    #efe9da 30%,
    #ddd6c4 70%,
    #8d8375 100%
  );
  border: 0.5px solid rgba(239, 233, 218, .3);
}
.candle .wick {
  position: absolute;
  bottom: 54px; left: 50%;
  width: 1px; height: 4px;
  background: #8d8375;
  transform: translateX(-50%);
}
.candle .flame {
  position: absolute;
  bottom: 56px; left: 50%;
  width: 10px; height: 18px;
  background: radial-gradient(
    ellipse at 50% 90%,
    #ffd27a 0%,
    #ff9b3a 40%,
    rgba(255, 80, 0, 0.6) 75%,
    transparent 100%
  );
  border-radius: 50% 50% 50% 50% / 70% 70% 40% 40%;
  transform: translateX(-50%);
  filter: blur(0.3px);
  animation: flicker 2.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.candle .glow {
  position: absolute;
  bottom: 46px; left: 50%;
  width: 80px; height: 80px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 180, 80, 0.18) 0%, transparent 60%);
  pointer-events: none;
  animation: glow-pulse 4s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1, 1) rotate(0deg); opacity: 0.95; }
  20% { transform: translateX(-50%) scale(0.96, 1.04) rotate(-1.5deg); opacity: 1; }
  45% { transform: translateX(-50%) scale(1.04, 0.96) rotate(1deg); opacity: 0.9; }
  70% { transform: translateX(-50%) scale(0.98, 1.02) rotate(-0.5deg); opacity: 0.98; }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.9; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
/* Dym — dwie smugi (element + ::after), widoczne tylko przy gaszeniu. */
.candle .smoke {
  position: absolute;
  bottom: 56px; left: 50%;
  width: 7px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 60%,
    rgba(214, 208, 196, 0.85) 0%,
    rgba(214, 208, 196, 0.3) 60%,
    transparent 100%
  );
  filter: blur(1.5px);
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.candle .smoke::after {
  content: "";
  position: absolute;
  inset: 2px -2px -2px 2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
}
/* Klasy przejściowe nadaje JS wyłącznie przy kliknięciu — wejście na
   stronę z zapisanym motywem nie odpala gaszenia ani rozpalania.
   Reguły stoją PO regule [data-theme="dark"], żeby przy tej samej
   specyficzności wygrać z jej animation: none. */
/* Iskra jak z zapalniczki — błyska przy knocie tuż przed płomieniem. */
.candle .spark {
  position: absolute;
  bottom: 55px; left: 50%;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fff8dc 0%,
    #ffd27a 40%,
    rgba(255, 155, 58, 0.6) 70%,
    transparent 100%
  );
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
/* Podmuch to impuls: szybki atak (płomień natychmiast się kładzie),
   krótkie dogaśnięcie — stąd 0.32s i krzywa z ostrym startem. */
.candle.is-dousing .flame { animation: candle-snuff 0.32s cubic-bezier(0.25, 0.6, 0.35, 1) both; }
.candle.is-dousing .glow { transition-duration: 0.25s; }
.candle.is-dousing .smoke { animation: smoke-rise 1.6s ease-out 0.26s both; }
.candle.is-dousing .smoke::after { animation: smoke-drift 1.5s ease-out 0.45s both; }
.candle.is-igniting .spark { animation: spark-strike 0.5s linear both; }
/* Bez własnego flickera: 100% klatka rozpalenia == 0% klatka flickera,
   więc po sprzątnięciu klasy bazowe migotanie startuje dokładnie z tego
   samego stanu — zero mrugnięcia niezależnie od momentu sprzątnięcia. */
.candle.is-igniting .flame {
  animation: candle-ignite 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) 0.32s both;
}
/* Poświata dołącza dopiero, gdy płomień już się zajął. */
.candle.is-igniting .glow {
  opacity: 0;
  transition: none;
  animation: glow-pulse 4s ease-in-out 0.6s infinite;
}
/* Dmuchnięcie: podmuch od lewej natychmiast kładzie płomień na bok
   (obrót wokół podstawy), rozciąga go i zrywa z knota. */
@keyframes candle-snuff {
  0% { opacity: 0.95; transform: translateX(-50%) scale(1, 1) rotate(0deg); }
  30% { opacity: 0.9; transform: translateX(-16%) scale(1.1, 0.72) rotate(52deg); }
  60% { opacity: 0.5; transform: translateX(4%) scale(0.7, 0.4) rotate(74deg); }
  100% { opacity: 0; transform: translateX(12%) scale(0.3, 0.16) rotate(86deg); }
}
/* Iskra: dwa szybkie błyski z odskokiem — jak krzesiwo zapalniczki. */
@keyframes spark-strike {
  0%, 100% { opacity: 0; transform: translate(-50%, 0) scale(0.3); }
  10% { opacity: 1; transform: translate(-105%, -3px) scale(1.5); }
  20% { opacity: 0; transform: translate(-80%, -5px) scale(0.5); }
  38% { opacity: 1; transform: translate(-5%, -2px) scale(1.2); }
  50% { opacity: 0.4; transform: translate(-35%, -6px) scale(0.7); }
  62% { opacity: 0; }
}
/* Płomień łapie od iskry: strzela w górę z przestrzeleniem.
   UWAGA: klatka 100% musi być identyczna z klatką 0% flickera
   (opacity 0.95, scale 1, rotate 0) — patrz komentarz wyżej. */
@keyframes candle-ignite {
  0% { opacity: 0; transform: translateX(-50%) scale(0.08, 0.12); }
  35% { opacity: 1; transform: translateX(-50%) scale(1.3, 0.72); }
  65% { transform: translateX(-50%) scale(0.88, 1.22) rotate(2deg); }
  100% { opacity: 0.95; transform: translateX(-50%) scale(1, 1) rotate(0deg); }
}
/* Dym unosi się, myszkuje na boki i rozprasza. */
@keyframes smoke-rise {
  0% { opacity: 0; transform: translate(-50%, 2px) scale(0.35) rotate(0deg); }
  14% { opacity: 0.85; }
  55% { transform: translate(-66%, -18px) scale(1.4) rotate(-11deg); }
  100% { opacity: 0; transform: translate(-30%, -40px) scale(2.4) rotate(13deg); }
}
@keyframes smoke-drift {
  0% { opacity: 0; transform: translate(0, 2px) scale(0.3); }
  16% { opacity: 0.55; }
  55% { transform: translate(3px, -13px) scale(1.5) rotate(10deg); }
  100% { opacity: 0; transform: translate(-5px, -30px) scale(2.1) rotate(-15deg); }
}

/* Kurtyny — delikatne kolumny cienia od krawędzi. */
.curtain {
  position: absolute;
  top: 0;
  width: 80px;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to right, var(--side-bg) 0%, transparent 100%);
  opacity: 0.06;
}
.curtain.left { left: 0; }
.curtain.right { right: 0; transform: scaleX(-1); }

/* ── GALERIA ────────────────────────────────────────────────────────────── */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(20px, 3vh, 32px);
}
.gallery-tag {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  transition: background .15s ease, color .15s ease;
}
.gallery-tag.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.gallery-tile {
  margin: 0;
  animation: screen-in 0.3s ease-out both;
}
.gallery-img img,
.scene-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-img {
  aspect-ratio: 4/3;
  border: 1px solid var(--rule);
  background: var(--bg-tint);
  overflow: hidden;
  position: relative;
}
.gallery-img .placeholder {
  position: absolute;
  inset: 0;
}
.gallery-caption {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin: 8px 0 0;
}

/* ── O NAS ──────────────────────────────────────────────────────────────── */
.o-nas-body {
  max-width: 660px;
  margin-inline: auto;
}
/* Kafle na zdjęcia w O Nas (placeholdery do podmiany). */
.o-nas-foto {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: clamp(28px, 5vh, 44px) 0;
}
.o-nas-foto figure { margin: 0; }
.o-nas-foto .frame {
  position: relative;
  aspect-ratio: 3/2;
  border: 1px solid var(--rule);
  background: var(--bg-tint);
  overflow: hidden;
}
.o-nas-foto figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin-top: 8px;
}
.o-nas-lead {
  margin-bottom: clamp(28px, 5vh, 48px);
}
.o-nas-lead .body-prose {
  font-size: clamp(1.1875rem, 4.6vw, 1.375rem);
  line-height: 1.55;
}
.founders {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.founders a {
  position: relative;
  display: inline-block;
  padding: 4px 0 4px 1.5em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 3.8vw, 1.125rem);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  transition: color .15s ease, text-decoration-color .15s ease;
}
/* Strzałka poza przepływem tekstu — podkreślenie linku jej nie obejmuje
   (strzałka z kreską pod spodem wyglądała jak ikona pobierania). */
.founders a::before {
  content: "↓";
  position: absolute;
  left: 0;
  color: var(--fg-fade);
  transition: transform .2s ease, color .15s ease;
}
.founders a:hover,
.founders a:focus-visible { color: var(--accent); text-decoration-color: var(--accent); }
.founders a:hover::before,
.founders a:focus-visible::before { color: var(--accent); transform: translateY(3px); }
.member-card { scroll-margin-top: calc(var(--h-topbar) + 24px); }
.member-name:focus { outline: none; }
.o-nas-section {
  margin-bottom: clamp(24px, 4vh, 40px);
}
.o-nas-section .eyebrow {
  margin-bottom: 10px;
}
.o-nas-deski {
  margin-top: clamp(32px, 6vh, 56px);
  text-align: center;
}
.o-nas-deski svg {
  width: clamp(64px, 12vw, 88px);
  height: auto;
  color: var(--fg);
  display: inline-block;
}

/* ── SPEKTAKLE — spis ────────────────────────────────────────────────────── */
.shows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
.show-card {
  border: 1px solid var(--rule);
  background: var(--bg);
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.show-card-art {
  background: var(--bg-tint);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  /* Format A plakatów (1:√2) — pełny plakat bez przycinania. */
  aspect-ratio: 1 / 1.4142;
}
.show-card-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.placeholder {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(135deg, transparent 0 12px, var(--rule-mute) 12px 13px);
  display: grid;
  place-items: center;
}
.placeholder > span {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
  background: var(--bg);
  padding: 4px 10px;
  border: 0.5px solid var(--rule);
}
.show-card-body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.show-card-num {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 0.75rem;
  color: var(--fg-fade);
  letter-spacing: 0.06em;
}
.show-card h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.1875rem, 5vw, 1.375rem);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}
.show-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.show-tags li {
  padding: 3px 8px 2px;
  border: 1px solid var(--rule-mute);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg-mute);
}
.show-card p {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-prose-sm);
  line-height: 1.5;
  color: var(--fg-mute);
}
.show-card .more {
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.show-card .more::after {
  content: "→";
  font-family: var(--font-body);
  font-size: 0.875rem;
  letter-spacing: 0;
}

/* ── Detal spektaklu ─────────────────────────────────────────────────────── */
/* Górny wiersz z powrotem do spisu — linia pod nim idzie na pełną szerokość. */
.show-detail-top {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.show-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.show-detail-head {
  text-align: center;
  border-bottom: 1px solid var(--rule);
  padding: clamp(24px, 5vw, 36px) 12px clamp(28px, 5vw, 40px);
  margin-bottom: clamp(28px, 5vw, 40px);
}
.show-detail-head h1 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.625rem, 7.5vw, 3.5rem);
  line-height: 1;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.show-detail-head .tag {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.9375rem, 3.8vw, 1.125rem);
  color: var(--fg-mute);
  margin: 0;
  text-wrap: balance;
}
.show-detail-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 6vw, 56px);
  align-items: start;
  margin-bottom: clamp(32px, 6vw, 48px);
}
.show-detail-prose h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin: 0 0 14px;
}
.show-detail-prose .lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.0625rem, 4.2vw, 1.25rem);
  line-height: 1.45;
  color: var(--fg);
  margin: 0 0 20px;
  text-wrap: balance;
}
.show-detail-prose p {
  font-family: var(--font-body);
  font-size: var(--fs-prose);
  line-height: 1.6;
  color: var(--fg);
  margin: 0 0 16px;
}
.video-wrap {
  border: 1px solid var(--rule);
  padding: 8px;
  background: var(--bg);
}
.video-wrap .placeholder {
  position: relative;
  inset: auto;
  aspect-ratio: 16/9;
  width: 100%;
  background-image:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--rule-mute) 14px 15px);
}
.video-wrap .play {
  width: 60px; height: 60px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.video-wrap .play::after {
  content: "";
  width: 0; height: 0;
  border-left: 14px solid var(--fg);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}
.video-wrap .caption {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-fade);
  padding: 12px 4px 4px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.video-wrap .caption > span:last-child { white-space: nowrap; }

/* Sceny — naprzemienne zdjęcia + opis */
.show-scenes {
  margin-top: clamp(32px, 6vw, 48px);
  margin-bottom: clamp(8px, 3vw, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vw, 44px);
}
.scene-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 3vw, 28px);
  align-items: center;
}
.scene-img {
  position: relative;
  aspect-ratio: 3/2;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.scene-text h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin: 0 0 10px;
}
.scene-text p {
  font-family: var(--font-body);
  font-size: var(--fs-prose);
  line-height: 1.6;
  color: var(--fg);
  margin: 0;
}

/* Obsada */
.cast-section { margin-top: clamp(32px, 6vw, 48px); }
/* Występy danego spektaklu — ten sam gazetowy wpis co aktualności na głównej. */
.show-events { margin-top: clamp(32px, 6vw, 48px); }
.show-events .news-list { max-width: 760px; margin-inline: auto; }
.events-empty {
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--fs-prose);
  color: var(--fg-mute);
}
.cast-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.25rem, 5.5vw, 1.625rem);
  margin: 24px 0;
  letter-spacing: -0.01em;
  text-align: center;
}
.cast-tba {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.875rem, 3.8vw, 1.0625rem);
  color: var(--fg-mute);
  text-align: center;
  margin: 24px auto;
  max-width: 48ch;
}
.cast-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-mute) transparent;
}
.cast-card {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
}
.cast-card .role {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin: 0;
}
.cast-card .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 4px 0 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.cast-card .as {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.7813rem;
  color: var(--fg-mute);
  margin: 4px 0 0;
}

/* Plakietka-kamea (rycina zamiast zdjęcia) */
.plate {
  position: relative;
  border: 1px solid var(--rule);
  background:
    radial-gradient(115% 85% at 50% 40%, var(--bg) 0%, var(--bg-tint) 62%, var(--bg-tint) 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.plate--34 { aspect-ratio: 3/4; }
.plate--45 { aspect-ratio: 4/5; }
.plate::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 0.5px solid var(--rule-mute);
  pointer-events: none;
}
.plate-art {
  width: 100%;
  height: 100%;
  color: var(--fg);
}

/* ── PIOSENKI ────────────────────────────────────────────────────────────── */
.songs-intro { margin-bottom: 28px; }
.songs-list { border-top: 1px solid var(--rule); }
.song-row {
  display: grid;
  grid-template-columns: 34px 1fr auto 40px;
  align-items: center;
  gap: 14px;
  padding: 16px 8px;
  border: 0;
  border-bottom: 1px solid var(--rule-mute);
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background .15s ease, padding-left .2s ease;
}
.song-row[data-playing="true"] { background: var(--bg-tint); }
.song-row[data-playing="true"] .song-num,
.song-row[data-playing="true"] .song-title { color: var(--accent); }
.song-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--fg-fade);
}
.song-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.song-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.9375rem, 4.2vw, 1.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.song-from {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--fg-mute);
}
.song-len {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  color: var(--fg-fade);
}
.song-play {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  margin-left: auto;
}
.song-play::after {
  content: "";
  width: 0; height: 0;
  border-left: 9px solid var(--fg);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 3px;
}
.song-row[data-playing="true"] .song-play {
  background: var(--accent);
  border-color: var(--accent);
}
.song-row[data-playing="true"] .song-play::after {
  border: 0;
  width: 8px; height: 10px;
  margin: 0;
  background: linear-gradient(
    to right,
    var(--on-accent) 0 3px,
    transparent 3px 5px,
    var(--on-accent) 5px 8px
  );
}

/* Accordion z tekstem piosenki */
.song-item {
  border-bottom: 1px solid var(--rule-mute);
}
.song-item .song-row {
  border-bottom: 0;
}
.song-lyrics-toggle {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0 8px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--fg-fade);
  text-align: left;
  transition: color .15s ease;
}
.song-lyrics-toggle::before {
  content: "▸ ";
  font-size: 0.75em;
}
.song-lyrics-toggle[aria-expanded="true"]::before {
  content: "▾ ";
}
.song-lyrics {
  padding: 0 8px 20px 48px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--fg-mute);
  animation: lyrics-in 0.25s ease-out;
}
@keyframes lyrics-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.song-lyrics p {
  margin: 0 0 16px;
  white-space: pre-line;
}
.lyrics-placeholder {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  color: var(--fg-fade);
  font-style: normal;
}

/* ── TRUPA ───────────────────────────────────────────────────────────────── */
.members-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: 860px;
}
/* Plakietka obok tekstu. Na telefonie bio schodzi pod spód na pełną
   szerokość — długi biogram w wąskiej kolumnie obok grafiki jest nieczytelny. */
.member-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-rows: 1fr auto auto;
  grid-template-areas:
    "plate name"
    "plate role"
    "bio   bio";
  column-gap: 18px;
}
.member-card > div:not(.plate) { display: contents; }
.member-card .plate { grid-area: plate; width: 100%; }
.member-card .member-name { grid-area: name; align-self: end; }
.member-card .member-role { grid-area: role; margin-bottom: 0; }
.member-card .member-bio { grid-area: bio; margin-top: 14px; }
@media (min-width: 640px) {
  .member-card {
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "plate name"
      "plate role"
      "plate bio";
    column-gap: 32px;
  }
  .member-card .member-name { align-self: start; }
  .member-card .member-bio { margin-top: 12px; }
}
.member-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.1875rem, 5vw, 1.375rem);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
.member-role {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin: 6px 0 12px;
}
.member-bio {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-prose);
  line-height: 1.6;
  color: var(--fg-mute);
  margin: 0;
}

/* ── PRZYJACIELE ─────────────────────────────────────────────────────────── */
.przyjaciele-intro {
  margin: 0 auto clamp(20px, 3vh, 40px);
  text-align: center;
}
.friends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 820px;
}
.friend-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Tasiemka żałobna (Z2): klasyczna szarfa przycięta do obrysu karty —
   wcześniej wystawała poza narożnik w rynnę między kolumnami. */
.friend-plate-wrap {
  position: relative;
  overflow: hidden;
}
.friend-card--memoriam .plate {
  filter: grayscale(1);
}
.mourning-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 64px;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.mourning-ribbon::after {
  content: "";
  position: absolute;
  top: 17px;
  right: -28px;
  width: 120px;
  height: 13px;
  background: var(--fg);
  transform: rotate(45deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.friend-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.friend-role {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin: 4px 0 0;
}
.friend-note {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.7813rem;
  color: var(--fg-mute);
  margin: 2px 0 0;
}

/* ── IN MEMORIAM ─────────────────────────────────────────────────────────── */
.memoriam {
  max-width: 880px;
  margin: 0 auto;
}
.memoriam-frame {
  border: 2px solid var(--rule);
  padding: clamp(32px, 7vw, 60px) clamp(20px, 6vw, 64px) clamp(30px, 6vw, 56px);
  position: relative;
  text-align: center;
}
.memoriam-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 0.5px solid var(--rule);
  pointer-events: none;
}
.memoriam-dagger {
  font-family: var(--font-body);
  font-size: 2.25rem;
  color: var(--fg);
  margin-bottom: 12px;
  line-height: 1;
}
.memoriam-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0 0 28px;
}
.memoriam-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.75rem, 8vw, 3.125rem);
  line-height: 1;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}
.memoriam-dates {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.8125rem, 3.5vw, 1rem);
  color: var(--fg-mute);
  margin: 0 0 32px;
}
.memoriam-rule {
  width: 80px;
  height: 1px;
  background: var(--rule);
  margin: 0 auto 32px;
}
.memoriam-body {
  font-family: var(--font-body);
  font-size: var(--fs-prose);
  line-height: 1.6;
  color: var(--fg);
  max-width: 56ch;
  margin: 0 auto;
  text-wrap: pretty;
}
.memoriam-body--em { margin-top: 18px; }
.memoriam-body em {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85em;
}
.memoriam-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: clamp(32px, 6vw, 56px);
}
.memoriam-gallery .tile {
  aspect-ratio: 3/4;
  border: 1px solid var(--rule);
  background: var(--bg-tint);
  background-image:
    repeating-linear-gradient(135deg, transparent 0 8px, var(--rule-mute) 8px 9px);
  position: relative;
}
.memoriam-gallery .tile::after {
  content: attr(data-caption);
  position: absolute;
  bottom: 8px; left: 8px; right: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-mute);
  text-align: center;
  background: var(--bg);
  padding: 3px 6px;
  border: 0.5px solid var(--rule);
}
.memoriam-quote {
  margin: clamp(32px, 6vw, 48px) auto 0;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.9375rem, 4vw, 1.1875rem);
  line-height: 1.5;
  color: var(--fg);
  max-width: 60ch;
  text-wrap: balance;
}
.memoriam-quote::before { content: "„"; }
.memoriam-quote-attrib {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-fade);
  margin-top: 16px;
  text-align: center;
}

/* ── KONTAKT ─────────────────────────────────────────────────────────────── */
.kontakt { max-width: 720px; }
.kontakt-intro { margin-bottom: 24px; }
.kontakt-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-mute);
}
.kontakt-row .k {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-fade);
}
.kontakt-row .v {
  font-family: var(--font-display);
  font-size: clamp(0.875rem, 4vw, 1.0625rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.kontakt-row .v a { text-decoration: underline; text-decoration-color: var(--rule-mute); text-underline-offset: 3px; }

/* ── Odtwarzacz (winyl) ──────────────────────────────────────────────────── */
.audio {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  height: var(--h-audio);
  background: var(--side-bg);
  color: var(--side-fg);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}
.audio-vinyl {
  position: relative;
  width: 42px; height: 42px;
}
.audio-disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center,
      var(--side-fg) 0 6px,
      var(--side-bg) 6px 8px,
      var(--side-fade) 8px 9px,
      var(--side-bg) 9px 11px,
      var(--side-fade) 11px 12px,
      var(--side-bg) 12px 15px,
      var(--side-fade) 15px 16px,
      var(--side-bg) 16px 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4),
              inset 0 0 0 0.5px var(--side-rule);
}
.audio-disc::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--accent);
  border: 0.5px solid var(--side-rule);
}
.audio-disc::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 2px; height: 2px;
  margin: -1px 0 0 -1px;
  background: var(--side-bg);
  border-radius: 50%;
  z-index: 2;
}
.audio.spin .audio-disc { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.audio-needle {
  position: absolute;
  top: -5px; right: -3px;
  width: 18px; height: 26px;
  pointer-events: none;
  transform-origin: 100% 0%;
  transform: rotate(-22deg);
  transition: transform .35s ease;
}
.audio.spin .audio-needle { transform: rotate(-8deg); }
.audio-needle::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 5px; height: 5px;
  background: var(--side-fg);
  border-radius: 50%;
}
.audio-needle::after {
  content: "";
  position: absolute;
  top: 2px; right: 2px;
  width: 1.5px; height: 24px;
  background: var(--side-fg);
  transform-origin: top right;
  transform: rotate(-18deg);
}
.audio-mid {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.audio-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.audio-info .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-info .from {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--side-fade);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.audio-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent; border: 0;
  color: var(--side-fg);
  opacity: 0.75;
}
.audio-btn.play {
  width: 38px; height: 38px;
  border: 1px solid var(--side-rule);
  border-radius: 50%;
  opacity: 1;
}
.audio-scrub {
  display: none;
  flex: 1;
  max-width: 380px;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--side-fade);
  letter-spacing: 0.12em;
}
.audio-scrub .track {
  flex: 1;
  position: relative;
  height: 1px;
  background: var(--side-rule);
}
.audio-scrub .fill {
  position: absolute;
  left: 0; top: 0;
  height: 1px;
  width: 0;
  background: var(--side-fg);
}
.audio-scrub .head {
  position: absolute;
  top: 50%; left: 0;
  width: 6px; height: 6px;
  margin-top: -3px;
  margin-left: -3px;
  background: var(--side-fg);
  border-radius: 50%;
}
.audio-right { display: none; }
.audio-stamp {
  font-family: var(--font-mono);
  font-size: var(--fs-ornament);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--side-fade);
  border: 0.5px solid var(--side-rule);
  padding: 4px 8px;
  white-space: nowrap;
}

/* ── Stany hover (tylko urządzenia z kursorem) ───────────────────────────── */
@media (hover: hover) {
  .menu-btn:hover, .menu-close:hover { background: var(--side-fg); color: var(--side-bg); }
  .nav-item:hover { color: var(--accent-fg); }
  .nav-item:hover .glyph { opacity: 1; }
  .news-entry:hover { background: var(--bg-tint); padding-left: 10px; }
  .news-entry:hover .news-arrow { opacity: 1; color: var(--accent); }
  .news-fb:hover,
  .news-tickets:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .show-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.25);
  }
  .show-detail-back:hover { color: var(--fg); }
  /* :not(.active) — inaczej hover nadpisywał tło aktywnego chipa
     (ta sama specyficzność, późniejsza pozycja w pliku) i kremowy
     tekst lądował na kremowym tle. */
  .gallery-tag:hover:not(.active) { background: var(--bg-tint); }
  .song-row:hover { background: var(--bg-tint); padding-left: 16px; }
  .audio-btn:hover { opacity: 1; }
  .kontakt-row .v a:hover { color: var(--accent); text-decoration-color: var(--accent); }
}

/* ── ≥640px — tablet ─────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .page-head {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 24px;
    padding-bottom: 28px;
    margin-bottom: 36px;
  }
  .page-head .count { padding-bottom: 8px; }
  .kontakt-row { grid-template-columns: 200px 1fr; gap: 24px; padding: 18px 0; }
  .song-row { grid-template-columns: 48px 1fr auto 44px; gap: 20px; padding: 20px 12px; }
  .song-main { flex-direction: row; align-items: baseline; gap: 14px; }
  .song-from { font-size: 0.8125rem; }
  .audio-scrub { display: flex; }
  .memoriam-gallery { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  /* Siatki tabletowe — wartości zbieżne z ≥1024px, więc desktop bez zmian. */
  .shows { grid-template-columns: 1fr 1fr; gap: 24px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .friends-grid { grid-template-columns: repeat(3, 1fr); }
  .scene-block { grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 40px); }
  .scene-block--flip { direction: rtl; }
  .scene-block--flip > * { direction: ltr; }
  .show-detail-body { grid-template-columns: 1.4fr 1fr; }
}

/* ── ≥900px — otwarta księga na stronie głównej ─────────────────────────── */
@media (min-width: 900px) {
  .news-actions { margin-left: calc(8.5rem + 20px); }
}

/* ── ≥1024px — desktop: stały shell z sidebar ────────────────────────────── */
@media (min-width: 1024px) {
  :root { --h-audio: 72px; }
  html, body { height: 100%; overflow: hidden; }
  .topbar { display: none; }

  .shell {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: var(--w-sidebar) 1fr;
    grid-template-rows: minmax(0, 1fr) var(--h-audio);
    grid-template-areas:
      "side main"
      "side audio";
  }
  .shell.no-audio {
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "side main";
  }

  .sidebar {
    position: static;
    grid-area: side;
    transform: none;
    visibility: visible;
    transition: none;
  }
  .menu-close { display: none; }
  .sidebar-inner {
    margin: 18px;
    padding: 26px 24px 24px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--side-rule) transparent;
  }
  /* Logo skaluje się z wysokością okna, żeby rozwinięte podsekcje menu
     mieściły się bez przewijania na typowych laptopach. */
  .sidebar-logo img { max-width: clamp(96px, 16vh, 168px); width: 100%; }
  .nav-item { font-size: 0.9375rem; padding: 10px 4px; }

  .main {
    grid-area: main;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--rule-mute) transparent;
  }
  .main::-webkit-scrollbar { width: 8px; }
  .main::-webkit-scrollbar-thumb { background: var(--rule-mute); border-radius: 4px; }

  .screen { min-height: 100%; }
  .screen--songs { padding-bottom: var(--pad-page); }

  .news-entry { grid-template-columns: 8.5rem 1fr; gap: 16px; padding: clamp(8px, 1.2vh, 13px) 4px; }

  .shows { grid-template-columns: 1fr 1fr; gap: 28px; }
  .show-card-body { padding: 24px 26px 26px; }

  .show-detail-body { grid-template-columns: 1.4fr 1fr; }
  .scene-block { grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 40px); }
  .scene-block--flip { direction: rtl; }
  .scene-block--flip > * { direction: ltr; }
  .cast-grid { grid-auto-columns: 1fr; gap: 20px; }
  .cast-card .name { font-size: 1.0625rem; }
  .cast-card .as { font-size: 0.875rem; }
  .plate { max-height: 42vh; }
  .cast-card .plate { max-height: 30vh; }

  .friends-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .member-name { font-size: 1.375rem; }

  .audio {
    position: static;
    grid-area: audio;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    padding: 0 32px;
  }
  .audio-vinyl { width: 56px; height: 56px; }
  .audio-disc {
    background:
      radial-gradient(circle at center,
        var(--side-fg) 0 8px,
        var(--side-bg) 8px 10px,
        var(--side-fade) 10px 11px,
        var(--side-bg) 11px 14px,
        var(--side-fade) 14px 15px,
        var(--side-bg) 15px 19px,
        var(--side-fade) 19px 20px,
        var(--side-bg) 20px 24px,
        var(--side-fade) 24px 25px,
        var(--side-bg) 25px 100%);
  }
  .audio-disc::after { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
  .audio-needle { top: -6px; right: -4px; width: 22px; height: 32px; }
  .audio-needle::after { height: 30px; }
  .audio-mid { gap: 24px; }
  .audio-info .title { font-size: 1rem; }
  .audio-info .from { letter-spacing: 0.2em; }
  .audio-right { display: flex; align-items: center; gap: 18px; }
}

/* Niskie laptopy (768–820px wysokości) — ciaśniejszy krok menu,
   żeby rozwinięte podsekcje O Nas nie wymuszały przewijania sidebaru. */
@media (min-width: 1024px) and (max-height: 820px) {
  .nav-item { padding-block: 6px; }
  .nav-sub { margin-block: 6px 4px; }
  .nav-sub a { padding-block: 3px; }
  .sidebar-logo { padding-bottom: 12px; }
  .sidebar-candle { padding-top: 8px; }
}

/* ── ≥1180px — szersze siatki ────────────────────────────────────────────── */
@media (max-width: 1179px) and (min-width: 1024px) {
  .shows { grid-template-columns: 1fr; }
}

/* ── Redukcja ruchu ──────────────────────────────────────────────────────── */
/* Powiększenie zdjęcia (lightbox) — ciemne jak sidebar w obu motywach. */
.gallery-img img,
.scene-img img { cursor: zoom-in; }
.gallery-img img:focus-visible,
.scene-img img:focus-visible { outline-offset: -4px; }
.lightbox {
  box-sizing: border-box;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(10, 8, 7, 0.92); }
.lightbox figure {
  margin: 0;
  min-width: 0;
  max-width: min(100%, 1600px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  border: 1px solid var(--side-rule);
  animation: lightbox-in .2s ease-out both;
}
.lightbox figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--side-fg);
  text-align: center;
}
.lightbox figcaption:empty { display: none; }
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--side-rule);
  background: var(--side-bg);
  color: var(--side-fg);
  font-family: var(--font-body);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { color: var(--accent-fg); border-color: var(--side-fg); }
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox img { animation: none; }
  .screen { animation: none; }
  .candle .flame, .candle .glow,
  .audio.spin .audio-disc { animation: none; }
  /* Wyższa specyficzność niż reguły animacji gaszenia/rozpalania —
     przy redukcji ruchu motyw przełącza się bez teatru. */
  .candle.is-dousing .flame, .candle.is-igniting .flame,
  .candle.is-igniting .spark, .candle.is-igniting .glow,
  .candle.is-dousing .smoke, .candle.is-dousing .smoke::after { animation: none; }
  .sidebar, .news-entry, .song-row, .show-card, .audio-needle { transition: none; }
}

/* ══ MOBILE (<1024px) — wyspy z mobile-spec.md; desktop nietykalny ══════════ */
@media (max-width: 1023px) {
  /* D2 — scroller obsady: karta ~2.4 szerokości kontenera, przycięta
     trzecia karta daje afordancję przewijania (na 375px mieściły się
     dokładnie 2 i dalsi aktorzy byli nieodkrywalni). */
  .cast-grid {
    grid-auto-columns: minmax(140px, calc((100% - 18px) / 2.4));
    scroll-snap-type: x proximity;
    align-items: start;
  }
  .cast-card { scroll-snap-align: start; }

  /* Mniej "gumy" na dotyku: bez łańcuchowego bounce'a przewijania. */
  html, body { overscroll-behavior-y: none; }

  /* Safe-area (notch / home bar) — na desktopie bez efektu, ale trzymamy
     w wyspie zgodnie z kontraktem. */
  .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--h-topbar) + env(safe-area-inset-top));
  }
  .audio {
    height: calc(var(--h-audio) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* D10 — cele dotykowe ≥44px. */
  .menu-btn { min-height: 44px; }
  .audio-btn { width: 44px; height: 44px; }
  .audio-btn.play { width: 48px; height: 48px; }
  .song-lyrics-toggle { min-height: 44px; padding: 14px 8px 14px; }
  .gallery-tag { min-height: 44px; padding: 11px 16px; }
  .kontakt-row .v a { display: inline-block; padding-block: 13px; }
  .show-detail-back { min-height: 44px; align-items: center; }

  /* D12 — menu fullscreen: szersza kolumna numeracji ("VIII." stykało
     się z tekstem); X w miejscu przycisku MENU (bez skoku); wysokość
     w dvh na wypadek pasków przeglądarki. */
  /* Świeca w rogu panelu menu — poza przepływem, żeby nie odbierała
     wysokości pozycjom nawigacji (dokładała 96px i menu przestawało
     się mieścić bez przewijania na 375px). */
  .sidebar-candle {
    position: absolute;
    right: 30px;
    bottom: 24px;
    margin-top: 0;
    padding-top: 0;
  }
  .nav { --nav-num-col: 44px; }
  /* svh, nie dvh: dvh śledzi chowanie paska przeglądarki i rama menu
     "oddychała" przy scrollu. svh = najmniejszy viewport — stała
     wysokość, menu zawsze w całości widoczne, zero elastyczności. */
  .sidebar { height: 100vh; height: 100svh; }
  .sidebar-inner {
    position: static;
    /* overflow-y:auto z bazy implicite włączał poziomy scroll —
       menu dawało się szarpać w prawo-lewo. */
    overflow-x: hidden;
    overscroll-behavior: contain;
  }

  /* Menu ma się mieścić BEZ przewijania także na niskich ekranach
     (iPhone SE, Safari z paskami ~660px widocznej wysokości) —
     odstępy i logo skalują się z wysokością okna zamiast sztywnych
     wartości. Na wysokich telefonach wartości sięgają dotychczasowych
     maksimów, więc nic się nie zmienia. */
  .sidebar-inner {
    padding: clamp(12px, 2.4vh, 24px) 22px clamp(12px, 2.2vh, 22px);
  }
  .sidebar-logo { padding: clamp(2px, 1vh, 8px) 0 clamp(8px, 2.2vh, 24px); }
  .sidebar-logo img { max-width: clamp(76px, 16vh, 132px); }
  .sidebar-rule { margin: clamp(6px, 1vh, 10px) -4px clamp(8px, 1.6vh, 16px); }
  .nav-item { padding-block: clamp(5px, 1.4vh, 12px); }
}

/* Niskie telefony (SE, Safari z paskami) — ciaśniejszy krok menu. */
@media (max-width: 1023px) and (max-height: 720px) {
  .nav-item { font-size: 0.9375rem; padding-block: 4px; }
  .sidebar-logo img { max-width: clamp(60px, 13vh, 100px); }
}

/* Landscape telefonu: na ~375px wysokości logo w menu nie ma szans się
   zmieścić — brand jest na topbarze. Zostaje czysty spis treści + świeca. */
@media (max-width: 1023px) and (max-height: 480px) {
  .sidebar-logo { display: none; }
  .sidebar-candle { bottom: 16px; }
}

/* Wyspa mobile, ciąg dalszy — drawer menu i poprawki D. (Blok landscape
   powyżej przez pomyłkę połykał kiedyś te reguły — stąd osobna wyspa.) */
@media (max-width: 1023px) {
  /* Menu jako szuflada od lewej: z prawej zostaje pasek strony, więc
     zmiana motywu świecą jest widoczna od razu, bez zamykania menu.
     Tap w pasek (scrim) zamyka. */
  .sidebar {
    /* bez kotwicy bottom — wysokość trzyma svh (stała), patrz wyżej */
    inset: 0 auto auto 0;
    width: min(86vw, 360px);
    box-shadow: 24px 0 48px rgba(0, 0, 0, 0.4);
  }
  .menu-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(10, 8, 7, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
  }
  body.menu-open .menu-scrim {
    opacity: 1;
    visibility: visible;
    transition: opacity .3s ease;
  }

  /* X w całości WEWNĄTRZ ramki menu (22px = margines ramki 14 + 8),
     z tłem — nie kładzie się już na jej liniach. */
  .menu-close {
    width: 44px;
    height: 44px;
    top: 22px;
    right: 22px;
    background: var(--side-bg);
  }

  /* D19 — strzałka hover nie istnieje na dotyku, a jej zarezerwowane
     miejsce wydłużało przekreślenie tytułu poza tekst. */
  .news-item.past .news-arrow { display: none; }


  /* D22 — mikrofonty: minimum ustalone tokenami --fs-label/--fs-ornament. */

  /* D15 — podpisy galerii: czytelniejsze i o stałym rytmie (rezerwa
     dwóch linii, żeby kafle w rzędzie trzymały równą wysokość). */
  .gallery-caption {
    letter-spacing: 0.14em;
    line-height: 1.5;
    min-height: 2lh;
  }

  /* D16 — podpisy kafli In Memoriam w jednej linii (rytm rzędu). */
  .memoriam-gallery .tile::after {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 12px);
  }
}

/* Desktop: cały kafelek spektaklu (plakat + opis) mieści się w pionie
   ekranu — szerokość karty wyprowadzona z wysokości okna (plakat 1:√2,
   ~320px na opis pod plakatem i oddech). Liczba kolumn z auto-fit:
   tyle kart w rzędzie, ile się zmieści. */
@media (min-width: 1024px) {
  /* Mniej pustki nad nagłówkami podstron. */
  .screen:not(.screen--home) { padding-top: 28px; }


  /* Przyjaciele: kafle dobijają do rzędu póki się mieszczą, wyśrodkowane
     — bez pustej prawej połowy ekranu. */
  .friends-grid {
    max-width: var(--w-content-max);
    margin-inline: auto;
    grid-template-columns: repeat(auto-fit, 250px);
    justify-content: center;
    gap: 28px;
  }

  .shows {
    /* Karta (plakat 1:√2 + ~290px opisu) zajmuje ~97% wysokości okna —
       cały kafelek mieści się w pionie ekranu na dowolnej proporcji
       (16:9, 21:9), a plakaty pozostają duże. */
    --card-w: clamp(260px, (97vh - 290px) * 0.7071, 520px);
    grid-template-columns: repeat(auto-fit, var(--card-w));
    justify-content: center;
  }
  /* Opis skrócony do 3 linii — stabilna wysokość karty; pełny opis
     jest na podstronie spektaklu. */
  .show-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* Przy niskich oknach karty robią się wąskie — zagęszczamy opis,
     żeby całość nadal mieściła się w pionie. */
  .show-card { container-type: inline-size; }
  @container (max-width: 300px) {
    .show-card h2 { font-size: 1.125rem; }
    .show-card-body { padding: 16px 18px 18px; }
    .show-card p { -webkit-line-clamp: 2; }
  }
}

/* ≥1240px — O Nas: zdjęcia po bokach kolumny tekstu (dopełnienie,
   nie treść); całość sekcji mieści się na jednym ekranie. */
@media (min-width: 1240px) {
  .o-nas-body {
    display: grid;
    max-width: 1240px;
    grid-template-columns: minmax(180px, 1fr) minmax(0, 620px) minmax(180px, 1fr);
    column-gap: clamp(28px, 3.5vw, 64px);
    align-items: start;
  }
  .o-nas-lead, .o-nas-section, .o-nas-deski { grid-column: 2; }
  .o-nas-foto { display: contents; }
  .o-nas-foto figure { margin: 0; }
  .o-nas-foto figure:first-child {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: start;
    margin-top: 48px;
    transform: rotate(-2deg);
  }
  .o-nas-foto figure:last-child {
    grid-column: 3;
    grid-row: 2 / span 3;
    align-self: center;
    transform: rotate(1.6deg);
  }
}


/* 640–1023px — nazwisko w ramie In Memoriam bez przeskalowania (D16). */
@media (min-width: 640px) and (max-width: 1023px) {
  .memoriam-name { font-size: clamp(1.75rem, 5vw, 2.5rem); }
}

/* <640px — układy jednokolumnowe (D6, D11). */
@media (max-width: 639px) {
  /* D6 — wiersz aktualności: data nad treścią zamiast ciasnych
     dwóch kolumn (etykiety łamały się w środku fraz). */
  .news-entry { grid-template-columns: 1fr; gap: 6px; }
}

/* Landscape telefonu (D13) — mniej chromu, hero bez ucięcia. */
@media (max-height: 480px) and (max-width: 1023px) {
  :root { --h-topbar: 46px; }
  /* Świeca zostaje — jest w menu, nie w hero, i musi być dostępna. */
  .sidebar-candle { padding-top: 12px; }
}

/* D9 — pasek postępu w belce audio na małych ekranach (pełny scrub
   pojawia się dopiero od 640px; wcześniej nie było żadnego wskaźnika). */
.audio-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: color-mix(in srgb, var(--side-rule) 60%, transparent);
}
.audio-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
}
@media (min-width: 640px) {
  .audio-progress { display: none; }
}

/* D4 — stopka podstron: domknięcie długich stron na mobile.
   Na desktopie ukryta (kontrakt "desktop bez zmian"). */
.page-foot {
  margin-top: clamp(36px, 8vw, 56px);
  border-top: 1px solid var(--rule);
  padding: 24px 0 36px;
  font-family: var(--font-mono);
  font-size: var(--fs-ornament);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-fade);
  text-align: center;
  text-wrap: balance;
}
@media (min-width: 1024px) {
  .page-foot { display: none; }
}

/* Piosenki — strona w budowie (lista i odtwarzacz tymczasowo ukryte). */
.under-construction {
  max-width: 560px;
  margin: clamp(24px, 6vh, 64px) auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px dashed var(--rule-mute);
  text-align: center;
}
.under-construction .eyebrow { margin-bottom: 12px; }
.under-construction .body-prose { margin: 0; }

/* Pod opisem: twórcy (reżyseria, scenariusz, muzyka) i obok metryczka
   (gatunek, premiera, czas). Na telefonie jedna pod drugą. */
.show-meta {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule-mute);
  display: grid;
  gap: 16px 32px;
  align-items: start;
}
.credits {
  margin: 0;
  display: grid;
  gap: 8px;
}
.credits > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: baseline;
}
.credits dt {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-fade);
}
.credits dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--fg);
}
/* Szerzej: dwie kolumny obok siebie, etykieta nad wartością. */
@media (min-width: 640px) {
  .show-meta { grid-template-columns: 1fr 1fr; }
  .credits { gap: 14px; }
  .credits > div { grid-template-columns: 1fr; gap: 4px; }
}

/* O Nas — sekcja 2: członkowie trupy (dawna podstrona Trupa). */
.o-nas-members {
  margin-top: clamp(40px, 8vh, 72px);
  scroll-margin-top: calc(var(--h-topbar) + 16px);
}
.o-nas-members .cast-title { margin-bottom: 12px; }
.o-nas-members-intro {
  text-align: center;
  margin: 0 auto clamp(24px, 4vh, 40px);
  max-width: 60ch;
}
.o-nas-members .members-grid { margin-inline: auto; }
/* Na szerokich ekranach (21:9) sekcja trzyma szerokość sekcji 1, a karty
   nie rozrastają się do gigantycznych plakietek. */
@media (min-width: 640px) {
  .o-nas-members { max-width: 1240px; margin-inline: auto; }
}

/* Duże monitory (1440p, 4K): treść podstron nie rośnie ponad szerokość
   z Full HD i jest wyśrodkowana. Nagłówki z linią, dopiski po bokach
   i dekoracje strony głównej zostają na pełną szerokość.
   :where() = zerowa specyficzność, węższe limity sekcji wygrywają. */
@media (min-width: 1024px) {
  :where(.screen > :not(.page-head, .show-detail-top, .page-foot, .curtain)) {
    max-width: var(--w-content-max);
    margin-inline: auto;
  }
}
