* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #05020c;
  color: #fff;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(5, 2, 12, 0.55), rgba(5, 2, 12, 0.9)),
    url("../img/bg.png") center/cover no-repeat;
  z-index: -5;
  animation: bgMove 18s infinite alternate ease-in-out;
}

@keyframes bgMove {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 75%, rgba(255, 0, 150, 0.3), transparent 35%),
    radial-gradient(circle at 82% 60%, rgba(0, 120, 255, 0.28), transparent 36%),
    radial-gradient(circle at 50% 20%, rgba(120, 0, 255, 0.18), transparent 38%);
  z-index: -4;
  animation: glowPulse 6s infinite alternate ease-in-out;
}

@keyframes glowPulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* LOADER */
#loader {
  position: fixed;
  inset: 0;
  background: #030108;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: 0.8s;
}

#loader.hide {
  opacity: 0;
  visibility: hidden;
}

.loader-logo img {
  width: 340px;
  max-width: 80vw;
}

.loader-text {
  margin-top: 20px;
  color: #00d9ff;
  letter-spacing: 4px;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 0 18px #00d9ff;
  font-family: 'Orbitron', sans-serif;
}

.loader-bar {
  width: 320px;
  max-width: 80vw;
  height: 8px;
  margin-top: 22px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff1493, #00d9ff);
  animation: load 1.7s ease forwards;
}

@keyframes load {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* TŁO ANIMOWANE */
.animated-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
  overflow: hidden;
}

.animated-bg span {
  position: absolute;
  width: 2px;
  height: 120px;
  background: linear-gradient(180deg, transparent, #ff1493, transparent);
  opacity: 0.45;
  animation: rainLine 7s linear infinite;
}

.animated-bg span:nth-child(1) { left: 10%; animation-delay: 0s; }
.animated-bg span:nth-child(2) { left: 22%; animation-delay: 1.5s; }
.animated-bg span:nth-child(3) { left: 38%; animation-delay: 0.7s; background: linear-gradient(180deg, transparent, #00d9ff, transparent); }
.animated-bg span:nth-child(4) { left: 55%; animation-delay: 2.4s; }
.animated-bg span:nth-child(5) { left: 72%; animation-delay: 1s; background: linear-gradient(180deg, transparent, #00d9ff, transparent); }
.animated-bg span:nth-child(6) { left: 88%; animation-delay: 3s; }

@keyframes rainLine {
  from { top: -180px; transform: translateX(0) rotate(25deg); }
  to { top: 110%; transform: translateX(-220px) rotate(25deg); }
}

/* MENU */
.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 94%;
  max-width: 1250px;
  height: 78px;
  padding: 0 26px;
  border-radius: 22px;
  background: rgba(8, 4, 20, 0.72);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow:
    0 0 45px rgba(157, 0, 255, 0.25),
    inset 0 0 20px rgba(255,255,255,0.03);
}

.menu-brand {
  font-family: 'Orbitron', sans-serif;
  position: relative;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1;
  padding: 8px 0;
  text-shadow:
    0 0 6px #fff,
    0 0 16px #ff1493,
    0 0 34px #ff1493;
  animation: brandPulse 2.8s infinite ease-in-out;
}

.menu-brand::selection {
  background: #ff1493;
}

.menu-brand::before,
.menu-brand::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 8px;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.menu-brand::before {
  color: #00eaff;
  z-index: -1;
  text-shadow: -2px 0 #00eaff;
  animation: cyberGlitchTop 2.2s infinite steps(2, end);
}

.menu-brand::after {
  color: #ff1493;
  z-index: -2;
  text-shadow: 2px 0 #ff1493;
  animation: cyberGlitchBottom 2.8s infinite steps(2, end);
}

.menu-brand:hover {
  color: #00eaff;
  text-shadow:
    0 0 8px #00eaff,
    0 0 18px #00eaff,
    0 0 45px #ff1493;
}

.menu-brand:hover::before,
.menu-brand:hover::after {
  animation-duration: .45s;
}

/* scanline przez napis */
.menu-brand span,
.menu-brand {
  isolation: isolate;
}

.menu-brand::selection {
  color: #000;
  background: #00eaff;
}

@keyframes brandPulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(255,20,147,.45));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(0,234,255,.55));
  }
}

@keyframes cyberGlitchTop {
  0%, 88%, 100% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
    transform: translate(0);
  }
  89% {
    opacity: .9;
    clip-path: inset(0 0 68% 0);
    transform: translate(-4px, -2px);
  }
  91% {
    opacity: .8;
    clip-path: inset(22% 0 50% 0);
    transform: translate(5px, 1px);
  }
  93% {
    opacity: .7;
    clip-path: inset(55% 0 20% 0);
    transform: translate(-7px, 2px);
  }
  95% {
    opacity: 0;
  }
}

