﻿/* ─────────────────────────────────────────────────────────────────────
   know — losuj temat i mów
   Ciemna scena, jedno światło z góry, temat w reflektorze.
   Instrument Serif na tematy, Space Grotesk na całą resztę.
   ───────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --bg:        #08090b;
  --bg-2:      #101216;
  --fg:        #f6f2ea;
  --fg-2:      #9a948a;
  --fg-3:      #5d5952;
  --line:      rgba(246, 242, 234, .13);
  --line-2:    rgba(246, 242, 234, .07);

  --akcent:    #ff5c2b;
  --akcent-cichy: #ff5c2b28;
  --bursztyn:  #e9b45c;

  /* gotowe wartości zamiast color-mix() — to samo, ale działa też na
     starszym Safari i starszych Chrome, a strona ma chodzić u każdego */
  --zaslona:   rgba(8, 9, 11, .87);
  --zazn:      rgba(246, 242, 234, .09);

  --serif: "Instrument Serif", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Space Grotesk", "Helvetica Neue", Arial, sans-serif;

  --pad: clamp(1.15rem, 4vw, 2.75rem);
  --ease: cubic-bezier(.2, .8, .25, 1);
}

html[data-motyw="dzien"] {
  --bg:      #f4f1ea;
  --bg-2:    #e8e3d8;
  --fg:      #14140f;
  --fg-2:    #5f5a51;
  --fg-3:    #918b80;
  --line:    rgba(20, 20, 15, .18);
  --line-2:  rgba(20, 20, 15, .09);
  --akcent:  #e03c0c;
  --akcent-cichy: #e03c0c1f;
  --bursztyn: #a9761b;
  --zaslona: rgba(244, 241, 234, .88);
  --zazn:    rgba(20, 20, 15, .07);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;   /* dvh dla przeglądarek, które je znają */
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── światło i ziarno ──────────────────────────────────────────────── */

/* jedno ciepłe światło z góry + winieta, żeby środek sceny wychodził do przodu */
.spot {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(30% 30% at 50% -3%, rgba(255, 186, 122, .30), transparent 62%),
    radial-gradient(62% 48% at 50% 34%, rgba(255, 138, 78, .05), transparent 72%),
    radial-gradient(36% 34% at 92% 98%, rgba(86, 128, 216, .10), transparent 72%);
}
.spot::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(118% 88% at 50% 44%, transparent 42%, rgba(0,0,0,.6) 100%);
}
html[data-motyw="dzien"] .spot {
  background:
    radial-gradient(46% 40% at 50% -2%, rgba(255, 196, 128, .55), transparent 64%),
    radial-gradient(38% 36% at 90% 96%, rgba(120, 150, 220, .18), transparent 72%);
}
html[data-motyw="dzien"] .spot::after {
  background: radial-gradient(118% 88% at 50% 44%, transparent 46%, rgba(120, 96, 56, .16) 100%);
}

/* delikatna siatka drukarska — dwie pionowe włoskowe linie na marginesach */
.rules { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.rules::before, .rules::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line) 18%, var(--line) 82%, transparent);
  opacity: .55;
}
.rules::before { left: var(--pad); }
.rules::after  { right: var(--pad); }
@media (max-width: 760px) { .rules { display: none; } }

.grain {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}
html[data-motyw="dzien"] .grain { mix-blend-mode: multiply; opacity: .16; }

/* ── pasek górny ───────────────────────────────────────────────────── */

.bar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.6vh, 1.7rem) var(--pad) clamp(.9rem, 2.4vh, 1.5rem);
}
.bar::after {
  content: ""; position: absolute; left: var(--pad); right: var(--pad); bottom: 0;
  height: 1px; background: var(--line-2);
}

.mark {
  font-family: var(--serif);
  font-size: 1.6rem; line-height: 1; letter-spacing: -.01em;
  display: inline-flex; align-items: baseline; gap: .32em;
}
.mark i {
  width: .3rem; height: .3rem; border-radius: 50%;
  background: var(--akcent);
  display: inline-block;
}

.bar__tools { display: flex; gap: .4rem; }

.ghost {
  appearance: none; cursor: pointer; background: none;
  border: 1px solid var(--line-2); border-radius: 2px;
  color: var(--fg-2);
  font: inherit; font-size: 11px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase;
  padding: .5rem .8rem;
  transition: color .2s, border-color .2s;
}
.ghost:hover { color: var(--fg); border-color: var(--line); }
.ghost--ico { padding: .5rem .72rem; letter-spacing: 0; font-size: 12px; }

