/* ==========================================================
   Farben hier anpassen
   ========================================================== */
:root {
  --bg: #0a0a0b;
  --tile: #111113;
  --tile-2: #16161a;
  --border: #212126;
  --border-strong: #2e2e35;
  --text: #ededee;
  --muted: #8b8b94;
  --dim: #82828c;
  --accent: #ffa53d;
  --accent-text: #ffa53d;
  --accent-ink: #1a1004;
  --accent-soft: rgba(255, 165, 61, 0.12);
  --accent-line: rgba(255, 165, 61, 0.45);
  --grid-line: rgba(255, 255, 255, 0.035);
  --topbar: rgba(10, 10, 11, 0.72);
  --radius: 20px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

/* Helles Design */
html[data-theme="light"] {
  --bg: #f3f2ef;
  --tile: #ffffff;
  --tile-2: #faf9f7;
  --border: #e4e2dd;
  --border-strong: #d4d1ca;
  --text: #141415;
  --muted: #5d5d66;
  --dim: #6a6a73;
  --accent: #e0801a;
  --accent-text: #a85b06;
  --accent-ink: #1a1004;
  --accent-soft: rgba(224, 128, 26, 0.1);
  --accent-line: rgba(224, 128, 26, 0.5);
  --grid-line: rgba(0, 0, 0, 0.045);
  --topbar: rgba(243, 242, 239, 0.8);
  color-scheme: light;
}

/* ==========================================================
   Grundlagen
   ========================================================== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* Tastatur-Fokus: deutlicher Rahmen für alle Links und Buttons */
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }

/* „Zum Inhalt springen“: erst beim ersten Tab sichtbar */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

a { color: inherit; }

/* Sprachumschaltung: nur die aktive Sprache anzeigen */
html[data-lang="de"] [lang="en"],
html[data-lang="en"] [lang="de"] { display: none; }

/* Hintergrund: langsam wanderndes Raster und ein warmer Lichtschein */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: -56px 0 0 -56px;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px;
  animation: grid-drift 14s linear infinite;
  will-change: transform;
}

.backdrop::after {
  content: "";
  position: absolute;
  top: -260px;
  left: -200px;
  width: 760px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  animation: glow-wander 26s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes grid-drift { to { transform: translate(56px, 56px); } }

@keyframes glow-wander {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(38vw, 60px); }
  100% { transform: translate(70vw, -20px); }
}

.label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.label.dim { color: var(--dim); }
.tile h2.label { margin: 0; font-size: 0.72rem; font-weight: 400; letter-spacing: 0.08em; line-height: inherit; }
.muted { color: var(--muted); }

/* ==========================================================
   Kopfzeile
   ========================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px max(20px, calc((100% - 1120px) / 2));
  background: var(--topbar);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.logo-text {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

nav { display: flex; align-items: center; gap: 8px; }

.nav-link {
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--text); background: var(--tile-2); }

.lang-toggle {
  height: 32px;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.lang-toggle:hover { border-color: var(--accent); color: var(--accent-text); }

.theme-toggle {
  width: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}

.theme-toggle svg { width: 15px; height: 15px; }

/* Sonne im dunklen Design, Mond im hellen */
.icon-moon,
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

/* ==========================================================
   Seitenrahmen
   ========================================================== */
.page, .legal {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 0;
}

/* ==========================================================
   Kacheln (Bento-Grid)
   ========================================================== */
.bento {
  display: grid;
  /* letzte Spalte breiter: dort sitzt das Hochformat-Foto */
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.45fr);
  grid-auto-rows: minmax(150px, auto);
  gap: 12px;
  grid-template-areas:
    "intro  intro  intro  photo"
    "intro  intro  intro  photo"
    "about  about  about  time"
    "skills skills skills skills"
    "projects projects projects projects"
    "career career career career"
    "subnet subnet subnet garage";
}

