/* =========================================================
   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 */
  -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 {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 28px;
}

/* 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;
  margin-bottom: 24px;
}

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

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

.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;
}

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

/* 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;
}

/* 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;
}

.station-points li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
}

.station-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 2px;
  background: 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: 56px 1fr auto;
  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: 56px 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 {
  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 {
  opacity: 1;
  transform: none;
}

/* 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 .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);
}

/* --- 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 {
    opacity: 1;
    transform: none;
  }

  .js .timeline-bus {
    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 {
    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 {
    opacity: 1 !important;
    transform: none !important;
  }

  .timeline-bus {
    display: none !important;
  }

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

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