/* =========================================================
   1. FARBEN UND GRUNDWERTE
   Alle Farben stehen hier zentral. Willst du den Look ändern,
   passt du nur diese Variablen an.
   ========================================================= */
:root {
  --bg: #ffffff;          /* Hintergrund: reines Weiss */
  --surface: #f3f4f5;     /* Seitenleiste: helles Signalgrau */
  --chip: #ffffff;        /* Skill-Tags */
  --ink: #1e2226;         /* Haupttext: Anthrazit */
  --muted: #686e75;       /* Nebentext: Daten, Firmen */
  --line: #dadde1;        /* Linien und Rahmen */
  --accent: #d52b1e;      /* Akzent: Schweizer Rot */
  --accent-soft: #fbe4e2; /* Helles Rot */
  --on-accent: #ffffff;   /* Text auf Rot */

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --radius: 6px;
}

/* Dark Mode: greift automatisch, wenn das Gerät dunkel eingestellt ist */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --surface: #202328;
    --chip: #272b31;
    --ink: #eceef0;
    --muted: #a3a9b0;
    --line: #353a41;
    --accent: #ff5a4d;
    --accent-soft: #43201d;
    --on-accent: #17191c;
  }
}

/* =========================================================
   2. GRUNDLAGEN
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  border-top: 6px solid var(--accent);   /* rotes Band über die ganze Breite */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;   /* 17px */
  line-height: 1.7;
  hyphens: auto;          /* trennt lange deutsche Wörter sauber */
  overflow-x: clip;       /* Bus und Sprechblase am Rand erzeugen keinen Querscroll */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* Sichtbarer Fokus für Tastatur-Navigation */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

ul, ol, dl {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* =========================================================
   3. LAYOUT: Seitenleiste links, Inhalt rechts
   Auf dem Handy stapelt sich alles untereinander.
   ========================================================= */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* verhindert horizontales Scrollen auf dem Handy */
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 72px;
    padding: 0 40px;
  }
}

/* =========================================================
   4. SEITENLEISTE
   ========================================================= */
.sidebar {
  background: var(--surface);
  padding: 40px 24px;
}

@media (min-width: 900px) {
  .sidebar {
    position: sticky;       /* bleibt beim Scrollen stehen */
    top: 0;
    align-self: start;
    min-height: 100vh;
    padding: 56px 36px;
    border-bottom: none;
    border-radius: 0 0 6px 6px;
  }
}

.portrait-card {
  max-width: 280px;
  margin-bottom: 28px;
  perspective: 800px;
}

.portrait-tilt {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}

.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: cover;
  object-position: center top;
}

/* Platzhalter mit Initialen, solange kein Foto da ist */
.portrait--placeholder {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
}

/* Der Name ist das auffälligste Element der Seite */
.name {
  font-size: clamp(2.4rem, 8vw, 2.9rem);
  overflow-wrap: anywhere;  /* sehr lange Namen brechen um statt überzulaufen */
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 14px;
}

.role {
  color: var(--accent);
  font-weight: 600;
  min-height: 3.4em;      /* Platz für zwei Zeilen: nichts springt beim Wechsel */
  margin-bottom: 24px;
}

.intro {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 28px;
}

.contact li {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

/* Telefon bleibt ohne JavaScript verborgen (siehe index.html) */
.contact li[hidden] {
  display: none;
}

.sidebar-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 36px 0 12px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
}

