/* ==========================================================================
   Leo Leifeld – Portfolio
   Farben aus dem Logo: Navy #15202B, Orange #C8501E / #E0662B, Creme #F4F1EA
   Standard ist das dunkle Theme; [data-theme="light"] auf <html> schaltet um.
   ========================================================================== */

/* Barlow (Logo-Schrift), lokal gehostet, Subset Latin + Latin-1 – SIL Open Font License, siehe /fonts/OFL.txt */
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-SemiBold.woff2") format("woff2"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-Bold.woff2") format("woff2"); font-weight: 700 900; font-style: normal; font-display: swap; }

:root {
  --navy: #15202b;
  --cream: #f4f1ea;
  --orange: #c8501e;
  --orange-bright: #e0662b;

  /* Dunkles Theme (Standard) */
  --bg: #15202b;
  --bg-alt: #111a23;
  --surface: #1b2834;
  --surface-2: #213040;
  --border: #2c3d4e;
  --grid: rgba(244, 241, 234, 0.045);
  --grid-strong: rgba(244, 241, 234, 0.08);
  --text: #f4f1ea;
  --text-muted: #aab4be;
  --accent: #e0662b;       /* Flächen, Linien, Deko */
  --accent-text: #ef7a43;  /* Text/Links auf --bg, AA-Kontrast */
  --accent-contrast: #15202b;
  --focus: #ffb38a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);

  --font-sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 4px;
  /* fluid: bis ~1420px volle Breite (80rem), darüber 90 % der Fensterbreite, höchstens 150rem */
  --maxw: min(max(80rem, 90vw), 150rem);
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 4rem;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f5f0;
  --bg-alt: #efece4;
  --surface: #ffffff;
  --surface-2: #f2efe8;
  --border: #d9d4c8;
  --grid: rgba(21, 32, 43, 0.05);
  --grid-strong: rgba(21, 32, 43, 0.09);
  --text: #15202b;
  --text-muted: #4d5966;
  --accent: #c8501e;
  --accent-text: #a8401a;
  --accent-contrast: #ffffff;
  --focus: #a8401a;
  --shadow: 0 1px 2px rgba(21, 32, 43, 0.06), 0 8px 24px rgba(21, 32, 43, 0.08);
  color-scheme: light;
}

/* ---------- Basis ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  /* Grundschrift wächst auf großen Screens mit: 16px bis ~1440px, ~17.7px bei 1920px, 20px bei 2560px.
     Alle Abstände sind in rem und skalieren mit. % statt px, damit Browser-Einstellungen greifen. */
  font-size: clamp(100%, 0.357vw + 0.679rem, 125%);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.6rem, 6vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.9rem); }

/* Logo-Typografie für Titel: Versalien, gesperrt, SemiBold; <span class="lt"> = Light (wie „LEO“ im Logo) */
h1, h2 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  line-height: 1.15;
  hyphens: manual;
}
.lt { font-weight: 300; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
p, li { text-wrap: pretty; }

a { color: var(--accent-text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

code, kbd, .mono { font-family: var(--font-mono); font-size: 0.9em; }

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

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header / Navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
/* Inline-SVG-Logo: Navy-Teile folgen --text (currentColor), Orange folgt --accent */
.brand { color: var(--text); }
.brand .logo { height: 2.1rem; width: auto; }
.logo-accent { fill: var(--accent); }

.nav-wrap { display: flex; align-items: center; gap: 0.25rem; }

.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; gap: 0.25rem;
}
.site-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  position: relative;
}
.site-nav a:hover { background: var(--surface); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: 0.2rem;
  height: 2px;
  background: var(--accent);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface); border-color: var(--border); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }

@media (max-width: 47.99rem) {
  .brand .logo { height: 1.8rem; }
  .nav-toggle { display: inline-grid; }
  .js .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 0.5rem var(--gutter) 1rem; }
  .site-nav a { padding: 0.75rem 0.5rem; font-size: 1.05rem; }
  .site-nav a[aria-current="page"]::after { left: 0; right: auto; top: 0.75rem; bottom: 0.75rem; width: 2px; height: auto; }
  /* ohne JS: Navigation als Zeile unter dem Logo */
  html:not(.js) .site-header .container { flex-wrap: wrap; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; padding: 0 0 0.5rem; }
}

/* ---------- Blueprint-Raster ---------- */

.blueprint {
  background-color: var(--bg-alt);
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

/* ---------- Bausteine ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 0.75rem;
}

/* Titel + Maßlinie als Einheit: Linie exakt so breit wie der Titel (wie im Logo).
   CSS-Fallback: fit-content; main.js misst die längste Textzeile nach und setzt die Breite genau. */
.title-block { width: fit-content; max-width: 100%; }
.title-block .dimension { max-width: none; width: 100%; }
.error-page .title-block { margin-inline: auto; }

/* Maßlinie wie im Logo: Linie mit Endstrichen */
.dimension {
  position: relative;
  height: 11px;
  max-width: 14rem;
  margin: 0 0 1.5rem;
  border: 0;
}
.dimension::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 5px;
  height: 1px;
  background: var(--accent);
}
.dimension::after {
  content: "";
  position: absolute;
  inset: 0;
  border-inline: 1px solid var(--accent);
}

