/* 8ib – Das Etikett im Buchdeckel */

@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-latin-opsz-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Farben (Palette 2: Petrol auf Papier) */
  --papier: #f7f5f0;
  --flaeche: #ebe7de;
  --folie: rgba(235, 231, 222, 0.62);
  --tinte: #1b1d1f;
  --leise: #57554f;
  --alu: #9a9c9a;
  --kante: #d9d4c8;
  --petrol: #0b5d73;
  --petrol-dunkel: #084656;

  /* Schriften */
  --kopf: "Jost", "Futura", system-ui, sans-serif;
  --text: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Maße */
  --rand: clamp(16px, 5vw, 72px);
  --lesefeld-breite: 300px;
  --spalte-luecke: clamp(32px, 4vw, 64px);
  --abschnitt-luecke: clamp(72px, 9vw, 128px);
  --etikett-radius: 22px;
  --etikett-innen: clamp(28px, 6vw, 96px);
  --kopf-hoehe: 72px;

  /* Typografie */
  --h1-groesse: clamp(3rem, 1.6rem + 5.4vw, 6rem);
  --h1-breite: 11ch;
  --h2-groesse: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  --h3-groesse: clamp(1.3rem, 1.15rem + 0.6vw, 1.65rem);
  --text-groesse: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --einleitung-groesse: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);

  /* Bewegung */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--kopf-hoehe) + 24px); scrollbar-color: var(--alu) var(--papier); }
body { min-height: 100vh; display: flex; flex-direction: column; margin: 0; background: var(--papier); color: var(--tinte); font-family: var(--text); font-size: var(--text-groesse); line-height: 1.6; font-optical-sizing: auto; text-rendering: optimizeLegibility; }
::selection { background: var(--petrol); color: var(--papier); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--petrol); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--petrol-dunkel); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--kopf); font-weight: 500; line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
p, li, dd, summary { text-wrap: pretty; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.sprung { position: absolute; left: 16px; top: -60px; background: var(--tinte); color: var(--papier); padding: 10px 16px; z-index: 50; font-family: var(--kopf); }
.sprung:focus { top: 12px; }

/* Kopf und Navigation */
.kopf { position: sticky; top: 0; z-index: 20; background: var(--papier); border-bottom: 1px dashed var(--alu); }
.kopf-innen { max-width: 1440px; margin: 0 auto; padding: 0 var(--rand); height: var(--kopf-hoehe); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { color: var(--tinte); display: inline-flex; }
.logo svg { height: 30px; width: auto; }
.navigation ul { list-style: none; margin: 0; padding: 0; }
.navigation > ul { display: flex; gap: clamp(18px, 2.4vw, 36px); align-items: center; }
.navigation a { font-family: var(--kopf); font-size: 1.0625rem; color: var(--tinte); text-decoration: none; padding: 8px 0; }
.navigation a:hover, .navigation a[aria-current] { color: var(--petrol); }
.navigation a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
.nr { font-family: var(--mono); font-size: 0.72em; color: var(--leise); margin-right: 0.5em; letter-spacing: 0; font-weight: 400; }
.hat-unter { position: relative; }
.unter { position: absolute; left: -18px; top: 100%; min-width: 230px; background: var(--papier); border: 1px solid var(--kante); border-radius: 10px; padding: 10px 18px; box-shadow: 0 12px 28px -12px rgba(27, 29, 31, 0.25); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s; }
.hat-unter:hover .unter, .hat-unter:focus-within .unter { opacity: 1; visibility: visible; transform: none; }
.unter a { display: block; padding: 6px 0; font-size: 1rem; }
.menue-knopf { display: none; }

main { flex: 1 0 auto; }

/* Bahn: Inhalt links, Lesefeld rechts */
.bahn { max-width: 1440px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) var(--rand) var(--abschnitt-luecke); display: grid; grid-template-columns: minmax(0, 1fr) var(--lesefeld-breite); gap: var(--spalte-luecke); align-items: start; }
.ohne-lesefeld { grid-template-columns: minmax(0, 1fr); }
.bahn-inhalt { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--abschnitt-luecke); }

