/* =========================================================================
   RoundKit — theme #1 prezentacji reveal.js (Faza 5A Sesja 1).
   Cel (brief Macieja 2026-06-24): elegancki szablon pobity do "wow, mega
   dobrze przygotowane" — cienie + subtelne animacje CSS (nie statyczne),
   ale bez przekombinowania. Tokeny Ink & Ember z docs/arch-design-system.md.
   Layout opcji zaadaptowany z gra-szkoleniowa (quiz-base.css).

   Pakowany jako `theme.css` w podfolderze prezentacji (obok index.html,
   reveal/, assets/). Fonty + grafiki kategorii + logo = w assets/.
   Wszystkie sciezki RELATYWNE (dziala z file://, offline).
   ========================================================================= */

@font-face {
  font-family: 'Fraunces';
  src: url('assets/fraunces.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* latin-ext = polskie diakrytyki (ć/ł/ń/ż/ź/ś/ą/ę). Subset `latin` ich nie ma -> nazwy rund/
   tytuly z ć renderowalyby sie rozbite. unicode-range = przegladarka bierze ext-glify z tego pliku. */
@font-face {
  font-family: 'Fraunces';
  src: url('assets/fraunces-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #16130f;
  --ink-2: #1d1812;
  --surface: #211b15;
  --elevated: #2e231a;
  --cream: #f2eadd;
  --cream-muted: rgba(242, 234, 221, 0.7);
  --cream-faint: rgba(242, 234, 221, 0.45);
  --ember: #e0682a;
  --brass: #c8902e;
  --border: rgba(242, 234, 221, 0.1);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.4);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Baza ciemna ZA wszystkim. reveal.css domyslnie ustawia .reveal-viewport bg #fff (robota theme);
   nadpisujemy na Ink -> margines/letterbox = ciemny, nie bialy/szary. (validator: regula
   css-no-background-on-reveal SWIADOMIE off w .revealjs-validator.json - chcemy ciemna baze.) */
html,
body {
  background: var(--ink);
}
.reveal-viewport {
  background: var(--ink);
  color: var(--cream);
}

/* ---- Globalny ekran (tlo per slajd przez data-background-* w HTML) ---- */
.reveal {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--cream);
  font-size: 40px;
}
.reveal h1,
.reveal h2,
.reveal h3 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--cream);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.015em;
  line-height: 1.08;
}
.reveal a {
  color: var(--ember);
  text-decoration: none;
}
/* Strzalki nawigacji: domyslnie ciemne (niewidoczne na Ink) -> kremowe, hover ember. */
.reveal .controls {
  color: var(--cream);
}
.reveal .controls button:hover {
  color: var(--ember);
}
.reveal .slides section { text-align: center; }

/* ---- Akcenty / utili ---- */
.eyebrow {
  font-size: 0.5em;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brass);
  margin-bottom: 0.7em;
}
.muted { color: var(--cream-muted); }
.ember { color: var(--ember); }
.brass { color: var(--brass); }

.logo-lockup {
  width: 360px;
  height: auto;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.45));
}
.logo-lockup.sm { width: 230px; }

/* Mosiezny krazek numeru rundy (motyw coaster) — subtelny oddech poswiaty */
.round-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  border: 2px solid var(--brass);
  color: var(--brass);
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.3em;
  background: radial-gradient(circle at 50% 35%, rgba(200, 144, 46, 0.18), transparent 70%);
  box-shadow:
    inset 0 0 18px rgba(200, 144, 46, 0.2),
    0 0 0 6px rgba(200, 144, 46, 0.04);
  animation: coinBreath 4.5s ease-in-out infinite;
}
@keyframes coinBreath {
  0%, 100% { box-shadow: inset 0 0 18px rgba(200, 144, 46, 0.2), 0 0 0 6px rgba(200, 144, 46, 0.04); }
  50% { box-shadow: inset 0 0 22px rgba(200, 144, 46, 0.32), 0 0 0 10px rgba(200, 144, 46, 0.07); }
}

/* =========================================================================
   SLAJD 1 — techniczny / watermark
   ========================================================================= */
.slide-tech { font-size: 0.82em; }
.slide-tech .lic {
  margin-top: 1.4em;
  color: var(--cream-muted);
}
.slide-tech .wm-email {
  color: var(--brass);
  font-weight: 600;
}
.slide-tech .hint {
  margin-top: 2em;
  font-size: 0.62em;
  color: var(--cream-faint);
}
.slide-tech .hint kbd {
  color: var(--brass);
  font-weight: 600;
  font-family: inherit;
}

