/* ============================================================
   ZIZIMEDIA — WARSTWA POPISU (motion)
   Kinowe intro, żywe tło, kinetyczna typografia, przypięty scroll,
   własny kursor. Wszystko na transform/opacity, wyłączane na dotyku.
   ============================================================ */

/* ---------- 1. INTRO (styl Obys): wordmark wykluwa się ze szczeliny ---------- */
#ld {
  position: fixed; inset: 0; z-index: 9999; background: #0a0a0c;
  display: grid; place-items: center; overflow: hidden;
}
html:not(.js) #ld { display: none; }
#ld .ld2 { display: inline-flex; flex-direction: column; align-items: center; gap: 16px; }
#ld .ld2__word {
  font-family: 'Sora', sans-serif; font-weight: 800; color: #fff;
  font-size: clamp(40px, 9vw, 108px); letter-spacing: -.04em; line-height: 1;
  clip-path: inset(46% 0 46% 0); opacity: 0; transform: scale(.985);
  animation: ldReveal 1.2s cubic-bezier(.16,1,.3,1) .12s forwards;
}
#ld .ld2__line { width: 0; height: 2px; background: var(--accent-2); animation: ldLine 1.1s cubic-bezier(.5,0,.2,1) .1s forwards; }
@keyframes ldReveal { to { clip-path: inset(0 0 0 0); opacity: 1; transform: none; } }
@keyframes ldLine { 0% { width: 0; } 55% { width: 128px; } 100% { width: 0; } }
#ld.is-out { opacity: 0; transition: opacity .55s ease; pointer-events: none; }
body.lock { overflow: hidden; }

/* ---------- 2. ŻYWE TŁO: dryfujące pola światła + ziarno ---------- */
.stage { position: relative; overflow: hidden; }
.aura { position: absolute; inset: -25%; z-index: 0; pointer-events: none; filter: blur(90px); opacity: .85; }
.aura i {
  position: absolute; display: block; border-radius: 50%;
  mix-blend-mode: screen; will-change: transform;
}
.aura i:nth-child(1) { width: 46vw; height: 46vw; left: 8%;  top: 6%;  background: radial-gradient(circle, rgba(35,76,255,.85), transparent 66%); animation: drift1 26s ease-in-out infinite; }
.aura i:nth-child(2) { width: 40vw; height: 40vw; right: 4%; top: 22%; background: radial-gradient(circle, rgba(120,60,255,.7), transparent 66%);  animation: drift2 32s ease-in-out infinite; }
.aura i:nth-child(3) { width: 34vw; height: 34vw; left: 34%; bottom: 2%; background: radial-gradient(circle, rgba(0,190,255,.55), transparent 66%); animation: drift3 28s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(9vw,7vh,0) scale(1.18); } }
@keyframes drift2 { 0%,100% { transform: translate3d(0,0,0) scale(1.1); } 50% { transform: translate3d(-8vw,10vh,0) scale(.92); } }
@keyframes drift3 { 0%,100% { transform: translate3d(0,0,0) scale(.95); } 50% { transform: translate3d(6vw,-9vh,0) scale(1.2); } }

.grain { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .055;
  background-image: url(noise.webp); background-size: 180px; }

/* ---------- 3. KINETYCZNA TYPOGRAFIA ---------- */
.kin { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
html.js .kin > span { display: block; transform: translateY(112%) rotate(3deg); transform-origin: left top; }
html.js body.go .kin > span {
  transform: none;
  transition: transform 1.05s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--d, 0s);
}
html.js .fade { opacity: 0; transform: translateY(20px); }
html.js body.go .fade { opacity: 1; transform: none; transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }

/* ---------- 4. WŁASNY KURSOR ---------- */
.cur, .cur-dot { position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none; border-radius: 50%; }
.cur { width: 42px; height: 42px; margin: -21px 0 0 -21px; border: 1px solid rgba(255,255,255,.5);
  transition: width .3s cubic-bezier(.2,.8,.2,1), height .3s cubic-bezier(.2,.8,.2,1), margin .3s cubic-bezier(.2,.8,.2,1), background .3s ease, border-color .3s ease; }
.cur-dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #fff; }
.cur.is-big { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: rgba(35,76,255,.2); border-color: transparent; }
@media (hover: none), (pointer: coarse) { .cur, .cur-dot { display: none; } }

