/* ---------- Basis ---------- */
:root {
  --bg: #f4f2ed;
  --dot: #d8d5cc;
  --ink: #111111;
  --pill-purple: #d9a6f0;
  --pill-yellow: #f2e27a;
  --halftone-blue: #7fa8e0;
  --font-px: 'Press Start 2P', monospace;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  font-family: var(--font-ui);
  color: var(--ink);
  overflow: hidden;
}

/* Tastaturbedienung: Sprunglink und ein Fokusring, der überall sichtbar ist. */
.skip-link {
  position: fixed;
  top: -100px;
  left: 18px;
  z-index: 200;
  font-family: var(--font-ui);
  font-weight: 600;
  background: var(--pill-yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 20px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 18px; }

:focus-visible {
  outline: 3px solid #3E7BC4;
  outline-offset: 2px;
}

/* Nur für Screenreader — z. B. die Ansage des Seitenwechsels. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#game { position: fixed; inset: 0; }
#game canvas { display: block; }

/* ---------- Fallback ohne Phaser ---------- */
#fallback {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}
#fallback[hidden] { display: none; }
#fallback h1 { font-family: var(--font-px); font-size: 22px; }
#fallback p { color: #555; max-width: 420px; }
#fallback a {
  font-family: var(--font-px);
  font-size: 11px;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 12px 22px;
  text-decoration: none;
  background: var(--pill-yellow);
  box-shadow: 3px 3px 0 var(--ink);
}
#fallback a:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- Overlay (Unterseiten) ---------- */
#overlay {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
#overlay[hidden] { display: none; }

/* ---------- Seiten-Gerüst ---------- */
.page { min-height: 100%; position: relative; padding: 18px; }