/* Etikett mit Antennenspule */
.etikett { position: relative; background: var(--folie); border: 1px solid var(--kante); border-radius: var(--etikett-radius); padding: var(--etikett-innen); isolation: isolate; }
/* gestanzte Kante: Schnittlinie knapp innerhalb des Rands */
.etikett::before { content: ""; position: absolute; inset: 7px; border: 1px dashed var(--kante); border-radius: calc(var(--etikett-radius) - 6px); pointer-events: none; z-index: -1; }
.spule { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.spule i { position: absolute; border: 1.5px solid var(--alu); }
.spule i:nth-child(1) { inset: 18px; border-radius: 16px; }
.spule i:nth-child(2) { inset: 28px; border-radius: 13px; }
.spule i:nth-child(3) { inset: 38px; border-radius: 10px; }
.js .spule { clip-path: inset(100% 100% 0 0 round var(--etikett-radius)); transition: clip-path 1.4s var(--ease) 0.15s; }
.js .spule.an { clip-path: inset(0 0 0 0 round var(--etikett-radius)); }

.einstieg { min-height: min(640px, calc(100svh - var(--kopf-hoehe) - 72px)); display: flex; flex-direction: column; justify-content: center; }
.gruss { font-family: var(--kopf); font-size: clamp(1.2rem, 1rem + 0.6vw, 1.5rem); color: var(--leise); margin-bottom: 0.4em; }
.einstieg h1 { font-size: var(--h1-groesse); line-height: 0.98; letter-spacing: -0.025em; max-width: var(--h1-breite); margin-bottom: clamp(24px, 3vw, 40px); }
.einleitung { font-size: var(--einleitung-groesse); line-height: 1.45; max-width: 48ch; margin-bottom: clamp(28px, 3.5vw, 48px); }

/* Aktionen: der Knopf ist der Chip */
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin: 0; }
.knopf { display: inline-block; background: var(--petrol); color: var(--papier); font-family: var(--kopf); font-size: 1.125rem; font-weight: 500; text-decoration: none; padding: 15px 26px; border-radius: 3px; transition: background-color 0.2s var(--ease), transform 0.2s var(--ease); }
.knopf:hover { background: var(--petrol-dunkel); color: var(--papier); }
.knopf:active { transform: translateY(1px); }
.chip { position: relative; }
.chip::before { content: ""; position: absolute; top: 50%; right: 100%; width: calc(var(--etikett-innen) - 38px); height: 1.5px; background: var(--alu); }
.chip::after { content: ""; position: absolute; top: calc(50% - 6px); right: calc(100% + var(--etikett-innen) - 38px - 6px); width: 12px; height: 12px; background: var(--petrol); }
.textlink { font-family: var(--kopf); font-size: 1.0625rem; }

/* Abschnitte */
.abschnitt > h2 { font-size: var(--h2-groesse); margin-bottom: clamp(28px, 3.5vw, 48px); display: flex; align-items: baseline; gap: 0.2em; }
.abschnitt > h2 .nr { font-size: 0.42em; }
.abschnitt h3 { font-size: var(--h3-groesse); }

.leistungsliste { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--alu); }
.leistungsliste li { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 20px clamp(24px, 4vw, 64px); padding: clamp(24px, 3vw, 36px) 0; border-bottom: 1px dashed var(--alu); }
.leistungsliste p { max-width: 62ch; }

.erfahrung { background: var(--flaeche); border-radius: var(--etikett-radius); padding: var(--etikett-innen); }
.erfahrung-raster { display: grid; grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.foto { margin: 0; position: relative; }
.foto img { border-radius: 12px; aspect-ratio: 1; object-fit: cover; }
.foto::after { content: ""; position: absolute; inset: -10px; border: 1.5px solid var(--alu); border-radius: 18px; pointer-events: none; }
.erfahrung-text { font-size: var(--einleitung-groesse); line-height: 1.45; max-width: 44ch; margin-bottom: 1.4em; }
.zeitleiste { list-style: none; margin: 0; padding: 0; }
.zeitleiste li { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--kante); }
.jahr { font-family: var(--mono); font-size: 0.9375rem; color: var(--leise); padding-top: 0.2em; font-variant-numeric: tabular-nums; }