/* ---------- 5. PRZYPIĘTY SCROLL: trzy sceny w miejscu ---------- */
.pin { position: relative; height: 340vh; background: var(--ink); }
.pin__stage { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; place-items: center; }
.pin__scene { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; }
.pin__scene.on { opacity: 1; pointer-events: auto; }
.pin__inner { max-width: var(--container); width: 100%; padding: 0 var(--pad-x); }
.pin__tag { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 20px; }
.pin__h { font-family: 'Sora', sans-serif; font-weight: 800; font-size: clamp(36px, 6.6vw, 88px); line-height: .96; letter-spacing: -.04em; color: #fff; margin: 0; max-width: 15ch; }
.pin__p { color: var(--text-soft-2); font-size: clamp(16px,1.9vw,20px); line-height: 1.5; max-width: 46ch; margin: 24px 0 0; }
.pin__cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; color: #fff; font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--accent-2); padding-bottom: 4px; }
/* wjazd elementów sceny */
.pin__scene .pin__tag, .pin__scene .pin__h, .pin__scene .pin__p, .pin__scene .pin__cta { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s cubic-bezier(.16,1,.3,1); }
.pin__scene.on .pin__tag { opacity: 1; transform: none; }
.pin__scene.on .pin__h { opacity: 1; transform: none; transition-delay: .06s; }
.pin__scene.on .pin__p { opacity: 1; transform: none; transition-delay: .12s; }
.pin__scene.on .pin__cta { opacity: 1; transform: none; transition-delay: .18s; }
/* pasek postępu scen */
.pin__rail { position: absolute; left: var(--pad-x); bottom: 46px; display: flex; gap: 8px; z-index: 3; }
.pin__rail b { width: 44px; height: 3px; background: rgba(255,255,255,.2); border-radius: 2px; overflow: hidden; }
.pin__rail b i { display: block; height: 100%; width: 0; background: var(--accent-2); }
.pin__count { position: absolute; right: var(--pad-x); bottom: 40px; z-index: 3;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .2em; color: #6d6d7a; }
.pin__count em { font-style: normal; color: #fff; font-size: 26px; }

@media (hover: none), (max-width: 900px), (prefers-reduced-motion: reduce) {
  .pin { height: auto; }
  .pin__stage { position: static; height: auto; display: block; }
  .pin__scene { position: static; opacity: 1; pointer-events: auto; padding: 62px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .pin__scene .pin__tag, .pin__scene .pin__h, .pin__scene .pin__p, .pin__scene .pin__cta { opacity: 1; transform: none; }
  .pin__rail, .pin__count { display: none; }
}

/* ---------- 6. PASEK Z PRĘDKOŚCIĄ ---------- */
.vel { background: var(--accent); overflow: hidden; padding: 18px 0; }
.vel__row { display: flex; width: max-content; will-change: transform; }
.vel__g { display: flex; align-items: center; gap: 30px; padding-right: 30px; white-space: nowrap; }
.vel__g span { font-family: 'Sora', sans-serif; font-weight: 800; font-size: clamp(20px,2.6vw,30px); text-transform: uppercase; color: var(--ink); letter-spacing: -.01em; }
.vel__g i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); flex: none; }

/* ============================================================
   PRACE — portfolio: prawdziwe realizacje jako bohater strony
   ============================================================ */
.prace { background: var(--ink); padding: 96px 0; }
.prace__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; flex-wrap: wrap; margin-bottom: 44px; }
.prace__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.praca {
  position: relative; display: block; overflow: hidden; text-decoration: none;
  border-radius: 18px; background: #15151a; border: 1px solid rgba(255,255,255,.1);
  aspect-ratio: 4 / 3;
}
.praca--wide { grid-column: span 2; aspect-ratio: 16 / 7; }
.praca__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.16,1,.3,1), filter .5s ease; filter: saturate(.85) brightness(.75); }
.praca__veil { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,8,10,.94) 4%, rgba(8,8,10,.35) 46%, rgba(8,8,10,.1) 100%); }
.praca__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 26px 24px; z-index: 2; }
.praca__tag {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; color: #fff;
  background: rgba(255,255,255,.14); backdrop-filter: blur(6px);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 14px;
}
.praca__name { font-family: 'Sora', sans-serif; font-weight: 800; font-size: clamp(21px,2.6vw,30px); letter-spacing: -.02em; color: #fff; margin: 0; line-height: 1.08; }
.praca__what { color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.5; margin: 8px 0 0; max-width: 46ch; }
.praca__go {
  position: absolute; top: 22px; right: 22px; z-index: 2;
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255,255,255,.12); backdrop-filter: blur(6px); color: #fff; font-size: 18px;
  opacity: 0; transform: translate(-6px, 6px); transition: opacity .35s ease, transform .35s cubic-bezier(.16,1,.3,1), background .3s ease;
}
@media (hover: hover) {
  .praca:hover .praca__img { transform: scale(1.06); filter: saturate(1) brightness(.85); }
  .praca:hover .praca__go { opacity: 1; transform: none; background: var(--accent); }
}
@media (max-width: 820px) {
  .prace { padding: 68px 0; }
  .prace__grid { grid-template-columns: 1fr; }
  .praca, .praca--wide { grid-column: auto; aspect-ratio: 4 / 3; }
}