/* =========================================================================
   SLAJD tytulowy
   ========================================================================= */
.slide-title h1 {
  font-size: 2.5em;
  margin: 0.1em auto;
  max-width: 18em;
}
.slide-title .meta {
  color: var(--cream-muted);
  margin-top: 0.3em;
}
.slide-title .logo-lockup { margin-top: 1.6em; }

/* =========================================================================
   PRZEKLADKA RUNDY — grafika kategorii POKAZANA PORZADNIE (bez deformacji)
   + DUZA nazwa rundy. (Maciej: obrazek nie moze sie "rozjechac".)
   Obraz w ramce o stalym aspekcie, object-fit: cover = zachowuje proporcje
   (przycina, nie znieksztalca). NIE jako rozciagniete tlo pod tekstem.
   ========================================================================= */
.slide-round { text-align: center; }
/* SPLIT: r-hstack r-stretch wypelnia wysokosc slajdu; obraz (lewo, pelne proporcje contain,
   bez cropu) + blok meta (prawo). items-center centruje pionowo. */
.round-split {
  gap: 3.2em;
  width: 92%;
  max-width: 1180px;
  margin: 0 auto;
}
.slide-round .cat-img {
  max-height: 80%;
  max-width: 46%;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
}
@keyframes frameRise {
  from { opacity: 0; transform: translateX(-22px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.round-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1;
  min-width: 0;
}
@keyframes metaRise {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}
/* Duzy zeton-coaster (sygnaturowy element marki) */
.round-meta .round-coin {
  width: 2.5em;
  height: 2.5em;
  font-size: 1.6em;
  margin-bottom: 0.3em;
}
.round-meta .eyebrow {
  font-size: 0.52em;
  margin-bottom: 0.22em;
}
.round-meta h2 {
  font-size: 3.1em;
  line-height: 1.03;
  margin: 0;
}
.round-rule {
  display: block;
  width: 2.6em;
  height: 3px;
  margin-top: 0.5em;
  border-radius: 2px;
  background: var(--ember);
  box-shadow: 0 0 16px rgba(224, 104, 42, 0.5);
}

/* =========================================================================
   SLAJD PYTANIA — naglowek (kontekst+licznik), pytanie r-stretch, opcje A-D / P-F
   Struktura reveal-native (gra-szkoleniowa/docs/revealjs/03-layout.md): naglowek i opcje
   = staly rozmiar; pytanie .r-stretch wypelnia reszte -> tresc wypelnia CALY slajd (zero
   ogromnych marginesow gora/dol). Naglowek w przeplywie -> nie zaslania pytania.
   ========================================================================= */
.slide-quiz { text-align: center; --fit: 1; }

/* STAGE: staly-wysokosciowy flex column (NIE r-stretch). Wysokosc < 720px (plotno) -> reveal
   center:true wycentruje sekcje z malymi marginesami. Pytanie wypelnia srodek (flex:1, overflow
   ukryty jako siatka bezp.), opcje na dole (staly rozmiar). Fit-to-box (JS --fit) skaluje czcionki
   pytania i opcji, by NIC sie nie przelewalo ani nie chowalo za kafelki - bez wzgledu na dlugosc. */
.slide-quiz .q-stage {
  display: flex;
  flex-direction: column;
  height: 648px;
  box-sizing: border-box;
  gap: 0.3em;
}

/* Naglowek: kontekst rundy (lewo) + licznik pytania (prawo), pelna szerokosc, w przeplywie */
.q-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.q-cat {
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-align: left;
}
/* Rounded-square + contain = pelny obrazek kategorii bez przycinania (nie kolo). */
.q-cat img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.q-cat-name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-size: 0.42em;
}
.q-round {
  color: var(--brass);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  font-size: 0.82em;
}
.q-label {
  color: var(--cream-muted);
  font-weight: 600;
}
.q-num {
  font-size: 0.42em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ember);
  flex-shrink: 0;
}
@keyframes headIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* PYTANIE: wypelnia srodek stage (flex:1), tekst wycentrowany. overflow:hidden = siatka
   bezpieczenstwa (skrajny przypadek po dojsciu do dolnej granicy --fit nie wyleje na opcje).
   font-size skalowany przez --fit (fit-to-box w JS). */
.quiz-question {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: calc(2em * var(--fit));
  line-height: 1.16;
  max-width: 22em;
  margin: 0 auto;
}
/* Mierzalny blok tekstu pytania (fit-to-box porownuje jego naturalna wysokosc z boxem). */
.quiz-question .q-text { display: block; }
@keyframes qIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Siatka opcji wypelnia szerokosc ekranu (rozciagniecie — Maciej 2026-06-24). */
.quiz-options {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85em;
  width: 84%;
  max-width: 1040px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}