.vortragsliste { list-style: none; margin: 0 0 32px; padding: 0; }
.vortragsliste li { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 16px; padding: 18px 0; border-top: 1px solid var(--kante); }
.vortragsliste li:last-child { border-bottom: 1px solid var(--kante); }
.vortrag a { font-family: var(--kopf); font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.375rem); line-height: 1.3; color: var(--tinte); text-decoration-color: var(--alu); }
.vortrag a:hover { color: var(--petrol); text-decoration-color: currentColor; }
.mit { display: block; color: var(--leise); font-size: 0.95em; margin-top: 4px; }

.projektliste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
.projektliste article { border-top: 1px dashed var(--alu); padding-top: 22px; }
.projektliste h3 { margin-bottom: 12px; }

.fragenliste { border-top: 1px dashed var(--alu); }
.fragenliste details { border-bottom: 1px dashed var(--alu); }
.fragenliste summary { list-style: none; cursor: pointer; font-family: var(--kopf); font-size: var(--h3-groesse); line-height: 1.25; padding: 22px 48px 22px 0; position: relative; }
.fragenliste summary::-webkit-details-marker { display: none; }
.fragenliste summary::before, .fragenliste summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 18px; height: 1.5px; background: var(--tinte); transition: transform 0.25s var(--ease); }
.fragenliste summary::after { transform: rotate(90deg); }
.fragenliste details[open] summary::after { transform: rotate(0deg); }
.fragenliste summary:hover { color: var(--petrol); }
.fragenliste details p { padding: 0 48px 24px 0; max-width: 62ch; }

.kontakt h2 { margin-bottom: 20px; }
.mail { font-family: var(--kopf); font-weight: 500; hyphens: none; }
.mail-teil { white-space: nowrap; }
.kontakt-text { font-size: var(--einleitung-groesse); line-height: 1.45; max-width: 40ch; margin-bottom: clamp(28px, 3.5vw, 44px); }

/* Lesefeld */
.lesefeld { position: sticky; top: calc(var(--kopf-hoehe) + 24px); border-left: 1px solid var(--tinte); padding: 4px 0 4px 24px; font-family: var(--mono); font-size: 0.875rem; line-height: 1.4; max-height: calc(100vh - var(--kopf-hoehe) - 48px); overflow-y: auto; }
.lesefeld-kopf { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--leise); margin: 0 0 14px; }
.lesefeld-kopf-zwei { margin-top: 28px; }
.lesefeld ul, .lesefeld ol { list-style: none; margin: 0; padding: 0; }
.lesefeld-daten { margin-bottom: 18px; }
.daten-mobil { display: none; list-style: none; padding: 0; font-family: var(--mono); font-size: 0.875rem; line-height: 1.4; }
.zeile { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--kante); }
.zeile a { display: flex; align-items: baseline; gap: 10px; color: var(--tinte); text-decoration: none; width: 100%; }
.zeile a:hover { color: var(--petrol); }
.zeile span { color: var(--tinte); }
.zeile a span { color: var(--leise); }
.zeile b { margin-left: auto; font-weight: 400; color: var(--leise); text-align: right; }
.zeile i { flex: none; width: 10px; height: 10px; border: 1.5px solid var(--petrol); background: var(--petrol); transform: translateY(1px); transition: background-color 0.35s var(--ease); }
.js .lesefeld-abschnitte .zeile i { background: transparent; }
.js .lesefeld-abschnitte .zeile.gelesen i { background: var(--petrol); }
.lesefeld-abschnitte .zeile.aktuell a { color: var(--petrol); }
.zeile.ebene2 { padding-left: 20px; }
.lesefeld-seiten a { display: block; padding: 7px 0; color: var(--tinte); text-decoration: none; border-bottom: 1px solid var(--kante); }
.lesefeld-seiten a:hover, .lesefeld-seiten a[aria-current] { color: var(--petrol); }
.lesefeld-seiten a[aria-current]::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--petrol); margin-right: 10px; }

