/* fonts are served from this site, not from Google (no visitor data goes to third parties) */
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/press-start-2p-latin.woff2) format('woff2')
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin.woff2) format('woff2')
}

:root {
  --bg: #05060f;
  --panel: rgba(18, 22, 48, .62);
  --line: rgba(120, 140, 255, .18);
  --text: #e7eaff;
  --soft: #cfd4f7;
  --muted: #9aa3d0;
  --spaceship_cockpit: #fff200;
  --spaceship_body: #3f48cc;
  --spaceship_wings: #00a2e8;
  --pixel: 'Press Start 2P', monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth
}

body {
  background: radial-gradient(1200px 800px at 70% -10%, #1a1f5a 0%, transparent 60%), radial-gradient(900px 700px at -10% 60%, #22104a 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden
}

a {
  color: inherit
}

#stars,
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none
}

#stars {
  z-index: 0
}

#fx {
  z-index: 1
}

/* ---------- rocket (start page) ---------- */
#rocket {
  position: fixed;
  left: 0;
  top: 0;
  width: 90px;
  display: block;
  z-index: 4;
  pointer-events: none;
  text-decoration: none;
  will-change: transform;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 18px rgba(0, 161, 231, .45))
}

#rocket:focus-visible {
  outline: 2px solid var(--spaceship_cockpit);
  outline-offset: 4px
}

#rocket img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: auto;
  image-rendering: pixelated
}

#rocket .flame {
  position: absolute;
  inset: 0;
  animation: flick .12s steps(2) infinite
}

@keyframes flick {
  0% {
    opacity: 1
  }

  50% {
    opacity: .75
  }
}

/* ---------- layout ---------- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(5, 6, 15, .8), rgba(5, 6, 15, 0))
}

nav ul {
  display: flex;
  gap: clamp(12px, 3vw, 32px);
  list-style: none
}

nav ul a {
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
  transition: color .2s
}

nav ul a:hover {
  color: var(--spaceship_cockpit)
}

main {
  position: relative;
  z-index: 3
}

section {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px clamp(16px, 5vw, 40px);
  scroll-margin-top: 60px
}

.lane {
  height: 300px
}

/* hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding-top: 80px
}

.hero .hello {
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--spaceship_cockpit);
  margin-bottom: 10px
}

.hero h1 {
  font-size: clamp(42px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -2px;
  font-weight: 700;
  background: linear-gradient(180deg, #fff 20%, #8fa2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent
}

.hero .cta {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center
}

.btn {
  position: relative;
  z-index: 5;
  font: 11px var(--pixel);
  text-decoration: none;
  padding: 14px 18px;
  border: 2px solid var(--spaceship_wings);
  color: var(--text);
  box-shadow: 4px 4px 0 var(--spaceship_body);
  transition: transform .15s, box-shadow .15s;
  background: rgba(0, 161, 231, .08)
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--spaceship_body)
}

.btn.ghost {
  border-color: var(--line);
  box-shadow: 4px 4px 0 rgba(62, 71, 203, .4)
}

.pad {
  height: 34vh;
  width: 100%;
  position: relative
}

.pad .ground {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(340px, 80vw);
  height: 14px;
  background: repeating-linear-gradient(90deg, #3e47cb 0 14px, #2a3190 14px 28px);
  box-shadow: 0 0 40px rgba(62, 71, 203, .6)
}

.pad .tower {
  position: absolute;
  left: calc(50% - 110px);
  bottom: 14px;
  width: 12px;
  height: 200px;
  background: repeating-linear-gradient(0deg, #5a63d8 0 4px, transparent 4px 16px), linear-gradient(90deg, #5a63d8 0 3px, transparent 3px 9px, #5a63d8 9px)
}

.scrollhint {
  transition: opacity .3s;
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font: 9px var(--pixel);
  color: var(--muted);
  animation: bob 1.6s ease-in-out infinite
}

@keyframes bob {
  50% {
    transform: translate(-50%, 6px)
  }
}

/* section headings */
.h {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 32px
}

.h .num {
  font: 12px var(--pixel);
  color: var(--spaceship_cockpit)
}