.pill-nav {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: max-content;
}
.pill {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.pill:active { transform: translate(2px, 2px); box-shadow: none; }
.pill-navigate { background: var(--pill-purple); }
.pill-item { background: var(--pill-yellow); }
.pill-items {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.pill-nav.open .pill-items { opacity: 1; transform: none; pointer-events: auto; }

.halftone {
  position: fixed;
  left: 4vw;
  bottom: 6vh;
  z-index: 0;
  font-family: var(--font-px);
  font-size: clamp(34px, 7vw, 84px);
  line-height: 1.25;
  transform: rotate(-4deg);
  color: transparent;
  background: radial-gradient(circle, var(--halftone-blue) 58%, transparent 60%) 0 0 / 6px 6px;
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
  user-select: none;
}

.content { position: relative; z-index: 1; max-width: 560px; margin: 8vh 6vw 12vh auto; }
.eyebrow { font-family: var(--font-px); font-size: 9px; letter-spacing: 3px; color: #999; margin-bottom: 14px; }
.content h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 700; margin-bottom: 18px; }
.content p { line-height: 1.65; margin-bottom: 14px; color: #333; }
.content .lead { font-size: 18px; color: var(--ink); }

.placeholder {
  border: 2px dashed #c4c0b4;
  border-radius: 8px;
  padding: 10px 14px;
  color: #8a8778 !important;
  font-style: italic;
}

/* ---------- Über mich ---------- */
.steckbrief {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 22px;
  margin: 22px 0 26px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 18px 20px;
  background: #fffdf8;
  box-shadow: 3px 3px 0 var(--ink);
}
.steckbrief dt { font-family: var(--font-px); font-size: 9px; color: #999; align-self: center; }
.steckbrief dd { font-weight: 600; }

/* ---------- Portfolio / Kartenstapel ---------- */
.portfolio { max-width: 620px; }
.deck-hint { font-size: 13px; color: #999; }
.deck-spacer { height: 190vh; }
.deck { position: sticky; top: 10vh; height: 76vh; }
.card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  border: none;
  border-radius: 16px;
  color: #f2efe8;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 16px;
  transition: transform 0.15s linear;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
}
.card span { pointer-events: none; }
.card:hover { filter: brightness(1.15); }

/* ---------- Projekt-Seiten ---------- */
.project { max-width: 640px; }
.pill-back { background: var(--pill-yellow); margin-bottom: 26px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 22px; }
.chip {
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fffdf8;
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.chip-link { background: var(--pill-purple); }
.project-shot {
  margin: 0 0 24px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
}
.project-shot img { display: block; width: 100%; height: auto; }
.project-shot-empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shot-word {
  font-family: var(--font-px);
  font-size: clamp(16px, 3vw, 26px);
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
}
.project-thumbs { display: flex; gap: 10px; margin: -12px 0 24px; flex-wrap: wrap; }
.thumb {
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  opacity: 0.55;
  width: 84px;
}
.thumb img { display: block; width: 100%; height: auto; }
.thumb-active, .thumb:hover { opacity: 1; box-shadow: 2px 2px 0 var(--ink); }
.project-h2 { font-size: 19px; margin: 26px 0 12px; }
.project-list { list-style: none; display: grid; gap: 10px; }
.project-list li {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fffdf8;
  padding: 10px 14px 10px 38px;
  position: relative;
  line-height: 1.5;
}
.project-list li::before {
  font-family: var(--font-px);
  font-size: 10px;
  position: absolute;
  left: 14px;
  top: 13px;
}
.project-list.wins li::before { content: '✓'; color: #35b24a; }
.project-list.learnings li::before { content: '→'; color: #e0a32e; }

/* ---------- Kontakt ---------- */
.page-contact .halftone { display: none; }

.contact {
  max-width: none;
  margin: 0;
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: 8vh;
  gap: 26px;
}
.handle-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #161616;
  border-radius: 999px;
  padding: 9px 26px 9px 10px;
}
.handle-badge .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f2c9a0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.handle-badge .avatar svg { width: 30px; height: 20px; }
.handle-badge .handle { color: #fff; font-size: 17px; font-weight: 600; }
.social-row { display: flex; gap: 18px; }
.social {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2ded4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.social svg { width: 28px; height: 28px; }
.social:hover { transform: translateY(-4px); }
.social-disabled { opacity: 0.4; cursor: default; }
.contact-note { font-size: 13px; color: #999; }

/* ---------- Kontaktformular ---------- */
.contact-form {
  width: min(440px, 92vw);
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 4px 4px 0 var(--ink);
  display: grid;
  gap: 12px;
}
.contact-form h2 { font-size: 20px; }
.form-field { display: grid; gap: 5px; }
.form-field span { font-family: var(--font-px); font-size: 8px; letter-spacing: 1px; color: #999; }
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font-ui);
  font-size: 15px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
}
.form-field textarea { resize: vertical; }
.form-field :focus { outline: none; box-shadow: 2px 2px 0 var(--ink); }
.form-submit { justify-self: start; }
.contact { padding: 40px 0; }
.project-cta { margin-top: 26px; }

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
  .content { margin: 10vh 18px 14vh; }
  /* Kontakt bleibt full-bleed und zentriert — nicht von der .content-Marge kapern lassen. */
  .content.contact { margin: 0; margin-top: 8vh; }
  .halftone { font-size: 30px; bottom: 3vh; opacity: 0.55; }
  .deck-spacer { height: 230vh; }
  .card { height: 150px; font-size: 13px; padding: 12px 14px 0; text-align: center; }
  .social-row { gap: 12px; }
  .social { width: 50px; height: 50px; }
}

/* ---------- Ecke oben rechts (Sprache, Sound) ---------- */
#corner-pills {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: flex;
  gap: 10px;
}
.pill-corner {
  background: #fffdf8;
  font-family: var(--font-px);
  font-size: 10px;
  padding: 10px 14px;
}

/* ---------- Hobbys: Fußball + Schach ---------- */
.hobbies { margin-top: 34px; }
.hobbies-intro { font-size: 14px; color: #777; }
.hobbies-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; margin-top: 14px; }
.pitch {
  position: relative;
  flex: 1 1 240px;
  min-width: 220px;
  height: 200px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #dcead2 linear-gradient(transparent 49%, rgba(17, 17, 17, 0.15) 49%, rgba(17, 17, 17, 0.15) 51%, transparent 51%);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}
.ball {
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transform: translate(30px, 0);
  will-change: transform;
}
.ball svg { width: 100%; height: 100%; display: block; }
.chessboard {
  display: grid;
  grid-template-columns: repeat(8, 34px);
  grid-auto-rows: 34px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 3px 3px 0 var(--ink);
  width: max-content;
}
.sq { border: none; padding: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #111; }
.sq-light { background: #f6efdc; }
.sq-dark { background: #b7a98a; }
.sq-legal { box-shadow: inset 0 0 0 3px rgba(53, 178, 74, 0.7); }
.sq-knight { cursor: default; }
.sq-nope { animation: nope 0.3s; }
@keyframes nope { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (max-width: 600px) {
  .chessboard { grid-template-columns: repeat(8, 30px); grid-auto-rows: 30px; }
  .sq { font-size: 19px; }
}

/* ---------- Konami-Easter-Egg: Regen ---------- */
.egg-drop {
  position: fixed;
  top: -48px;
  z-index: 80;
  pointer-events: none;
  animation: egg-fall 3s linear forwards;
}
@keyframes egg-fall {
  to { transform: translateY(110vh) rotate(540deg); }
}


/* ---------- Über mich: Werdegang und Skills ---------- */
.timeline { list-style: none; display: grid; gap: 12px; margin-bottom: 8px; }
.timeline li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: baseline;
  border-left: 3px solid var(--ink);
  padding: 4px 0 4px 14px;
}
.timeline-when { font-family: var(--font-px); font-size: 9px; color: #8a8474; }
.timeline-what { line-height: 1.55; color: #333; }

.skills {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 22px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 18px 20px;
  background: #fffdf8;
  box-shadow: 3px 3px 0 var(--ink);
  margin-bottom: 8px;
}
.skills dt { font-family: var(--font-px); font-size: 9px; color: #999; align-self: start; padding-top: 3px; }
.skills dd { line-height: 1.55; }

/* ---------- Projektseite: belegte Zahlen ---------- */
.metric-row { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.metric {
  font-family: var(--font-px);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.5px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #eaf3ea;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 9px 12px;
}

.gallery { margin-bottom: 4px; }

/* ---------- Portfolio: Archiv-Raster ---------- */
.archive-title { font-size: 22px; margin: 46px 0 6px; }
.archive-intro { font-size: 14px; color: #8a8474; margin-bottom: 18px; }
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
  padding-bottom: 10vh;
}
.archive-tile {
  --tile: #333;
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
  font-family: var(--font-ui);
  border: 2px solid var(--ink);
  border-left: 8px solid var(--tile);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 15px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.archive-tile:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.archive-tile:active { transform: translate(2px, 2px); box-shadow: none; }
.archive-name { font-size: 16px; font-weight: 700; }
.archive-status {
  font-family: var(--font-px);
  font-size: 7px;
  letter-spacing: 1px;
  color: #fffdf8;
  background: var(--tile);
  border-radius: 999px;
  padding: 5px 9px;
}
.archive-line { font-size: 13px; line-height: 1.5; color: #666; }

@media (max-width: 600px) {
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .archive-grid { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; gap: 2px 0; }
  .skills dd { margin-bottom: 10px; }
}
