:root {
  --bg: #07070b;
  --fg: #f4f4f7;
  --muted: #8a8a9a;
  --accent-1: #b6ff3b;
  --accent-2: #7a5cff;
  --accent-3: #ff4d8d;
  --ink: #0b0b10;
  --mx: 50%;
  --my: 50%;
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); }

/* ---------- tło ---------- */

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }

.blob {
  position: absolute;
  width: 60vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .35;
  animation: drift 18s ease-in-out infinite alternate;
}
.blob--a { background: var(--accent-2); top: -25vmax; left: -15vmax; }
.blob--b { background: var(--accent-3); bottom: -30vmax; right: -20vmax; animation-delay: -9s; }

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--mx) var(--my), rgb(182 255 59 / .08), transparent 60%);
}

/* ---------- układ ---------- */

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(1rem, 3vh, 2rem);
  padding: 2rem 1.25rem;
  text-align: center;
}

.tag {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .9rem;
  font: 600 .75rem/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgb(255 255 255 / .1);
  border-radius: 999px;
  background: rgb(255 255 255 / .03);
  backdrop-filter: blur(8px);
  animation: rise .8s .1s both cubic-bezier(.2, .8, .2, 1);
}

.dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 0 var(--accent-3);
  animation: ping 1.6s infinite;
}

/* ---------- trollface ---------- */

.troll {
  margin: 0;
  width: clamp(180px, 34vmin, 320px);
  position: relative;
  animation: pop 1s cubic-bezier(.34, 1.56, .64, 1) both;
}

.troll svg {
  width: 100%;
  display: block;
  overflow: visible;
  animation: bob 3.2s ease-in-out infinite;
  filter: drop-shadow(0 0 40px rgb(182 255 59 / .25));
}

.troll__face {
  transform-origin: 50% 90%;
  animation: smug 3.2s ease-in-out infinite;
}

.troll__shadow {
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -18px;
  height: 18px;
  border-radius: 50%;
  background: rgb(0 0 0 / .6);
  filter: blur(8px);
  animation: shadow 3.2s ease-in-out infinite;
}

.skin  { fill: #fbfbfd; stroke: var(--ink); stroke-width: 7; stroke-linejoin: round; }
.line  { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.thin  { stroke-width: 3.5; }
.mouth { fill: var(--ink); }
.teeth { fill: #fbfbfd; }
.pupil { fill: var(--ink); transition: transform .15s ease-out; }

.brow { transform-box: fill-box; transform-origin: center; animation: brow 3.2s ease-in-out infinite; }
.brow--r { animation-delay: .1s; }

/* ---------- nagłówek ---------- */

.headline {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.75rem, 5.2vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.headline__line {
  display: block;
  position: relative;
  animation: rise .9s both cubic-bezier(.2, .8, .2, 1);
  animation-delay: .35s;
}

.headline__line--accent {
  animation-delay: .55s;
  background: linear-gradient(90deg, var(--accent-1), #fff 45%, var(--accent-3));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise .9s .55s both cubic-bezier(.2, .8, .2, 1), shine 6s linear infinite;
}

/* glitch */
.headline__line.is-glitching::before,
.headline__line.is-glitching::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--fg);
  -webkit-text-fill-color: currentColor;
  pointer-events: none;
}
.headline__line.is-glitching::before { color: var(--accent-3); transform: translate(-3px, 1px); clip-path: inset(10% 0 55% 0); mix-blend-mode: screen; }
.headline__line.is-glitching::after  { color: var(--accent-2); transform: translate(3px, -1px); clip-path: inset(55% 0 5% 0);  mix-blend-mode: screen; }

.meta {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
  animation: rise .9s .8s both cubic-bezier(.2, .8, .2, 1);
}

.caret { animation: blink 1s steps(1) infinite; color: var(--accent-1); }

/* ---------- keyframes ---------- */

@keyframes pop    { from { opacity: 0; transform: scale(.4) rotate(-20deg); } }
@keyframes rise   { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } }
@keyframes bob    { 50% { transform: translateY(-14px); } }
@keyframes smug   { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes shadow { 50% { transform: scaleX(.8); opacity: .6; } }
@keyframes brow   { 0%, 60%, 100% { transform: translateY(0); } 70%, 85% { transform: translateY(-8px); } }
@keyframes shine  { to { background-position: -200% 0; } }
@keyframes blink  { 50% { opacity: 0; } }
@keyframes ping   { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes drift  { to { transform: translate(10vmax, 6vmax) scale(1.15); } }

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