:root {
  --bg-space: #05030c;
  --bg-space-deep: #0b1028;
  --pixel-white: #e8f2ff;
  --pixel-blue: #53a8ff;
  --pixel-cyan: #63f7ff;
  --pixel-pink: #fb63ff;
  --pixel-purple: #7f6bff;
  --pixel-yellow: #f6df5d;
  --panel-bg: #101833cc;
  --panel-border: #4f76ff;
  --btn-dark: #1a2550;
  --btn-mid: #2e4fb8;
  --btn-light: #77deff;
  --focus: #fff38a;

  /* Tuning knobs */
  --parallax-strength: 24;
  --twinkle-speed: 1;
  --planet-drift-speed: 1;
  --asteroid-speed: 1;
  --rocket-speed: 1;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(to bottom, var(--bg-space) 0%, var(--bg-space-deep) 100%);
  color: var(--pixel-white);
  font-family: "Press Start 2P", system-ui, sans-serif;
  image-rendering: pixelated;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 50;
  background: #000;
  color: #fff;
  padding: 0.75rem;
  border: 2px solid var(--focus);
}

.space-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  perspective: 500px;
}

.parallax {
  position: absolute;
  inset: -10%;
  transform-style: preserve-3d;
  transition: transform 120ms linear;
}

.layer-far {
  opacity: 0.55;
}

.layer-mid {
  opacity: 0.8;
}

.layer-near {
  opacity: 1;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--pixel-white);
  box-shadow:
    2px 0 0 var(--pixel-white),
    0 2px 0 var(--pixel-white),
    2px 2px 0 var(--pixel-white);
  animation: twinkle calc((2.5s + var(--delay)) / var(--twinkle-speed)) steps(2, end) infinite;
}

.star.big {
  width: 3px;
  height: 3px;
  box-shadow:
    3px 0 0 var(--pixel-cyan),
    0 3px 0 var(--pixel-cyan),
    3px 3px 0 var(--pixel-cyan);
}

.celestial,
.satellite,
.rocket {
  position: absolute;
  transform: translateZ(0);
}

.planet {
  width: 110px;
  height: 110px;
  border-radius: 2px;
  border: 4px solid #000;
  image-rendering: pixelated;
  box-shadow: 0 0 0 4px #1f2f74, 0 0 24px #1a4cff66;
  animation: planetDrift calc(16s / var(--planet-drift-speed)) ease-in-out infinite alternate;
}

.planet::before,
.planet::after {
  content: "";
  position: absolute;
  image-rendering: pixelated;
}