.quiz-options.single {
  grid-template-columns: 1fr;
  max-width: 620px;
}
.quiz-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.85em 1.05em;
  /* miejsce zarezerwowane na ✓ (absolutny) — ujawnienie nie zmienia ukladu */
  padding-right: 2.2em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brass);
  border-radius: 14px;
  font-size: calc(0.92em * var(--fit));
  text-align: left;
  box-shadow: var(--shadow-md);
}
.opt-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85em;
  flex-shrink: 0;
  background: var(--elevated);
  color: var(--cream);
  border: 1px solid var(--border);
}

/* Stagger wejscia opcji — patrz sekcja "ANIMACJE WEJSCIA" na koncu (scope .anim). */

/* ---- Fragment ujawniajacy POPRAWNA odpowiedz (klik) ----
   Opcja-fragment ma byc widoczna caly czas; klik (.visible) dodaje
   podswietlenie "poprawna" (ember-glow + ✓). Nadpisujemy domyslne
   opacity/visibility fragmentu reveal.js w obrebie quizu. */
.slide-quiz .quiz-option.answer.fragment {
  opacity: 1;
  visibility: visible;
}
.slide-quiz .quiz-option.answer.fragment.visible {
  border-color: var(--ember);
  border-left-color: var(--ember);
  background: var(--elevated);
  box-shadow: 0 0 30px rgba(224, 104, 42, 0.4), var(--shadow-md);
  animation: correctPop 0.42s var(--ease-out);
}
.slide-quiz .quiz-option.answer.fragment.visible .opt-label {
  background: var(--ember);
  color: #fff;
  border-color: var(--ember);
}
/* ✓ ABSOLUTNY — nie wchodzi w uklad flex, wiec ujawnienie nie przesuwa opcji
   ani nie re-centruje slajdu (Maciej: "przeskakuje odpowiedz na dol"). */
.slide-quiz .quiz-option.answer.fragment.visible::after {
  content: '✓';
  position: absolute;
  right: 0.85em;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ember);
  font-weight: 800;
}
@keyframes correctPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

/* =========================================================================
   PRZEKLADKA-PAUZA (questionMode: interstitial) — "chwila przerwy"
   ========================================================================= */
.slide-pause .round-coin {
  border-color: var(--ember);
  color: var(--ember);
  margin-bottom: 0.3em;
}
.slide-pause h2 { font-size: 2.1em; }
.slide-pause p { color: var(--cream-muted); }

/* =========================================================================
   PODZIEKOWANIE
   ========================================================================= */
.slide-thanks h1 { font-size: 2.4em; }
.slide-thanks .logo-lockup { margin-top: 1.6em; }
.slide-thanks p { color: var(--cream-muted); margin-top: 0.4em; }

/* =========================================================================
   CREDITS (zrodla pytan + licencje)
   ========================================================================= */
.slide-credits {
  font-size: 0.6em;
  text-align: left;
}
.slide-credits h2 {
  font-size: 1.7em;
  text-align: center;
  margin-bottom: 0.5em;
}
.slide-credits .note {
  max-width: 34em;
  margin: 0 auto 0.9em;
  color: var(--cream-muted);
  text-align: center;
  font-size: 0.82em;
}
.slide-credits ul {
  max-width: 36em;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}
.slide-credits li {
  margin: 0.55em 0;
  padding-left: 0.9em;
  border-left: 2px solid var(--brass);
  color: var(--cream-muted);
  line-height: 1.35;
}
.slide-credits li .refs {
  color: var(--brass);
  font-weight: 600;
}
.slide-credits li .url {
  color: var(--cream-faint);
  font-size: 0.85em;
}
.slide-credits .micro {
  text-align: center;
  margin-top: 1.1em;
  font-size: 0.82em;
  color: var(--cream-faint);
}

/* =========================================================================
   Stopka marki (na wszystkich slajdach)
   ========================================================================= */
.brand-footer {
  position: fixed;
  bottom: 14px;
  right: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--cream-faint);
  z-index: 30;
}

/* =========================================================================
   ANIMACJE WEJSCIA — scope `.anim` (klasa dodawana JS-em na biezacy slajd przy KAZDYM
   wejsciu + reflow). Dzieki temu wjazdy GRAJA przy nawigacji, nie tylko raz przy load.
   Stan bazowy elementow = widoczny (opacity 1); animacja startuje od `from` tylko pod `.anim`.
   ========================================================================= */