.tile-intro { grid-area: intro; }
.tile-photo { grid-area: photo; }
.tile-about { grid-area: about; }
.tile-time   { grid-area: time; }
.tile-skills { grid-area: skills; }
.tile-projects { grid-area: projects; }
.tile-career { grid-area: career; }
.tile-subnet { grid-area: subnet; }
.tile-garage { grid-area: garage; }

.tile {
  position: relative;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(420px circle at var(--mx, -500px) var(--my, -500px), var(--accent-soft), transparent 45%),
    linear-gradient(180deg, var(--tile-2), var(--tile));
  overflow: hidden;
  transition: border-color 0.25s, transform 0.35s cubic-bezier(.2,.7,.2,1);
  scroll-margin-top: 80px;
}

.page .tile.tilting { transition: border-color 0.25s, transform 0.08s linear; transition-delay: 0s; }

.tile:hover { border-color: var(--border-strong); }

.tile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.tile h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.tile p { margin: 0; }

/* --- Intro --- */
.tile-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 28px;
  min-height: 420px;
}

.corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent-line);
  border-style: solid;
  border-width: 0;
}

.corner.tl { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }

.tile-intro .tile-head { margin: 0; padding: 0 8px; }

.intro-body { position: relative; padding: 0 8px; }

/* Netzwerk-Topologie rechts in der Intro-Kachel */
.topology {
  position: absolute;
  top: 50%;
  right: 48px;
  width: min(34%, 300px);
  transform: translateY(-50%);
  overflow: visible;
  pointer-events: none;
}

.topology .links path {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.2;
}

.topology .flow path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 6 190;
  animation: flow 3.2s linear infinite;
}

.topology .flow path + path { animation-delay: -1.6s; }

@keyframes flow { to { stroke-dashoffset: -196; } }

.topology .nodes rect {
  fill: var(--tile-2);
  stroke: var(--border-strong);
  stroke-width: 1.2;
}

.topology .nodes rect.core { stroke: var(--accent); }

.topology .tags text {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 1rem;
}

h1 {
  margin: 0;
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.045em;
  padding-bottom: 0.16em; /* Platz für die Unterlänge vom "g" */
}

.role {
  max-width: 30ch;
  margin: 14px 0 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
}

.role span { border-left: 2px solid var(--accent); padding-left: 12px; display: block; }

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn svg { width: 16px; height: 16px; transition: transform 0.2s; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 30px -10px var(--accent);
}

.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-sm { height: 40px; padding: 0 16px; font-size: 0.85rem; border-radius: 10px; }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent-line); }

/* --- Foto --- */
.tile-photo {
  padding: 0;
  min-height: 300px;
  background: var(--tile-2);
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-text);
}

.tile-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  filter: saturate(0.85) contrast(1.05);
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1), filter 0.4s;
}

.tile-photo:hover img { transform: scale(1.03); filter: saturate(1) contrast(1.05); }

.tile-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.tile-photo figcaption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
}

.tile-photo figcaption .dim { color: rgba(255, 255, 255, 0.6); }

/* --- Über mich --- */
.tile-about p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}

.tile-about p + p { margin-top: 12px; color: var(--muted); }

/* --- Uhr --- */
.tile-time {
  display: flex;
  flex-direction: column;
}

.clock {
  margin: auto 0 6px !important;
  font-family: var(--mono);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-line);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-line); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- Chips --- */
.chips {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips li {
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* --- Skills --- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.skill-group { padding-top: 14px; border-top: 1px solid var(--border); }

.skill-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.skill-group .chips { margin-top: 12px; }
.skill-group .chips li { color: var(--text); font-size: 0.75rem; padding: 5px 11px; }
/* Skill-Chips mit Tooltip (Einsatzort) */
.skill-chips .skill { position: relative; cursor: help; outline: none; }
.skill-chips .skill:hover,
.skill-chips .skill:focus-visible,
.skill-chips .skill:focus { border-color: var(--accent-line); color: var(--accent-text); }
.skill-chips .skill:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }

.skill-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  padding: 6px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}

