:root {
  --bg: #050507;
  --fg: #e9ecf2;
  --muted: #8a90a0;
  --line: rgba(255, 255, 255, .09);
  --glass: rgba(14, 15, 20, .55);
  --glow: #dfe8ff;
  --accent: #b9c8ff;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
a { color: inherit; }
::selection { background: #fff; color: #000; }

/* ---------- tlo ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; }
.bg-avatar {
  position: fixed; inset: -10%; z-index: -4;
  background: url(assets/bg-blur.jpg) center/cover;
  opacity: .22; filter: grayscale(1) contrast(1.2);
}
.flash {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(ellipse at var(--fx, 50%) 0%, rgba(220,230,255,.35), transparent 60%);
  opacity: 0;
}
.flash.on { animation: flash .9s ease-out; }
@keyframes flash { 0%{opacity:0} 8%{opacity:1} 16%{opacity:.2} 24%{opacity:.8} 100%{opacity:0} }
.vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.85) 100%);
}

/* ---------- kursor ---------- */
@media (hover: hover) and (pointer: fine) {
  html, body, a, button, input, [role=button] { cursor: none; }
  .cursor-dot {
    position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
    border-radius: 50%; transform: translate(-50%, -50%);
  }
  .cursor-dot {
    width: 8px; height: 8px; background: #fff; box-shadow: 0 0 10px #fff, 0 0 20px var(--glow);
    transition: width .15s, height .15s;
  }
  .cursor-dot.hover { width: 14px; height: 14px; }
}
@media not ((hover: hover) and (pointer: fine)) { .cursor-dot { display: none; } }

/* ---------- bramka ---------- */
#gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(3,3,5,.92); backdrop-filter: blur(14px);
  transition: opacity .8s ease, visibility .8s;
}
#gate.gone { opacity: 0; visibility: hidden; }
.gate-inner { display: grid; gap: 14px; text-align: center; }
.gate-brand {
  font-size: clamp(32px, 8vw, 64px); font-weight: 700; letter-spacing: -.02em;
  text-shadow: 0 0 30px rgba(220,230,255,.5);
}
.gate-hint { font-family: var(--mono); color: var(--muted); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(to bottom, rgba(5,5,7,.8), transparent);
}
.logo { font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--muted); }
.topbar nav { display: flex; gap: 22px; font-family: var(--mono); font-size: 13px; }
.topbar nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.topbar nav a:hover { color: #fff; }
.pill {
  font: 600 12px var(--mono); color: var(--fg); background: var(--glass);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.pill:hover { border-color: rgba(255,255,255,.35); }
@media (max-width: 640px) { .topbar nav { display: none; } }

/* ---------- hero / karta ---------- */
.hero {
  min-height: 100svh; display: grid; place-items: center; align-content: center; gap: 18px;
  padding: 90px 16px 60px; position: relative;
}
.card {
  position: relative; width: min(440px, 100%);
  padding: 34px 28px 18px; text-align: center;
  background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  transform-style: preserve-3d; transition: transform .15s ease-out;
}
.card-glow {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(300px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.09), transparent 60%);
}
.avatar-wrap { position: relative; width: 128px; height: 128px; margin: 0 auto 16px; transform: translateZ(40px); }
.avatar {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,.18);
  box-shadow: 0 0 40px rgba(220,230,255,.25);
}
.status-dot {
  position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: #747f8d; border: 4px solid #0d0e12;
}
.status-dot.online { background: #23a55a; }
.status-dot.idle { background: #f0b232; }
.status-dot.dnd { background: #f23f43; }

.name {
  margin: 0; font-size: 34px; letter-spacing: -.02em; position: relative; transform: translateZ(30px);
  text-shadow: 0 0 18px rgba(220,230,255,.45);
}
.name:hover::before, .name:hover::after {
  content: attr(data-text); position: absolute; inset: 0; opacity: .7;
}
.name:hover::before { color: #9fb4ff; animation: glitch .35s infinite; clip-path: inset(0 0 55% 0); }
.name:hover::after { color: #fff; animation: glitch .35s infinite reverse; clip-path: inset(55% 0 0 0); }
@keyframes glitch { 0%{transform:translate(0)} 25%{transform:translate(-2px,1px)} 50%{transform:translate(2px,-1px)} 75%{transform:translate(-1px,-1px)} 100%{transform:translate(0)} }

.handle { margin: 4px 0 0; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.typer { margin: 14px 0 0; font-family: var(--mono); font-size: 15px; min-height: 1.4em; }
.caret { animation: pulse 1s steps(1) infinite; }

.presence {
  display: flex; align-items: center; gap: 12px; text-align: left;
  margin: 18px auto 0; padding: 10px 12px; max-width: 320px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.25);
}
.presence img { border-radius: 8px; object-fit: cover; }
.presence img[src=""] { display: none; }
.presence-top { font-size: 13px; font-weight: 600; }
.presence-sub { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.socials { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 0; margin: 22px 0 0; }
.socials a, .socials span {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--fg);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.socials a:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.4); box-shadow: 0 0 22px rgba(220,230,255,.25); }
.socials span { opacity: .28; }
.socials img { width: 20px; height: 20px; display: block; }

.card-foot {
  display: flex; justify-content: space-between; margin-top: 22px; padding-top: 12px;
  border-top: 1px solid var(--line); color: var(--muted); font: 12px var(--mono);
}
.views { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- odtwarzacz ---------- */
.player {
  display: flex; align-items: center; gap: 12px; width: min(440px, 100%);
  padding: 10px 14px; background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(18px);
}
.play {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #fff; color: #000; display: grid; place-items: center;
}
.play svg { width: 18px; height: 18px; }
.play .i-pause, .player.playing .play .i-play { display: none; }
.player.playing .play .i-pause { display: block; }
.track { flex: 1; min-width: 0; text-align: left; }
.track-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.bar { height: 3px; margin-top: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: #fff; }
#vol { width: 80px; accent-color: #fff; }
#yt { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
@media (max-width: 420px) { #vol { display: none; } }

.scroll-hint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  text-decoration: none; color: var(--muted); font-size: 26px; animation: bob 2s infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- sekcje ---------- */
.block { width: min(860px, 100%); margin: 0 auto; padding: 70px 16px; }
.block h2 { font-size: 26px; margin: 0 0 24px; letter-spacing: -.01em; }
.block h2 span:first-child { font: 600 13px var(--mono); color: var(--muted); margin-right: 8px; }
.bio { font-size: 18px; line-height: 1.7; color: #cfd3dc; max-width: 62ch; }

.skills { display: grid; gap: 18px; }
.skill-group h3 { margin: 0 0 10px; font: 600 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 13px var(--mono); padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass);
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.proj {
  padding: 20px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(12px); transition: transform .25s, border-color .25s;
}
.proj:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.3); }
.proj h3 { margin: 0 0 8px; font-size: 17px; }
.proj p { margin: 0 0 14px; color: #b8bdc9; font-size: 14px; line-height: 1.6; }
.proj .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.proj .tags span { font: 11px var(--mono); color: var(--muted); }
.proj .tags span::before { content: "#"; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 14px; }
.timeline li::before {
  content: ""; position: absolute; left: -23px; top: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px #fff;
}
.timeline .when { font: 12px var(--mono); color: var(--muted); }
.timeline h3 { margin: 4px 0 6px; font-size: 17px; }
.timeline p { margin: 0; color: #b8bdc9; line-height: 1.6; }

.btn {
  display: inline-block; margin-top: 8px; padding: 12px 20px; border-radius: 12px;
  background: #fff; color: #000; text-decoration: none; font-weight: 600;
  transition: box-shadow .2s;
}
.btn:hover { box-shadow: 0 0 28px rgba(220,230,255,.5); }

footer { text-align: center; padding: 40px 16px; color: var(--muted); font: 12px var(--mono); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s; }
.reveal.in { opacity: 1; transform: none; }

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

[hidden] { display: none !important; }
