/* Fonts: lokal gehostet (DSGVO), Lizenzen unter assets/fonts/licenses */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/fraunces-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  /* Grundfarben Blau, nur hier als Hex-Wert */
  --blue: #1E5A8A;
  --blue-light: #8FB4D3;  /* #1E5A8A zu 55 % mit Weiss gemischt */

  --bg: #F7F6F2;
  --ink: #17181A;
  --body: #3A3C40;
  --muted: #5B5E63;
  --line: #DAD8D2;
  --rule: #17181A;
  --card: #FFFFFF;
  --inset: #F7F6F2;
  --node-border: #C9C7C0;
  --connector: #8A8D92;
  --btn-bg: #17181A;
  --btn-fg: #F7F6F2;
  --accent: var(--blue);
  --on-accent: #FFFFFF;
  --contact-bg: #17181A;
  --contact-fg: #F7F6F2;
  --contact-muted: #C9CACD;
  --contact-line: #34363A;
  --contact-btn-bg: #F7F6F2;
  --contact-btn-fg: #17181A;
  --contact-accent: var(--blue-light);
  --outline: #5B5E63;
  --footer-muted: #A9ABAF;
  --node-dc: color-mix(in srgb, var(--accent) 9%, var(--card));
  --node-hub: var(--accent);
  --logo-tile: #17181A;
  --logo-chevron: var(--blue-light);
  --logo-bar: #F7F6F2;
  --path-active: #2E7D4F;
  --path-failed: #B3261E;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1120px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121315;
  --ink: #ECEAE5;
  --body: #C4C5C8;
  --muted: #9A9DA2;
  --line: #2C2E32;
  --rule: #ECEAE5;
  --card: #1B1C1F;
  --inset: #121315;
  --node-border: #3A3D42;
  --connector: #6E7177;
  --btn-bg: #ECEAE5;
  --btn-fg: #121315;
  --accent: var(--blue-light);
  --on-accent: #121315;
  --contact-bg: #0A0B0C;
  --contact-fg: #ECEAE5;
  --contact-muted: #B5B7BB;
  --contact-line: #26282B;
  --contact-btn-bg: #ECEAE5;
  --contact-btn-fg: #0A0B0C;
  --contact-accent: var(--blue-light);
  --outline: #4A4D52;
  --footer-muted: #9A9DA2;
  --node-dc: color-mix(in srgb, var(--accent) 8%, var(--card));
  --node-hub: var(--accent);
  --logo-tile: #ECEAE5;
  --logo-chevron: var(--blue);
  --logo-bar: #121315;
  --path-active: #7CC49B;
  --path-failed: #F28B82;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}

a { color: inherit; }
a:hover { opacity: .75; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; top: 8px; padding: 10px 16px; background: var(--btn-bg); color: var(--btn-fg); border-radius: 999px; z-index: 10; }
.skip-link:focus { left: 16px; }

.container { max-width: var(--container); margin: 0 auto; padding-inline: 32px; }
@media (max-width: 520px) { .container { padding-inline: 20px; } }

.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); font-weight: 500; }

