:root {
  --bg: #05060a;
  --bg-soft: #0b0e17;
  --panel: #11131c;
  --panel-2: #161a25;
  --line: #23252f;
  --text: #f5f5f5;
  --muted: #c2cad8;
  --muted-2: #98a0af;
  --accent: #7fb0ff;
  --accent-strong: #3f82ff;
  --glow: rgba(63, 130, 255, 0.18);
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.25);
  --mouse-x: 50vw;
  --mouse-y: 50vh;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(circle at top right, rgba(63, 130, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #070910 0%, var(--bg) 28%, #070910 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(127, 176, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 176, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 38%, transparent 85%);
  opacity: 0.55;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    560px circle at var(--mouse-x) var(--mouse-y),
    rgba(127, 176, 255, 0.08),
    transparent 42%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

body.js-enhanced.has-fine-pointer:hover::after {
  opacity: 1;
}

header,
main,
footer,
#runlevel-console {
  position: relative;
  z-index: 1;
}

header {
  position: relative;
  padding: 3rem 1.5rem 2rem;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.2rem;
}

.hero-text {
  flex: 1 1 320px;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.hero-text p {
  margin: 0.5rem 0;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.68;
}

.hero-copy {
  font-size: 1.08rem;
  line-height: 1.72;
  color: #d7dfec;
}

.hero-actions,
.meta-row,
.card .links,
.contact-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero-actions {
  margin-top: 1.2rem;
}

.badge,
.button,
.meta-pill,
.mini-tag,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  text-decoration: none;
}

.badge {
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--accent-strong);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
  color: #c7d9ff;
  background: rgba(63, 130, 255, 0.08);
}

.button {
  padding: 0.68rem 1rem;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.button.primary {
  background: linear-gradient(135deg, rgba(63, 130, 255, 0.18), rgba(63, 130, 255, 0.08));
  border-color: rgba(127, 176, 255, 0.3);
}

.meta-row {
  margin-top: 1.4rem;
}

.meta-pill {
  padding: 0.42rem 0.75rem;
  font-size: 0.83rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.hero-image {
  position: relative;
  flex: 0 0 280px;
  width: min(320px, 100%);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(127, 176, 255, 0.16);
  background: radial-gradient(circle at top, rgba(63, 130, 255, 0.22), #05060a 70%);
  box-shadow: var(--shadow);
}

.hero-image::after {
  content: "online";
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(5, 6, 10, 0.72);
  border: 1px solid rgba(127, 176, 255, 0.2);
  color: #d7e5ff;
  font-size: 0.76rem;
  backdrop-filter: blur(8px);
}

.hero-image img {
  display: block;
  width: 100%;
  height: auto;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

section {
  margin: 2.6rem 0;
}

.js-enhanced .reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
}

.js-enhanced .reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

h2 {
  font-size: 1.5rem;
  margin: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.14;
}

h3 {
  line-height: 1.24;
}

.section-note {
  color: var(--muted-2);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.grid,
.stats,
.github-grid {
  display: grid;
  gap: 1.2rem;
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.github-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card,
.terminal,
.repo-card,
.box {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(22, 26, 37, 0.95), rgba(17, 19, 28, 0.95));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card,
.repo-card {
  padding: 1.15rem 1.2rem;
}

.grid .card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.card h3,
.repo-card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
}

.card p,
.repo-card p,
.box p,
.box li {
  color: var(--muted);
  line-height: 1.66;
}

.card p,
.repo-card p {
  max-width: 58ch;
}

.grid .card p {
  line-height: 1.66;
}

.grid .card .links {
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
}

.grid .card .tag {
  margin-top: auto;
}

.tag,
.mini-tag {
  padding: 0.16rem 0.5rem;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted-2);
  margin-top: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.mini-tag {
  margin-top: 0;
}

.card .links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--accent);
  text-decoration: none;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.card .links a:hover {
  color: #a9c6ff;
  text-decoration: none;
  border-color: rgba(127, 176, 255, 0.28);
  background: rgba(127, 176, 255, 0.06);
  transform: translateY(-1px);
}

.card .links a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.card,
.repo-card,
.button,
.badge,
.meta-pill,
.tag,
.mini-tag,
.hero-image {
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.card,
.repo-card {
  position: relative;
  overflow: hidden;
}

.project-card,
.repo-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* Glow + Light Edge gemeinsam */
.card::before,
.repo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(
      circle at top right,
      rgba(127, 176, 255, 0.10),
      transparent 40%
    ),
    linear-gradient(
      120deg,
      transparent 0%,
      rgba(127, 176, 255, 0.04) 40%,
      rgba(127, 176, 255, 0.12) 50%,
      rgba(127, 176, 255, 0.04) 60%,
      transparent 100%
    );
  opacity: 0;
  transition: opacity 0.22s ease;
}

.card:hover,
.repo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(127, 176, 255, 0.34);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(127, 176, 255, 0.05),
    0 0 24px rgba(63, 130, 255, 0.10);
}

.card:hover::before,
.repo-card:hover::before {
  opacity: 1;
}

.hero-image:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 176, 255, 0.32);
}

