/* 1. Die lokal gespeicherte variable Schrift laden. */
@font-face {
  font-family: "Google Sans Flex";
  src: url("../fonts/google-sans-flex-latin.woff2") format("woff2");
  font-weight: 1 1000;
  font-stretch: 25% 151%;
  font-style: oblique 0deg 10deg;
  font-display: swap;
}

/* 2. Wiederkehrende Farben zentral benennen: Handbuch der HU, Seiten 19 und 20. */
:root {
  --color-blue: #00376c;
  --color-text: #0a0a19;
  --color-muted: #59595f;
  --color-background: #fafaf5;
  --color-line: #cfcfd1;
}

/* Innenabstände und Rahmen zählen zur angegebenen Elementbreite. */
* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: "Google Sans Flex", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  font-stretch: 100%;
  font-optical-sizing: auto;
  line-height: 1.65;
}

h1, h2, h3, p, ul, dl, dd {
  margin: 0;
}

h1, h2, h3 {
  line-height: 1.25;
  overflow-wrap: break-word;
  text-wrap: balance;
}

h1, h2 {
  color: var(--color-blue);
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 1.125rem;
  font-weight: 650;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

a {
  color: var(--color-blue);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.07em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

/* Der Tastaturfokus bleibt auf allen Links deutlich sichtbar. */
a:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 4px;
}

ul {
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.35rem;
}

/* Der Sprunglink erscheint, wenn man ihn mit der Tabulatortaste erreicht. */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  z-index: 1;
  padding: 0.5rem 1rem;
  background-color: var(--color-background);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* 3. Seitenkopf und Navigation. */
.site-header {
  border-top: 4px solid var(--color-blue);
  padding: clamp(1.75rem, 5vw, 3rem) 0 1.75rem;
}

.eyebrow {
  margin-bottom: 1.25rem;
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 550;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 1.25rem;
}

.header-layout > *,
.cv-section > * {
  min-width: 0;
}

.portrait {
  display: block;
  inline-size: clamp(6.25rem, 10vw, 7.75rem);
  block-size: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}

.subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  text-wrap: balance;
}

.affiliation {
  margin-top: 0.25rem;
}

.faculty {
  margin-top: 0.15rem;
  font-size: 0.9rem;
}

.faculty a {
  color: var(--color-muted);
}

.faculty a:hover {
  color: var(--color-blue);
}

.contact {
  grid-column: 1 / -1;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-style: normal;
  overflow-wrap: anywhere;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.15rem;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.profile-icon {
  flex-shrink: 0;
  inline-size: 0.95em;
  block-size: 0.95em;
}

.profile-link span {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.07em;
}

.profile-link:hover span {
  text-decoration-thickness: 0.14em;
}

.introduction {
  max-width: 46rem;
  margin-top: 1.5rem;
  font-size: 1.125rem;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem clamp(1rem, 3vw, 1.5rem);
  border-top: 1px solid var(--color-line);
  padding: 0.75rem 0;
  font-size: 0.9rem;
}

.section-nav a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.4rem 0;
}

/* 4. Lebenslauf: dieselben Klassen werden für jede Station wiederverwendet. */
.cv-section {
  display: grid;
  gap: 1.5rem;
  border-top: 1px solid var(--color-line);
  padding: clamp(1.75rem, 4vw, 2.25rem) 0;
  scroll-margin-top: 1rem;
}

/* Der verfügbare Platz dieser Liste steuert den Aufbau der Stationen. */
.entry-list {
  container-name: entries;
  container-type: inline-size;
  display: grid;
  row-gap: 2.25rem;
}

/* Logo und Identität bilden eine Einheit. Details folgen darunter. */
.entry {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: start;
  gap: 1rem 0.875rem;
}

.entry-mark {
  display: grid;
  place-items: start center;
  inline-size: 100%;
  aspect-ratio: 1;
}

.entry-logo {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 3.5rem;
  object-fit: contain;
  object-position: center top;
}

.entry-header {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  min-inline-size: 0;
}

.entry-identity {
  min-inline-size: 0;
}

.entry-identity h3 {
  font-size: 1rem;
  font-weight: 650;
}

.entry-detail {
  margin-block-start: 0.35rem;
  font-size: 0.9375rem;
  text-wrap: balance;
}

.entry-role {
  margin-block-start: 0.2rem;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.period {
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.period time {
  white-space: nowrap;
}

/* Auf schmalen Bildschirmen nutzen Beschreibungen die ganze Zeile. */
.entry-content {
  grid-column: 1 / -1;
  min-inline-size: 0;
}

.entry-content > * + * {
  margin-block-start: 0.75rem;
}

/* Diese Ergänzung verbessert die Ausrichtung in unterstützenden Browsern. */
@supports (text-box: trim-start cap alphabetic) {
  .entry-identity h3 {
    text-box: trim-start cap alphabetic;
  }

  .profile-link span {
    text-box: trim-both cap alphabetic;
  }
}

/* Entscheidend ist die Breite der Station und nicht die des Browserfensters. */
@container entries (min-width: 40rem) {
  .entry {
    grid-template-columns: 6rem minmax(0, 1fr);
    column-gap: 1.5rem;
  }

  .entry-mark {
    aspect-ratio: 12 / 7;
  }

  .entry-header {
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 1.5rem;
  }

  .entry-identity h3 {
    font-size: 1.125rem;
  }

  .period {
    font-size: 0.875rem;
  }

  .entry-content {
    grid-column: 2;
  }
}

.methods {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.skills > div + div {
  margin-top: 1.25rem;
}

.skills dt {
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--color-line);
  padding: 1.5rem 0 2.5rem;
  color: var(--color-muted);
  font-size: 0.8rem;
}

/* 5. Erst auf größeren Bildschirmen werden zwei Spalten verwendet. */
@media (min-width: 56rem) {
  .header-layout {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 2rem;
    row-gap: 0.75rem;
  }

  .header-layout > div {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .portrait {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .contact {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-items: end;
    text-align: right;
  }

  .profile-links {
    justify-content: flex-end;
  }

  .cv-section {
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 3rem;
  }

  .cv-section > h2 {
    position: sticky;
    top: 1.5rem;
    align-self: start;
  }
}

/* 6. Beim Drucken stehen Inhalt und Lesbarkeit im Vordergrund. */
@media print {
  @page {
    size: A4;
    margin: 16mm;
  }

  body {
    max-width: none;
    padding: 0;
    background-color: white;
    color: black;
    font-size: 10pt;
  }

  .skip-link, .section-nav, .site-footer {
    display: none;
  }

  .site-header {
    padding: 1rem 0;
  }

  h1 {
    font-size: 28pt;
  }

  .eyebrow {
    margin-bottom: 0.75rem;
  }

  .introduction {
    margin-top: 0.75rem;
  }

  .cv-section {
    gap: 0.75rem;
    padding: 1rem 0;
  }

  .entry {
    break-inside: avoid;
  }

  h2, h3 {
    break-after: avoid;
  }

  a, .profile-link span {
    color: inherit;
    text-decoration: none;
  }
}