.h h2 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -1px
}

/* about: plain text */
.text {
  max-width: 720px
}

.text p {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--soft);
  margin-bottom: 1.1em
}

.quote {
  margin: 28px 0;
  max-width: 720px;
  padding-left: 18px;
  border-left: 3px solid var(--spaceship_wings);
  color: var(--muted);
  font-style: italic
}

.quote cite {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 14px;
  color: var(--spaceship_wings)
}

.card {
  position: relative;
  z-index: 5;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(6px)
}

.card h3 {
  font-size: 18px;
  margin-bottom: 8px
}

.card p {
  color: var(--muted)
}

/* stack */
.stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px
}

.chip {
  font-size: 13px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(62, 71, 203, .15);
  color: #d5daff;
  transition: all .2s
}

.chip:hover {
  border-color: var(--spaceship_wings);
  background: rgba(0, 161, 231, .2);
  transform: translateY(-2px)
}

.stack .card h3 {
  display: flex;
  align-items: center;
  gap: 10px
}

.stack .card h3 i {
  width: 10px;
  height: 10px;
  display: inline-block;
  background: var(--spaceship_cockpit);
  box-shadow: 0 0 10px var(--spaceship_cockpit)
}

.stack .card:nth-child(2) h3 i {
  background: var(--spaceship_wings);
  box-shadow: 0 0 10px var(--spaceship_wings)
}

/* projects */
.filter {
  position: relative;
  z-index: 5;
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap
}

.filter button {
  font: 10px var(--pixel);
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer
}

.filter button.on {
  color: var(--bg);
  background: var(--spaceship_cockpit);
  border-color: var(--spaceship_cockpit)
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px
}

.proj {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .25s, border-color .25s, opacity .3s
}

.proj:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 161, 231, .5)
}

.proj .thumb {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px
}

.proj .thumb img {
  max-height: 100%;
  max-width: 70%;
  object-fit: contain
}

.cat {
  font: 8px var(--pixel);
  letter-spacing: 1px;
  color: var(--spaceship_wings)
}

.cat.mb {
  color: var(--spaceship_cockpit)
}

.proj h3 {
  font-size: 20px
}

.proj h3 a {
  text-decoration: none
}

.proj h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px
}

/* whole card is clickable */
.proj .links {
  margin-top: auto;
  display: flex;
  gap: 18px;
  font-size: 14px
}

.proj .links a {
  position: relative;
  z-index: 1;
  color: var(--spaceship_wings);
  text-decoration: none
}

.proj .links a:hover {
  text-decoration: underline
}

.proj.hide {
  display: none
}

/* project pages */
.project-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 110px clamp(16px, 5vw, 40px) 80px
}

.back {
  display: table;
  margin-bottom: 28px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px
}

.back:hover {
  color: var(--spaceship_cockpit)
}

.project-page h1 {
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 10px 0 14px
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px
}

.meta a {
  color: var(--spaceship_wings);
  text-decoration: none
}

.meta a:hover {
  text-decoration: underline
}

.project-page figure {
  margin: 34px 0;
  padding: 28px;
  display: flex;
  justify-content: center
}

.project-page figure img {
  max-width: min(100%, 420px);
  max-height: 360px
}

.prose p,
.prose ul {
  color: var(--soft);
  margin-bottom: 1.1em;
  font-size: 17px
}

.prose ul {
  padding-left: 1.3em
}

.prose li {
  margin-bottom: .2em
}

.prose h2 {
  font-size: 18px;
  margin: 1.6em 0 .5em
}

.prose a {
  color: var(--spaceship_wings)
}

/* imprint / privacy */
.legal {
  min-height: calc(100vh - 100px)
}

/* keeps the footer at the bottom on the short imprint */
.legal .prose h1 {
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 28px;
  overflow-wrap: break-word;
  hyphens: manual
}

.legal .prose h2 {
  font-size: 22px;
  margin-top: 2em
}

.legal .prose h3 {
  font-size: 17px;
  margin: 1.6em 0 .4em
}

.legal .prose h4 {
  font-size: 15px;
  color: var(--soft);
  margin: 1.2em 0 .3em
}