.section { padding-block: clamp(3.5rem, 9vw, 6rem); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 70ch; margin-bottom: 2.5rem; }
.section-head p { color: var(--text-muted); }
.section-head .eyebrow { color: var(--accent-text); }
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 60ch; }
/* Fließtext immer auf lesbare Zeilenlänge begrenzen, egal wie breit der Container ist */
main p, .prose li, .legal li { max-width: 70ch; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 85%, var(--text)); text-decoration: none; }
/* Sekundär-Button: solide Fläche, klare Kontur; gleiche Höhe wie .btn (gleiches Padding, 1px Rand) */
.btn--ghost { background: var(--surface); color: var(--text); border-color: color-mix(in srgb, var(--text) 35%, var(--surface)); }
.btn--ghost:hover { background: var(--surface); color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
  background: var(--surface);
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.5rem;
  border-radius: 2px;
  border: 1px solid var(--accent);
  color: var(--accent-text);
}

/* Markierung für Platzhalter, die noch ersetzt werden müssen */
.placeholder {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px dashed var(--accent);
  padding: 0 0.3em;
  border-radius: 2px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 10vw, 7rem);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero .container {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 60rem) {
  .hero .container { grid-template-columns: 1.35fr 1fr; gap: clamp(3rem, 6vw, 8rem); }
}
/* Titelgröße folgt der Spaltenbreite (Container Query): längste Zeile ≈ 11.3em → 8.2cqi füllt ~93 % der Spalte */
.hero-text { container-type: inline-size; }
.hero-title { font-size: clamp(1.75rem, 8.2cqi, 6.5rem); line-height: 1.1; }
.hero-title .lt { display: block; }
.hero .lead { margin-bottom: 2rem; }

.spec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.spec-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.spec dl { margin: 0; padding: 0.5rem 1rem 1rem; }
.spec dl div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border);
}
.spec dl div:last-child { border-bottom: 0; }
.spec dt { color: var(--accent-text); }
.spec dd { margin: 0; color: var(--text); }

/* ---------- Über mich ---------- */

.about { display: grid; gap: 3rem; }
@media (min-width: 60rem) { .about { grid-template-columns: 1.2fr 1fr; } }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 0.5rem; bottom: 0.5rem;
  width: 1px;
  background: var(--border);
}
.timeline li { position: relative; padding: 0 0 1.5rem 2rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.45rem;
  width: 11px; height: 11px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}
.timeline .when { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-text); display: block; }
.timeline strong { display: block; }
.timeline span.what { color: var(--text-muted); font-size: 0.95rem; }

