:root {
  --papier: #f6f3ec;
  --karte: #fffdf8;
  --tinte: #1d1b18;
  --grau: #6b665d;
  --linie: #e2dccf;
  --akzent: #b4361f;
  --luecke: #fff1b8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #151412;
    --karte: #1e1c19;
    --tinte: #ece7dd;
    --grau: #a39d92;
    --linie: #34312c;
    --akzent: #e0694f;
    --luecke: #4a3f12;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 16px 40px;
}
main.breit, footer.breit { max-width: 1040px; }

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 4px;
  padding: 40px 36px;
}
main > .karte:first-child, .kopf { border-top: 4px solid var(--akzent); }

h1, h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: 2.4rem; line-height: 1.1; margin: 0 0 8px; }
h2 {
  font-size: 0.8rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grau);
  margin: 36px 0 12px;
}
.teil > h2:first-child, .teil-inhalt > h2:first-child { margin-top: 0; }

.zeile { color: var(--akzent); font-weight: 500; margin: 0; }
.ganz { white-space: nowrap; }
p { margin: 0 0 14px; }
/* Blocksatz mit Silbentrennung (lang="de"), sonst reißen schmale Spalten große Lücken */
.karte p:not(.zeile) { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }

/* Kopf: Foto und Name nebeneinander, darunter Text und Kontakt */
.person { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.foto { flex: none; width: 112px; height: 112px; border-radius: 14px; object-fit: cover; background: var(--linie); }
.kopf .text { margin-bottom: 20px; }
.kopf .text p:last-child { margin-bottom: 0; }

/* Raster der Startseite (Leos Wunsch 29.10., wie die zwei Reiter auf dem Handy): ab 861 px zwei Spalten –
   links „Über mich“ und darunter die Stationen, rechts Projekt und Arbeitsproben. Die Stationen-Karte füllt links
   den Rest der Höhe, damit beide Spalten unten bündig abschließen. Bis 860 px untereinander mit zwei Reitern. */
.raster {
  display: grid; gap: 20px; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.75fr);
  grid-template-areas: "kopf arbeitsproben" "werdegang arbeitsproben"; grid-template-rows: auto 1fr;
}
.raster > .kopf { grid-area: kopf; }
.raster > #werdegang { grid-area: werdegang; }
.raster > #arbeitsproben { grid-area: arbeitsproben; }
@media (min-width: 861px) {
  .kopf .person { flex-direction: column; align-items: flex-start; gap: 18px; }
  .raster .stationen li { grid-template-columns: 1fr; gap: 0; }   /* schmale linke Spalte: Datum über der Stelle */
}
@media (min-width: 1100px) {
  main.breit.raster, footer.breit { max-width: 1280px; }
}

/* Reiter nur auf dem Handy (siehe unten); ohne JavaScript bleiben sie verborgen */
.reiter { display: none; }

ul.stationen { list-style: none; margin: 0; padding: 0; }
.stationen li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 4px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--linie);
}
.stationen li:first-child { border-top: 0; padding-top: 0; }
.zeit { color: var(--grau); font-variant-numeric: tabular-nums; font-size: 0.92rem; padding-top: 1px; }
.stationen strong { font-weight: 600; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.stationen span.ort { display: block; color: var(--grau); font-size: 0.92rem; }

.einleitung { color: var(--grau); font-size: 0.95rem; }
ul.proben { list-style: none; margin: 0; padding: 0; }
.proben li { padding: 14px 0; border-top: 1px solid var(--linie); }
.proben li:first-child { border-top: 0; padding-top: 4px; }
.proben a { display: block; font-weight: 600; color: var(--tinte); text-decoration-color: var(--akzent); text-underline-offset: 3px; }
.proben a:hover, .proben a:focus-visible { color: var(--akzent); }
.proben .quelle { display: block; margin-top: 4px; color: var(--grau); font-size: 0.85rem; }
.proben .worum { display: block; margin-top: 4px; font-size: 0.95rem; }

/* Projekt: oben in der Karte Arbeitsproben (Leo: wichtiger als die Texte), Bild in voller Kartenbreite */
.projekt { padding-bottom: 8px; }
.projekt > h2:first-child { margin-top: 0; }
.projekt figure { margin-top: 20px; }
.projekt h3 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.35rem; font-weight: 600; margin: 0 0 12px; }
.projekt .technik { color: var(--grau); font-size: 0.9rem; margin: 0; }
.projekt figure { margin-left: 0; margin-right: 0; margin-bottom: 0; }
.projekt figure img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--linie); }
.projekt figure a:focus-visible img { outline: 2px solid var(--akzent); outline-offset: 2px; }
.projekt figcaption { margin-top: 8px; color: var(--grau); font-size: 0.82rem; }
/* Zweites Projekt (PolyTicker, 10.11.2026) mit Trennlinie, darunter Knöpfe zur öffentlichen App und zum Newsletter */
.projekt + .projekt { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--linie); }
.projekt .links { margin-top: 16px; }

.kontakt { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.kontakt a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--tinte);
  border-radius: 999px;
  color: var(--tinte);
  text-decoration: none;
  font-weight: 500;
}
.kontakt a:hover, .kontakt a:focus-visible { background: var(--tinte); color: var(--karte); }

a { color: var(--akzent); }

footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 48px;
  font-size: 0.85rem;
  color: var(--grau);
}
footer a { color: var(--grau); }

.luecke { background: var(--luecke); padding: 0 4px; border-radius: 2px; }

@media (max-width: 860px) {
  .raster { display: block; }
  .raster > .teil { margin-top: 20px; }
  /* Mit Reitern: nur der gewählte Teil ist sichtbar */
  .mit-reitern .reiter {
    position: sticky; top: 8px; z-index: 5;          /* bleibt beim Scrollen oben */
    display: flex; gap: 4px; margin-top: 0; padding: 4px;
    background: var(--karte); border: 1px solid var(--linie); border-radius: 999px;
  }
  .reiter button {
    flex: 1; padding: 10px 6px; font: inherit; font-weight: 600; font-size: 0.92rem;
    color: var(--grau); background: transparent; border: 0; border-radius: 999px; cursor: pointer;
  }
  .reiter button[aria-selected="true"] { color: var(--karte); background: var(--tinte); }
  .reiter button:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
  .mit-reitern .teil:not(.aktiv) { display: none; }
  .mit-reitern .raster > .teil { margin-top: 12px; }
}

@media (max-width: 520px) {
  main { padding-top: 24px; }
  .karte { padding: 28px 20px; }
  h1 { font-size: 2rem; }
  .person { gap: 16px; }
  .foto { width: 84px; height: 84px; border-radius: 12px; }
  .stationen li { grid-template-columns: 1fr; gap: 0; }
}