/* Header */
.site-header .container { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; padding-block: 28px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; display: block; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-mark .bm-bg { fill: var(--logo-tile); }
.brand-mark .bm-fg { fill: none; stroke: var(--logo-bar); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .bm-chev { stroke: var(--logo-chevron); }
.brand-name { font-weight: 600; font-size: 16px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; font-size: 15px; margin-left: auto; }
.header-tools { display: flex; align-items: center; gap: 12px; }
/* Schmale Bildschirme: Logo und Sprache/Darkmode in der ersten Zeile, Navigation darunter */
@media (max-width: 1000px) {
  .site-header .container { row-gap: 12px; }
  .header-tools { order: 2; margin-left: auto; }
  .site-nav { order: 3; flex-basis: 100%; margin-left: 0; gap: 8px 20px; }
}
/* Smartphone: Text-Link zum Werdegang ausblenden, der Button daneben fuehrt zum selben Abschnitt.
   So passen Navigation und Button in eine Zeile. */
@media (max-width: 600px) {
  .site-nav { gap: 8px 12px; font-size: 14px; }
  .site-nav a[href="#werdegang"]:not(.btn-pill), .site-nav a[href="#experience"]:not(.btn-pill) { display: none; }
  .site-nav .btn-pill { padding: 8px 12px; }
}
.site-nav a { text-decoration: none; }
.btn-pill { display: inline-block; text-decoration: none; padding: 10px 18px; border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg); font-weight: 500; }
.theme-toggle { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.theme-toggle svg { width: 20px; height: 20px; }
.lang-switch { text-decoration: none; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: .04em; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-end; padding-block: 96px 112px; }
.hero-main { flex: 999 1 560px; min-width: 0; }
.eyebrow { margin: 0 0 28px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em; color: var(--accent); }
/* Shell-Prompt-Elemente: Praefix in Akzentfarbe, Befehl gedaempft */
.prompt-line { margin: 0 0 6px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em; color: var(--muted); }
.prompt { color: var(--accent); }
.nowrap { white-space: nowrap; }
.hero h1 .cursor { display: inline-block; width: .5em; height: 4px; margin-left: .08em; background: var(--accent); vertical-align: baseline; }
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .cursor { animation: cursor-blink 1.1s steps(1, end) infinite; }
}
@keyframes cursor-blink { 50% { opacity: 0; } }
.hero h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(44px, 6.5vw, 78px); line-height: 1.02; letter-spacing: -.02em; }
.lead { margin: 32px 0 0; max-width: 600px; font-size: 20px; line-height: 1.55; color: var(--body); }
.keywords { margin: 36px 0 0; font-size: 15px; color: var(--muted); }
.hero-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 32px; }
.portrait { display: block; }
.portrait img { display: block; width: 100%; max-width: 280px; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
@media (min-width: 901px) { .hero-side { max-width: 300px; } .portrait img { max-width: none; } }
:root[data-theme="dark"] .portrait img { filter: brightness(.9); }
.facts { margin: 0; border-top: 1px solid var(--rule); font-size: 15px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }

/* Sections */
.section { border-top: 1px solid var(--line); }
.section > .container { padding-block: 96px; }
.section h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 44px; line-height: 1.15; letter-spacing: -.01em; }
.section-head { display: flex; flex-wrap: wrap; gap: 16px 48px; align-items: baseline; justify-content: space-between; margin-bottom: 56px; }
.section-head p { margin: 0; max-width: 420px; color: var(--muted); font-size: 16px; }