.facts { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.facts li { display: flex; gap: 0.75rem; }
.facts li::before {
  content: "";
  flex: none;
  width: 0.9rem; height: 0.9rem;
  margin-top: 0.4rem;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 2px 100% no-repeat;
}

.offbench { margin: 2rem 0 0; font-size: 0.95rem; color: var(--text-muted); }
.offbench .eyebrow { display: block; margin-bottom: 0.3rem; }

/* ---------- Maker ---------- */

.section--edge { border-block: 1px solid var(--border); }
/* Text links, Datenblatt „Maker-Stationen“ rechts (wie Über mich / Kontakt) */
.maker { display: grid; gap: 2rem 3rem; align-items: start; }
.maker .section-head { margin-bottom: 0; }
@media (min-width: 60rem) { .maker { grid-template-columns: 1fr 1.4fr; } }
.maker .spec dl div { grid-template-columns: 7rem 1fr; }
.maker .spec dd { font-family: var(--font-sans); font-size: 1rem; line-height: 1.5; }

/* ---------- Skills ---------- */

/* 6 Karten lückenlos, Umbruch nach verfügbarer Breite (Container Query, rem = Wurzelschrift):
   1 Spalte → ab 34rem 2 → ab 56rem 3 × 2 → ab 90rem 6 Spalten (Karte ≥ ~14rem, damit die längsten
   Tags wie „Baugruppenkonstruktion“ in eine Kartenbreite passen; Tags brechen nie um). */
.skills-wrap { container: skills / inline-size; }
.skills { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@container skills (min-width: 34rem) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container skills (min-width: 56rem) { .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container skills (min-width: 90rem) { .skills { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.skill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.skill h3 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; margin-bottom: 1rem; }
.skill h3 .num { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; color: var(--accent-text); }

/* ---------- Projektkarten ---------- */

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0; padding: 0;
}
@media (min-width: 640px)  { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card:focus-within { border-color: var(--accent); }
.card-media { aspect-ratio: 16 / 10; border-bottom: 1px solid var(--border); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.25rem; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.15rem; }
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a::after { content: ""; position: absolute; inset: 0; } /* ganze Karte klickbar */
.card-body p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.card-body .tags { margin-top: auto; padding-top: 0.5rem; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }

/* ---------- Bild-Platzhalter (technische Zeichnung) ---------- */

.ph {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.75rem;
  width: 100%; height: 100%;
  min-height: 8rem;
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px);
  background-size: 20px 20px;
}
.ph::before {
  content: "";
  position: absolute;
  inset: 0.6rem;
  border: 1px dashed var(--border);
  pointer-events: none;
}
.ph svg { width: 3rem; height: 3rem; color: var(--accent); }
.ph span { font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.4; word-break: break-all; }

/* ---------- Projekt-Detailseite ---------- */

.project-hero { padding-block: clamp(2.5rem, 7vw, 4.5rem); border-bottom: 1px solid var(--border); }
.breadcrumb { font-family: var(--font-mono); font-size: 0.8rem; margin-bottom: 1.5rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; color: var(--text-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; color: var(--border); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-text); }
.project-hero .tags { margin-top: 1.5rem; }

.project-layout { display: grid; gap: 3rem; }
@media (min-width: 60rem) {
  .project-layout { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
  .project-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}
.prose { max-width: 60rem; } /* Absätze selbst: 70ch (s. o.) */
.prose h2 { font-size: 1.3rem; margin-top: 2.75rem; display: flex; align-items: baseline; gap: 0.75rem; }
.prose h2:first-child { margin-top: 0; }
.prose h2 .num { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; color: var(--accent-text); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.specs { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
table.specs caption { text-align: left; padding: 0.75rem 1rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--surface); }
table.specs th, table.specs td { padding: 0.65rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
table.specs tr:last-child th, table.specs tr:last-child td { border-bottom: 0; }
table.specs th { width: 38%; font-weight: 500; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.85rem; }
table.specs tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface) 50%, transparent); }

.aside-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.aside-box + .aside-box { margin-top: 1rem; }
.aside-box h2 { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.75rem; }

.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); margin: 0; }
.gallery figure { margin: 0; }
.gallery .frame { aspect-ratio: 4 / 3; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery a { display: block; height: 100%; }
.gallery figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; }

.pager { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.pager a { display: block; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pager .next { text-align: right; grid-column: 2; }

/* Lightbox */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 95vw; max-height: 95vh; }
.lightbox::backdrop { background: rgba(10, 15, 20, 0.92); }
.lightbox img { max-width: 95vw; max-height: 88vh; width: auto; margin: 0 auto; }
.lightbox .icon-btn { position: fixed; top: 1rem; right: 1rem; color: #f4f1ea; background: rgba(21, 32, 43, 0.8); }

/* ---------- Kontakt ---------- */

.contact { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .contact { grid-template-columns: 1fr 1fr; align-items: start; } }
/* Profil-Links ohne aktive Einträge (alle auskommentiert) ausblenden */
.links:not(:has(li)) { display: none; }
.contact-mail { font-size: clamp(1.1rem, 3.5vw, 1.5rem); font-weight: 600; }
.contact-info { max-width: 36rem; }
@media (min-width: 60rem) { .contact-info { justify-self: end; width: 100%; } }
/* Profil-Links als weitere Datenblatt-Zeilen unter der Info */
.links { list-style: none; margin: 0 1rem 1rem; padding: 0.5rem 0 0; border-top: 1px solid var(--border); }
.links li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px dashed var(--border); }
.links li:last-child { border-bottom: 0; }
.links .label { color: var(--accent-text); }

/* ---------- Rechtstexte / 404 ---------- */

.legal { max-width: 70ch; }
.legal h2 { font-size: 1.3rem; margin-top: 2.5rem; text-transform: none; letter-spacing: 0; } /* lange Rechtstitel: normal lesbar */
.legal h3 { font-size: 1.05rem; margin-top: 1.75rem; }
.notice {
  padding: 1rem 1.25rem;
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.error-page { text-align: center; padding-block: clamp(4rem, 14vw, 9rem); }
.error-page .code { font-family: var(--font-mono); font-size: clamp(4rem, 18vw, 8rem); font-weight: 700; line-height: 1; color: var(--accent); margin: 0 0 1rem; }
.error-page .dimension { margin-inline: auto; }
.error-page .btn-row { justify-content: center; margin-top: 2rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: 2.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent-text); }
.site-footer .mono { font-size: 0.8rem; }

/* ---------- Druck ---------- */

@media print {
  .site-header, .site-footer, .theme-toggle, .pager, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}