.skill-tip .tip-k { color: var(--accent-text); }
.skill.tip-flip .skill-tip { left: auto; right: 0; }

.skill:hover .skill-tip,
.skill:focus .skill-tip,
.skill:focus-visible .skill-tip { opacity: 1; transform: none; }

/* Tooltips dürfen über den Kachelrand hinausragen */
.tile-skills { overflow: visible; }

/* --- Projekte --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: var(--accent-line);
  background: var(--tile-2);
  transform: translateY(-2px);
}

.project-top { display: flex; justify-content: space-between; align-items: center; }

.project-card .arrow {
  width: 18px;
  height: 18px;
  color: var(--dim);
  transition: transform 0.25s, color 0.25s;
}

.project-card:hover .arrow { color: var(--accent-text); transform: translate(3px, -3px); }

/* Schema-Grafik auf der Projektkarte (reine Deko) */
.project-art { width: 100%; height: auto; margin: 4px 0 2px; overflow: visible; }
.project-art .bx { fill: var(--tile-2); stroke: var(--border-strong); stroke-width: 1.2; }
.project-art .ln { fill: none; stroke: var(--border-strong); stroke-width: 1.2; }
.project-art .ac { stroke: var(--accent); }
.project-art .acf { fill: var(--accent); }
.project-art .dot { fill: var(--border-strong); }
.project-art text { font-family: var(--mono); font-size: 9px; fill: var(--dim); }
.project-art .ln, .project-art .bx { transition: stroke 0.25s; }
.project-card:hover .project-art .ln:not(.ac),
.project-card:hover .project-art .bx:not(.ac) { stroke: var(--accent-line); }