.planet::before {
  inset: 8px;
  background:
    linear-gradient(90deg, #263f9f 0 28%, #4f87ff 28% 56%, #7dc3ff 56% 74%, #3e63c6 74% 100%);
}

.planet::after {
  width: 130px;
  height: 16px;
  left: -14px;
  top: 42px;
  background: repeating-linear-gradient(
    90deg,
    #93a9ff 0 8px,
    #6f7fff 8px 14px,
    #445ad6 14px 20px
  );
  border: 3px solid #000;
}

.planet-a {
  top: 8%;
  left: 8%;
  transform: scale(1.1);
}

.planet-b {
  width: 72px;
  height: 72px;
  top: 22%;
  right: 10%;
  animation-duration: calc(12s / var(--planet-drift-speed));
}

.planet-b::after {
  width: 88px;
  height: 12px;
  top: 26px;
}

.asteroid {
  width: 24px;
  height: 24px;
  border: 3px solid #000;
  background: #5f6889;
  box-shadow:
    inset -6px -6px 0 #3f486a,
    inset 5px 4px 0 #858faf;
  animation: asteroidFloat calc(11s / var(--asteroid-speed)) ease-in-out infinite;
}

.asteroid-a {
  left: 18%;
  top: 66%;
  animation-delay: -0.5s;
}

.asteroid-b {
  left: 70%;
  top: 58%;
  width: 30px;
  height: 30px;
  animation-duration: calc(14s / var(--asteroid-speed));
}

.asteroid-c {
  left: 84%;
  top: 34%;
  width: 18px;
  height: 18px;
  animation-duration: calc(9s / var(--asteroid-speed));
  animation-delay: -2.2s;
}

.satellite {
  width: 36px;
  height: 22px;
  border: 3px solid #000;
  background: #9ec9ff;
}

.satellite::before,
.satellite::after {
  content: "";
  position: absolute;
}

.satellite::before {
  left: -24px;
  top: 4px;
  width: 20px;
  height: 12px;
  border: 2px solid #000;
  background: repeating-linear-gradient(90deg, #5d79ff 0 4px, #8dc0ff 4px 8px);
}

.satellite::after {
  right: -24px;
  top: 4px;
  width: 20px;
  height: 12px;
  border: 2px solid #000;
  background: repeating-linear-gradient(90deg, #5d79ff 0 4px, #8dc0ff 4px 8px);
}

.satellite-a {
  top: 12%;
  left: -80px;
  animation: satelliteOrbit 30s linear infinite;
}

.satellite-b {
  top: 38%;
  left: -120px;
  animation: satelliteOrbit 44s linear infinite reverse;
}

.cat-monster {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 88px;
  z-index: 6;
  transform-origin: 50% 60%;
  animation: catOrbit 22s linear infinite;
  filter: drop-shadow(0 0 14px #9878ff88);
}

.cat-ear {
  position: absolute;
  top: 2px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 20px solid #f2f6ff;
  filter: drop-shadow(0 -4px 0 #000);
}

.cat-ear-left {
  left: 20px;
  transform: rotate(-10deg);
}

.cat-ear-right {
  right: 20px;
  transform: rotate(10deg);
}

.cat-head {
  position: absolute;
  left: 16px;
  top: 20px;
  width: 64px;
  height: 58px;
  border: 4px solid #000;
  background: #eef4ff;
  box-shadow:
    inset 0 -8px 0 #c9d8f7;
}

.cat-eye {
  position: absolute;
  top: 20px;
  width: 11px;
  height: 11px;
  border: 2px solid #000;
  background: #67f4ff;
  animation: catBlink 3.2s steps(2, end) infinite;
}

.cat-eye-left {
  left: 11px;
}

.cat-eye-right {
  right: 11px;
}

.cat-nose {
  position: absolute;
  left: 25px;
  top: 38px;
  width: 10px;
  height: 8px;
  border: 2px solid #000;
  background: #ff6ca3;
}

.cat-whisker {
  position: absolute;
  top: 42px;
  width: 14px;
  height: 2px;
  background: #000;
}

.cat-whisker-left {
  left: 6px;
  transform: rotate(-14deg);
}

.cat-whisker-right {
  right: 6px;
  transform: rotate(14deg);
}

.cat-tail {
  position: absolute;
  left: 40px;
  top: 34px;
  width: 16px;
  height: 32px;
  border: 4px solid #000;
  background: #e9f1ff;
  transform-origin: 50% 6px;
  animation: catTailSwish 1.4s steps(2, end) infinite;
  z-index: -1;
}

.cat-paw {
  position: absolute;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border: 3px solid #000;
  background: #dbe7ff;
}

.cat-paw-left {
  left: 28px;
}

.cat-paw-right {
  right: 28px;
}

.rocket {
  width: 54px;
  height: 86px;
  left: 50%;
  top: 50%;
  transform-origin: 50% 70%;
  animation: rocketPath calc(18s / var(--rocket-speed)) linear infinite;
}

.rocket-body {
  position: absolute;
  left: 10px;
  top: 8px;
  width: 34px;
  height: 60px;
  border: 4px solid #000;
  background: linear-gradient(to right, #f2f7ff 0 40%, #b6c4ff 40% 70%, #8095ee 70% 100%);
}

.rocket-body::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -20px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 20px solid #dce7ff;
  filter: drop-shadow(0 -3px 0 #000);
}

.rocket-window {
  position: absolute;
  left: 19px;
  top: 28px;
  width: 16px;
  height: 16px;
  border: 3px solid #000;
  background: radial-gradient(circle at 35% 35%, #baf7ff 0 45%, #5a7bdc 45% 100%);
}

.rocket-fin {
  position: absolute;
  top: 50px;
  width: 12px;
  height: 26px;
  border: 3px solid #000;
  background: #ec5378;
}

.rocket-fin-left {
  left: 0;
}

.rocket-fin-right {
  right: 0;
}

.rocket-flame {
  position: absolute;
  left: 17px;
  top: 66px;
  width: 20px;
  height: 18px;
  background: linear-gradient(to bottom, #ffe68f 0 45%, #ff8f3f 45% 80%, #ff4c29 80% 100%);
  border: 3px solid #000;
  animation: flameFlicker 180ms steps(2, end) infinite;
}

.main-panel {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  place-items: center;
  gap: 1.75rem;
  padding: 2rem;
  z-index: 10;
  text-align: center;
}

.identity {
  margin: 0;
  font-size: clamp(1.2rem, 3.4vw, 2rem);
  line-height: 1.5;
  text-shadow:
    0 3px #000,
    0 0 16px #6384ff55;
}

.tagline {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(0.52rem, 1.4vw, 0.7rem);
  color: #b8cfff;
  letter-spacing: 0.08em;
  text-shadow: 0 2px #000;
}

.cta-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem;
  border: 4px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow:
    0 0 0 4px #000,
    0 0 20px #6080ff44;
}

.pixel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  padding: 0.95rem 1.1rem;
  color: #fff;
  font-size: 0.58rem;
  text-decoration: none;
  border: 3px solid #000;
  background:
    linear-gradient(
      to bottom,
      var(--btn-light) 0 12%,
      var(--btn-mid) 12% 62%,
      var(--btn-dark) 62% 100%
    );
  box-shadow:
    0 4px 0 #000,
    0 0 12px #66d9ff38;
  transition: transform 90ms steps(2, end), filter 120ms linear;
}

.pixel-btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.12);
}

.pixel-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #000,
    0 0 8px #66d9ff40;
}

.pixel-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.pixel-btn-linkedin {
  background: linear-gradient(to bottom, #8fd6ff 0 12%, #2f7ff7 12% 62%, #0f3b96 62% 100%);
  box-shadow:
    0 4px 0 #000,
    0 0 12px #4aa8ff66;
}

.pixel-btn-email {
  background: linear-gradient(to bottom, #ffb0b0 0 12%, #f14f4f 12% 62%, #951d1d 62% 100%);
  box-shadow:
    0 4px 0 #000,
    0 0 12px #ff666666;
}

.pixel-btn-github {
  background: linear-gradient(to bottom, #737373 0 12%, #2e2e2e 12% 62%, #0d0d0d 62% 100%);
  box-shadow:
    0 4px 0 #000,
    0 0 12px #00000088;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

@keyframes planetDrift {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(18px, -10px);
  }
  100% {
    transform: translate(-12px, 16px);
  }
}

@keyframes asteroidFloat {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(12px, -10px) rotate(90deg);
  }
  66% {
    transform: translate(-8px, 14px) rotate(200deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}

@keyframes satelliteOrbit {
  0% {
    transform: translateX(-15vw) translateY(0);
  }
  50% {
    transform: translateX(120vw) translateY(-32px);
  }
  100% {
    transform: translateX(-15vw) translateY(0);
  }
}

@keyframes rocketPath {
  0% {
    transform: translate(-50vw, 18vh) rotate(28deg);
  }
  25% {
    transform: translate(-12vw, -22vh) rotate(8deg);
  }
  50% {
    transform: translate(36vw, -10vh) rotate(-18deg);
  }
  75% {
    transform: translate(10vw, 24vh) rotate(-34deg);
  }
  100% {
    transform: translate(-50vw, 18vh) rotate(28deg);
  }
}

@keyframes flameFlicker {
  0% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(2px) scaleY(0.78);
  }
  100% {
    transform: translateY(0) scaleY(1);
  }
}

@keyframes catOrbit {
  0% {
    transform: translate(-52vw, 24vh) rotate(18deg);
  }
  25% {
    transform: translate(-6vw, -20vh) rotate(-6deg);
  }
  50% {
    transform: translate(40vw, -8vh) rotate(-20deg);
  }
  75% {
    transform: translate(8vw, 28vh) rotate(-34deg);
  }
  100% {
    transform: translate(-52vw, 24vh) rotate(18deg);
  }
}

@keyframes catTailSwish {
  0% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(-22deg);
  }
  100% {
    transform: rotate(10deg);
  }
}

@keyframes catBlink {
  0%,
  44%,
  52%,
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
  48% {
    transform: scaleY(0.18);
    opacity: 0.85;
  }
}

@media (max-width: 700px) {
  .rocket {
    transform: scale(0.75);
  }

  .planet-a {
    top: 4%;
    left: -3%;
  }

  .planet-b {
    top: 16%;
    right: -6%;
  }

  .cat-monster {
    transform: scale(0.75);
  }

  .pixel-btn {
    min-width: 116px;
    font-size: 0.52rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .star,
  .planet,
  .asteroid,
  .satellite,
  .rocket,
  .rocket-flame,
  .cat-monster,
  .cat-eye,
  .cat-tail {
    animation: none !important;
  }

  .parallax {
    transition: none;
  }
}
