:root {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-soft: #151b23;
  --panel: #161b22;
  --panel-2: #0d1117;
  --border: #30363d;
  --border-soft: #21262d;
  --text: #f0f6fc;
  --muted: #8b949e;
  --blue: #4493f8;
  --green: #3fb950;
  --green-1: #0e4429;
  --green-2: #006d32;
  --green-3: #26a641;
  --green-4: #39d353;
  --purple: #a371f7;
  --shadow: rgba(1, 4, 9, .6);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --panel: #ffffff;
  --panel-2: #f6f8fa;
  --border: #d0d7de;
  --border-soft: #d8dee4;
  --text: #1f2328;
  --muted: #656d76;
  --blue: #0969da;
  --green: #1a7f37;
  --green-1: #aceebb;
  --green-2: #4ac26b;
  --green-3: #2da44e;
  --green-4: #116329;
  --purple: #8250df;
  --shadow: rgba(31, 35, 40, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; min-width: 320px; overflow: hidden; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 80% 40%, color-mix(in srgb, var(--purple) 13%, transparent), transparent 28%),
    radial-gradient(circle at 62% 72%, color-mix(in srgb, var(--blue) 10%, transparent), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  transition: background-color 200ms ease, color 200ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(color-mix(in srgb, var(--border) 28%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--border) 28%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  opacity: .42;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 75%, transparent);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
svg { display: block; }
::selection { background: var(--blue); color: white; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.page {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1440px, calc(100% - 48px));
  height: 100svh;
  margin: 0 auto;
  grid-template-rows: 64px minmax(0, 1fr) 82px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}

.brand, .header-actions { display: flex; align-items: center; }
.brand { gap: 10px; font-size: 14px; font-weight: 600; }
.brand svg { width: 27px; fill: currentColor; }
.header-actions { gap: 18px; }
.header-actions > a { color: var(--muted); font-family: var(--mono); font-size: 11px; transition: color 160ms ease; }
.header-actions > a:hover { color: var(--blue); }

.legal-nav { display: flex; gap: 14px; }
.legal-nav a { color: var(--muted); font-family: var(--mono); font-size: 11px; transition: color 160ms ease; }
.legal-nav a:hover, .legal-nav a[aria-current="page"] { color: var(--blue); }

.theme-toggle {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
  cursor: pointer;
}

.theme-toggle svg { width: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.3; }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

.hero {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, .9fr) minmax(480px, 1.1fr);
  align-items: center;
  gap: clamp(54px, 7vw, 120px);
  padding: clamp(28px, 6vh, 70px) 2vw;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow span { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 12%, transparent); animation: pulse 2.4s ease-in-out infinite; }

h1 {
  margin: 0 0 34px;
  font-size: clamp(62px, 7.4vw, 108px);
  font-weight: 650;
  letter-spacing: -.065em;
  line-height: .86;
}

h1 span {
  background: linear-gradient(90deg, var(--blue), var(--purple) 78%);
  background-clip: text;
  color: transparent;
}

.github-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--green) 65%, var(--border));
  border-radius: 6px;
  background: var(--green);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: filter 160ms ease, transform 160ms ease;
}

.github-button:hover { filter: brightness(1.08); transform: translateY(-2px); }
.github-button svg { width: 18px; fill: currentColor; }
.github-button span { margin-left: 5px; font-size: 15px; }

.activity-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 620px);
  justify-self: end;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 24px 70px var(--shadow), 0 0 0 1px rgba(255,255,255,.02) inset;
}

.card-glow { position: absolute; top: -120px; right: -80px; width: 300px; height: 300px; background: radial-gradient(circle, color-mix(in srgb, var(--purple) 25%, transparent), transparent 68%); pointer-events: none; }

.card-header {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 75%, transparent);
}

.repo-name { display: flex; min-width: 0; align-items: center; gap: 6px; color: var(--blue); font-size: 13px; }
.repo-name svg { width: 16px; flex: 0 0 auto; fill: var(--muted); }
.repo-name strong, .repo-name b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.repo-name span { color: var(--muted); }
.public-badge { padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 500; }

.card-body { position: relative; padding: clamp(18px, 3vh, 30px); }
.branch-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(16px, 2.5vh, 26px); }
.branch-row > span { display: flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-soft); color: var(--text); font: 600 11px var(--mono); }
.branch-row svg { width: 14px; fill: var(--muted); }
.branch-row small { color: var(--muted); font-size: 11px; }