.project-title { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.project-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.project-tags > span {
  padding: 3px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

/* --- Projektseiten (projekte/*.html) --- */
.project-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.project-page .back-link svg { width: 16px; height: 16px; }

.bento.project-bento {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "hero  hero  hero  hero"
    "about about about stack"
    "parts parts parts parts"
    "case  case  case  case";
}

.bento.project-bento.has-arch {
  grid-template-areas:
    "hero  hero  hero  hero"
    "arch  arch  arch  arch"
    "about about about stack"
    "parts parts parts parts"
    "case  case  case  case";
}

/* Architekturdiagramm (projekte/homelab.html) */
.project-arch { grid-area: arch; }
.project-arch .tile-head { flex-wrap: wrap; gap: 4px 16px; }
.arch { display: block; width: 100%; height: auto; }
.arch-tall { display: none; }
.arch .bx { fill: var(--tile-2); stroke: var(--border-strong); stroke-width: 1.3; }
.arch .bx.ac { stroke: var(--accent); }
.arch .bx.dash { stroke-dasharray: 4 4; }
.arch .ln { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.arch .tun { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 7 6; }
.arch .dns { fill: none; stroke: var(--accent-line); stroke-width: 1.6; stroke-dasharray: 2 5; stroke-linecap: round; }
.arch text { font-family: var(--mono); fill: var(--text); }
.arch .t { font-size: 13px; font-weight: 600; }
.arch .s { font-size: 11px; fill: var(--muted); }

.project-hero  { grid-area: hero; padding: 32px; }
.project-about { grid-area: about; }
.project-stack { grid-area: stack; }
.project-parts { grid-area: parts; }
.project-case  { grid-area: case; }

/* Case Study */
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
}

.case-step { display: grid; gap: 10px; align-content: start; padding-top: 16px; border-top: 1px solid var(--border); }
.case-step p { margin: 0; line-height: 1.7; color: var(--text); }
.case-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.case-list li { line-height: 1.65; color: var(--muted); padding-left: 16px; position: relative; }
.case-list li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 6px; height: 6px; background: var(--accent); }
.case-list strong { color: var(--text); font-weight: 600; }

.project-h1 {
  margin: 12px 0 14px;
  padding-bottom: 0.1em;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
}

.project-lead {
  max-width: 60ch;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

.project-about p { font-size: 1.02rem; line-height: 1.7; }
.project-about p + p { margin-top: 12px; color: var(--muted); }
.project-stack .chips { margin-top: 0; }
.project-stack .chips li { color: var(--text); }

.part-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.part-list li {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}

.part-name { font-weight: 600; }
.part-name::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 10px 2px 0; background: var(--accent); }
.part-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

.next-project {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.25s;
}

.next-project:hover { border-color: var(--accent-line); }

.next-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.next-title svg { width: 22px; height: 22px; color: var(--accent-text); transition: transform 0.25s; }
.next-project:hover .next-title svg { transform: translateX(4px); }

/* --- Subnetz-Rechner --- */
.subnet-form { display: grid; gap: 8px; }
.subnet-label { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.subnet-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.subnet-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.subnet-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.subnet-input.invalid { border-color: #e5484d; }
.subnet-presets { display: flex; gap: 6px; }
.subnet-preset {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.subnet-preset:hover, .subnet-preset.active { color: var(--accent-text); border-color: var(--accent-line); }
.subnet-error { margin: 0 !important; font-size: 0.85rem; color: #e5484d; }
.subnet-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}
.subnet-result > div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  min-width: 0;
}
.subnet-result dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.subnet-result dd { margin: 4px 0 0; font-family: var(--mono); font-size: 1rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* --- Garage (Pixel-Art) --- */
.tile-garage { padding: 0; min-height: 260px; background: var(--tile-2); }
.tile-garage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 70%;
  image-rendering: pixelated;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.tile-garage:hover img { transform: scale(1.03); }
.tile-garage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.8));
  pointer-events: none;
}
.tile-garage figcaption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
}
.tile-garage figcaption .label { color: #ffa53d; }
.tile-garage figcaption .dim { color: rgba(255, 255, 255, 0.7); }

/* --- 404-Seite --- */
.error-page { min-height: calc(100vh - 220px); display: grid; align-content: center; }
.error-tile { display: grid; justify-items: start; gap: 10px; padding: 40px 36px; max-width: 720px; width: 100%; margin: 0 auto; }
.error-tile .tile-head { width: 100%; }
.error-code {
  margin: 8px 0 0 !important;
  font-family: var(--mono);
  font-size: clamp(4.5rem, 16vw, 8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent-text);
}
.error-title { margin: 0; font-size: clamp(1.6rem, 5vw, 2.4rem); padding-bottom: 0; }
.error-text { margin: 0 0 12px !important; color: var(--muted); }

/* --- Werdegang --- */
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { margin-left: 8px; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--dim);
}

.dot.done { background: var(--accent); border-color: var(--accent); }
.dot.now  { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.step {
  position: relative;
  padding: 30px 16px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Verbindungslinie */
.step::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--border-strong);
}

.step.done::before { border-top: 1px solid var(--accent-line); }
.step:last-child::before { right: auto; width: 0; }

/* Punkt */
.step::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--tile);
  border: 1.5px solid var(--dim);
}

.step.done::after { background: var(--accent); border-color: var(--accent); }
.step.now::after {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2s infinite;
}