/* Projects */
.projects { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 1080px) {
  .projects { grid-template-columns: repeat(3, 1fr); }
  .projects > .project { padding: 32px; }
  /* Einheitliche Karten: Label, Titel, drei Abschnitte und Tags stehen ueber alle Karten auf gleicher Hoehe */
  .projects > .project { display: grid; grid-row: span 6; grid-template-rows: subgrid; row-gap: 20px; }
  .projects > .project dl { grid-row: span 3; display: grid; grid-template-rows: subgrid; row-gap: 14px; }
  .projects > .project .tags { margin-top: 0; align-self: end; }
}
.project-wide { margin-top: 24px; }
.project-wide > p:not(.tags):not(.project-label) { max-width: 720px; }
.project { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 36px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 520px) { .project { padding: 26px; } }
.project-label { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.project h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 28px; line-height: 1.2; }
.project p { margin: 0; font-size: 16px; color: var(--body); }
.project dl { margin: 0; display: flex; flex-direction: column; gap: 14px; font-size: 16px; }
.project dt { font-weight: 600; }
.project dd { margin: 2px 0 0; color: var(--body); }
.project .tags { margin-top: auto; padding-top: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.project .tags span { white-space: nowrap; }

/* Interaktives Netzwerkdiagramm (Projekt 04, volle Breite unter dem Projekt-Grid) */
.topo-figure { margin: 0; padding: 24px; border-radius: 12px; background: var(--inset); }
.topo-stage { position: relative; max-width: 760px; margin: 0 auto; }
.topo-svg { display: block; width: 100%; height: auto; }
.t-frame { fill: none; stroke: var(--node-border); stroke-width: 1.5; stroke-dasharray: 6 5; }
.t-frame-label { font-family: var(--font-mono); font-size: 13px; fill: var(--muted); }
.t-mesh-label { font-family: var(--font-mono); font-size: 12px; fill: var(--muted); }
.t-mesh-label.lbl-short { display: none; }
.t-halo { paint-order: stroke; stroke: var(--inset); stroke-width: 8px; stroke-linejoin: round; }
.t-line { stroke: var(--connector); stroke-width: 1.5; fill: none; }
.t-backup { stroke-dasharray: 6 5; }
.t-primary.is-failed { stroke: var(--path-failed); stroke-dasharray: 1.5 4; stroke-linecap: round; }
.t-active { fill: none; stroke: var(--path-active); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0.1 7; }
@media (prefers-reduced-motion: no-preference) {
  .t-active { animation: topo-flow 0.9s linear infinite; }
}
@keyframes topo-flow { to { stroke-dashoffset: -14.2; } }
.t-node rect { stroke-width: 1.5; }
.t-node text { font-family: var(--font-body); font-size: 15px; font-weight: 500; fill: var(--ink); }
.t-dc rect { fill: var(--node-dc); stroke: var(--node-border); }
.t-hub rect { fill: var(--node-hub); stroke: var(--node-hub); }
.t-hub text { fill: var(--on-accent); }
.t-hub .t-hub-title { font-size: 17px; font-weight: 600; }
.t-office rect { fill: var(--card); stroke: var(--node-border); }
.t-office.is-selected rect, .t-dc.is-selected rect { stroke: var(--ink); stroke-width: 3; }
.lbl-short { display: none; }
.topo-office-btn, .topo-dc-btn { position: absolute; margin: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; color: transparent; font-size: 1px; overflow: hidden; cursor: pointer; }
.topo-figure:not(.is-interactive) .topo-office-btn, .topo-figure:not(.is-interactive) .topo-dc-btn { display: none; }
.topo-office-btn:hover, .topo-dc-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.topo-office-btn:focus-visible, .topo-dc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.topo-figure figcaption { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.topo-controls { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.topo-status { margin: 0; flex: 1 1 320px; min-height: 2.6em; font-size: 15px; color: var(--body); }
.topo-fail { min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--outline); background: var(--card); color: var(--ink); font: 500 15px var(--font-body); cursor: pointer; }
.topo-fail[aria-pressed="true"] { border-color: var(--path-failed); color: var(--path-failed); }
.topo-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.topo-legend li { display: flex; align-items: center; gap: 8px; }
.topo-legend .sw { width: 28px; height: 0; border-top: 1.5px solid var(--connector); }
.topo-legend .sw-backup { border-top-style: dashed; }
.topo-legend .sw-active { border-top: 2.5px dotted var(--path-active); }

/* Mittlere Breiten: Kurznamen, damit die SVG-Texte lesbar bleiben */
@media (max-width: 820px) {
  .t-node .lbl-full, .t-mesh-label.lbl-full { display: none; }
  .t-mesh-label.lbl-short { display: inline; font-size: 20px; }
  .t-node .lbl-short { display: inline; font-size: 22px; font-weight: 600; }
  .t-frame-label { font-size: 20px; }
}
/* Unter 600px: Texte im SVG mindestens 11px, Status und Button untereinander */
@media (max-width: 600px) {
  .project-wide { padding: 20px 16px; }
  .topo-figure { padding: 8px; }
  .t-node .lbl-short, .t-frame-label, .t-mesh-label.lbl-short { font-size: 27px; }
  .topo-controls { flex-direction: column; align-items: stretch; }
  .topo-status { flex: none; }
  .topo-fail { width: 100%; }
}


/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 40px 48px; margin-top: 48px; }
.skill { border-top: 1px solid var(--rule); padding-top: 16px; }
.skill h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.skill p { margin: 0; font-size: 16px; color: var(--body); }

/* Timeline */
.career { display: flex; flex-wrap: wrap; gap: 56px; }
.career-main { flex: 999 1 560px; min-width: 0; }
.career-main h2 { margin-bottom: 40px; }
.cmd-label { margin: 0 0 12px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
/* Werdegang als git log: Raster aus Hash | Zeitraum | Eintrag, Badge unter dem Hash */
.timeline li { display: grid; grid-template-columns: auto 132px minmax(0, 1fr); column-gap: 24px; row-gap: 4px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline li > .hash { grid-column: 1; grid-row: 1; }
.timeline li > .period { grid-column: 2; grid-row: 1; }
.timeline li > .entry { grid-column: 3; grid-row: 1 / span 2; }
@media (max-width: 600px) {
  .timeline li { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; }
  .timeline li > .entry { grid-column: 1 / -1; grid-row: auto; margin-top: 6px; }
}
.timeline .hash { font-family: var(--font-mono); font-size: 14px; color: var(--accent); padding-top: 3px; }
.timeline .period { font-family: var(--font-mono); font-size: 14px; color: var(--muted); padding-top: 3px; }
.timeline .entry { min-width: 0; }
.timeline .role { margin: 0; font-weight: 600; }
.timeline li > .head-row { grid-column: 1 / span 2; grid-row: 2; margin: -2px 0 0 -8px; }
@media (max-width: 600px) { .timeline li > .head-row { grid-column: 1 / -1; } }
.head-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 500; white-space: nowrap; }
.timeline .org { margin: 2px 0 0; color: var(--muted); font-size: 16px; }
.certs { flex: 1 1 280px; }
.certs h3 { margin: 0 0 24px; padding-top: 18px; font-size: 16px; font-weight: 600; }
.certs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; font-size: 16px; }
.certs .year { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

/* Contact */
.contact { background: var(--contact-bg); color: var(--contact-fg); }
.contact .container.inner { padding-block: 112px 96px; }
.contact h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(40px, 6vw, 72px); line-height: 1.05; letter-spacing: -.02em; }
.contact p { margin: 24px 0 0; max-width: 560px; font-size: 19px; color: var(--contact-muted); }
.contact .ping-out { margin: 24px 0 0; font-family: var(--font-mono); font-size: 14px; line-height: 1.7; color: var(--contact-muted); }
.contact .ping-out p { margin: 0; max-width: none; font-size: inherit; overflow-wrap: anywhere; }
.contact .ping-out .prompt { color: var(--contact-accent); }
.contact-actions { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 16px; }
.btn-light { text-decoration: none; padding: 16px 26px; border-radius: 999px; background: var(--contact-btn-bg); color: var(--contact-btn-fg); font-weight: 600; font-size: 16px; }
.btn-outline { text-decoration: none; padding: 16px 26px; border-radius: 999px; border: 1px solid var(--outline); color: var(--contact-fg); font-weight: 500; font-size: 16px; }
.site-footer { border-top: 1px solid var(--contact-line); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; padding-block: 24px 40px; font-size: 14px; color: var(--footer-muted); }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { color: var(--contact-muted); }

/* Legal pages */
.legal { padding-block: 72px 112px; max-width: 760px; }
.legal h1 { margin: 0 0 32px; font-family: var(--font-display); font-weight: 500; font-size: clamp(36px, 5vw, 56px); line-height: 1.1; }
.legal h2 { margin: 40px 0 12px; font-size: 20px; font-weight: 600; }
.legal p, .legal li { color: var(--body); }
.placeholder { background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 0 4px; border-radius: 3px; }

/* Kontakt-Ueberschrift: hervorgehobenes Wort ("anpingen" / "ping") */
.contact .ping { color: var(--contact-accent); }

/* Nur fuer Screenreader sichtbar */
.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; }