/* ── scena ─────────────────────────────────────────────────────────── */

.stage {
  position: relative; z-index: 2;
  display: grid; align-content: center; justify-items: center;
  gap: 0;
  padding: clamp(1rem, 3vh, 2.5rem) var(--pad);
  text-align: center;
}

/* przełącznik trybu */

.modes {
  display: inline-flex; align-items: center; gap: .25rem;
  border: 1px solid var(--line-2); border-radius: 2px;
  padding: .22rem;
}
.mode {
  appearance: none; cursor: pointer; background: none; border: none;
  color: var(--fg-3);
  font: inherit; font-size: 11.5px; font-weight: 600;
  letter-spacing: .17em; text-transform: uppercase;
  padding: .52rem 1.05rem;
  border-radius: 1px;
  transition: color .2s, background .2s;
}
.mode:hover { color: var(--fg-2); }
.mode.is-on { color: var(--bg); background: var(--fg); }

.modes__note {
  margin: .85rem 0 0;
  font-size: 12.5px; color: var(--fg-2); letter-spacing: .01em;
  max-width: 32ch;
}

/* temat */

.deck {
  margin-top: clamp(1.6rem, 6vh, 3.6rem);
  width: min(100%, 62rem);
  display: grid; justify-items: center; gap: 0;
}

.deck__meta {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  font-size: 10.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: var(--akcent);
  margin-bottom: clamp(.9rem, 2.4vh, 1.5rem);
  animation: wejscie .5s var(--ease);
}
.deck__meta .sep { width: 14px; height: 1px; background: currentColor; opacity: .5; }
.deck__meta > span:last-child { color: var(--fg-3); letter-spacing: .2em; }

.topic {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3rem, 9.4vw, 8rem);
  line-height: .94;
  letter-spacing: -.018em;
  overflow-wrap: break-word; hyphens: auto;
  max-width: 18ch;
  transition: opacity .14s, filter .14s;
}
.topic--long  { font-size: clamp(2.4rem, 7vw, 5.8rem); max-width: 20ch; }
.topic--xlong { font-size: clamp(1.8rem, 4.8vw, 3.8rem); line-height: 1.04; max-width: 24ch; }
.topic.is-empty { color: var(--fg-3); font-style: italic; }

.is-drawing .topic { opacity: .38; filter: blur(1.2px); }

/* Świadomie bez opacity i bez fill-mode: gdyby wejście treści zależało od
   animacji, przy zdławionych animacjach (karta w tle, słabsze urządzenie)
   temat zostałby niewidzialny. Sam ruch nic nie ukrywa. */
@keyframes wejscie {
  from { transform: translateY(14px); }
  to   { transform: none; }
}
.is-landed .topic { animation: wejscie .44s var(--ease); }

.topic__gloss {
  margin: clamp(.9rem, 2.4vh, 1.4rem) 0 0;
  font-size: 13.5px; color: var(--fg-2);
  max-width: 46ch; line-height: 1.6;
}

.hint {
  margin-top: 1.4rem;
  max-width: 46rem;
  display: flex; gap: 1rem; align-items: flex-start; text-align: left;
  border-top: 1px solid var(--line-2); padding-top: 1.1rem;
  animation: wejscie .35s var(--ease);
}
.hint__img {
  width: 66px; height: 66px; object-fit: cover; flex-shrink: 0;
  border-radius: 2px; filter: grayscale(.3) contrast(1.05);
}
.hint__txt { margin: 0; font-size: 13px; line-height: 1.65; color: var(--fg-2); }

/* akcje */

.actions {
  margin-top: clamp(1.8rem, 5vh, 3rem);
  display: flex; gap: .55rem; flex-wrap: wrap; justify-content: center;
}

.btn {
  appearance: none; cursor: pointer;
  background: none; color: var(--fg);
  border: 1px solid var(--line); border-radius: 2px;
  font: inherit; font-size: 12px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  padding: 1.02rem 1.6rem;
  transition: border-color .2s, color .2s, background .2s, transform .12s var(--ease);
}
.btn:hover { border-color: var(--fg-2); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--akcent); border-color: var(--akcent);
  color: #120904;
  padding-inline: 2.3rem;
  box-shadow: 0 0 0 0 var(--akcent-cichy);
  transition: box-shadow .3s var(--ease), transform .12s var(--ease), filter .2s;
}
.btn--primary:hover { box-shadow: 0 0 0 6px var(--akcent-cichy); filter: brightness(1.06); }