@keyframes cyberGlitchBottom {
  0%, 80%, 100% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
    transform: translate(0);
  }
  81% {
    opacity: .9;
    clip-path: inset(70% 0 5% 0);
    transform: translate(5px, 2px);
  }
  83% {
    opacity: .8;
    clip-path: inset(38% 0 35% 0);
    transform: translate(-5px, -1px);
  }
  86% {
    opacity: .65;
    clip-path: inset(12% 0 70% 0);
    transform: translate(8px, 2px);
  }
  88% {
    opacity: 0;
  }
}

/* LINKI MENU */
nav {
  display: flex;
  gap: 25px;
}

nav a {
  font-family: 'Orbitron', sans-serif;
  position: relative;
  color: #eee;
  text-decoration: none;
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: 0.3s;
  padding: 10px 0;
}

nav a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff1493, #00eaff);
  box-shadow: 0 0 15px #00eaff;
  transition: .3s;
}

nav a::after {
  content: attr(href);
  position: absolute;
  left: 0;
  top: -12px;
  color: #ff1493;
  font-size: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: .3s;
}

nav a:hover {
  color: #00eaff;
  text-shadow:
    0 0 8px #00eaff,
    0 0 22px #00eaff;
  transform: translateY(-2px);
}

nav a:hover::before {
  width: 100%;
}

nav a:hover::after {
  opacity: .8;
  transform: translateY(0);
}

/* LOGO IMAGE */
.glitch-logo {
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 0 22px rgba(255,20,147,0.55));
  animation: logoFloat 4s infinite ease-in-out;
}

.glitch-logo img {
  display: block;
  max-width: 520px;
  width: 100%;
}

.glitch-logo::before,
.glitch-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/logo.png") center/contain no-repeat;
  opacity: 0;
  pointer-events: none;
}

.glitch-logo::before {
  filter: hue-rotate(160deg);
  animation: glitchOne 2.4s infinite steps(2, end);
}

.glitch-logo::after {
  filter: hue-rotate(300deg);
  animation: glitchTwo 3s infinite steps(2, end);
}

@keyframes glitchOne {
  0%, 88%, 100% { opacity: 0; transform: translate(0); clip-path: inset(0 0 0 0); }
  89% { opacity: .85; transform: translate(-8px, 2px); clip-path: inset(12% 0 70% 0); }
  91% { opacity: .75; transform: translate(7px, -3px); clip-path: inset(45% 0 35% 0); }
  93% { opacity: 0; }
}

@keyframes glitchTwo {
  0%, 82%, 100% { opacity: 0; transform: translate(0); clip-path: inset(0 0 0 0); }
  83% { opacity: .75; transform: translate(9px, 1px); clip-path: inset(65% 0 18% 0); }
  85% { opacity: .65; transform: translate(-6px, -2px); clip-path: inset(25% 0 55% 0); }
  87% { opacity: 0; }
}

@keyframes logoFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* HERO */
.hero {
  min-height: 100vh;
  padding: 160px 8% 90px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 50px;
}

.hero-text {
  animation: fadeUp 1s ease forwards;
}

.small-title {
  color: #00d9ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 15px;
  text-shadow: 0 0 15px #00d9ff;
  font-family: 'Orbitron', sans-serif;
}

.hero-logo {
  margin-bottom: 25px;
}

.hero h2 {
  max-width: 780px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
  margin-bottom: 22px;
}

.typewriter {
  border-right: 3px solid #00d9ff;
  width: fit-content;
  animation: cursorBlink .8s infinite;
}

