/* =========================================================
   KAROL WEB – wspólne style (index.html + realizacje.html)
   Wszystko jest widoczne od razu – bez ukrywania przezroczystością.
   ========================================================= */
:root {
  --obsydian: #090D16;
  --panel: #111827;
  --jasne: #F8FAFC;
  --blue: #3B82F6;
  --emerald: #10B981;
  --amber: #F59E0B;
}
html { scroll-behavior: smooth; }
body { background: var(--obsydian); color: #E2E8F0; overflow-x: hidden; }
img { max-width: 100%; }
::selection { background: rgba(16,185,129,.35); color: #fff; }

/* ---------- Pasek postępu przewijania ---------- */
.scroll-progress {
  position: fixed; z-index: 100; top: 0; left: 0; height: 3px; width: 100%;
  transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--emerald), var(--blue), var(--amber));
  box-shadow: 0 0 12px rgba(59,130,246,.8);
  pointer-events: none;
}

/* ---------- Nawigacja glassmorphism ---------- */
.glass-nav {
  background: rgba(9,13,22,.62);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(148,163,184,.14);
}
.nav-link { position: relative; padding: .35rem 0; color: #CBD5E1; font-weight: 600; transition: color .2s; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--emerald), var(--blue));
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-link:hover, .nav-link.active, .nav-link[aria-current="page"] { color: #fff; }
.nav-link:hover::after, .nav-link.active::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }

.live-dot { position: relative; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--emerald); }
.live-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--emerald);
  animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 0% { transform: scale(.6); } 80%, 100% { transform: scale(1.9); border-color: rgba(16,185,129,.05); } }

/* ---------- Aurora: płynące kule światła ---------- */
.live-dot.busy { background: var(--amber); }
.live-dot.busy::after { border-color: var(--amber); }
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora .orb { position: absolute; border-radius: 50%; filter: blur(70px); mix-blend-mode: screen; }
.orb-a { width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; left: -10%; top: -18%; background: radial-gradient(circle, rgba(59,130,246,.55), transparent 65%); animation: driftA 18s ease-in-out infinite; }
.orb-b { width: 40vw; height: 40vw; max-width: 540px; max-height: 540px; right: -8%; top: 8%; background: radial-gradient(circle, rgba(16,185,129,.45), transparent 65%); animation: driftB 22s ease-in-out infinite; }
.orb-c { width: 30vw; height: 30vw; max-width: 420px; max-height: 420px; left: 35%; bottom: -20%; background: radial-gradient(circle, rgba(245,158,11,.28), transparent 65%); animation: driftC 26s ease-in-out infinite; }
@keyframes driftA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(12%, 10%) scale(1.15); } }
@keyframes driftB { 0%,100% { transform: translate(0,0) scale(1.05); } 50% { transform: translate(-14%, 12%) scale(.9); } }
@keyframes driftC { 0%,100% { transform: translate(0,0) scale(.95); } 50% { transform: translate(10%, -12%) scale(1.2); } }
.net-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.grid-fade {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}