/* Textseiten (Bibcourse, Mailservice, Impressum) */
.pfad { font-family: var(--kopf); font-size: 1rem; color: var(--leise); margin-bottom: -40px; }
.pfad a { color: var(--leise); }
.text { max-width: 72ch; overflow-wrap: break-word; }
.text :is(h1, h2) { hyphens: auto; }
.text h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem); margin: 0 0 0.6em; letter-spacing: -0.02em; }
.text h2 { font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.25rem); margin: 1.8em 0 0.6em; }
.text h3 { font-size: var(--h3-groesse); margin: 1.6em 0 0.5em; }
.text h4 { font-size: 1.15rem; margin: 1.4em 0 0.5em; }
.text h1 a, .text h2 a, .text h3 a, .text h4 a { color: inherit; text-decoration: none; }
.text .toc-anchor, .text a[aria-label="Anchor"] { color: var(--alu); font-family: var(--mono); font-size: 0.6em; margin-left: 0.4em; opacity: 0; transition: opacity 0.2s; text-decoration: none; }
.text :is(h1, h2, h3, h4):hover .toc-anchor, .text :is(h1, h2, h3, h4):hover a[aria-label="Anchor"], .text .toc-anchor:focus-visible { opacity: 1; }
.text ul, .text ol { padding-left: 1.3em; margin: 0 0 1em; }
.text li { margin: 0.3em 0; }
.text li::marker { color: var(--leise); }
.text strong { font-weight: 650; }
.text code { font-family: var(--mono); font-size: 0.88em; background: var(--flaeche); padding: 0.1em 0.35em; border-radius: 3px; }
.text pre { font-family: var(--mono); font-size: 0.9rem; background: var(--flaeche); border: 1px solid var(--kante); border-radius: 10px; padding: 18px 20px; overflow-x: auto; }
.text pre code { background: none; padding: 0; }
.text table { border-collapse: collapse; width: 100%; margin: 1.2em 0 1.6em; font-size: 0.95em; display: block; overflow-x: auto; }
.text th, .text td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--kante); vertical-align: top; }
.text th { font-family: var(--kopf); font-weight: 500; border-bottom: 1.5px solid var(--tinte); }
.text td:first-child { font-family: var(--mono); font-size: 0.9em; color: var(--leise); white-space: nowrap; }
.text img { border: 1px solid var(--kante); border-radius: 8px; margin: 1em 0; background: #fff; }
.text a[rel="lightbox"] { display: inline-block; cursor: zoom-in; }
.text blockquote { margin: 1.4em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 1px solid var(--alu); color: var(--leise); }
.text hr { border: 0; border-top: 1px dashed var(--alu); margin: 2.5em 0; }
.text .page-toc { background: var(--flaeche); border-radius: 12px; padding: 18px 22px; margin: 0 0 2em; font-family: var(--kopf); }
.text .page-toc-titel { margin: 0 0 8px; font-size: 1rem; font-weight: 500; }
.text .page-toc ul { margin: 0; padding-left: 1.1em; }
.text .notices { border: 1px solid var(--kante); border-radius: 10px; padding: 14px 18px; margin: 1.2em 0; background: var(--flaeche); }

/* Fehlerseite */
.fehler h1 { font-size: var(--h2-groesse); margin-bottom: 20px; }

/* Fuß */
.fuss { background: var(--flaeche); border-top: 1px dashed var(--alu); }
.fuss-innen { max-width: 1440px; margin: 0 auto; padding: 40px var(--rand); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; }
.fuss-name { margin: 0; font-family: var(--kopf); color: var(--leise); }
.fuss-links { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.fuss-links a { font-family: var(--kopf); color: var(--tinte); }
.fuss-links a:hover { color: var(--petrol); }

/* Mittlere Breiten: Lesefeld wird schmaler Streifen */
@media (max-width: 1080px) {
  .bahn { grid-template-columns: minmax(0, 1fr); }
  .lesefeld { min-width: 0; order: -1; position: sticky; top: var(--kopf-hoehe); z-index: 10; margin: 0 calc(-1 * var(--rand)); padding: 10px var(--rand); border-left: 0; border-bottom: 1px solid var(--kante); background: var(--papier); max-height: none; overflow: visible; }
  .lesefeld-kopf, .lesefeld-seiten, .lesefeld-kopf-zwei { display: none; }
  .lesefeld-daten { display: flex; gap: 2px 18px; overflow-x: auto; scrollbar-width: none; margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px dashed var(--kante); }
  .seite-start .lesefeld-daten .zeile { white-space: nowrap; }
  /* Startseite: feste Daten scrollen mit, fest oben bleibt nur der Abschnittsstreifen */
  .seite-start .lesefeld .lesefeld-daten { display: none; }
  .seite-start .daten-mobil { display: flex; flex-wrap: wrap; overflow: visible; margin: 0 0 calc(24px - var(--abschnitt-luecke)); }
  .lesefeld-daten .zeile { border: 0; padding: 2px 0; gap: 8px; }
  .lesefeld-abschnitte { display: flex; gap: 6px 18px; overflow-x: auto; scrollbar-width: none; }
  .lesefeld-abschnitte .zeile { border: 0; padding: 4px 0; white-space: nowrap; }
  .lesefeld-abschnitte .zeile.ebene2 { display: none; }
  .bahn-text .lesefeld { display: none; }
  .bahn-text .lesefeld:has(.lesefeld-daten) { display: block; }
  .bahn-text .lesefeld-abschnitte { display: none; }
  .pfad { margin-bottom: -24px; }
}
@media (min-width: 1081px) {
  .bahn-text .text .page-toc { display: none; }
}

/* Handy */
@media (max-width: 760px) {
  :root { --kopf-hoehe: 60px; --etikett-radius: 16px; }
  .menue-knopf { display: inline-flex; align-items: center; gap: 10px; background: none; border: 1px solid var(--tinte); border-radius: 3px; padding: 8px 12px; font-family: var(--kopf); font-size: 1rem; color: var(--tinte); cursor: pointer; }
  .menue-striche { width: 16px; height: 10px; border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; position: relative; }
  .menue-striche::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid currentColor; transform: translateY(-50%); }
  .navigation { position: absolute; left: 0; right: 0; top: var(--kopf-hoehe); background: var(--papier); border-bottom: 1px dashed var(--alu); padding: 8px var(--rand) 20px; display: none; }
  .navigation.offen { display: block; }
  .navigation > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .navigation a { display: block; padding: 12px 0; font-size: 1.15rem; border-bottom: 1px solid var(--kante); }
  .unter { position: static; opacity: 1; visibility: visible; transform: none; border: 0; box-shadow: none; padding: 0 0 0 16px; min-width: 0; background: none; }
  .unter a { font-size: 1rem; }
  .spule i:nth-child(1) { inset: 10px; border-radius: 10px; }
  .spule i:nth-child(2) { inset: 16px; border-radius: 8px; }
  .spule i:nth-child(3) { inset: 22px; border-radius: 6px; }
  .etikett { padding: 40px 34px 36px; }
  .chip::before { width: 12px; }
  .chip::after { right: calc(100% + 6px); width: 10px; height: 10px; top: calc(50% - 5px); }
  .einstieg { min-height: 0; }
  .einstieg h1 { max-width: none; }
  .leistungsliste li, .erfahrung-raster, .projektliste { grid-template-columns: minmax(0, 1fr); }
  .foto { max-width: 280px; }
  .zeitleiste li, .vortragsliste li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .fuss-links { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .spule { clip-path: none; }
}