.links {
  margin-top: clamp(1.1rem, 3vh, 1.7rem);
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; justify-content: center;
  font-size: 11.5px; letter-spacing: .07em;
  color: var(--fg-3);
}

.link {
  appearance: none; background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--fg-2); text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color .18s, border-color .18s;
}
.link:hover { color: var(--akcent); border-color: var(--akcent); }
.dot { opacity: .45; }

/* ── stopka ────────────────────────────────────────────────────────── */

.foot {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: clamp(.9rem, 2.4vh, 1.5rem) var(--pad) clamp(1rem, 2.6vh, 1.7rem);
}
.foot::before {
  content: ""; position: absolute; left: var(--pad); right: var(--pad); top: 0;
  height: 1px; background: var(--line-2);
}
.foot__btn {
  appearance: none; background: none; border: none; padding: .3rem 0; cursor: pointer;
  font: inherit; font-size: 10.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-3);
  transition: color .2s;
}
.foot__btn:hover { color: var(--fg); }
.foot__btn--plan { color: var(--fg-3); }
.foot__btn--plan::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--bursztyn); margin-right: .6em;
}

/* ── sesja ─────────────────────────────────────────────────────────── */

/* Tło sesji jest nieprzezroczyste bez żadnej animacji — gdyby zależało
   od @keyframes, przy zdławionych animacjach prześwitywałaby strona pod spodem.
   Animujemy wyłącznie zawartość. */
.session {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  padding: clamp(1rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 6vw, 3rem);
  background: var(--bg);
  overflow-y: auto;
  --faza: var(--bursztyn);
  --faza-swiatlo: rgba(233, 180, 92, .16);
}
@keyframes przyciemnij { from { opacity: 0; } to { opacity: 1; } }

.session::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(46% 42% at 50% 44%, var(--faza-swiatlo), transparent 70%);
  transition: background .6s var(--ease);
}

.session.is-mowa   { --faza: var(--akcent); --faza-swiatlo: rgba(255, 92, 43, .16); }
.session.is-koniec { --faza: var(--fg);     --faza-swiatlo: rgba(246, 242, 234, .09); }

.session__inner {
  position: relative;
  display: grid; justify-items: center; gap: 0;
  text-align: center;
  animation: wejscie .4s var(--ease);
}

.session__x {
  position: absolute; top: clamp(.8rem, 3vw, 1.6rem); right: clamp(.8rem, 3vw, 1.6rem);
  appearance: none; background: none; border: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--fg-3);
  padding: .3rem .5rem;
  transition: color .2s;
  z-index: 2;
}
.session__x:hover { color: var(--fg); }

.session__phase {
  margin: 0 0 clamp(1rem, 3vh, 1.8rem);
  font-size: 11px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase;
  color: var(--faza);
}

.dial {
  position: relative;
  width: min(72vw, clamp(12rem, 36vh, 21rem)); aspect-ratio: 1;
  display: grid; place-items: center;
}
.dial__svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dial__track { fill: none; stroke: var(--line-2); stroke-width: 1.4; }
.dial__run {
  fill: none; stroke: var(--faza); stroke-width: 1.4; stroke-linecap: round;
  transition: stroke-dashoffset .28s linear, stroke .6s var(--ease);
}
.dial__mid { display: grid; justify-items: center; gap: .35rem; }
.dial__time {
  font-size: clamp(3.2rem, 9vh, 5rem); font-weight: 300;
  letter-spacing: -.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dial__sub {
  font-size: 10px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase;
  color: var(--fg-3);
}

.session__topic {
  margin: clamp(1.2rem, 3.4vh, 2rem) 0 0;
  font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.06; letter-spacing: -.015em;
  max-width: 20ch;
}

.session__actions {
  margin-top: clamp(1.4rem, 3.6vh, 2.2rem);
  display: flex; gap: .55rem; flex-wrap: wrap; justify-content: center;
}
.session__actions .btn { text-decoration: none; }

/* ── panele ────────────────────────────────────────────────────────── */

.sheet {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: clamp(.8rem, 3vw, 1.6rem);
  background: var(--zaslona);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sheet__panel {
  position: relative;
  width: min(100%, 36rem);
  max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: clamp(1.5rem, 4vw, 2.3rem);
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.9);
  animation: wejscie .3s var(--ease);
}
.sheet__panel h2 {
  margin: 0 0 1.4rem;
  font-family: var(--serif); font-weight: 400;
  font-size: 2rem; letter-spacing: -.015em;
}
.sheet__panel p { margin: 0 0 .9rem; font-size: 13.5px; line-height: 1.7; color: var(--fg-2); }
.sheet__panel b { color: var(--fg); font-weight: 600; }
.sheet__panel .note {
  border-left: 2px solid var(--akcent); padding-left: .9rem; font-size: 12.5px;
}
.sheet__panel .meta {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-3); margin: 1.4rem 0 0;
}
.sheet__x {
  position: absolute; top: .5rem; right: .7rem;
  appearance: none; background: none; border: none; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--fg-3); padding: .25rem .45rem;
}
.sheet__x:hover { color: var(--fg); }