/* ---------- Podświetlenia słów kluczowych ---------- */
.hl {
  background-image: linear-gradient(90deg, var(--emerald), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative; display: inline; cursor: default;
}
.hl-amber { background-image: linear-gradient(90deg, #FBBF24, #F97316); }
.hl-blue { background-image: linear-gradient(90deg, #60A5FA, #A78BFA); }
.hl-emerald { background-image: linear-gradient(90deg, #34D399, #10B981); }
/* Animowane podkreślenie pod wyróżnioną frazą */
.uline { position: relative; display: inline-block; cursor: default; }
.uline::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.04em; height: .09em; min-height: 3px; border-radius: 4px;
  background: linear-gradient(90deg, var(--emerald), var(--blue));
  transform: scaleX(.18); transform-origin: left;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .3s;
}
.uline.amber::after { background: linear-gradient(90deg, #FBBF24, #F97316); }
.uline.blue::after { background: linear-gradient(90deg, #60A5FA, #A78BFA); }
.uline:hover::after { transform: scaleX(1); box-shadow: 0 0 14px rgba(59,130,246,.7); }
.uline:hover { filter: drop-shadow(0 0 14px rgba(16,185,129,.35)); }
.mark {
  border-radius: .4rem; padding: 0 .3rem; font-weight: 700;
  background: linear-gradient(90deg, rgba(16,185,129,.18), rgba(59,130,246,.18));
  box-shadow: inset 0 -2px 0 rgba(16,185,129,.55);
  transition: box-shadow .25s, background .25s;
}
.mark:hover { box-shadow: inset 0 -1.2em 0 rgba(16,185,129,.25); }
.mark.amber { background: rgba(245,158,11,.16); box-shadow: inset 0 -2px 0 rgba(245,158,11,.7); }
.mark.amber:hover { box-shadow: inset 0 -1.2em 0 rgba(245,158,11,.28); }

/* ---------- Przyciski z poświatą ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  border-radius: .95rem; padding: .9rem 1.5rem; font-weight: 700; isolation: isolate; overflow: hidden;
  transition: transform .2s ease, box-shadow .25s ease, background-color .2s, border-color .2s, color .2s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .6s ease;
}
.btn:hover::before { transform: translateX(120%); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--emerald), #059669); color: #04130D; box-shadow: 0 0 0 1px rgba(16,185,129,.5), 0 10px 30px -8px rgba(16,185,129,.7); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(16,185,129,.8), 0 14px 40px -6px rgba(16,185,129,.9), 0 0 60px rgba(16,185,129,.35); }
.btn-blue { background: linear-gradient(135deg, var(--blue), #2563EB); color: #fff; box-shadow: 0 0 0 1px rgba(59,130,246,.5), 0 10px 30px -8px rgba(59,130,246,.8); }
.btn-blue:hover { box-shadow: 0 0 0 1px rgba(96,165,250,.9), 0 14px 40px -6px rgba(59,130,246,.9), 0 0 60px rgba(59,130,246,.35); }
.btn-ghost { border: 1px solid rgba(148,163,184,.35); color: #F1F5F9; background: rgba(255,255,255,.04); }
.btn-ghost:hover { border-color: rgba(59,130,246,.8); box-shadow: 0 0 30px rgba(59,130,246,.3); }
.btn-dark { background: #0F172A; color: #fff; box-shadow: 0 10px 25px -10px rgba(15,23,42,.8); }
.btn-dark:hover { box-shadow: 0 14px 34px -8px rgba(15,23,42,.9), 0 0 0 1px var(--emerald); }
.btn:focus-visible, .filter-chip:focus-visible, .chip:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

/* ---------- Karty 3D Tilt & Glow ---------- */
.tilt-scene { perspective: 1000px; }
.tilt {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --glow: 16,185,129;
  position: relative; isolation: isolate; overflow: hidden;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s;
  will-change: transform;
}
.tilt.glow-blue { --glow: 59,130,246; }
.tilt.glow-amber { --glow: 245,158,11; }
.tilt::before { /* światło podążające za kursorem */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--glow), .16), transparent 45%);
  transition: background .2s;
}
.tilt::after { /* przesuwający się błysk */
  content: ""; position: absolute; inset: -50% -20%; z-index: 3; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.16) 50%, transparent 60%);
  transform: translateX(-80%); transition: transform .9s ease;
}
.tilt:hover { border-color: rgba(var(--glow), .85) !important; box-shadow: 0 0 0 1px rgba(var(--glow), .6), 0 24px 60px -18px rgba(var(--glow), .55); }
.tilt:hover::after { transform: translateX(80%); }
.tilt.is-tilting { transition: transform .08s linear, box-shadow .35s, border-color .35s; }

/* ---------- Makieta przeglądarki w Hero ---------- */
.mock-wrap { perspective: 1200px; }
.mock {
  --rx: 6deg; --ry: -12deg;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
  animation: hover3d 7s ease-in-out infinite;
}
@keyframes hover3d { 0%,100% { translate: 0 0; } 50% { translate: 0 -14px; } }
.mock-screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0B1220; }
.mock-track { display: flex; height: 100%; transition: transform .9s cubic-bezier(.7,0,.2,1); }
.mock-slide { position: relative; flex: 0 0 100%; height: 100%; }
.mock-slide img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.mock-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(148,163,184,.45); transition: width .3s, background-color .3s; }
.mock-dot.active { width: 22px; background: var(--emerald); }

.badge-float {
  position: absolute; z-index: 5; display: inline-flex; align-items: center; gap: .55rem;
  border-radius: 1rem; padding: .65rem .9rem; font-weight: 700; font-size: .875rem; white-space: nowrap;
  background: rgba(15,23,42,.82); border: 1px solid rgba(148,163,184,.25);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.7);
  animation: bob 5s ease-in-out infinite;
  transform: translateZ(60px);
}
.badge-float.b2 { animation-delay: -1.7s; animation-duration: 6s; }
.badge-float.b3 { animation-delay: -3.2s; animation-duration: 5.5s; }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* Zapasowe tło zrzutu ekranu, gdy brak pliku */
.shot { position: relative; overflow: hidden; }
.shot-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: rgba(255,255,255,.9); }
.shot img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.tilt:hover .shot img { transform: scale(1.04); }
.shot.scroll-peek img { object-position: top; }

/* ---------- Porównanie WordPress vs czysty kod ---------- */
.vs-row { transition: background-color .2s; }
.vs-row:hover { background: rgba(16,185,129,.06); }
.cost-bar { height: 14px; border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
input[type="range"].range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--emerald) var(--fill, 20%), #E2E8F0 var(--fill, 20%)); outline: none; }
input[type="range"].range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--emerald); box-shadow: 0 4px 14px rgba(16,185,129,.5); cursor: pointer; }
input[type="range"].range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--emerald); cursor: pointer; }