/* Kleine Überschrift über jeder Gruppe von Schwerpunkten */
.tag-group {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.tags + .tag-group {
  margin-top: 16px;
}

.plain-list li {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

/* Sprachen: Name, sechs Kästchen (A1 bis C2), Niveau */
.languages li {
  display: grid;
  grid-template-columns: 84px 72px auto;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.lang-meter {
  height: 8px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / calc(var(--level, 0) * 12.4px) 100% no-repeat,
    var(--line);
  /* schneidet den Balken in 6 Kästchen à 10px mit 2.4px Abstand */
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12.4px);
  mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12.4px);
  animation: fill-meter 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 500ms backwards;
}

@keyframes fill-meter {
  from {
    background-size: 0 100%;
  }
}

.lang-code {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Button für die PDF-Version */
.print-button {
  margin-top: 24px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 10px 18px;
  cursor: pointer;
}

.print-button:hover {
  filter: brightness(0.9);
}

.print-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Symbole: feine Linien in Textfarbe */
.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact li,
.plain-list .with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact .icon,
.with-icon .icon {
  color: var(--accent);
}

.print-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================
   5. HAUPTBEREICH
   ========================================================= */
.content {
  padding: 48px 24px 32px;
  max-width: 680px;       /* hält Zeilen gut lesbar */
}

@media (min-width: 900px) {
  .content {
    padding: 72px 0 40px;
  }
}

.section {
  margin-bottom: 88px;
}

.section-heading {
  font-size: clamp(1.4rem, 3.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

/* Kurzer roter Strich unter jeder Abschnittsüberschrift */
.section-heading::after {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin-top: 10px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left;
}

.letter .signature {
  margin-top: 24px;
}

/* Vorgehen der Diplomarbeit: drei nummerierte Schritte, verbunden mit einer Linie */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 4px 0 20px;
}

.steps li {
  counter-increment: step;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Nummer im roten Kreis */
.steps li::before {
  content: counter(step);
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Verbindungslinie zum nächsten Schritt */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 30px;
  right: -16px;
  height: 2px;
  background: var(--line);
}

.step-title {
  font-weight: 600;
}

.step-text {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Auf dem Handy untereinander, Linie senkrecht */
@media (max-width: 600px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .steps li {
    min-height: 30px;
    padding-left: 44px;
  }

  .steps li::before {
    position: absolute;
    left: 0;
    top: 0;
  }

  .steps li:not(:last-child)::after {
    top: 30px;
    bottom: -12px;
    left: 14px;
    right: auto;
    width: 2px;
    height: auto;
  }
}

/* Nachweis-Links bei Stationen und Abschlüssen */
.proof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.station .proof {
  margin-top: 8px;
}

/* =========================================================
   5b. EINSTIEG: BEWERBUNG UND PASSUNG ZUR STELLE
   ========================================================= */
.application-for {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.application-title {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 32px;
}

/* Zwei Spalten: Anforderung links, Erfahrung rechts */
.fit-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 6px 28px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.fit-row:last-child {
  border-bottom: 1px solid var(--line);
}

.fit dt {
  font-weight: 600;
}

.fit dd {
  margin: 0;
  color: var(--muted);
}

.fit-head {
  border-top: none;
  padding-top: 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Auf dem Handy untereinander, Kopfzeile ausblenden */
@media (max-width: 600px) {
  .fit-row {
    grid-template-columns: 1fr;
  }

  .fit-head {
    display: none;
  }

  .fit-row:nth-child(2) {
    border-top: none;
  }
}

/* =========================================================
   6. ZEITLEISTE
   Eine durchgehende Linie mit Punkten pro Station.
   Die aktuelle Stelle bekommt einen gefüllten Punkt.
   ========================================================= */
.timeline {
  position: relative;
  padding-left: 32px;
}

/* Die senkrechte Linie */
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 2px;
  background: var(--line);
}

.station {
  position: relative;
  padding-bottom: 36px;
}

.station:last-child {
  padding-bottom: 0;
}

/* Punkt auf der Linie */
.station::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted);
}

.station.is-current::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.station-date {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;  /* Ziffern gleich breit wie auf einer Anzeigetafel */
  margin-bottom: 2px;
}

.station-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.station-org {
  color: var(--muted);
  margin-bottom: 10px;
}

/* Aufgaben mit kleinem Symbol davor */
.station-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.station-points .icon {
  margin-top: 0.3em;
  color: var(--accent);
}

/* =========================================================
   7. PROJEKTE
   ========================================================= */
.project {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.project:last-child {
  border-bottom: 1px solid var(--line);
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.project-result {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.project p:last-child {
  margin-bottom: 0;
}

/* =========================================================
   8. AUSBILDUNG
   ========================================================= */
.education-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;   /* Platz für "2023–2027" */
  gap: 4px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.education-row:last-child {
  border-bottom: 1px solid var(--line);
}

/* Auf schmalen Bildschirmen rutscht der Nachweis unter den Abschluss */
@media (max-width: 520px) {
  .education-row {
    grid-template-columns: 92px 1fr;
  }
  .education-proof {
    grid-column: 2;
  }
}

.education dt {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.education dd {
  margin: 0;
}

/* =========================================================
   9. FUSSZEILE
   ========================================================= */
.footer {
  color: var(--muted);
  font-size: 0.9rem;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* =========================================================
   11. BEWEGUNG UND ÜBERGÄNGE
   ========================================================= */

html {
  scroll-behavior: smooth;
}

/* --- Beim Laden: Seitenleiste und erster Abschnitt erscheinen einmal --- */
.sidebar > *,
.content > .section:first-child {
  animation: arrive 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.sidebar > :nth-child(2) { animation-delay: 60ms; }
.sidebar > :nth-child(3) { animation-delay: 120ms; }
.sidebar > :nth-child(4) { animation-delay: 180ms; }
.sidebar > :nth-child(n+5) { animation-delay: 240ms; }
.content > .section:first-child { animation-delay: 300ms; }

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* --- Abschnitte: Strich zeichnet sich, Inhalt blendet ein --- */
.js .section-heading::after {
  transform: scaleX(0);
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms;
}

.js .section.is-visible .section-heading::after {
  transform: scaleX(1);
}

.js .project,
.js .education-row,
.js .steps li {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 500ms ease,
    transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .section.is-visible .project,
.js .section.is-visible .education-row,
.js .section.is-visible .steps li {
  opacity: 1;
  transform: none;
}

/* Schritte erscheinen erst nach dem Projekt selbst */
.js .section.is-visible .steps li { transition-delay: 300ms; }

/* Leicht versetzt nacheinander */
.js .section.is-visible :is(.project, .education-row, .fit-row):nth-child(2) { transition-delay: 80ms; }
.js .section.is-visible :is(.project, .education-row, .fit-row):nth-child(3) { transition-delay: 160ms; }
.js .section.is-visible :is(.project, .education-row, .fit-row):nth-child(4) { transition-delay: 240ms; }
.js .section.is-visible .steps li:nth-child(2) { transition-delay: 450ms; }
.js .section.is-visible .steps li:nth-child(3) { transition-delay: 600ms; }
.js .section.is-visible .fit-row:nth-child(5) { transition-delay: 320ms; }
.js .section.is-visible .fit-row:nth-child(6) { transition-delay: 400ms; }
.js .section.is-visible .fit-row:nth-child(7) { transition-delay: 480ms; }

/* --- Zeitleiste: rote Linie und fahrender Bus --- */
.timeline::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(var(--progress, 1));
  transition: transform 150ms linear;
}

/* Der Bus sitzt auf der Linie und fährt mit --progress nach unten */
.timeline-bus {
  display: none;
  position: absolute;
  z-index: 2;
  left: -11px;
  top: calc(8px + (100% - 16px) * var(--progress, 0) - 18px);
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 12px rgba(213, 43, 30, 0.3);
  transition: top 150ms linear;
}

.timeline-bus .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* Nur sichtbar, wenn JavaScript läuft */
.js .timeline-bus {
  display: grid;
}

/* Haltestellen füllen sich, sobald der Bus sie erreicht */
.station::before {
  z-index: 1;
  transition:
    border-color 300ms ease,
    background-color 300ms ease;
}

.station.is-reached::before {
  border-color: var(--accent);
  background: var(--accent);
}

/* --- Hover-Übergänge --- */
a {
  transition: color 150ms ease;
}

.proof .icon {
  transition: transform 200ms ease;
}

.proof:hover .icon {
  transform: translateY(-2px);
}

.tags li {
  transition: border-color 200ms ease, color 200ms ease;
}

.tags li:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.print-button {
  transition: filter 150ms ease;
}

.print-button .icon {
  transition: transform 200ms ease;
}

.print-button:hover .icon {
  transform: translateY(2px);
}

/* --- Scroll-Fortschritt: roter Balken ganz oben --- */
.scroll-progress {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--scroll, 0));
}

/* --- Foto: kippt mit der Maus, Lichtreflex folgt --- */
.portrait-tilt {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 400ms ease;
}

.portrait-tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 300ms ease;
}

.portrait-tilt.is-tilting {
  transition-duration: 100ms;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.portrait-tilt.is-tilting::after {
  opacity: 1;
}

/* --- Rolle: Buchstaben rattern wie auf einer Anzeigetafel --- */
.role .flap {
  display: inline-block;
  animation: flap 90ms ease-out;
}

@keyframes flap {
  from {
    transform: scaleY(0.4);
    opacity: 0.4;
  }
}

/* --- Schwerpunkte: ploppen nacheinander auf, heben sich beim Hover --- */
.tags li {
  animation: pop 400ms cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
  animation-delay: calc(350ms + var(--i, 0) * 60ms);
  transition: border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.tags li:hover {
  transform: translateY(-2px);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

/* --- Kontakt-Links: Unterstrich wächst beim Hover --- */
.contact a,
.plain-list a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size 250ms ease, color 150ms ease;
}

.contact a:hover,
.plain-list a:hover {
  background-size: 100% 1.5px;
}

.contact li .icon {
  transition: transform 250ms cubic-bezier(0.3, 1.5, 0.5, 1);
}

.contact li:hover .icon {
  transform: scale(1.2) rotate(-8deg);
}

/* --- PDF-Button hebt sich leicht --- */
.print-button {
  transition: filter 150ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.print-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(213, 43, 30, 0.3);
}

.print-button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* --- Überschriften: roter Strich wird beim Hover länger --- */
.js .section-heading::after {
  transition:
    transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms,
    width 300ms ease;
}

.section-heading:hover::after {
  width: 72px;
}

/* --- Aktuelle Stelle: Punkt pulsiert wie ein Live-Signal --- */
.station.is-current::before {
  animation: live 2.4s ease-out infinite;
}

@keyframes live {
  0% {
    box-shadow: 0 0 0 5px var(--accent-soft), 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  70%, 100% {
    box-shadow: 0 0 0 5px var(--accent-soft), 0 0 0 16px transparent;
  }
}

/* --- Bus: wackelt beim Fahren, hupt beim Anklicken --- */
.js .timeline-bus {
  cursor: pointer;
}

.timeline.is-driving .timeline-bus .icon {
  animation: bump 260ms ease-in-out infinite;
}

@keyframes bump {
  50% { transform: translateY(-1.5px) rotate(-3deg); }
}

.timeline-bus.is-honking {
  animation: shake 400ms ease;
}

@keyframes shake {
  20%, 60% { transform: translateX(-2px) rotate(-4deg); }
  40%, 80% { transform: translateX(2px) rotate(4deg); }
}

.honk {
  position: absolute;
  left: 46px;
  top: 50%;
  white-space: nowrap;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  --honk-x: 0%;
  --honk-y: -50%;
  animation: honk 1.2s ease forwards;
}

@keyframes honk {
  0%   { opacity: 0; transform: translate(calc(var(--honk-x) - 6px), var(--honk-y)) scale(0.6); }
  15%  { opacity: 1; transform: translate(var(--honk-x), var(--honk-y)) scale(1); }
  75%  { opacity: 1; transform: translate(var(--honk-x), calc(var(--honk-y) - 30%)); }
  100% { opacity: 0; transform: translate(var(--honk-x), calc(var(--honk-y) - 90%)); }
}

/* --- Zeitleiste waagrecht: links die Vergangenheit, rechts die Zukunft ---
   Auf dem Handy bleibt sie senkrecht (älteste Station oben). */
@media (min-width: 601px) {
  .timeline {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 32px;
    padding-left: 0;
    padding-top: 44px;
  }

  /* Linie liegt oben quer */
  .timeline::before,
  .timeline::after {
    top: 5px;
    bottom: auto;
    left: 8px;
    right: 8px;
    width: auto;
    height: 4px;
  }

  .timeline::after {
    transform-origin: left;
    transform: scaleX(var(--progress, 1));
  }

  /* Punkte sitzen auf der Linie über jeder Station */
  .station::before {
    top: -44px;
    left: 0;
  }

  .station {
    padding-bottom: 0;
  }

  /* Der Bus fährt nach rechts */
  .timeline-bus {
    top: -11px;
    left: calc(8px + (100% - 16px) * var(--progress, 0) - 18px);
    transition: left 150ms linear;
  }

  /* Der ganze Inhalt steht still, während der Bus fährt. --pin-offset
     (aus script.js) hält ihn so, dass die Zeitleiste mittig bleibt.
     Die Höhe des Runways bestimmt, wie lange gescrollt werden muss. */
  .js .content {
    position: sticky;
    top: var(--pin-offset, 0px);
    align-self: start;
  }

  .js .timeline-runway {
    grid-column: -2;       /* immer in der Spalte des Inhalts */
    height: 70vh;
  }

  /* Sprechblase über dem Bus statt daneben */
  .honk {
    left: 50%;
    top: auto;
    bottom: calc(100% + 6px);
    --honk-x: -50%;
    --honk-y: 0%;
  }
}

/* --- Projekte: roter Balken links beim Hover --- */
.project {
  position: relative;
}

.project::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 24px;
  bottom: 24px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project:hover::before {
  transform: scaleY(1);
}

/* Notenbalken: füllt sich bis 5.4 von 6 */
.grade-meter {
  display: inline-block;
  position: relative;
  width: 72px;
  height: 6px;
  margin-left: 12px;
  vertical-align: middle;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.grade-meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--grade, 1));
  transition: transform 1200ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms;
}

.js .section:not(.is-visible) .grade-meter::after {
  transform: scaleX(0);
}

/* --- Ausbildung: Jahr wird beim Hover rot --- */
.education dt {
  transition: color 200ms ease;
}

.education-row:hover dt {
  color: var(--accent);
}

/* --- Nach-oben-Knopf erscheint nach dem ersten Scrollen --- */
.to-top {
  position: fixed;
  z-index: 10;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.8);
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms cubic-bezier(0.3, 1.5, 0.5, 1);
}

.to-top.is-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover .icon {
  transform: translateY(-3px);
}

.to-top .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
  transition: transform 200ms ease;
}

.to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- Easter Egg: "bus" tippen, dann fährt ein Bus unten durchs Bild --- */
.drive-by {
  position: fixed;
  z-index: 20;
  left: 0;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
  pointer-events: none;
  animation: drive-by 3.2s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

.drive-by .icon {
  width: 38px;
  height: 38px;
  stroke-width: 2;
  animation: bump 260ms ease-in-out infinite;
}

@keyframes drive-by {
  from { transform: translateX(-80px); }
  to   { transform: translateX(calc(100vw + 20px)); }
}

/* --- Weniger Bewegung, wenn das Gerät es verlangt --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .section-heading::after,
  .js .project,
  .js .education-row,
  .js .fit-row,
  .js .steps li {
    opacity: 1;
    transform: none;
  }

  .js .timeline-bus {
    display: none;
  }

  /* Ohne Bewegung kein Anhalten beim Scrollen */
  .js .content {
    position: static;
  }

  .js .timeline-runway {
    display: none;
  }
}

/* =========================================================
   10. DRUCKANSICHT
   Mit Strg+P / Cmd+P entsteht daraus ein sauberes PDF.
   ========================================================= */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --ink: #000000;
    --muted: #444444;
    --accent-soft: #eeeeee;
    --chip: #ffffff;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: 0;
    border: none;
    padding: 0 0 24px;
  }

  .content {
    position: static !important;
    padding: 0;
    max-width: none;
  }

  /* Im PDF keine Übergänge, sonst druckt der Browser halbe Zustände */
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .timeline::after {
    transform: scaleY(1);
  }

  .js .section-heading::after,
  .js .project,
  .js .education-row,
  .js .fit-row,
  .js .steps li {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Farbige Balken und Kreise auch im PDF drucken */
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .timeline-bus,
  .timeline-runway,
  .scroll-progress,
  .to-top,
  .drive-by {
    display: none !important;
  }

  .portrait-tilt {
    transform: none !important;
  }

  .grade-meter::after {
    transform: scaleX(var(--grade, 1)) !important;
  }

  .station,
  .project {
    break-inside: avoid;
  }

  /* Button, Nachweis-Links und Fusszeile sind im PDF überflüssig */
  .print-button,
  .proof,
  .footer {
    display: none;
  }
}