/* Napisownia — „Historia” wersja 3 (13.11.2026 noc): kręta linia rysowana przewijaniem i hasła wyskakujące z boku.
   Wersje 1 (same hasła) i 2 (talia kart) leżą w makieta-historia-2026-11-13/wersja-1/ i wersja-2/.
   Zasady: linia jest pod palcem (koniec linii = 72% wysokości ekranu), hasło wyskakuje szybko (0,42 s) ze swojej strony,
   gdy linia dojdzie do jego przystanku, i potem stoi. Linia zawsze biegnie po stronie przeciwnej do tekstu.
   Kolor kluczowego słowa = kolor linii na tej wysokości (niebieski → fiolet → róż). Przed linią widać blady, kropkowany
   ślad jej drogi — wiadomo, że dalej coś jest. Linia kończy się na przycisku, który wtedy się zapala.
   Stan bazowy = hasła widoczne (bez JS i przy „ogranicz ruch”); ukrywanie włącza dopiero klasa .hl-on ze skryptu. */

.historia {
  --hl-ink: #141b45;
  --hl-ink-2: #2a3366;
  --hl-display: "Plus Jakarta Sans", "Geist", system-ui, "Segoe UI", sans-serif;
  --hl-text: "Geist", system-ui, "Segoe UI", Roboto, sans-serif;
  --hl-out: cubic-bezier(.16, 1, .3, 1);
  --hl-snap: cubic-bezier(.2, .9, .25, 1.12);
  position: relative; overflow-x: clip; padding: clamp(16px, 3vh, 40px) 0 clamp(64px, 12vh, 150px); color: var(--hl-ink);
}
@supports not (overflow: clip) { .historia { overflow-x: hidden; } }

.hl-wrap { --hl-gut: 58px; position: relative; box-sizing: border-box; max-width: 1080px; margin: 0 auto; padding: 0 18px;
  display: flex; flex-direction: column; gap: clamp(52px, 9vh, 112px); }
.hl-it { position: relative; z-index: 1; box-sizing: border-box; max-width: 100%; }
.hl-l { align-self: flex-start; padding-right: var(--hl-gut); }
.hl-r { align-self: flex-end; padding-left: var(--hl-gut); text-align: right; }