/* Sweep-Glanz nur für Projektkarten */
.project-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -120%;
  width: 60%;
  height: 200%;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(127, 176, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.05) 70%,
    transparent 100%
  );
  transform: rotate(18deg);
  transition: left 0.65s ease;
  opacity: 0;
}

.project-card:hover::after {
  left: 120%;
  opacity: 1;
}

.terminal {
  overflow: hidden;
}

.terminal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.terminal-dots {
  display: flex;
  gap: 0.35rem;
}

.terminal-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.terminal-title {
  font-size: 0.82rem;
  color: var(--muted-2);
  letter-spacing: 0.03em;
}

.terminal-body {
  margin: 0;
  padding: 1.1rem 1rem 1.25rem;
  font: 0.95rem/1.75 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: #d9e7ff;
  white-space: pre-wrap;
}

.prompt {
  color: #86b4ff;
}

.stats .card p {
  margin: 0.2rem 0 0;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
}

.muted {
  color: var(--muted-2);
}

.repo-card .repo-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
  margin-bottom: 0.45rem;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.contact-card {
  display: grid;
  gap: 0.8rem;
}

.contact-card p {
  margin: 0;
}

footer {
  border-top: 1px solid var(--line);
  padding: 1rem 1.5rem 2.4rem;
  max-width: 1080px;
  margin: 0 auto;
  font-size: 0.88rem;
  color: #888;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  gap: 0.9rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #a9c6ff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

body.legal {
  padding: 2rem 1rem;
  line-height: 1.72;
}

body.legal::before {
  opacity: 0.3;
}

.box {
  max-width: 840px;
  margin: 0 auto;
  padding: 1.6rem;
}

.box h1 {
  margin-top: 0;
}

.box h2 {
  margin-top: 1.4rem;
  font-size: 1.15rem;
}

.box ul {
  padding-left: 1.25rem;
}

.box p,
.box li {
  max-width: 70ch;
}

.small {
  font-size: 0.92rem;
}

@media (max-width: 720px) {
  header {
    padding-top: 2rem;
  }

  .hero-actions,
  .meta-row,
  .contact-links,
  .card .links,
  .footer-links {
    gap: 0.55rem;
  }

  .button,
  .meta-pill,
  .card .links a {
    width: 100%;
    justify-content: center;
  }

  .grid,
  .github-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .card,
  .repo-card {
    padding: 1rem;
  }

  .grid .card {
    min-height: unset;
  }

  .footer-row,
  .section-head,
  .repo-card .repo-top {
    align-items: flex-start;
  }
}

.terminal {
  position: relative;
}

.terminal::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    0 0 0 1px rgba(127, 176, 255, 0.08),
    0 0 22px rgba(63, 130, 255, 0.12),
    0 0 60px rgba(63, 130, 255, 0.08);
}

.terminal-body {
  position: relative;
}

.terminal-body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at 50% 30%,
      rgba(127, 176, 255, 0.05),
      transparent 70%
    );
}

#runlevel-console {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: min(680px, 92vw);
  background: #0b0e17;
  border: 1px solid rgba(127, 176, 255, 0.25);
  border-radius: 12px;
  font: 0.9rem/1.6 "SFMono-Regular", Consolas, monospace;
  color: #cfe3ff;
  padding: 0.8rem 1rem;
  box-shadow:
    0 0 20px rgba(63, 130, 255, 0.18),
    0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  z-index: 999;
}

#runlevel-console.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#runlevel-console .runlevel-user {
  color: #86b4ff;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  body::after {
    display: none;
  }

  .js-enhanced .reveal-on-scroll,
  .js-enhanced .reveal-on-scroll.visible {
    opacity: 1;
    transform: none;
  }
}

.system-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  font-size: 0.84rem;
  color: var(--muted-2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(127, 176, 255, 0.45);
}

.status-sep {
  opacity: 0.55;
}

.soundtrack-cover,
.soundtrack-video {
  width: 100%;
  border-radius: 16px;
  margin-top: 0.8rem;
  border: 1px solid var(--line);
}

.soundtrack-meta {
  margin-top: 0.6rem;
  color: var(--muted-2);
  font-size: 0.9rem;
}

audio {
  width: 100%;
  margin-top: 1rem;
}