/* Tempo SPOKOJNE (elegancki szablon — Maciej 2026-06-24): dluzsze czasy + wieksze odstepy. */

/* --- Pytanie: naglowek, tresc, opcje (wjazd + subtelny CIAGLY glow po wjezdzie) ---
   Wzorzec bank-delta: `wjazd, idle infinite`. Idle = delikatny cieply glow box-shadow
   (NIE zmiana koloru/bordera jak bank-delta - elegancko), staggerowany faza per opcja. */
.anim .q-head { animation: headIn 0.7s var(--ease-out) both; }
.anim .quiz-question { animation: qIn 0.8s var(--ease-out) 0.15s both; }
.anim .quiz-option {
  animation: optIn 0.65s var(--ease-out) both, optIdle 6.5s ease-in-out infinite;
}
.anim .quiz-option:nth-child(1) { animation-delay: 0.22s, 2s; }
.anim .quiz-option:nth-child(2) { animation-delay: 0.38s, 3.2s; }
.anim .quiz-option:nth-child(3) { animation-delay: 0.54s, 2.6s; }
.anim .quiz-option:nth-child(4) { animation-delay: 0.7s, 3.8s; }
@keyframes optIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes optIdle {
  0%, 100% { box-shadow: var(--shadow-md); }
  50% { box-shadow: var(--shadow-md), 0 0 24px rgba(200, 144, 46, 0.16); }
}

/* --- Przekladka rundy: wjazd + ken-burns na obrazie + subtelny puls zetonu/akcentu --- */
.anim .cat-img {
  animation: frameRise 0.9s var(--ease-out) both, kenDrift 22s ease-in-out 0.9s infinite alternate;
}
@keyframes kenDrift {
  from { transform: scale(1); }
  to { transform: scale(1.035) translate(-1%, -0.6%); }
}
.anim .round-meta > * { animation: metaRise 0.8s var(--ease-out) both; }
.anim .round-meta .eyebrow { animation-delay: 0.34s; }
.anim .round-meta h2 { animation-delay: 0.48s; }
.anim .round-meta .round-coin {
  animation: metaRise 0.8s var(--ease-out) 0.2s both, coinGlow 5s ease-in-out 1.4s infinite;
}
@keyframes coinGlow {
  0%, 100% { box-shadow: inset 0 0 18px rgba(200, 144, 46, 0.2), 0 0 0 6px rgba(200, 144, 46, 0.04); }
  50% { box-shadow: inset 0 0 24px rgba(200, 144, 46, 0.34), 0 0 22px rgba(200, 144, 46, 0.22), 0 0 0 10px rgba(200, 144, 46, 0.06); }
}
.anim .round-meta .round-rule {
  animation: metaRise 0.8s var(--ease-out) 0.64s both, rulePulse 4.5s ease-in-out 1.6s infinite;
}
@keyframes rulePulse {
  0%, 100% { box-shadow: 0 0 16px rgba(224, 104, 42, 0.5); }
  50% { box-shadow: 0 0 26px rgba(224, 104, 42, 0.85); }
}

/* --- Tytul / podziekowanie / pauza / credits: wjazd "rise + fade" pod-elementow --- */
.anim.slide-title > *,
.anim.slide-thanks > *,
.anim.slide-pause > *,
.anim.slide-tech > * {
  animation: riseIn 0.8s var(--ease-out) both;
}
.anim.slide-title > *:nth-child(2),
.anim.slide-thanks > *:nth-child(2) { animation-delay: 0.16s; }
.anim.slide-title > *:nth-child(3),
.anim.slide-thanks > *:nth-child(3) { animation-delay: 0.32s; }
.anim.slide-title > *:nth-child(4) { animation-delay: 0.48s; }
.anim.slide-credits > * { animation: riseIn 0.7s var(--ease-out) both; }
.anim.slide-credits > *:nth-child(2) { animation-delay: 0.12s; }
.anim.slide-credits > *:nth-child(3) { animation-delay: 0.24s; }
.anim.slide-credits > *:nth-child(4) { animation-delay: 0.36s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* ---- Reduced motion: wylacz animacje ozdobne (stan koncowy = widoczny) ---- */
@media (prefers-reduced-motion: reduce) {
  .anim .q-head,
  .anim .quiz-question,
  .anim .quiz-option,
  .anim .cat-img,
  .anim .round-meta > *,
  .anim.slide-title > *,
  .anim.slide-thanks > *,
  .anim.slide-pause > *,
  .anim.slide-tech > *,
  .anim.slide-credits > *,
  .round-coin {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