/* ---------- Typografia ---------- */
.hl-say { margin: 0; font: 800 var(--fs, 40px)/1.05 var(--hl-display); letter-spacing: -.045em; word-spacing: .06em; color: var(--hl-ink); text-wrap: balance; }
.hl-it:nth-child(2) .hl-say { --fs: clamp(34px, 9.6vw, 88px); }
.hl-it:nth-child(3) .hl-say, .hl-it:nth-child(4) .hl-say { --fs: clamp(31px, 8.6vw, 78px); }
.hl-it:nth-child(5) .hl-say, .hl-it:nth-child(6) .hl-say { --fs: clamp(28px, 7.6vw, 66px); }
/* kluczowe słowo w kolorze linii; podkreślenie rośnie od strony, po której biegnie linia */
.hl-k { position: relative; display: inline-block; color: var(--kc); }
.hl-k::after { content: ""; position: absolute; left: .02em; right: .02em; bottom: -.04em; height: .085em; border-radius: 1em; background: var(--kc); opacity: .9; transform-origin: 100% 50%; }
.hl-r .hl-k::after { transform-origin: 0 50%; }
.hl-big { display: block; width: max-content; margin-top: .06em; font-size: 1.42em; line-height: 1.06;
  background: linear-gradient(100deg, #7a64d7, #c8417f 60%, #e0609f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hl-big::after { background: linear-gradient(90deg, #7a64d7, #e0609f); }
.hl-note { margin: clamp(10px, 1.8vh, 18px) 0 0; max-width: 25em; font: 400 clamp(16px, 4.3vw, 21px)/1.45 var(--hl-text); letter-spacing: -.01em; color: var(--hl-ink-2); text-wrap: pretty; }
.hl-r .hl-note { margin-left: auto; }

.hl-cta { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 56px; margin-top: clamp(18px, 3vh, 30px); padding: 0 28px; border-radius: 99px;
  background: var(--hl-ink); color: #fff; font: 650 17px/1 var(--hl-text); letter-spacing: -.01em; text-decoration: none;
  box-shadow: 0 18px 38px -16px rgba(20, 27, 69, .6), inset 0 1px 0 rgba(255, 255, 255, .18); transition: transform .2s var(--hl-out), box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.hl-cta svg { flex: none; width: 18px; height: 18px; }
.hl-cta::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; box-shadow: 0 0 0 2px #e0609f; opacity: 0; pointer-events: none; }
@media (hover: hover) { .hl-cta:hover { transform: translateY(-2px); box-shadow: 0 24px 44px -16px rgba(20, 27, 69, .7), inset 0 1px 0 rgba(255, 255, 255, .18); } }
.hl-cta:active { transform: scale(.96); transition-duration: .12s; }
.hl-cta:focus-visible { outline: 2px solid #2f63c8; outline-offset: 4px; }

/* ---------- Linia ---------- */
.hl-svg { position: absolute; left: 0; top: 0; z-index: 0; overflow: visible; pointer-events: none; }
.hl-track { fill: none; stroke: rgba(20, 27, 69, .13); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1.5 9; }
.hl-path { fill: none; stroke: url(#hl-grad); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.hl-node { fill: #fff; stroke: rgba(20, 27, 69, .18); stroke-width: 2; transform-box: fill-box; transform-origin: center; transition: fill .2s, stroke .2s; }
.hl-node.on { fill: url(#hl-grad); stroke: #fff; stroke-width: 2.5; }
.hl-on .hl-node.on { animation: hl-node .45s var(--hl-snap); }
@keyframes hl-node { 0% { transform: scale(.4); } 60% { transform: scale(1.5); } 100% { transform: none; } }
.hl-tip { transition: opacity .25s; }
.hl-dot { fill: #fff; stroke: url(#hl-grad); stroke-width: 3; }
.hl-halo { fill: url(#hl-grad); opacity: .2; transform-box: fill-box; transform-origin: center; }
.hl-on .hl-halo { animation: hl-halo 1.4s ease-in-out infinite; }
@keyframes hl-halo { 0%, 100% { transform: scale(.75); opacity: .26; } 50% { transform: scale(1.15); opacity: .1; } }
.historia:not(.hl-live) .hl-tip { opacity: 0; }

/* ---------- Ruch (tylko z .hl-on) ---------- */
/* hasło wyskakuje ze swojej strony: krótko, z lekkim odbiciem; mały tekst chwilę po nim */
.hl-on .hl-it > * { transition: transform .42s var(--hl-snap), opacity .2s linear; }
.hl-on .hl-l:not(.in) > * { opacity: 0; transform: translateX(-56px) skewX(5deg); }
.hl-on .hl-r:not(.in) > * { opacity: 0; transform: translateX(56px) skewX(-5deg); }
.hl-on .hl-it.in > .hl-note { transition-delay: .08s; }
/* podkreślenie kluczowego słowa dorysowuje się po wyskoku */
.hl-on .hl-it:not(.in) .hl-k::after { transform: scaleX(0); }
.hl-on .hl-it.in .hl-k::after { transition: transform .5s var(--hl-out) .2s; }
/* przycisk pojawia się, gdy linia do niego dojdzie, i raz rozchodzi się od niego pierścień */
.hl-on:not(.hl-done) .hl-it .hl-cta { opacity: 0; transform: scale(.88); }
.hl-on.hl-done .hl-cta { transition: transform .45s var(--hl-snap), opacity .2s linear; }
.hl-on.hl-done .hl-cta::after { animation: hl-ring .9s var(--hl-out) .1s; }
@keyframes hl-ring { from { opacity: .9; transform: scale(.96); } to { opacity: 0; transform: scale(1.25, 1.6); } }

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

/* ---------- Szerszy ekran: większe pola na linię, hasła nie rozciągają się na całą szerokość ---------- */
@media (min-width: 761px) {
  .hl-wrap { --hl-gut: 120px; padding: 0 32px; }
  .hl-it { max-width: min(100%, 860px); }
  .hl-path { stroke-width: 4.5; }
  .hl-note { font-size: clamp(20px, 1.8vw, 25px); }
}
@media (min-width: 1100px) {
  .hl-it:nth-child(2) .hl-say { --fs: clamp(60px, 6.4vw, 96px); }
  .hl-it:nth-child(3) .hl-say, .hl-it:nth-child(4) .hl-say { --fs: clamp(52px, 5.6vw, 82px); }
  .hl-it:nth-child(5) .hl-say, .hl-it:nth-child(6) .hl-say { --fs: clamp(46px, 4.8vw, 70px); }
}
/* Telefon poziomo: litery liczone od wysokości ekranu */
@media (max-height: 480px) and (orientation: landscape) {
  .hl-say { --fs: clamp(26px, 9vh, 44px) !important; }
  .hl-wrap { gap: 48px; }
}
