/* Urośnij: wejście z logo, raz na sesję (ten sam zabieg co na tpdigital.pl).
   Klasę .intro-on na <html> ustawia /intro-head.js przed pierwszym malowaniem; /intro.js zdejmuje ją
   i usuwa nakładkę po kurtynie. Bez .intro-on nakładki nie ma (display: none), przy ograniczonym ruchu też nie.
   Oś czasu (s): 0,05–0,75 obrys ikony · 0,12–1,15 postacie kreską · 1,05–1,55 wypełnienie
                 1,20–1,85 napis wyjeżdża zza ikony · 1,85–2,75 kurtyna w górę (na jej starcie intro.js wysyła
                 „urosnij:intro-done”, po niej usuwa nakładkę). Zmieniając czasy, zmień też zapas w intro.js. */

.intro { display: none; }

.intro-on .intro {
  --s: clamp(96px, 6vw + 72px, 168px);
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  background: #02050b;
  clip-path: inset(0 0 0 0);
  contain: strict;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  animation: urosnij-kurtyna 0.59s cubic-bezier(.76, 0, .24, 1) 1.22s forwards;
}

/* Delikatna niebieska poświata za znakiem */
.intro-on .intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side circle at 50% 50%,
    rgba(26, 178, 255, .11) 0%, rgba(26, 178, 255, .075) 22%, rgba(26, 178, 255, .04) 45%,
    rgba(26, 178, 255, .014) 70%, rgba(26, 178, 255, 0) 100%);
  opacity: 0;
  pointer-events: none;
  animation: urosnij-pokaz 0.92s cubic-bezier(.2, .8, .2, 1) 0.03s forwards;
}

/* Ikona + napis: kolumna z napisem rośnie od 0fr do 1fr, więc ikona sama zjeżdża w lewo i całość zostaje na środku */
.intro__in {
  position: relative;
  display: grid;
  grid-template-columns: auto 0fr;
  align-items: center;
  animation:
    urosnij-napis 0.43s cubic-bezier(.65, 0, .35, 1) 0.79s forwards,
    urosnij-odjazd 0.59s cubic-bezier(.76, 0, .24, 1) 1.22s forwards;
}

.intro__mark { position: relative; width: var(--s); height: var(--s); }
.intro__mark::before {
  content: "";
  position: absolute;
  inset: -55%;
  background: radial-gradient(closest-side, rgba(18, 143, 255, .30), rgba(18, 143, 255, .10) 50%, rgba(18, 143, 255, 0));
  opacity: 0;
  pointer-events: none;
  animation: urosnij-pokaz 0.46s ease 0.69s forwards;
}

.intro__icon {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: scale(.9);
  animation: urosnij-zoom 1.25s cubic-bezier(.2, .8, .2, 1) forwards;
}

/* Rysowanie kreską: pathLength="1", więc 1 = cała ścieżka. Wzór 1/2 i start 1,02 (nie 1), żeby okrągłe
   zakończenie kreski nie zostawiało kropki przed startem. */
.intro__sq,
.intro__p,
.intro__c {
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.02;
}