@keyframes cursorBlink {
  0%,100% { border-color: transparent; }
  50% { border-color: #00d9ff; }
}

.desc {
  max-width: 720px;
  color: #c9c1d6;
  font-size: 18px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 18px;
  margin-top: 35px;
  flex-wrap: wrap;
}

.btn-main,
.btn-second {
  display: inline-block;
  padding: 16px 30px;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 14px;
  transition: 0.3s;
  font-family: 'Orbitron', sans-serif;
}

.btn-main {
  background: linear-gradient(135deg, #ff1493, #8f00ff);
  box-shadow: 0 0 35px rgba(255,20,147,0.55);
}

.btn-main:hover {
  transform: translateY(-5px) scale(1.04);
  box-shadow: 0 0 60px rgba(255,20,147,0.9);
}

.btn-second {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
}

.btn-second:hover {
  color: #00d9ff;
  border-color: #00d9ff;
  box-shadow: 0 0 30px rgba(0,217,255,0.25);
}

.code-card {
  background: rgba(5, 3, 15, 0.78);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 28px;
  padding: 30px;
  backdrop-filter: blur(18px);
  box-shadow:
    0 0 80px rgba(0, 217, 255, 0.16),
    inset 0 0 35px rgba(255,255,255,0.03);
  animation: float 4s infinite ease-in-out;
}

.code-card code {
  color: #00d9ff;
  font-size: 16px;
  line-height: 1.8;
  text-shadow: 0 0 12px rgba(0,217,255,0.6);
}

/* STATS */
.stats {
  padding: 20px 8% 80px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  padding: 28px;
  text-align: center;
  backdrop-filter: blur(15px);
}

.stat-box strong {
  display: block;
  font-size: 46px;
  color: #ff1493;
  text-shadow: 0 0 20px rgba(255,20,147,.7);
  font-family: 'Orbitron', sans-serif;
}

.stat-box span {
  color: #c9c1d6;
  font-weight: 800;
}

/* SEKCJE */
.section {
  padding: 110px 8%;
}

.section-title {
  text-align: center;
  margin-bottom: 55px;
}

.section-title p {
  color: #ff1493;
  font-weight: 900;
  letter-spacing: 4px;
  font-size: 13px;
  margin-bottom: 10px;
  font-family: 'Orbitron', sans-serif;
}

.section-title h2 {
  font-size: clamp(38px, 5vw, 64px);
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.project-card {
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 28px;
  overflow: hidden;
  backdrop-filter: blur(15px);
  box-shadow: 0 0 40px rgba(0,0,0,0.35);
  transition: 0.35s;
}

.project-card:hover {
  transform: translateY(-12px) scale(1.015);
  border-color: rgba(255,20,147,0.6);
  box-shadow: 0 0 65px rgba(255,20,147,0.22);
}

.project-image {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}

.project-card:hover .project-image img {
  transform: scale(1.08);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(5,2,12,0.95));
}

.project-overlay.blue {
  background: linear-gradient(180deg, transparent 20%, rgba(0,20,40,0.95));
}

.project-overlay.purple {
  background: linear-gradient(180deg, transparent 20%, rgba(20,0,40,0.95));
}

.project-content {
  padding: 28px;
}

.tag {
  display: inline-block;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 18px;
  font-family: 'Orbitron', sans-serif;
}

.tag.pink {
  background: rgba(255,20,147,0.18);
  color: #ff4fb5;
  border: 1px solid rgba(255,20,147,0.35);
}

.tag.blue {
  background: rgba(0,217,255,0.16);
  color: #00d9ff;
  border: 1px solid rgba(0,217,255,0.35);
}

.tag.purple {
  background: rgba(160,80,255,0.16);
  color: #b57cff;
  border: 1px solid rgba(160,80,255,0.35);
}

.project-content h3 {
  font-size: 30px;
  margin-bottom: 14px;
}

.project-content p {
  color: #c9c1d6;
  line-height: 1.7;
  margin-bottom: 22px;
}

.project-content a {
  color: #00d9ff;
  text-decoration: none;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 13px;
  font-family: 'Orbitron', sans-serif;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.skill-box {
  padding: 28px;
  text-align: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  font-size: 22px;
  font-weight: 900;
  transition: 0.3s;
  font-family: 'Orbitron', sans-serif;
}

.skill-box:hover {
  transform: translateY(-8px);
  color: #00d9ff;
  border-color: #00d9ff;
  box-shadow: 0 0 35px rgba(0,217,255,0.25);
}

.contact {
  padding: 120px 8%;
  text-align: center;
  background: radial-gradient(circle at center, rgba(255,20,147,0.16), transparent 45%);
}

.contact h2 {
  font-size: clamp(40px, 5vw, 70px);
  margin-bottom: 18px;
}

.contact p {
  color: #c9c1d6;
  margin-bottom: 30px;
  font-size: 18px;
}

footer {
  text-align: center;
  padding: 35px;
  color: #8f879c;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.reveal {
  opacity: 0;
  transform: translateY(45px);
  transition: .8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(45px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(1deg); }
}

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .projects,
  .stats {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  nav {
    display: none;
  }

  .menu-brand {
    font-size: 19px;
  }
}

@media (max-width: 600px) {
  .topbar {
    height: 62px;
  }

  .hero {
    padding: 130px 6% 70px;
  }

  .section {
    padding: 80px 6%;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .project-image {
    height: 190px;
  }
}