/* ---------- Liczniki ---------- */
.counter { font-variant-numeric: tabular-nums; }

/* ---------- Filtry realizacji ---------- */
.filter-chip {
  display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; padding: .6rem 1.1rem;
  border: 1px solid rgba(148,163,184,.28); background: rgba(255,255,255,.04); color: #CBD5E1; font-weight: 700; font-size: .92rem;
  transition: border-color .2s, background-color .2s, color .2s, box-shadow .25s, transform .15s;
}
.filter-chip:hover { border-color: rgba(59,130,246,.8); color: #fff; transform: translateY(-1px); }
.filter-chip.active { background: linear-gradient(135deg, var(--emerald), var(--blue)); color: #fff; border-color: transparent; box-shadow: 0 0 28px rgba(59,130,246,.45); }
.filter-chip .count { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; border-radius: 999px; background: rgba(255,255,255,.12); font-size: .75rem; }
.pop-in { animation: popIn .5s cubic-bezier(.2,.8,.2,1); }
@keyframes popIn { from { transform: translateY(18px) scale(.97); } to { transform: none; } }

.tech { display: inline-flex; align-items: center; border-radius: 999px; padding: .25rem .65rem; font-size: .75rem; font-weight: 700; border: 1px solid; }
.tech-html { color: #FDBA74; border-color: rgba(249,115,22,.4); background: rgba(249,115,22,.1); }
.tech-tw { color: #67E8F9; border-color: rgba(6,182,212,.4); background: rgba(6,182,212,.1); }
.tech-js { color: #FDE047; border-color: rgba(234,179,8,.4); background: rgba(234,179,8,.1); }
.tech-3d { color: #C4B5FD; border-color: rgba(139,92,246,.4); background: rgba(139,92,246,.12); }
.tech-form { color: #6EE7B7; border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.1); }

/* ---------- Formularz ---------- */
.field {
  width: 100%; border-radius: .95rem; border: 1px solid #CBD5E1; background: #fff; padding: .85rem 1rem; color: #0F172A;
  transition: border-color .2s, box-shadow .2s;
}
.field:hover { border-color: #94A3B8; }
.field:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
.field.err { border-color: #EF4444; box-shadow: 0 0 0 4px rgba(239,68,68,.12); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
