/* Fonts */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Display face (Makushka Kontura, Peter Wiegel, SIL OFL; since 2026-11-13, replaced
   Nuernberg) — headings and the wordmark. Covers Latin-1 plus typographic quotes and dashes. */
@font-face {
  font-family: 'Makushka Kontura';
  src: url('/fonts/MakushkaKontura-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* weltsein, black and white (since 2026-11-29): ink on paper, 2px frames,
   4px offset block shadows, no rounding, no colour at all — the accent is
   ink itself. Hover, selection and the current page are ink blocks with
   paper text. */
:root {
  --ink: #1c241d;
  --paper: #faf9f7;
  --hard: 2px solid var(--ink);
  --thin: 1px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --bg-secondary: #f0eee9;
  --text-muted: #5c605c;
  --danger: #b02a2a;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-display: 'Makushka Kontura', Impact, 'Arial Narrow', sans-serif;
  --max-width: 760px;
  --gutter: clamp(1rem, 4vw, 3rem);
}
html.dark {
  --ink: #e4e6e2;
  --paper: #1a1b19;
  --bg-secondary: #252624;
  --text-muted: #9a9e99;
  --danger: #e06666;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0 !important; }
::selection { background: var(--ink); color: var(--paper); }

html { font-size: 19px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.0625rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--paper); color: var(--ink);
  border: var(--hard); box-shadow: var(--shadow);
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Type */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin-bottom: 0.5em;
}
h4, h5, h6 { font-family: var(--font-mono); font-weight: 700; margin-bottom: 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 2.7rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.35rem); }
p { margin-bottom: 1em; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3.5rem;
}
main.wide { max-width: 1240px; }
main.lists-page { max-width: 1100px; }

/* Header: wordmark, nav, controls in one row */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem clamp(1rem, 3vw, 2.5rem);
  flex-wrap: wrap;
  padding: 0.9rem var(--gutter);
  border-bottom: var(--hard);
}
.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.3rem);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.site-title span {
  display: inline-block;
  margin-left: 0.04em;
  padding: 0 0.12em;
  background: var(--ink);
  color: var(--paper);
  border: var(--hard);
  box-shadow: 3px 3px 0 var(--ink);
}
.site-title:hover { background: none; color: var(--ink); }
.site-title:hover span { background: var(--paper); color: var(--ink); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; margin-right: auto; }
.site-nav a {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border: 2px solid transparent;
}
.site-nav a[aria-current="page"] { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.site-nav a[aria-current="page"]:hover { box-shadow: none; }

.header-controls { display: flex; gap: 0.5rem; }
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  padding: 0.25rem 0.5rem;
  background: var(--paper);
  color: var(--ink);
  border: var(--hard);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--ink); color: var(--paper); }
.theme-toggle:active { transform: translate(4px, 4px); box-shadow: none; }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem var(--gutter);
  border-top: var(--hard);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.site-footer span { margin-right: auto; }

/* The mark (logo) sits on "über mich" in the corner right of the Impressum:
   top flush with "Impressum", bottom flush with the "Datenschutzerklärung"
   heading (measured: ~15.6rem high on wide screens, ~13.7rem on tablets).
   It always leaves ~13rem for the text beside it, so on phones it only
   reaches the e-mail line (~9.8rem). */
.about-mark {
  float: right;
  width: min(15.3rem, calc(100% - 13rem));
  aspect-ratio: 697 / 707;
  margin: 0 0 1rem 1.25rem;
  background: var(--ink);
  -webkit-mask: url('/images/logo.svg') center / contain no-repeat;
  mask: url('/images/logo.svg') center / contain no-repeat;
}
@media (max-width: 1199px) {
  /* the headings grow with the viewport here (3vw), so the mark does too */
  .about-mark { width: min(158px + 11.65vw, 15.3rem, calc(100% - 13rem)); }
}
@media (max-width: 900px) {
  .about-mark { width: min(13.4rem, calc(100% - 13rem)); }
}
@media (max-width: 600px) {
  .about-mark { width: min(9.6rem, calc(100% - 13rem)); }
}
.home-projects h1 { margin-bottom: 1rem; }

/* Project cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}
.card {
  display: flex;
  flex-direction: column;
  border: var(--hard);
  box-shadow: var(--shadow);
  background: var(--paper);
}
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0.95rem 0.9rem;
}
.card-body h2 { font-size: 1.45rem; margin-bottom: 0.3rem; }
.card-body h2 a { text-decoration: none; }
.card-body p { font-size: 0.82rem; line-height: 1.5; margin-bottom: 0.7rem; }
.card-body .card-meta {
  margin: auto 0 0;
  padding-top: 0.55rem;
  border-top: var(--thin);
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.card-meta a { color: var(--ink); }

/* Links & lists: collapsible lists stacked top to bottom */
.lists { display: flex; flex-direction: column; gap: 1.1rem; }
.list { border: var(--hard); box-shadow: var(--shadow); background: var(--paper); }
.list summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.2;
  user-select: none;
}
.list summary::-webkit-details-marker { display: none; }
.list summary::before {
  content: '+';
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border: var(--hard);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1;
}
.list[open] > summary::before { content: '−'; }
.list summary:hover { background: var(--ink); color: var(--paper); }
.list summary:hover::before, .list summary:hover .list-count { border-color: var(--paper); }
.list[open] > summary { border-bottom: var(--hard); }
.list-title { flex: 1; }
/* A list heading that is a link: keeps the summary's colours, the link
   itself becomes the block on hover. */
.list-title a { color: inherit; }
.list-title a::after { content: ' ↗'; font-family: var(--font-mono); font-size: 0.6em; }
.list-title a[href^="/"]::after { content: ''; }
.list summary:hover .list-title a:hover { background: var(--paper); color: var(--ink); }
.list-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.05rem 0.4rem;
  border: var(--thin);
}
.list-entries { list-style: none; }
.list-entries li { border-bottom: var(--thin); }
.list-entries li:last-child { border-bottom: none; }
.list-entries > li > a, .list-entries > li > span { display: block; padding: 0.45rem 0.9rem 0.45rem 3.15rem; }
.list-entries a::after { content: ' ↗'; font-family: var(--font-mono); font-size: 0.75em; }
.list-entries a[href^="/"]::after { content: ''; }
.list-empty { padding: 0.45rem 0.9rem 0.45rem 3.15rem; margin: 0; color: var(--text-muted); }

/* A list inside a list: framed, no shadow, a step in */
.list .list { margin: 0.75rem 0.9rem 0.9rem 2.25rem; box-shadow: none; }
.list-entries + .list { margin-top: 0.9rem; }
.list .list summary { font-size: 1.15rem; }
.list .list .list-entries > li > a, .list .list .list-entries > li > span,
.list .list .list-empty { padding-left: 2.9rem; }

/* Article text */
.prose h2, .prose h3, .prose h4 { margin-top: 1.5em; }
.prose h1.visually-hidden + * { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.5em; }
.prose li { margin-bottom: 0.25em; }
.prose code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-secondary); padding: 0.1em 0.3em; }
.prose blockquote { border-left: 6px solid var(--ink); padding-left: 1rem; margin: 1em 0; }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: none; border-top: var(--thin); margin: 2em 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  .site-nav { order: 3; width: 100%; margin-right: 0; margin-left: -0.5rem; }
  .header-controls { margin-left: auto; }
  .list .list { margin-left: 0.9rem; }
  .list-entries > li > a, .list-entries > li > span, .list-empty,
  .list .list .list-entries > li > a, .list .list .list-entries > li > span { padding-left: 0.9rem; }
}