/* ---------- OKNO PRZEGLĄDARKI z samo-przewijającą się stroną ----------
   Zrzut całej strony klienta (1200x6906) jedzie w ramce. Przesunięcie
   -89.1% odpowiada dokładnie dojechaniu do stopki przy proporcji 16:10. */
.okno {
  position: relative; border-radius: 12px; overflow: hidden;
  background: #0c0c10; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.75);
}
.okno__bar {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  background: #1b1b21; border-bottom: 1px solid rgba(255,255,255,.08);
}
.okno__bar b { width: 10px; height: 10px; border-radius: 50%; background: #3a3a44; flex: none; }
.okno__bar b:nth-child(1) { background: #ff5f57; }
.okno__bar b:nth-child(2) { background: #febc2e; }
.okno__bar b:nth-child(3) { background: #28c840; }
.okno__url {
  flex: 1; margin-left: 8px; background: #0f0f14; border-radius: 6px; padding: 5px 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #8a8a94;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.okno__vp { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.okno__shot { position: absolute; top: 0; left: 0; width: 100%; height: auto; display: block; }
html.js .okno__shot { animation: przewin 26s cubic-bezier(.5,0,.5,1) infinite alternate; }
@keyframes przewin { from { transform: translateY(0); } to { transform: translateY(-89.1%); } }
.okno:hover .okno__shot { animation-play-state: paused; }
.okno__zywo {
  position: absolute; right: 14px; bottom: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(8px);
  color: #fff; text-decoration: none; font-weight: 700; font-size: 13px;
  padding: 10px 16px; border-radius: 999px; transition: background .25s ease;
}
.okno__zywo:hover { background: var(--accent); }
@media (hover: none), (prefers-reduced-motion: reduce) {
  html.js .okno__shot { animation: none; }
  .okno__vp { aspect-ratio: 16 / 13; }
}

/* Realizacja z pełną prezentacją: okno + rekord danych obok */
.real { display: grid; grid-template-columns: 1.35fr .65fr; gap: 40px; align-items: center; margin-bottom: 26px; }
.real__meta { display: grid; gap: 4px; }
.real__efekt {
  font-family: 'Sora', sans-serif; font-weight: 800; color: #fff;
  font-size: clamp(22px, 2.7vw, 32px); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 16px;
}
.real__wiersz { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 14.5px; }
.real__wiersz dt { color: #6d6d7a; min-width: 88px; flex: none; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding-top: 3px; }
.real__wiersz dd { margin: 0; color: rgba(255,255,255,.86); }
.real__tagi { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.real__tagi span { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .08em; color: var(--accent-2); border: 1px solid rgba(77,116,255,.4); padding: 5px 11px; border-radius: 999px; }
@media (max-width: 980px) { .real { grid-template-columns: 1fr; gap: 26px; } }

/* Człowiek za tym stojący */
.czlowiek { background: var(--bg); padding: 96px 0; }
.czlowiek__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 52px; align-items: center; }
.czlowiek__foto {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 5;
  background: linear-gradient(150deg, #1a2a66, #11142e); display: grid; place-items: center;
}
.czlowiek__foto img { width: 100%; height: 100%; object-fit: cover; }
.czlowiek__brak { color: rgba(255,255,255,.45); font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .12em; text-align: center; padding: 24px; line-height: 1.7; }
.czlowiek__cyt { font-family: 'Sora', sans-serif; font-weight: 700; font-size: clamp(21px,2.8vw,31px); line-height: 1.28; letter-spacing: -.02em; margin: 0 0 22px; }
.czlowiek__kto { display: flex; align-items: center; gap: 12px; margin-top: 26px; font-size: 15px; }
.czlowiek__kto b { font-weight: 700; }
.czlowiek__kto span { color: var(--text-soft); }
@media (max-width: 820px) { .czlowiek { padding: 64px 0; } .czlowiek__grid { grid-template-columns: 1fr; gap: 30px; } .czlowiek__foto { max-width: 320px; } }

/* ---------- Wyłączniki ---------- */
@media (hover: none), (max-width: 900px) {
  .aura { filter: blur(60px); opacity: .6; }
  .aura i { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  #ld { display: none; }
  .aura i { animation: none; }
  html.js .kin > span, html.js .fade { transform: none !important; opacity: 1 !important; transition: none !important; }
  .cur, .cur-dot { display: none; }
}
