/* =========================================================
   HOME — portfolio KG.Dev
   Paleta: peryferyjny fiolet (papier) + indygo (tusz)
           + ultramaryna (sygnał) + koral (iskra)
   ========================================================= */
:root {
  --paper: #ECEAF6;
  --paper-2: #F7F6FC;
  --ink: #1A1633;
  --ink-2: #2A2550;
  --signal: #4B3BFF;
  --spark: #FF6B4A;
  --mist: #CFC9EC;
  --muted: rgba(26, 22, 51, .62);
  --pad: clamp(20px, 5vw, 72px);
  --radius: 22px;
  --f: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body { background: var(--paper); color: var(--ink); font-family: var(--f); font-size: 17px; line-height: 1.55; font-optical-sizing: auto; overflow-x: hidden; }
h1, h2, h3 { font-weight: 700; line-height: 1; letter-spacing: -.035em; }
h2 { font-size: clamp(42px, 6.4vw, 104px); font-stretch: 80%; font-weight: 750; }
p { max-width: 62ch; }

/* ---------- Logo KG.Dev ---------- */
.logo { display: inline-flex; align-items: baseline; font-weight: 800; letter-spacing: -.05em; text-decoration: none; line-height: 1; }
.logo i { display: inline-block; width: .24em; height: .24em; border-radius: 50%; background: var(--spark); margin: 0 .05em 0 .06em; }
.logo span { font-weight: 400; letter-spacing: -.03em; }

/* ---------- Przyciski ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 28px; border-radius: 99px;
  background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  border: 1.5px solid var(--bg);
  transition: background .35s, color .35s, border-color .35s, transform .6s var(--ease-out);
}
.btn:hover { --bg: var(--signal); --fg: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: rgba(26,22,51,.25); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--light { --bg: var(--paper); --fg: var(--ink); }
.btn--light:hover { --bg: #fff; --fg: var(--signal); }
.btn--small { height: 42px; padding: 0 20px; font-size: 14px; }
.btn--big { height: 64px; padding: 0 36px; font-size: 17px; }

/* ---------- Intro: KG na czarnym tle ---------- */
.intro { position: fixed; inset: 0; z-index: 9500; display: none; place-items: center; background: #050505; color: #fff; }
.has-intro .intro { display: grid; }
.intro.is-out { transform: translateY(-100%); transition: transform 1.05s var(--ease-io); }
.intro__logo { display: flex; align-items: baseline; font-weight: 800; font-size: clamp(64px, 10vw, 140px); letter-spacing: -.06em; line-height: 1; }
.intro__logo span { display: inline-block; opacity: 0; transform: translateY(30%) scale(.92); filter: blur(8px); transition: opacity .7s ease, transform .9s var(--ease-out), filter .7s ease; }
.intro__logo span:nth-child(2) { transition-delay: .12s; }
.intro__logo i { display: inline-block; width: .2em; height: .2em; margin: 0 .06em 0 .08em; border-radius: 50%; background: var(--spark); transform: scale(0); transition: transform .6s cubic-bezier(.34, 1.8, .64, 1) .45s; }
.intro__logo em { font-style: normal; font-weight: 300; letter-spacing: -.03em; clip-path: inset(0 100% 0 0); transition: clip-path .8s var(--ease-io) .6s; }
.intro.is-in .intro__logo span { opacity: 1; transform: none; filter: none; }
.intro.is-in .intro__logo i { transform: scale(1); }
.intro.is-in .intro__logo em { clip-path: inset(0 0 0 0); }

/* ---------- Nawigacja ---------- */
.nav {
  position: fixed; z-index: 500; top: 16px; left: var(--pad); right: var(--pad);
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding: 0 12px 0 22px; border-radius: 99px;
  background: rgba(247, 246, 252, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(26,22,51,.06);
  transition: transform .7s var(--ease-out), background .4s, color .4s, border-color .4s;
}
.nav.is-hidden { transform: translateY(-140%); }
.nav.is-dark { background: rgba(42, 37, 80, .55); color: var(--paper); border-color: rgba(236,234,246,.1); }
.nav.is-dark .btn { --bg: var(--paper); --fg: var(--ink); }
.nav.is-dark .btn:hover { --bg: var(--signal); --fg: #fff; }
.nav__logo { font-size: 24px; margin-right: auto; }
.nav__links { display: flex; gap: 26px; }
.nav__links a { text-decoration: none; font-size: 15px; font-weight: 500; }
.nav__burger { display: none; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); position: relative; }
.nav__burger i { position: absolute; left: 14px; right: 14px; height: 1.6px; background: var(--paper); transition: transform .5s var(--ease-out); }
.nav__burger i:first-child { top: 19px; } .nav__burger i:last-child { top: 26px; }
.menu-open .nav__burger i:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-open .nav__burger i:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 450; background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 120px var(--pad) 40px;
  clip-path: circle(0 at calc(100% - var(--pad) - 35px) 48px);
  transition: clip-path .9s var(--ease-io); visibility: hidden;
}
.menu-open .menu { clip-path: circle(150% at calc(100% - var(--pad) - 35px) 48px); visibility: visible; }
.menu nav { display: flex; flex-direction: column; gap: 6px; margin-bottom: 40px; }
.menu nav a { font-size: clamp(44px, 12vw, 80px); font-weight: 750; font-stretch: 80%; letter-spacing: -.04em; line-height: 1.02; text-decoration: none; opacity: 0; transform: translateY(40px); transition: opacity .5s, transform .8s var(--ease-out); }
.menu-open .menu nav a { opacity: 1; transform: none; transition-delay: calc(.25s + var(--i) * 60ms); }
.menu p { opacity: .6; }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto auto;
  padding: 130px var(--pad) 30px;
  background:
    radial-gradient(60% 50% at 85% 10%, rgba(75,59,255,.10), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(255,107,74,.08), transparent 70%),
    var(--paper);
}
.hero__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.hero__lead { display: block; font-size: clamp(22px, 2.6vw, 38px); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.hero__status { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 99px; background: var(--paper-2); border: 1px solid rgba(26,22,51,.08); font-size: 14px; font-weight: 500; white-space: nowrap; }
.hero__status i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22B26B; }
.hero__status i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid #22B26B; animation: halo 1.8s ease-out infinite; }
.hero__stage { position: relative; min-height: 240px; margin: 0 calc(var(--pad) * -1); }
.dots { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.hero__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 30px; }
.hero__desc { font-size: clamp(17px, 1.35vw, 20px); max-width: 44ch; color: var(--muted); }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); padding-top: 18px; }
.timeline__line { position: absolute; top: 25px; left: 7px; right: 0; height: 1.5px; background: rgba(26,22,51,.14); pointer-events: none; }
.timeline__line b { position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; transform: scaleX(var(--tl, 0)); }
.timeline__item { position: relative; z-index: 1; display: grid; justify-items: start; gap: 6px; }
.timeline__item button { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-align: left; font-size: 14px; color: var(--muted); padding: 0; transition: color .3s; }
.timeline__item button i { width: 15px; height: 15px; border-radius: 50%; background: var(--paper); border: 1.5px solid rgba(26,22,51,.35); position: relative; transition: border-color .3s; }
.timeline__item button i::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--spark); transform: scale(0); transition: transform .5s var(--ease-out); }
.timeline__item a { font-size: 13px; font-weight: 600; color: var(--signal); text-decoration: none; border-bottom: 1px solid currentColor; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .4s, transform .5s var(--ease-out); }
.timeline__item.is-active button { color: var(--ink); }
.timeline__item.is-active button i { border-color: var(--spark); }
.timeline__item.is-active button i::after { transform: scale(1); }
.timeline__item.is-active button i::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--spark); animation: halo 1.8s ease-out infinite; }
.timeline__item.is-active a { opacity: 1; transform: none; pointer-events: auto; }
@keyframes halo { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* Wejście hero */
.js .nav, .js .hero__actions, .js .timeline, .js .hero__status { opacity: 0; transform: translateY(24px); }
.hero-in .nav, .hero-in .hero__actions, .hero-in .timeline, .hero-in .hero__status { opacity: 1; transform: none; transition: opacity .9s ease, transform 1.1s var(--ease-out); }
.hero-in .hero__status { transition-delay: .3s; }
.hero-in .hero__actions { transition-delay: .5s; }
.hero-in .timeline { transition-delay: .7s; }
.hero-in .nav { transition-delay: .2s; }
.hero-in .nav.is-hidden { transform: translateY(-140%); transition-delay: 0s; }

/* ---------- Manifest z mediami w tekście ---------- */
.statement { padding: clamp(120px, 16vw, 230px) var(--pad) clamp(90px, 10vw, 150px); }
.statement__text { max-width: 24ch; font-size: clamp(34px, 5vw, 84px); font-weight: 650; line-height: 1.1; letter-spacing: -.035em; }
@media (min-width: 1100px) { .statement__text { max-width: 26ch; } }
.statement__text .sw { opacity: .14; transition: opacity .3s linear; }
.statement__text .sw.on { opacity: 1; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  height: .92em; min-width: 1.9em; margin: -.1em .08em 0; border-radius: 99px; overflow: hidden;
  transform: scale(0) rotate(-8deg); transition: transform .8s cubic-bezier(.34, 1.56, .64, 1);
}
.chip.on { transform: none; }
.chip--img { width: 1.9em; background: var(--mist); }
.chip--img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.4); transition: transform 1.4s var(--ease-out); }
.chip.on img { transform: scale(1); }
.chip--sketch { width: 2.3em; background: var(--paper-2); border: 1.5px solid rgba(26,22,51,.15); }
.chip--sketch svg { width: 74%; fill: none; stroke: var(--signal); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset 1.6s var(--ease-out) .2s; }
.chip--sketch.on svg { stroke-dashoffset: 0; }
.chip--code { width: 2em; background: var(--ink); color: var(--spark); font: 600 .38em/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0; gap: .3em; }
.chip--code b { width: .5em; height: 1.1em; background: var(--paper); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.chip--live { gap: .25em; padding: 0 .35em; background: #DFF5E8; color: #137447; font-size: .4em; height: 2.1em; letter-spacing: 0; font-weight: 600; }
.chip--live i { width: .7em; height: .7em; border-radius: 50%; background: #22B26B; box-shadow: 0 0 0 .25em rgba(34,178,107,.25); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: clamp(70px, 9vw, 130px); border-top: 1.5px solid var(--ink); padding-top: 28px; }
.fact b { display: block; font-size: clamp(48px, 5.5vw, 88px); font-weight: 800; font-stretch: 75%; letter-spacing: -.04em; line-height: 1; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.fact > span { display: block; max-width: 26ch; color: var(--muted); }

/* ---------- Realizacje: karty na cały ekran, nakładające się ---------- */
.projects { position: relative; background: var(--ink); }
.projects__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; padding: clamp(110px, 13vw, 190px) var(--pad) clamp(60px, 8vw, 110px); color: var(--paper); }
.projects__head h2 { font-size: clamp(60px, 11vw, 190px); }
.projects__head p { max-width: 38ch; color: rgba(236,234,246,.7); }
.proj {
  position: sticky; top: 0; height: 100svh; min-height: 640px; overflow: hidden;
  display: grid; grid-template-columns: minmax(300px, .8fr) 1.25fr; align-items: center; gap: clamp(30px, 5vw, 80px);
  padding: 110px var(--pad) 50px;
  background: var(--pbg); color: var(--pfg);
  transform-origin: 50% 0;
  border-radius: 34px 34px 0 0;
}
.proj__n { display: block; font-size: 15px; font-weight: 600; color: var(--pac); margin-bottom: 22px; font-variant-numeric: tabular-nums; }
.proj__name { font-size: clamp(46px, 5.6vw, 96px); font-stretch: 80%; margin-bottom: 26px; }
.proj__info p { opacity: .78; max-width: 44ch; }
.proj__tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 24px 0 34px; }
.proj__tags li { font-size: 13px; padding: 7px 13px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--pfg) 25%, transparent); }
.proj__btn { --bg: var(--pfg); --fg: var(--pbtn); }
.proj__btn:hover { --bg: var(--pac); --fg: var(--pbtn); }
.proj__device { position: relative; display: block; perspective: 1600px; }
.device {
  position: relative; border-radius: 14px; overflow: hidden; background: #fff;
  box-shadow: 0 50px 100px -30px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.06);
  transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) translateZ(0);
  transition: transform .9s var(--ease-out);
}
.device__bar { height: 34px; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: #ECEBF1; }
.device__dots { display: flex; gap: 6px; }
.device__dots i { width: 10px; height: 10px; border-radius: 50%; background: #D3D1DC; }
.device__dots i:first-child { background: #FF6159; } .device__dots i:nth-child(2) { background: #FFBF2F; } .device__dots i:nth-child(3) { background: #2ACB42; }
.device__url { flex: 1; max-width: 300px; margin: 0 auto; height: 22px; border-radius: 6px; background: #fff; font-size: 12px; color: #666; display: grid; place-items: center; }
.device__screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #111; }
.device__screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.device__screen iframe { position: absolute; top: 0; left: 0; width: 1440px; height: 900px; border: 0; transform-origin: 0 0; transform: scale(var(--sc, .5)); pointer-events: none; opacity: 0; transition: opacity .8s; background: #fff; }
.device__screen iframe.is-loaded { opacity: 1; }
.phone { position: absolute; right: -3%; bottom: -8%; width: 21%; aspect-ratio: 9 / 19; border-radius: 26px; border: 6px solid #111; overflow: hidden; background: #111; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); transform: translateY(var(--py, 0)) rotate(4deg); transition: transform .9s var(--ease-out); }
.phone img { width: 100%; height: 100%; object-fit: cover; }
.proj__device:hover .phone { --py: -12px; }

/* ---------- Usługi ---------- */
.services { padding: clamp(110px, 14vw, 200px) var(--pad); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; margin-bottom: clamp(50px, 7vw, 90px); }
.section-head h2 { max-width: 12ch; }
.section-head p { max-width: 38ch; color: var(--muted); }
.svc { list-style: none; border-top: 1.5px solid var(--ink); }
.svc__item { border-bottom: 1px solid rgba(26,22,51,.16); }
.svc__head { position: relative; z-index: 0; width: 100%; display: grid; grid-template-columns: 1fr auto 46px; align-items: center; gap: 30px; padding: 28px 24px; text-align: left; overflow: hidden; transition: color .45s; }
.svc__head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .6s var(--ease-out); }
.svc__head:hover, .svc__item.is-open .svc__head { color: var(--paper); }
.svc__head:hover::before, .svc__item.is-open .svc__head::before { transform: scaleY(1); }
.svc__name { font-size: clamp(30px, 4.2vw, 68px); font-weight: 720; font-stretch: 82%; letter-spacing: -.035em; line-height: 1; transition: transform .7s var(--ease-out); }
.svc__head:hover .svc__name { transform: translateX(18px); }
.svc__short { font-size: 15px; opacity: .65; text-align: right; }
.svc__plus { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid currentColor; }
.svc__plus::before, .svc__plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.6px; background: currentColor; translate: -50% -50%; transition: transform .5s var(--ease-out); }
.svc__plus::after { transform: rotate(90deg); }
.svc__item.is-open .svc__plus::after { transform: rotate(0); }
.svc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s var(--ease-out); background: var(--ink); color: var(--paper); }
.svc__body > div { overflow: hidden; }
.svc__item.is-open .svc__body { grid-template-rows: 1fr; }
.svc__inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; padding: 4px 24px 36px; }
.svc__inner p { font-size: 18px; opacity: .8; }
.svc__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-self: start; }
.svc__meta dt { font-size: 13px; opacity: .55; margin-bottom: 4px; }
.svc__meta dd { font-weight: 600; }

/* ---------- Proces: strona buduje się na oczach ---------- */
.build { position: relative; height: 520vh; background: var(--ink); color: var(--paper); }
.build__sticky { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(280px, .75fr) 1.25fr; gap: clamp(30px, 5vw, 80px); align-items: center; padding: 100px var(--pad) 40px; }
.build__text h2 { font-size: clamp(40px, 4.6vw, 76px); margin-bottom: 40px; max-width: 11ch; }
.build__steps { list-style: none; }
.build__steps li { padding: 14px 0; border-top: 1px solid rgba(236,234,246,.12); opacity: .35; transition: opacity .5s; }
.build__steps li.is-active { opacity: 1; }
.build__steps h3 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.build__steps p { font-size: 15px; color: rgba(236,234,246,.7); max-height: 0; overflow: hidden; transition: max-height .6s var(--ease-out), margin .6s; }
.build__steps li.is-active p { max-height: 120px; margin-top: 8px; }
.build__progress { display: flex; align-items: center; gap: 16px; margin-top: 26px; font-size: 14px; color: rgba(236,234,246,.6); font-variant-numeric: tabular-nums; }
.build__bar { flex: 1; height: 1.5px; background: rgba(236,234,246,.15); }
.build__bar i { display: block; height: 100%; background: var(--spark); transform-origin: left; transform: scaleX(var(--bp, 0)); }

.browser { border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 60px 120px -40px rgba(0,0,0,.7); }
.browser__bar { height: 40px; display: flex; align-items: center; gap: 16px; padding: 0 14px; background: #E9E7F2; }
.browser__url { flex: 1; max-width: 360px; margin: 0 auto; height: 26px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 7px; background: #fff; color: #444; font-size: 13px; }
.browser__url svg { width: 10px; fill: #22B26B; stroke: #22B26B; stroke-width: 1.4; opacity: 0; transition: opacity .4s; }
.browser.s4 .browser__url svg { opacity: 1; }
.browser__caret { width: 1px; height: 14px; background: #444; animation: caret 1s steps(1) infinite; }
.browser.s4 .browser__caret { display: none; }
.browser__view {
  --b: #F2E8E4; --t: #3A2230;
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--b); color: var(--t);
  font-family: Georgia, "Times New Roman", serif; font-size: clamp(8px, 1vw, 14px);
  padding: 3.4% 4.5%; display: grid; grid-template-rows: auto 1fr auto; gap: 5%;
  transition: background .8s;
}
.bw-nav, .bw-hero, .bw-cards { transition: opacity .6s, transform .8s var(--ease-out); }
.bw-nav { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.bw-logo { font-style: italic; font-size: 1.5em; }
.bw-links { display: flex; gap: 1.6em; font: 1em system-ui, sans-serif; }
.bw-links i { font-style: normal; }
.bw-btn, .bw-cta { font: 600 .9em system-ui, sans-serif; padding: .7em 1.4em; border-radius: 99px; background: var(--t); color: var(--b); white-space: nowrap; }
.bw-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 6%; align-items: center; min-height: 0; }
.bw-copy { display: grid; gap: 1.1em; justify-items: start; }
.bw-title { font-size: 3.2em; line-height: .95; }
.bw-title span { display: inline-block; }
.bw-sub { font: 1.05em system-ui, sans-serif; opacity: .7; }
.bw-img { height: 100%; max-height: 100%; aspect-ratio: 4 / 5; justify-self: end; border-radius: 999px 999px 0 0; overflow: hidden; background: #E2D2CB; position: relative; }
.bw-img img, .bw-card__img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .6s; }
.bw-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4%; }
.bw-card { display: flex; align-items: center; gap: .8em; padding: .7em; border-radius: .8em; background: rgba(255,255,255,.6); font: 600 .95em system-ui, sans-serif; }
.bw-card__img { width: 2.6em; height: 2.6em; border-radius: 50%; overflow: hidden; flex: none; background: #E2D2CB; }

/* Etap 0: brief — tylko karteczki */
.bw-notes { position: absolute; inset: 0; display: grid; place-content: center; gap: 1.2em; font: 600 1.4em/1.2 system-ui, sans-serif; color: #1A1633; pointer-events: none; }
.bw-notes span { padding: .9em 1.3em; background: #FFE58F; box-shadow: 0 10px 20px -8px rgba(0,0,0,.25); transform: rotate(var(--r)) translateY(0); transition: transform .7s var(--ease-out), opacity .5s; }
.bw-notes span:nth-child(2) { background: #C8F0D6; margin-left: 3em; transition-delay: .08s; }
.bw-notes span:nth-child(3) { background: #FFD2C7; margin-left: 1em; transition-delay: .16s; }
.browser:not(.now-0) .bw-notes span { opacity: 0; transform: rotate(calc(var(--r) * 3)) translateY(-160%); }
.browser:not(.s1) .bw-nav, .browser:not(.s1) .bw-hero, .browser:not(.s1) .bw-cards { opacity: 0; transform: translateY(16px); }
.browser.now-0 .browser__view { --b: #F4F3F8; }

/* Etap 1: makieta — szare bloki */
.browser:not(.s2) .browser__view { --b: #fff; --t: #C9C6D6; }
.browser:not(.s2) :is(.bw-logo, .bw-links i, .bw-btn, .bw-title span, .bw-sub, .bw-cta, .bw-card b) { color: transparent !important; background: #E7E5EF; border-radius: 4px; }
.browser:not(.s2) .bw-img, .browser:not(.s2) .bw-card__img { border-radius: 6px; background: linear-gradient(to top right, transparent calc(50% - 1px), #D5D2E2 50%, transparent calc(50% + 1px)), linear-gradient(to top left, transparent calc(50% - 1px), #D5D2E2 50%, transparent calc(50% + 1px)), #EFEDF5; }
.browser:not(.s2) .bw-img img, .browser:not(.s2) .bw-card__img img { opacity: 0; }
.browser:not(.s2) .bw-card { background: #F6F5FA; outline: 1px dashed #D5D2E2; }
.bw-logo, .bw-links i, .bw-btn, .bw-title span, .bw-sub, .bw-cta, .bw-card b, .bw-img, .bw-card__img, .bw-card { transition: color .6s, background .6s, border-radius .8s var(--ease-out); }

/* Etap 2: kod */
.bw-code { position: absolute; right: 3%; bottom: 5%; width: 46%; height: 58%; margin: 0; padding: 1.2em 1.4em; border-radius: .8em; background: #1A1633; color: #CFC9EC; font: 1em/1.55 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); opacity: 0; transform: translateY(20%) scale(.96); transition: opacity .5s, transform .8s var(--ease-out); pointer-events: none; }
.bw-code .k { color: #FF8A6F; } .bw-code .s { color: #9BE3B6; } .bw-code .a { color: #A89CFF; }
.browser.now-2 .bw-code { opacity: 1; transform: none; }

/* Etap 3: animacje */
.browser.s3 .bw-title span { animation: wordIn .9s var(--ease-out) backwards; }
.browser.s3 .bw-title span:nth-child(2) { animation-delay: .1s; } .browser.s3 .bw-title span:nth-child(3) { animation-delay: .2s; } .browser.s3 .bw-title span:nth-child(4) { animation-delay: .3s; }
@keyframes wordIn { from { opacity: 0; transform: translateY(60%) rotate(6deg); } }
.browser.s3 .bw-card { animation: bob 3.2s ease-in-out infinite; }
.browser.s3 .bw-card:nth-child(2) { animation-delay: -1s; } .browser.s3 .bw-card:nth-child(3) { animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-8%); } }
.browser.s3 .bw-img img { animation: kb 8s ease-in-out infinite alternate; }
@keyframes kb { to { transform: scale(1.12); } }
.bw-cursor { position: absolute; left: 70%; top: 85%; width: 4%; fill: #1A1633; stroke: #fff; stroke-width: 1.5; opacity: 0; pointer-events: none; }
.browser.now-3 .bw-cursor { opacity: 1; animation: cursorPath 3.6s var(--ease-io) infinite; }
@keyframes cursorPath { 0% { left: 70%; top: 85%; } 40%, 55% { left: 15%; top: 64%; transform: scale(1); } 47% { transform: scale(.8); } 100% { left: 70%; top: 85%; } }
.browser.now-3 .bw-cta { animation: ctaPulse 3.6s var(--ease-io) infinite; }
@keyframes ctaPulse { 0%, 44%, 60%, 100% { box-shadow: 0 0 0 0 rgba(58,34,48,0); } 48% { box-shadow: 0 0 0 .6em rgba(58,34,48,.25); } }

/* Etap 4: publikacja */
.bw-score { position: absolute; left: 50%; bottom: 6%; translate: -50% 0; display: flex; gap: 2.2em; padding: 1.4em 2.4em; border-radius: 1em; background: rgba(255,255,255,.94); box-shadow: 0 30px 60px -20px rgba(26,22,51,.45); font-family: system-ui, sans-serif; color: #1A1633; opacity: 0; transform: translateY(40%); transition: opacity .5s, transform .8s var(--ease-out); }
.browser.s4 .bw-score { opacity: 1; transform: none; }
.ring { position: relative; display: grid; justify-items: center; gap: .5em; font-size: .95em; }
.ring svg { width: 4.6em; height: 4.6em; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.4; }
.ring circle:first-child { stroke: #DFF5E8; }
.ring circle:last-child { stroke: #22B26B; stroke-linecap: round; stroke-dasharray: 107; stroke-dashoffset: 107; transition: stroke-dashoffset 1.6s var(--ease-out) .3s; }
.browser.s4 .ring circle:last-child { stroke-dashoffset: calc(107 - 107 * var(--v)); }
.ring b { position: absolute; top: 1.15em; font-size: 1.35em; color: #137447; }

/* ---------- Kontakt ---------- */
.contact { position: relative; z-index: 2; margin-top: -40px; padding: clamp(110px, 13vw, 180px) var(--pad); background: var(--signal); color: #fff; border-radius: 40px 40px 0 0; overflow: hidden; }
.contact h2 { max-width: 12ch; }
.contact__lead { margin-top: 28px; max-width: 46ch; font-size: clamp(17px, 1.4vw, 20px); opacity: .88; }
.contact__mail {
  display: inline-block; margin: clamp(50px, 7vw, 100px) 0 clamp(40px, 5vw, 70px);
  font-size: clamp(38px, 8.4vw, 150px); font-weight: 750; font-stretch: 78%; letter-spacing: -.045em; line-height: .95;
  color: #fff; text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(#fff, #fff) 0 100% / 0 3px no-repeat; transition: background-size .8s var(--ease-out);
}
.contact__mail:hover { background-size: 100% 3px; }
.contact__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; padding-top: 34px; border-top: 1.5px solid rgba(255,255,255,.3); }
.contact__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn--line { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--line:hover { background: #fff; color: var(--signal); border-color: #fff; }
.contact__hints p { font-size: 14px; opacity: .7; margin-bottom: 10px; }
.contact__hints ul { list-style: none; display: grid; gap: 6px; }
.contact__hints li { display: flex; gap: 10px; align-items: baseline; }
.contact__hints li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--spark); translate: 0 -2px; }

/* ---------- FAQ ---------- */
.faq { padding: clamp(100px, 12vw, 170px) var(--pad); background: var(--paper); position: relative; z-index: 3; border-radius: 40px 40px 0 0; margin-top: -40px; }
.faq__list { border-top: 1.5px solid var(--ink); max-width: 1100px; margin-left: auto; }
.qa { border-bottom: 1px solid rgba(26,22,51,.16); }
.qa summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px 0; font-size: clamp(20px, 2vw, 28px); font-weight: 600; letter-spacing: -.02em; transition: color .3s; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--signal); }
.qa summary i { flex: none; position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid currentColor; }
.qa summary i::before, .qa summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.6px; background: currentColor; translate: -50% -50%; transition: transform .5s var(--ease-out); }
.qa summary i::after { transform: rotate(90deg); }
.qa.is-open summary i::after { transform: rotate(0); }
.qa__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease-out); }
.qa__a > div { overflow: hidden; }
.qa.is-open .qa__a { grid-template-rows: 1fr; }
.qa__a p { padding-bottom: 28px; color: var(--muted); font-size: 18px; max-width: 64ch; }

/* ---------- Stopka ---------- */
.footer { background: var(--ink); color: var(--paper); padding: 90px var(--pad) 28px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer__label { font-size: 14px; opacity: .55; margin-bottom: 12px; }
.footer a { display: block; text-decoration: none; width: fit-content; transition: color .3s; }
.footer a:hover { color: var(--spark); }
.footer__mail { font-size: clamp(24px, 3vw, 44px); font-weight: 650; letter-spacing: -.03em; }
.footer__clock { font-size: 22px; font-variant-numeric: tabular-nums; }
.footer__dots { position: relative; height: clamp(150px, 25vw, 420px); margin: 50px calc(var(--pad) * -1) 20px; }
.footer__dots canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.footer__base { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 14px; opacity: .6; border-top: 1px solid rgba(236,234,246,.12); padding-top: 22px; }

/* ---------- Responsywność ---------- */
@media (max-width: 1000px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .nav { height: 60px; padding-right: 7px; }
  .proj { grid-template-columns: 1fr; align-content: center; gap: 30px; padding-top: 96px; }
  .proj__tags { display: none; }
  .proj__info p { font-size: 15px; }
  .proj__name { margin-bottom: 14px; }
  .proj__btn { margin-top: 20px; }
  .build__sticky { grid-template-columns: 1fr; align-content: center; gap: 26px; padding-top: 90px; }
  .build__text h2 { display: none; }
  .build__steps li:not(.is-active) { display: none; }
  .build__steps li { border: 0; padding: 0; }
  .svc__head { grid-template-columns: 1fr 40px; }
  .svc__short { display: none; }
  .svc__plus { width: 40px; height: 40px; }
  .svc__inner { grid-template-columns: 1fr; gap: 20px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding-top: 104px; }
  .hero__top { flex-direction: column; gap: 14px; }
  .hero__stage { min-height: 150px; }
  .timeline__item button span { font-size: 12px; }
  .timeline__item a { font-size: 11px; }
  .facts { grid-template-columns: 1fr; gap: 26px; }
  .proj { min-height: 0; border-radius: 24px 24px 0 0; }
  .proj__info p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .phone { display: none; }
  .contact, .faq { border-radius: 26px 26px 0 0; }
  .bw-score { gap: 1.2em; padding: 1em 1.4em; }
}
