/*
 * Strona główna — plansze K-Strona (komputer) i T-Strona (telefon) z płótna
 * „PIROCZAT — nowy design”. Próg jak na planszy: 860 px.
 * Telefon NIE jest pomniejszonym komputerem: bez liczb i kafli, za to trzy cechy
 * i stały przycisk „Wejdź na czat” na dole.
 */

/* ---------- hero ---------- */
.hero { padding-top: 72px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.hero-tekst { display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: 56px; line-height: 1.05; letter-spacing: -.025em; text-wrap: wrap; }
.hero .lead { font-size: 18.5px; line-height: 1.6; color: var(--tekst-2); }
.hero-cta { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.hero-cta .podpis { font-size: 14px; line-height: 1.25; color: var(--tekst-3); }

/* wejście: tekst po kolei, podgląd chwilę później — wejście dłuższe niż wyjście, tylko transform/opacity */
@keyframes gl-wejscie { from { opacity: 0; transform: translateY(14px); } }
@keyframes gl-okno { from { opacity: 0; transform: translateY(22px) scale(.98); } }
@keyframes gl-wiad { from { opacity: 0; transform: translateY(8px); } }
.hero-tekst > * { animation: gl-wejscie var(--t-duzy) var(--r-wejscie) both; }
.hero-tekst > :nth-child(2) { animation-delay: 60ms; }
.hero-tekst > :nth-child(3) { animation-delay: 120ms; }
.hero-tekst > :nth-child(4) { animation-delay: 180ms; }
.okienko { animation: gl-okno 600ms var(--r-wejscie) 160ms both; }
.ok-wiadomosci .wiad { animation: gl-wiad var(--t-sredni) var(--r-wejscie) both; }
.ok-wiadomosci .wiad:nth-child(1) { animation-delay: 520ms; }
.ok-wiadomosci .wiad:nth-child(2) { animation-delay: 760ms; }
.ok-wiadomosci .wiad:nth-child(3) { animation-delay: 1000ms; }
.reak { animation: gl-reakcja var(--t-maly) var(--r-sprezyna) 1300ms both; }
@keyframes gl-reakcja { from { transform: scale(.6); opacity: 0; } }

/* ---------- podgląd aplikacji (makieta) ---------- */
.okienko, .np, .cecha-t, .kafel { line-height: 1.25; }
.okienko {
  background: #0d0e12; border-radius: 20px; padding: 8px; display: flex; gap: 8px; height: 420px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.ok-boczny { width: 200px; background: #111318; border-radius: 14px; padding: 10px 0; flex: none; }
.ok-serwer { display: flex; align-items: center; gap: 8px; padding: 0 12px 10px; }
.ok-serwer img { width: 26px; height: 26px; border-radius: 8px; }
.ok-serwer b { font-family: var(--krój-naglowki); font-size: 15px; }
.okienko .kat { padding: 12px 14px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tekst-3); }
.okienko .kat:first-of-type { padding-top: 8px; }
.kan { display: flex; align-items: center; gap: 10px; height: 32px; margin: 1px 6px; padding: 0 10px; border-radius: 10px; color: var(--tekst-3); font-size: 14px; font-weight: 500; position: relative; }
.kan.niep { font-weight: 600; }
.kan .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kan.on { background: var(--pow-2); color: var(--tekst); }
.kan.niep { color: var(--tekst); }
.kan.niep::before { content: ""; position: absolute; left: -6px; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--tekst); }
.kan.glosowy { color: var(--tekst); }
.ok-twarze { display: flex; }
.ok-twarze .av { box-shadow: 0 0 0 2px #111318; }
.ok-twarze .av + .av { margin-left: -6px; }
.ok-czat { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ok-glowka { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; box-shadow: 0 1px 0 rgba(255, 255, 255, .06); flex: none; }
.ok-glowka svg { color: var(--tekst-3); }
.ok-glowka b { font-size: 15px; font-weight: 600; }
.ok-online { margin-left: auto; font-size: 12px; color: var(--tekst-3); display: flex; align-items: center; gap: 5px; }
.kropka-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.ok-wiadomosci { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 8px; }
.wiad { display: flex; gap: 12px; padding: 4px 16px; margin-top: 12px; }
.cialo { flex: 1; min-width: 0; }
.wmeta { display: flex; align-items: baseline; gap: 7px; margin-bottom: 1px; }
.nick { font-weight: 600; font-size: 14.5px; }
.nick.mod { color: var(--nieb); }
.czas { font-size: 12px; color: var(--tekst-3); }
.tresc { font-size: 14.5px; line-height: 1.45; color: #e7e9ed; }
.reakcje { display: flex; gap: 6px; margin-top: 6px; }
.reak { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 9px; background: var(--pow-2); border: 1px solid transparent; font-size: 13px; font-weight: 600; color: var(--tekst-2); }
.reak.moja { background: var(--czerwien-tlo); border-color: rgba(255, 77, 85, .45); color: #ff9aa0; }
.ok-pisz { padding: 0 12px 10px; flex: none; }
.ok-pole { min-height: 42px; border-radius: 14px; background: var(--pow-2); display: flex; align-items: center; padding: 0 12px; color: var(--tekst-3); font-size: 14px; }

/* awatary z literą */
.av { border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #fff; flex: none; }
.av20 { width: 20px; height: 20px; font-size: 9px; }
.av36 { width: 36px; height: 36px; font-size: 14px; }
.av40 { width: 40px; height: 40px; font-size: 16px; }
.c1 { background: #b4471a; } .c2 { background: #1f5fbf; } .c3 { background: #0f7a5a; }
.c4 { background: #a3245e; } .c5 { background: #4338ca; }

/* ---------- liczby (komputer) ---------- */
.liczby { padding-top: 88px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.liczby > div { padding: 4px 24px; }
.liczby > div:first-child { padding-left: 0; }
.liczby > div + div { box-shadow: -1px 0 0 rgba(255, 255, 255, .08); }
.liczby b { display: block; font-family: var(--krój-naglowki); font-size: 44px; line-height: 1; }
.liczby span { font-size: 15px; color: var(--tekst-3); }

/* ---------- kafle (komputer) ---------- */
.srodek { padding-top: 88px; }
.srodek h2 { margin-bottom: 28px; font-size: 36px; letter-spacing: -.01em; }
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.kafel { background: var(--pow); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 20px; min-height: 300px; }
.kafel.szeroki { grid-column: span 2; }
.cecha { display: flex; flex-direction: column; gap: 10px; }
.cecha b { font-size: 18px; font-weight: 600; }
.cecha p { font-size: 15.5px; line-height: 1.55; color: var(--tekst-2); }
.czipy { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.kafle-glos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; }
.kafle-glos > div { height: 86px; border-radius: 12px; background: var(--pow-2); display: grid; place-items: center; }
.kafle-glos > .mowi { box-shadow: inset 0 0 0 2px var(--ok); animation: gl-mowi 2.4s ease-in-out infinite; }
@keyframes gl-mowi { 0%, 100% { box-shadow: inset 0 0 0 2px var(--ok); } 50% { box-shadow: inset 0 0 0 2px rgba(61, 220, 132, .35); } }
.film { margin-top: auto; border-radius: 12px; overflow: hidden; background: var(--pow-2); }
.film-kadr { height: 110px; display: grid; place-items: center; color: var(--tekst); background: repeating-linear-gradient(135deg, #171a21 0 14px, #1c1f27 14px 28px); }
.film-podpis { padding: 10px 12px; font-size: 13.5px; color: var(--tekst-2); }
.film-podpis b { color: var(--tekst); font-weight: 600; }
.dziennik { margin-top: auto; background: var(--pow-2); border-radius: 12px; overflow: hidden; }
.dziennik > div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 14px; }
.dziennik > div + div { box-shadow: 0 -1px 0 rgba(255, 255, 255, .06); }
.dz-ik { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.dz-ik svg { width: 15px; height: 15px; }
.dz-ik.zolty { background: rgba(245, 185, 66, .14); color: var(--zolty); }
.dz-ik.ok { background: rgba(61, 220, 132, .14); color: var(--ok); }
.dz-co { flex: 1; }
.dz-co b { color: var(--nieb); font-weight: 600; }
.dz-kiedy { color: var(--tekst-3); }

/* ---------- pasek z newsów ---------- */
.z-newsow { padding-top: 72px; }
.np { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); transition: background var(--t-maly), box-shadow var(--t-maly); }
.np:hover { background: var(--pow); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.np-ik { color: var(--zar); }
.np-tekst { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.np-kiedy { font-size: 14px; color: var(--tekst-3); flex: none; }
.np-tytul { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-wszystkie { font-size: 14.5px; font-weight: 600; color: var(--tekst-2); flex: none; transition: color var(--t-maly), transform var(--t-maly) var(--r-wejscie); }
.np:hover .np-wszystkie { color: var(--tekst); transform: translateX(3px); }
.np-chev { display: none; color: var(--tekst-3); }

/* ---------- zaproszenie ---------- */
.koniec { padding-top: 72px; }
.koniec-box { background: var(--pow); border-radius: 24px; padding: 40px 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.koniec-box h2 { font-size: 34px; }
.koniec-box p { margin-top: 8px; font-size: 17px; line-height: 1.55; color: var(--tekst-2); }

/* ---------- tylko telefon ---------- */
.cechy-t, .dolny-pasek { display: none; }
.ik-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--pow-3); color: var(--tekst); }

/* ---------- pojawianie przy przewijaniu (klasy dokłada js/glowna.js) ---------- */
html.ruch .pojaw:not(.widac) { opacity: 0; transform: translateY(18px); }
html.ruch .pojaw.widac { transition: opacity var(--t-duzy) var(--r-wejscie), transform var(--t-duzy) var(--r-wejscie); }
html.ruch .bento .pojaw:nth-child(2) { transition-delay: 60ms; }
html.ruch .bento .pojaw:nth-child(3) { transition-delay: 120ms; }
html.ruch .bento .pojaw:nth-child(4) { transition-delay: 180ms; }

@media (max-width: 1100px) and (min-width: 861px) {
  .hero { gap: 40px; }
  .hero h1 { font-size: 46px; }
}

@media (max-width: 860px) {
  .hero { padding-top: 36px; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .hero-tekst { gap: 16px; }
  .hero h1 { font-size: 36px; line-height: 1.08; letter-spacing: -.02em; }
  .hero .lead { font-size: 16.5px; line-height: 1.55; }
  .hero-cta { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero-cta .btn { height: 54px; font-size: 16px; }
  .hero-cta .podpis { text-align: center; font-size: 13px; }

  /* podgląd bez listy kanałów, w karcie jak na planszy T-Strona */
  .okienko { height: auto; padding: 0; background: var(--pow); border-radius: 22px; overflow: hidden; margin: 0 -4px; box-shadow: 0 30px 60px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .06); }
  .ok-boczny { display: none; }
  .ok-glowka { height: 50px; padding: 0 14px; }
  .ok-wiadomosci { padding: 4px 0 10px; }
  .wiad { padding: 3px 14px; }
  .nick { font-size: 14px; }
  .ok-pisz { padding: 0 12px 12px; }
  .ok-pole { min-height: 40px; border-radius: 21px; padding: 0 16px; }

  .cechy-t { display: flex; flex-direction: column; gap: 24px; padding-top: 44px; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .cecha-t { display: flex; gap: 14px; align-items: flex-start; }
  .cecha-t b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
  .cecha-t p { font-size: 14.5px; line-height: 1.5; color: var(--tekst-2); }

  .liczby, .srodek, .koniec, .np-wszystkie { display: none; }
  .z-newsow { padding-top: 40px; }
  .np { gap: 12px; padding: 14px 16px; }
  .np-ik { width: 18px; height: 18px; }
  .np-tekst { flex-direction: column; align-items: stretch; gap: 0; }
  .np-kiedy { font-size: 12.5px; }
  .np-tytul { font-size: 14.5px; }
  .np-chev { display: block; }

  .dolny-pasek {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 12px 16px max(28px, calc(env(safe-area-inset-bottom) + 12px));
    background: linear-gradient(to bottom, rgba(11, 12, 16, 0), #0b0c10 35%);
  }
  .dolny-pasek .btn { width: 100%; height: 54px; }
  .glowna .stopka { padding-bottom: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-tekst > *, .okienko, .ok-wiadomosci .wiad, .reak { animation: gl-przenik 150ms linear both; animation-delay: 0ms; }
  @keyframes gl-przenik { from { opacity: 0; } }
  .kafle-glos > .mowi { animation: none; }
  html.ruch .pojaw:not(.widac) { transform: none; }
  html.ruch .pojaw.widac { transition: opacity 150ms linear; }
}