.step .when {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.step.done .when, .step.now .when { color: var(--accent-text); }

.step .what { font-weight: 600; line-height: 1.35; }
.step .where { font-size: 0.85rem; color: var(--muted); }
.step.next .what, .step.next .where { opacity: 0.75; }

/* ==========================================================
   Kontakt
   ========================================================== */
.contact { padding: 96px 0 0; }

.section-head { margin-bottom: 20px; }

.section-title {
  margin: 8px 0 0;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.tile-form { grid-column: span 2; }

/* Weitere Kontaktwege */
.tile-socials { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }

.social-list { list-style: none; margin: 0; padding: 0; }

.social-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, padding 0.2s;
}

.social-list li:last-child a { border-bottom: 0; }

.social-list .arrow {
  width: 18px;
  height: 18px;
  color: var(--dim);
  transition: transform 0.25s, color 0.25s;
}

.social-list a:hover { color: var(--accent-text); padding-left: 4px; }
.social-list a:hover .arrow { color: var(--accent-text); transform: translate(3px, -3px); }

/* ==========================================================
   Kontaktformular
   ========================================================== */
.contact-form { display: grid; gap: 14px; padding: 26px; }
.contact-form .tile-head { margin-bottom: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { display: grid; gap: 6px; }

.field-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea { resize: vertical; min-height: 120px; }

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input.invalid, .field textarea.invalid { border-color: #e5484d; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-note { margin: 0; font-size: 0.8rem; color: var(--muted); }
.form-note a { color: var(--accent-text); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.form-actions .btn { border: 0; cursor: pointer; font-family: inherit; }
.form-actions .btn:disabled { opacity: 0.7; cursor: wait; }

.send-busy, .contact-form.busy .send-idle { display: none; }
.contact-form.busy .send-busy { display: inline; }

.form-status { margin: 0; font-size: 0.85rem; color: var(--muted); }
.form-status.ok { color: var(--accent-text); }
.form-status.err { color: #e5484d; }

/* ==========================================================
   Terminal-Modus (Easter Egg)
   ========================================================== */
.term-open {
  display: none;
  align-items: center;
  height: 24px;
  margin-right: 14px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.js .term-open { display: inline-flex; }
.term-open:hover, .term-open:focus-visible { color: var(--accent-text); border-color: var(--accent); }

/* Das Terminal bleibt auch im hellen Design dunkel */
.term {
  width: min(720px, calc(100% - 32px));
  height: min(460px, calc(100% - 64px));
  margin: auto;
  padding: 0;
  display: none;
  flex-direction: column;
  border: 1px solid rgba(255, 165, 61, 0.45);
  border-radius: 14px;
  background: #07070a;
  color: #d8d8dc;
  font-family: var(--mono);
  font-size: 0.85rem;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 165, 61, 0.08);
  overflow: hidden;
}

.term[open] { display: flex; animation: term-in 0.25s cubic-bezier(.2,.7,.2,1); }
.term::backdrop { background: rgba(5, 5, 6, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

@keyframes term-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #1d1d22;
  background: #0d0d11;
}

.term-dots { display: inline-flex; gap: 6px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a2a31; }
.term-dots i:first-child { background: #ffa53d; }
.term-title { flex: 1; color: #6f6f78; font-size: 0.75rem; }

.term-close {
  width: 26px;
  height: 26px;
  border: 1px solid #2a2a31;
  border-radius: 6px;
  background: transparent;
  color: #8b8b94;
  font: inherit;
  cursor: pointer;
}

.term-close:hover, .term-close:focus-visible { color: #ffa53d; border-color: #ffa53d; }
.term-close:focus-visible { outline-color: #ffa53d; }

.term-out {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 4px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.term-row { min-height: 1.6em; }
.term-row.ok { color: #ffa53d; }
.term-row.cmd { color: #ededee; }
.term-row.err { color: #ff7a6b; }
.term-row.typing::after,
.term-line::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: #ffa53d;
  animation: term-blink 1s steps(1) infinite;
}

.term-line { display: flex; align-items: center; gap: 8px; padding: 8px 16px 14px; }
.term-line::after { display: none; }
.term-prompt { color: #ffa53d; white-space: nowrap; }
.term-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #ededee;
  font: inherit;
  caret-color: #ffa53d;
  outline: none;
}

@keyframes term-blink { 50% { opacity: 0; } }

@media (max-width: 600px) {
  .term { height: calc(100% - 32px); font-size: 0.8rem; }
  .term-prompt { font-size: 0.72rem; }
}

/* ==========================================================
   Fußzeile
   ========================================================== */
footer {
  max-width: 1120px;
  margin: 96px auto 0;
  padding: 24px 20px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
}

footer p { margin: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent-text); }

/* ==========================================================
   Rechtstexte (datenschutz.html)
   ========================================================== */
.legal { max-width: 760px; }
.legal h1 { font-size: clamp(1.7rem, 7.5vw, 3.2rem); margin: 40px 0 28px; letter-spacing: -0.035em; line-height: 1.05; overflow-wrap: break-word; hyphens: auto; }
.legal .card {
  margin-bottom: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--tile-2), var(--tile));
}
.legal h2 { font-size: 1.1rem; margin: 0 0 10px; letter-spacing: -0.01em; }
.legal p, .legal li { color: var(--muted); }
.legal p { margin: 0 0 10px; }
.legal p:last-child { margin-bottom: 0; }
.legal ul { padding-left: 20px; margin: 0 0 10px; }
.legal a { color: var(--accent-text); }
.back-link { display: inline-block; margin-top: 12px; color: var(--muted) !important; text-decoration: none; }
.back-link:hover { color: var(--accent-text) !important; }
.muted-note { font-family: var(--mono); font-size: 0.75rem; color: var(--dim) !important; margin: 20px 0 0; }

/* ==========================================================
   Einblenden beim Scrollen
   ========================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1), border-color 0.25s;
  transition-delay: var(--delay, 0s);
}

.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pulse, .topology .flow path, .step.now::after,
  .backdrop::before, .backdrop::after, .term[open], .term-row.typing::after { animation: none; }
  * { transition-duration: 0s !important; }
}

/* ==========================================================
   Tablet und Handy
   ========================================================== */
@media (max-width: 900px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "intro  intro"
      "photo  time"
      "about  about"
      "skills skills"
      "projects projects"
      "career career"
      "subnet subnet"
      "garage garage";
  }
  .skill-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento.project-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "hero hero" "about about" "stack stack" "parts parts" "case case"; }
  .bento.project-bento.has-arch { grid-template-areas: "hero hero" "arch arch" "about about" "stack stack" "parts parts" "case case"; }
  .tile-intro { min-height: 360px; }
  .tile-photo { aspect-ratio: 4 / 5; min-height: 0; }
  .tile-garage { aspect-ratio: 16 / 9; min-height: 0; }
}

@media (max-width: 760px) {
  .topology { display: none; }
}

@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .logo-text, .nav-link { display: none; }
  .page, .legal { padding: 16px 16px 0; }
  .bento {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "photo" "about" "time" "skills" "projects" "career" "subnet" "garage";
  }
  .skill-groups { grid-template-columns: minmax(0, 1fr); }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .bento.project-bento { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "about" "stack" "parts" "case"; }
  .case-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .bento.project-bento.has-arch { grid-template-areas: "hero" "arch" "about" "stack" "parts" "case"; }
  .arch-wide { display: none; }
  .arch-tall { display: block; max-width: 420px; margin: 0 auto; }
  .project-hero { padding: 24px 20px; }
  .legend { display: none; }
  /* Zeitleiste senkrecht */
  .timeline { grid-template-columns: minmax(0, 1fr); }
  .step { padding: 0 0 22px 30px; }
  .step::before { top: 13px; bottom: 0; left: 6px; right: auto; border-top: 0; border-left: 1px dashed var(--border-strong); }
  .step.done::before { border-top: 0; border-left: 1px solid var(--accent-line); }
  .step:last-child::before { display: none; }
  .step:last-child { padding-bottom: 0; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .contact-form { padding: 20px; }
  .tile-intro { min-height: 0; padding: 24px 20px; gap: 36px; }
  .tile-photo { min-height: 0; aspect-ratio: 4 / 5; }
  .contact { padding-top: 72px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .tile-form { grid-column: auto; }
  footer { flex-direction: column; margin-top: 72px; }
  .tile-garage { aspect-ratio: 1 / 1; }
  .subnet-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subnet-result > div { padding: 10px 10px; }
  .subnet-result dd { font-size: clamp(0.72rem, 3.4vw, 0.95rem); white-space: nowrap; overflow-wrap: normal; }
}