.legal .prose p,
.legal .prose ul {
  font-size: 15px
}

/* contact / footer */
.contact {
  text-align: center;
  padding-bottom: 140px
}

.contact h2 {
  font-size: clamp(30px, 5vw, 56px);
  letter-spacing: -1px;
  margin: 14px 0 18px
}

.contact p {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--soft)
}

.contact p a {
  color: var(--spaceship_wings);
  text-decoration: none
}

.contact p a:hover {
  text-decoration: underline
}

.contact .cta {
  position: relative;
  z-index: 5;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px
}

footer {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 30px 16px 40px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line)
}

footer a {
  margin: 0 10px;
  color: var(--muted)
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease
}

.reveal.in {
  opacity: 1;
  transform: none
}

@media (max-width:760px) {
  .lane {
    height: 240px
  }

  .stack,
  .projects {
    grid-template-columns: 1fr
  }

  nav ul {
    gap: 14px
  }

  nav ul a {
    font-size: 13px
  }

  #rocket {
    width: 64px
  }

  .pad .tower {
    left: calc(50% - 80px)
  }
}

@media (max-width:480px) {
  nav ul li:nth-child(2) {
    display: none
  }
}

@media (prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none
  }
}

/* spaceship defense */
.game-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 112px clamp(16px, 5vw, 40px) 72px
}

.game-header {
  margin-bottom: 30px
}

.game-kicker {
  color: var(--spaceship_cockpit);
  font: 9px var(--pixel);
  margin-bottom: 12px
}

.game-header h1 {
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 8px
}

.game-header>p:last-child {
  color: var(--muted)
}

.game-shell {
  padding: clamp(14px, 3vw, 28px);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 22, 48, .88), rgba(8, 12, 28, .92));
  box-shadow: 0 0 48px rgba(0, 161, 231, .1)
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px
}

.game-hud p {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-left: 2px solid var(--spaceship_wings);
  background: rgba(5, 6, 15, .46)
}

.game-hud p:nth-child(2) {
  border-color: var(--spaceship_wings)
}

.game-hud p:nth-child(3) {
  border-color: var(--spaceship_wings)
}

.game-hud span {
  color: var(--muted);
  font: 8px var(--pixel)
}

.game-hud strong {
  color: var(--text);
  font: 18px var(--pixel)
}

.game-board {
  overflow: hidden;
  border: 1px solid rgba(85, 214, 190, .35);
  background: #070b19;
  box-shadow: inset 0 0 28px rgba(0, 161, 231, .08)
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  touch-action: manipulation
}

#game-canvas:focus-visible,
.touch-controls button:focus-visible,
#start-game:focus-visible {
  outline: 2px solid var(--spaceship_cockpit);
  outline-offset: 3px
}

.game-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 10px
}

#game-status {
  color: var(--soft);
  font-size: 15px
}

#start-game {
  color: var(--bg);
  background: var(--spaceship_wings);
  border: 2px solid var(--spaceship_wings);
  box-shadow: 4px 4px 0 var(--spaceship_body);
  cursor: pointer;
  white-space: nowrap
}

.touch-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 12px
}

.touch-controls button {
  min-height: 58px;
  border: 1px solid var(--line);
  background: rgba(0, 161, 231, .1);
  color: var(--text);
  font: 12px var(--pixel);
  cursor: pointer;
  touch-action: none;
  user-select: none
}

.touch-controls button:nth-child(2) {
  border-color: rgba(254, 126, 38, .5);
  background: rgba(254, 126, 38, .12);
  color: #ffb16d
}

.touch-controls button:active {
  background: rgba(0, 161, 231, .32)
}

.game-help {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center
}

@media (max-width: 600px) {
  .game-header h1 {
    font-size: 32px
  }

  .game-hud {
    gap: 6px
  }

  .game-hud p {
    padding: 9px 8px
  }

  .game-hud span {
    font-size: 7px
  }

  .game-hud strong {
    font-size: 13px
  }

  .game-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 12px
  }

  #start-game {
    min-height: 48px
  }

  .game-help {
    font-size: 12px
  }
}