/* plan czasu */

.plan {
  display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 5vw, 2.4rem);
  border: 1px solid var(--line-2); border-radius: 3px;
  padding: 1.15rem 1rem .95rem;
  margin-bottom: .55rem;
}
.plan__col { display: grid; justify-items: center; gap: .25rem; }
.plan__k {
  font-size: 9.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--fg-3);
}
.plan__col b {
  font-size: clamp(1.7rem, 6vw, 2.3rem); font-weight: 300; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.plan__col:first-child b { color: var(--bursztyn); }
.plan__col:last-child b { color: var(--akcent); }
.plan__arrow { color: var(--fg-3); font-size: 15px; }
.plan__note {
  margin: 0 0 1.8rem !important; font-size: 11px !important;
  letter-spacing: .06em; color: var(--fg-3) !important; text-align: center;
}

.row { margin-bottom: 1.6rem; }
.row--split {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line-2); padding-top: 1.15rem; margin-bottom: 1.15rem;
}
.row__label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-2); margin-bottom: .7rem;
}
.row--split .row__label { margin-bottom: 0; }
.row__n { color: var(--fg-3); letter-spacing: .12em; }
.row__sub { margin-top: .7rem; font-size: 11px; color: var(--fg-3); }

.postep {
  height: 3px; border-radius: 2px; overflow: hidden;
  background: var(--line-2);
}
.postep i {
  display: block; height: 100%; width: 0;
  background: var(--akcent);
  transition: width .35s var(--ease);
}

.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  appearance: none; cursor: pointer;
  background: none; color: var(--fg-2);
  border: 1px solid var(--line-2); border-radius: 2px;
  font: inherit; font-size: 11px; font-weight: 500; letter-spacing: .06em;
  padding: .48rem .72rem;
  transition: all .16s;
}
.chip:hover { border-color: var(--line); color: var(--fg); }
.chip.is-on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chips--kat .chip { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
/* szuflad jest jedenaście — na biało byłaby ściana, więc zaznaczenie
   pokazujemy ramką i jasnym tekstem, nie wypełnieniem */
.chips--kat .chip.is-on {
  background: var(--zazn);
  border-color: var(--fg-2); color: var(--fg);
}
.chip__n { opacity: .45; margin-left: .4em; font-size: 9.5px; }

.sheet__panel::-webkit-scrollbar { width: 8px; }
.sheet__panel::-webkit-scrollbar-track { background: transparent; }
.sheet__panel::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.sheet__panel { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

.switch {
  appearance: none; cursor: pointer; border: none; padding: 0;
  width: 42px; height: 24px; border-radius: 999px;
  background: var(--line-2); position: relative;
  transition: background .22s var(--ease);
  flex-shrink: 0;
}
.switch i {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--fg-3);
  transition: transform .22s var(--ease), background .22s;
}
.switch[aria-checked="true"] { background: var(--akcent); }
.switch[aria-checked="true"] i { transform: translateX(18px); background: #120904; }

.seg {
  display: inline-flex; border: 1px solid var(--line-2); border-radius: 2px; padding: .18rem;
}
.seg button {
  appearance: none; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3); padding: .38rem .75rem; border-radius: 1px;
  transition: color .18s, background .18s;
}
.seg button.is-on { background: var(--fg); color: var(--bg); }

/* ── toast ─────────────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: 1.6rem; left: 50%; transform: translateX(-50%); z-index: 95;
  background: var(--fg); color: var(--bg);
  padding: .6rem 1rem; border-radius: 2px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  animation: wejscie .25s var(--ease);
}

/* ── mobile ────────────────────────────────────────────────────────── */

@media (max-width: 620px) {
  .topic { max-width: 14ch; }
  .actions { flex-direction: column; align-self: stretch; }
  .actions .btn { width: 100%; }
  .foot { justify-content: center; gap: .5rem 1.2rem; }
  .hint { flex-direction: column; }
  .plan { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

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