/* Kolor kryjący (#8ccfff na 75% wymieszany z tłem): dwie połówki obrysu nakładają się na środku bez jaśniejszej kropki */
.intro__sq { stroke: #6a9dc4; stroke-width: 1.2; }
.intro-on .intro__sq { animation: urosnij-rysuj 0.46s cubic-bezier(.4, 0, .2, 1) 0.03s forwards, urosnij-zgas 0.33s ease 0.69s forwards; }

.intro__bg { opacity: 0; }
.intro-on .intro__bg { animation: urosnij-pokaz 0.33s ease 0.69s forwards; }

.intro__p { fill: #fff; fill-opacity: 0; stroke: #f2f6fb; stroke-width: 1.6; }
.intro-on .intro__p--1 { animation: urosnij-rysuj 0.66s cubic-bezier(.4, 0, .25, 1) 0.08s forwards, urosnij-wypelnij 0.33s ease 0.69s forwards; }
.intro-on .intro__p--2 { animation: urosnij-rysuj 0.43s cubic-bezier(.4, 0, .25, 1) 0.2s forwards, urosnij-wypelnij 0.33s ease 0.69s forwards; }
.intro-on .intro__p--3 { animation: urosnij-rysuj 0.59s cubic-bezier(.4, 0, .25, 1) 0.13s forwards, urosnij-wypelnij 0.33s ease 0.73s forwards; }
.intro-on .intro__p--4 { animation: urosnij-rysuj 0.43s cubic-bezier(.4, 0, .25, 1) 0.25s forwards, urosnij-wypelnij 0.33s ease 0.73s forwards; }

/* Uśmiechy i skrzyżowane ręce: kolor tła ikony, więc po wypełnieniu wyglądają jak wycięcia jak na ikonie aplikacji */
.intro__c { stroke-width: 1.6; fill-opacity: 0; }
.intro-on .intro__c { animation: urosnij-rysuj 0.3s cubic-bezier(.4, 0, .25, 1) 0.46s forwards; }
.intro-on .intro__c--smile { animation: urosnij-rysuj 0.3s cubic-bezier(.4, 0, .25, 1) 0.46s forwards, urosnij-wypelnij-c 0.26s ease 0.76s forwards; }

/* Napis „Urośnij” wyjeżdża zza ikony. Kolumna odsłania go z miękką krawędzią (maska z wygaszeniem na 1,2em).
   Wygaszenie leży na prawym dopełnieniu, które ujemny margines odejmuje od kolumny: na końcu nic nie jest
   przygaszone, a środkiem całości jest widoczny znak + napis. */
.intro__word {
  min-width: 0;
  padding: .2em 1.2em .2em 0;
  margin: -.2em -1.2em -.2em 0;
  font: 800 calc(var(--s) * .44)/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Inter Fallback", "Helvetica Neue", Arial, sans-serif;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1.2em), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 1.2em), transparent);
}
.intro__word > span {
  display: block;
  padding-left: calc(var(--s) * .17);
  white-space: nowrap;
  letter-spacing: -.035em;
  color: #f2f6fb;
  opacity: 0;
  transform: translateX(-.3em);
  animation: urosnij-slowo 0.53s cubic-bezier(.2, .8, .2, 1) 0.86s forwards;
}

@keyframes urosnij-rysuj { to { stroke-dashoffset: 0; } }
@keyframes urosnij-wypelnij { to { fill-opacity: 1; stroke-opacity: 0; } }
@keyframes urosnij-wypelnij-c { to { fill-opacity: 1; } }
@keyframes urosnij-zgas { to { stroke-opacity: 0; } }
@keyframes urosnij-pokaz { to { opacity: 1; } }
@keyframes urosnij-zoom { to { transform: none; } }
@keyframes urosnij-napis { to { grid-template-columns: auto 1fr; } }
@keyframes urosnij-slowo { to { opacity: 1; transform: none; } }
/* Znak jedzie w górę o pół ekranu tą samą krzywą co kurtyna, więc zostaje na środku zwijającej się nakładki
   (krawędź kurtyny go nie przecina), i po drodze gaśnie. */
@keyframes urosnij-odjazd { to { transform: translateY(-50vh) scale(.94); transform: translateY(-50dvh) scale(.94); opacity: 0; } }
@keyframes urosnij-kurtyna { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }

/* Strona pod spodem nie przewija się, dopóki trwa wejście (intro.js zdejmuje .intro-on po kurtynie).
   Stały margines na pasek przewijania: po zdjęciu blokady nic nie przeskakuje w bok. */
@media (prefers-reduced-motion: no-preference) {
  html.intro-on { overflow: hidden; scrollbar-gutter: stable; }
}

@media (prefers-reduced-motion: reduce) {
  .intro, .intro-on .intro { display: none !important; }
}

@media (max-width: 600px) {
  .intro__sq { stroke-width: 1.6; }
  .intro__p { stroke-width: 2.2; }
  .intro__c { stroke-width: 1.9; }
}

@media print {
  .intro, .intro-on .intro { display: none !important; }
}