.contribution-wrap { position: relative; }
.month-row { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 8px 2px; color: var(--muted); font-size: 9px; }
.contribution-grid { display: grid; grid-template-columns: repeat(18, 1fr); grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: clamp(3px, .45vw, 6px); }
.contribution-grid i { aspect-ratio: 1; border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 2px; background: color-mix(in srgb, var(--border-soft) 70%, transparent); opacity: 0; animation: square-in 380ms ease forwards, square-glow 5s ease-in-out infinite; }
.contribution-grid i[data-level="1"] { background: var(--green-1); }
.contribution-grid i[data-level="2"] { background: var(--green-2); }
.contribution-grid i[data-level="3"] { background: var(--green-3); }
.contribution-grid i[data-level="4"] { background: var(--green-4); }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.legend i { width: 9px; height: 9px; border: 1px solid var(--border-soft); border-radius: 2px; background: var(--panel-2); }
.legend i:nth-of-type(2) { background: var(--green-1); }
.legend i:nth-of-type(3) { background: var(--green-2); }
.legend i:nth-of-type(4) { background: var(--green-3); }
.legend i:nth-of-type(5) { background: var(--green-4); }

.commit-line { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 11px; margin-top: clamp(16px, 2.5vh, 27px); padding-top: clamp(14px, 2vh, 22px); border-top: 1px solid var(--border-soft); }
.commit-dot { width: 10px; height: 10px; border: 2px solid var(--purple); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--purple) 12%, transparent); }
.commit-line div { display: flex; flex-direction: column; gap: 2px; }
.commit-line strong { font-size: 12px; font-weight: 600; }
.commit-line small { color: var(--muted); font-size: 10px; }
.commit-line code { padding: 3px 7px; border-radius: 5px; background: color-mix(in srgb, var(--purple) 13%, transparent); color: var(--purple); font: 10px var(--mono); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, .55fr)) 1.35fr;
  border-top: 1px solid var(--border-soft);
}

.stats > * { display: flex; min-width: 0; align-items: center; margin: 0; padding: 0 24px; border-right: 1px solid var(--border-soft); }
.stats div { gap: 9px; }
.stats strong { font-size: 22px; letter-spacing: -.04em; }
.stats div > span { color: var(--muted); font-size: 10px; }
.stats p { justify-content: flex-end; gap: 8px; border-right: 0; overflow: hidden; color: var(--muted); font: 10px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; background: var(--green); border-radius: 50%; box-shadow: 0 0 8px color-mix(in srgb, var(--green) 60%, transparent); }

.error-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; overflow: auto; }
.error-panel { width: min(620px, 100%); padding: 60px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.error-code { color: var(--green); font: 600 12px var(--mono); }
.error-panel h1 { margin: 22px 0; font-size: clamp(54px, 10vw, 92px); letter-spacing: -.06em; }
.error-panel p { margin-bottom: 28px; color: var(--muted); }
.button { display: inline-flex; padding: 11px 15px; border-radius: 6px; background: var(--green); color: white; font-weight: 600; }

/* Legal pages (Impressum, Datenschutz) */
html.legal, html.legal body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
.legal-shell { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(920px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; }
.legal-shell .header { flex: 0 0 64px; }

.legal-intro { padding: clamp(40px, 9vh, 84px) 0 28px; }
.legal-intro .eyebrow { margin-bottom: 16px; }
.legal-intro h1 { margin: 0 0 14px; font-size: clamp(44px, 6.5vw, 72px); line-height: .95; }
.legal-intro p { max-width: 560px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.legal-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 24px 70px var(--shadow), 0 0 0 1px rgba(255,255,255,.02) inset;
}

.legal-tabs { display: flex; gap: 4px; padding: 0 12px; overflow-x: auto; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-soft) 75%, transparent); }
.legal-tabs a { display: flex; align-items: center; gap: 8px; padding: 14px 12px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; transition: color 160ms ease, border-color 160ms ease; }
.legal-tabs a:hover { color: var(--text); border-bottom-color: var(--border); }
.legal-tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--purple); }
.legal-tabs svg { width: 16px; fill: currentColor; opacity: .8; }

