/* KZG Software – Stylesheet
   Ein einzelnes Stylesheet, keine Abhängigkeiten, kein Build-Schritt. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-subtle: #f6f7f8;
  --bg-inset: #f0f1f3;
  --border: #e3e5e8;
  --border-strong: #d0d3d7;
  --text: #1b1d1f;
  --text-muted: #5b6167;
  --text-faint: #868d94;
  --link: #1f5fd6;
  --link-hover: #1a4fb4;
  --accent-bg: #eef3fd;
  --code-bg: #f2f3f5;

  --maxw: 1080px;
  --radius: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #16181a;
  --bg-subtle: #1c1f22;
  --bg-inset: #202427;
  --border: #2b2f33;
  --border-strong: #3a3f44;
  --text: #e7e9ea;
  --text-muted: #a9afb5;
  --text-faint: #7d848b;
  --link: #6aa4ff;
  --link-hover: #8fbcff;
  --accent-bg: #1b2534;
  --code-bg: #202427;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181a;
    --bg-subtle: #1c1f22;
    --bg-inset: #202427;
    --border: #2b2f33;
    --border-strong: #3a3f44;
    --text: #e7e9ea;
    --text-muted: #a9afb5;
    --text-faint: #7d848b;
    --link: #6aa4ff;
    --link-hover: #8fbcff;
    --accent-bg: #1b2534;
    --code-bg: #202427;
  }
}

* { box-sizing: border-box; }

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

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

h1, h2, h3 { line-height: 1.25; font-weight: 640; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 .4rem; }
p { margin: 0 0 1rem; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1em .35em;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  color: var(--text);
  padding: .6rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: .925rem;
}
.nav a:hover { color: var(--text); background: var(--bg-inset); text-decoration: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { display: block; }

.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

.nav-toggle { display: none; }

/* Hero */
.hero {
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.hero .container { padding-top: 56px; padding-bottom: 56px; }
.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 1.5rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: .925rem;
  font-weight: 550;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--bg);
}
.btn:hover { text-decoration: none; border-color: var(--text-faint); }
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover { color: var(--bg); opacity: .9; }

/* Sections */
section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 28px; max-width: 60ch; }
.section-head p { color: var(--text-muted); margin: 0; }

/* Project cards */
.projects-status {
  margin: 0 0 20px;
  font-size: .875rem;
  color: var(--text-faint);
}
.projects-fallback {
  margin: 0;
  color: var(--text-muted);
  font-size: .95rem;
}
.projects { display: grid; gap: 20px; }
.project {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg);
}
.project-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.project-top h3 { margin: 0; }
.badge {
  font-size: .75rem;
  font-weight: 550;
  color: var(--text-muted);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  letter-spacing: .01em;
}
.project > p { color: var(--text-muted); margin-bottom: 14px; }

.meta { margin: 0 0 16px; display: grid; gap: 8px; }
.meta div { display: flex; gap: 8px; font-size: .9rem; }
.meta dt { color: var(--text-faint); min-width: 96px; flex-shrink: 0; }
.meta dd { margin: 0; color: var(--text); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .9rem;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.project-links a { display: inline-flex; align-items: center; gap: 5px; }

/* Open source list */
.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 40px;
}
.os-grid h3 { margin-bottom: .25rem; font-size: .975rem; }
.os-grid p { color: var(--text-muted); font-size: .925rem; margin: 0; }

/* Tech */
.tech-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
}
.tech-cols h3 { font-size: .95rem; margin-bottom: .5rem; }
.tech-cols ul { margin: 0; padding: 0; list-style: none; }
.tech-cols li {
  color: var(--text-muted);
  font-size: .925rem;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.tech-cols li:last-child { border-bottom: 0; }

/* Prose (Impressum / Datenschutz) */
.prose { max-width: 68ch; padding: 48px 0; }
.prose h1 { margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.15rem; margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose a { word-break: break-word; }

/* Footer */
.site-footer {
  background: var(--bg-subtle);
  border-bottom: 0;
  padding: 32px 0;
  font-size: .9rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .copyright { color: var(--text-faint); }
.site-footer .attribution {
  width: 100%;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* Mobile nav */
@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .nav {
    position: fixed;
    inset: 60px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; border-bottom: 1px solid var(--border); }
  .nav .icon-btn { margin-top: 12px; width: 100%; height: 40px; }
  .site-header { position: sticky; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  .container { padding: 0 18px; }
  section { padding: 44px 0; }
}