.legal-body { padding: clamp(22px, 4vw, 44px); }
.legal-body section + section { margin-top: 30px; }
.legal-body h2 { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.legal-body h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
.legal-body p, .legal-body li, .legal-body address { color: var(--muted); font-size: 14px; font-style: normal; line-height: 1.7; }
.legal-body p, .legal-body address { margin: 0 0 12px; }
.legal-body ul { margin: 0 0 12px; padding-left: 22px; }
.legal-body li + li { margin-top: 2px; }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body a { color: var(--blue); overflow-wrap: anywhere; }
.legal-body a:hover { text-decoration: underline; }
.legal-body .legal-notice { padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--purple) 35%, var(--border)); border-radius: 6px; background: color-mix(in srgb, var(--purple) 7%, transparent); }
.legal-body .legal-notice p:last-child { margin-bottom: 0; }

.legal-toc { margin: 0 0 32px; padding: 16px 20px; border: 1px solid var(--border-soft); border-radius: 6px; background: color-mix(in srgb, var(--bg-soft) 60%, transparent); }
.legal-toc strong { display: block; margin-bottom: 8px; font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.legal-toc ol { columns: 2 220px; margin: 0; padding-left: 20px; }
.legal-toc li { font-size: 13px; }
.legal-toc a { color: var(--muted); }
.legal-toc a:hover { color: var(--blue); }

.legal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 36px 0 28px; color: var(--muted); font: 11px var(--mono); }
.legal-footer nav { display: flex; gap: 16px; }
.legal-footer a { transition: color 160ms ease; }
.legal-footer a:hover, .legal-footer a[aria-current="page"] { color: var(--blue); }

@keyframes pulse { 50% { opacity: .45; box-shadow: 0 0 0 9px color-mix(in srgb, var(--green) 4%, transparent); } }
@keyframes square-in { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
@keyframes square-glow { 0%, 94%, 100% { filter: brightness(1); } 97% { filter: brightness(1.7); } }

@media (max-width: 860px) {
  .page { width: calc(100% - 28px); grid-template-rows: 56px minmax(0, 1fr) 72px; }
  .brand span, .header-actions > a { display: none; }
  .header-actions { gap: 14px; }
  .legal-nav { gap: 12px; }
  .legal-shell { width: calc(100% - 28px); }
  .legal-shell .header { flex-basis: 56px; }
  .legal-intro { padding: 32px 0 20px; text-align: left; }
  .legal-intro .eyebrow { justify-content: flex-start; }
  .legal-intro h1 { line-height: .95; }
  .legal-tabs { padding: 0 6px; }
  .legal-footer { justify-content: center; text-align: center; }
  .hero { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 24px; padding: 22px 0; }
  .hero-copy { text-align: center; }
  .eyebrow { justify-content: center; margin-bottom: 12px; font-size: 8px; }
  h1 { margin-bottom: 18px; font-size: clamp(48px, 13.5vw, 70px); line-height: .82; }
  .github-button { min-height: 38px; padding: 0 13px; font-size: 12px; }
  .activity-card { width: min(100%, 500px); height: 100%; min-height: 235px; max-height: 330px; justify-self: center; }
  .card-header { min-height: 44px; padding: 0 14px; }
  .card-body { padding: 14px 16px; }
  .branch-row { margin-bottom: 11px; }
  .contribution-grid { gap: 3px; }
  .commit-line { margin-top: 10px; padding-top: 10px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats > * { justify-content: center; padding: 0 8px; }
  .stats p { display: none; }
  .stats > :nth-child(3) { border-right: 0; }
  .stats strong { font-size: 18px; }
  .stats div > span { font-size: 8px; }
}

@media (max-height: 720px) and (max-width: 860px) {
  .page { grid-template-rows: 50px minmax(0, 1fr) 62px; }
  .hero { gap: 14px; padding: 14px 0; }
  .eyebrow { margin-bottom: 8px; }
  h1 { margin-bottom: 12px; font-size: clamp(42px, 12vw, 58px); }
  .activity-card { min-height: 205px; }
  .card-header { min-height: 38px; }
  .card-body { padding: 10px 14px; }
  .branch-row { margin-bottom: 7px; }
  .legend { margin-top: 5px; }
  .commit-line { margin-top: 7px; padding-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
