/* rumpler.me – digitale Visitenkarte
   Schwarz, Weiß, ein Grau für Nebentext. Harte Kanten, 1-px-Linien, asymmetrisches Raster (4 : 8).
   Bitcount Prop Single (eckige Pixel) nur für den Namen und Bereichstitel, Archivo für alles andere.
   Beide Schriften SIL Open Font License, selbst gehostet. */

@font-face {
  font-family: 'Bitcount';
  src: url('/fonts/bitcount.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --black: #000;
  --white: #fff;
  --grey: #6e6e6e;      /* 5.1:1 auf Weiß */
  --grey-dark: #a8a8a8; /* 8.9:1 auf Schwarz */
  --line: 1px solid var(--black);
  --pad: clamp(1rem, 2.6vw, 2.25rem);
  --pixel: 'Bitcount', 'Courier New', monospace;
  --sans: 'Archivo', system-ui, sans-serif;
  --touch: 3rem;
  /* Linke Spalte des 4:8-Rasters. Auf sehr breiten Seiten wächst sie, damit die Playerspalte nicht mitwächst. */
  --left: 33.334%;
}
@media (min-width: 1500px) {
  :root { --left: max(33.334%, calc(100% - 60rem - 2 * var(--pad))); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.125rem);
  line-height: 1.5;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
main:focus { outline: none; }

.vh {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--pad); top: -5rem; z-index: 10;
  background: var(--black); color: var(--white); padding: .75rem 1rem;
}
.skip:focus { top: .75rem; }

/* Pixelschrift: eckige Elemente (ELSH 50), Gewicht 500 – getestet am Namenszug */
.name, .fold-title, .player-title, .page-title, .year-num, .cv-years, .bar-name {
  font-family: var(--pixel);
  font-weight: 500;
  font-variation-settings: 'ELSH' 50;
  letter-spacing: 0;
}

/* Namenszug: beim Laden wachsen die eckigen Pixel Buchstabe für Buchstabe von klein zu voll;
   danach zerfällt in langen, versetzten Abständen gelegentlich ein Buchstabe kurz in seine Einzelpixel.
   Nur die Achse wght ändert sich (ELSH bleibt 50: keine hohlen Zwischenformen), die Breite bleibt gleich. */
.name-w { white-space: nowrap; }
.name-l { font-variation-settings: 'ELSH' 50, 'wght' 500; }
/* Index (Einbau-Reihenfolge), Dauer und Versatz je Buchstabe; Dauern teilerfremd, damit sich nichts im Gleichtakt wiederholt */
.l0 { --i: 0; --d: 41s; --o: 0.0s; }
.l1 { --i: 1; --d: 53s; --o: 7.3s; }
.l2 { --i: 2; --d: 37s; --o: 14.6s; }
.l3 { --i: 3; --d: 59s; --o: 21.9s; }
.l4 { --i: 4; --d: 47s; --o: 0.2s; }
.l5 { --i: 5; --d: 67s; --o: 7.5s; }
.l6 { --i: 6; --d: 43s; --o: 14.8s; }
.l7 { --i: 7; --d: 61s; --o: 22.1s; }
.l8 { --i: 8; --d: 71s; --o: 0.4s; }
.l9 { --i: 9; --d: 49s; --o: 7.7s; }
.l10 { --i: 10; --d: 57s; --o: 15.0s; }
.l11 { --i: 11; --d: 73s; --o: 22.3s; }
@media (prefers-reduced-motion: no-preference) {
  .name-l {
    animation:
      name-bauen 1.1s cubic-bezier(.25, .7, .2, 1) calc(var(--i) * 70ms) both,
      name-ruhe var(--d) ease-in-out calc(3s + var(--o)) infinite;
  }
}
@keyframes name-bauen {
  0%   { font-variation-settings: 'ELSH' 50, 'wght' 100; opacity: 0; }
  15%  { opacity: 1; }
  100% { font-variation-settings: 'ELSH' 50, 'wght' 500; }
}
@keyframes name-ruhe {
  0%, 94%, 100% { font-variation-settings: 'ELSH' 50, 'wght' 500; }
  97%           { font-variation-settings: 'ELSH' 50, 'wght' 270; }
}

/* ── Visitenkarte ───────────────────────────── */

.card {
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr);
  border-bottom: var(--line);
}
.name {
  grid-column: 1 / -1;
  padding: calc(var(--pad) * .9) var(--pad) calc(var(--pad) * .7);
  font-size: clamp(4rem, 14vw - .75rem, 15rem);  /* füllt die Breite: Namenszug ≈ 6,8 × Schriftgröße */
  line-height: .84;
  white-space: nowrap;
  border-bottom: var(--line);
}

.contact {
  display: flex; flex-direction: column;
  padding: var(--pad);
  border-right: var(--line);
}
.role { font-size: 1.1875rem; line-height: 1.35; }
.mail {
  margin-top: 1.5rem;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.mail a { text-decoration-thickness: 2px; text-underline-offset: .14em; }
.mail a:hover { text-decoration-thickness: 4px; }

.actions { margin-top: 1.25rem; border-top: var(--line); max-width: 28rem; }
.actions li { border-bottom: var(--line); }
.actions li:has(> [hidden]) { display: none; }
.action {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: var(--touch);
  padding: .5rem .75rem;
  background: none; border: 0; border-radius: 0;
  font-weight: 600; text-align: left; text-decoration: none; cursor: pointer;
}
.action:hover, .action[data-done] { background: var(--black); color: var(--white); }
.action:focus-visible { outline-offset: -3px; }
.status { min-height: 1.5em; margin-top: .5rem; font-size: .9375rem; }
.contact-more { margin-top: auto; padding-top: 1.5rem; color: var(--grey); font-size: .9375rem; line-height: 1.6; }
.contact-more a { color: var(--black); }

/* ── Player ─────────────────────────────────── */

.player {
  background: var(--black);
  color: var(--white);
  padding: var(--pad);
  display: flex; flex-direction: column;
}
.player :focus-visible { outline-color: var(--white); }
.player-box {
  position: relative;
  aspect-ratio: 16 / 9;   /* Platz ist reserviert – beim Öffnen springt nichts */
  /* passt sich an: volle Spaltenbreite, höchstens 60rem, und nie höher als der Bildschirm erlaubt */
  width: min(100%, 60rem, calc((100svh - 16rem) * 16 / 9));
  container-type: inline-size;
  border: var(--line); border-color: var(--white);
}
.player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-cover {
  position: absolute; inset: 0;
  display: grid; grid-template-rows: 1fr auto auto; gap: .75rem;
  padding: clamp(1rem, 3vw, 2.25rem);
}
.player-cover[hidden] { display: none; }
.player-title { font-size: clamp(1.75rem, 9.5cqi, 5.5rem); line-height: .9; align-self: start; max-width: 9ch; }
.player-text { max-width: 36ch; color: var(--grey-dark); }
.player-open {
  justify-self: start;
  display: inline-flex; align-items: center; gap: .75rem;
  min-height: 3.25rem; padding: .75rem 1.25rem;
  background: var(--white); color: var(--black);
  border: 0; border-radius: 0;
  font-weight: 700; font-size: 1.125rem; cursor: pointer;
}
.player-open::before {   /* Abspiel-Dreieck aus Kanten, keine Grafik */
  content: ''; width: 0; height: 0;
  border-left: .75rem solid currentColor; border-top: .45rem solid transparent; border-bottom: .45rem solid transparent;
}
.player-open:hover { outline: 2px solid var(--white); outline-offset: 3px; }
.player-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .5rem 2rem;
  padding-top: .9rem;
  font-size: .9375rem;
}
.player-notes { display: grid; max-width: 52ch; }
.player-note { grid-area: 1 / 1; color: var(--grey-dark); }
.player-note[hidden] { display: block; visibility: hidden; }  /* beide Texte belegen denselben Platz: kein Sprung */
.player-note a { color: var(--white); }
.player-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; min-height: 2.75rem; }
.player-close {
  min-height: 2.75rem; padding: .4rem 1rem;
  background: none; border: 1px solid var(--white); border-radius: 0; color: var(--white);
  font-weight: 600; cursor: pointer;
}
.player-close:hover { background: var(--white); color: var(--black); }
.player-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.player[data-state='open'] .player-box { border-color: var(--black); }

/* ── Aufklappbereiche ───────────────────────── */

.fold { border-bottom: var(--line); }
.fold summary {
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr);
  align-items: center;
  min-height: 5rem;
  list-style: none;
  cursor: pointer;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary:focus-visible { outline-offset: -6px; }
.fold-title {
  padding: 1rem var(--pad);
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3.75rem);
  line-height: 1;
  border-right: var(--line);
  align-self: stretch; display: flex; align-items: center;
}
.fold-hint {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--pad);
  color: var(--grey);
}
.fold-icon {   /* Pfeil im Quadrat: zeigt nach unten (öffnen) bzw. oben (schließen) */
  position: absolute; right: var(--pad);
  width: 3.25rem; height: 3.25rem;
  border: var(--line);
  display: grid; place-items: center;
}
.fold summary { position: relative; }
.fold-icon::before {
  content: ''; width: 0; height: 0;
  border-top: .7rem solid currentColor; border-left: .55rem solid transparent; border-right: .55rem solid transparent;
}
.fold summary:hover .fold-icon { background: var(--black); color: var(--white); }
.fold[open] summary { background: var(--black); color: var(--white); }
.fold[open] .fold-title { border-color: var(--white); }
.fold[open] .fold-hint { color: var(--grey-dark); }
.fold[open] .fold-icon { border-color: var(--white); }
.fold[open] .fold-icon::before { border-top: 0; border-bottom: .7rem solid currentColor; }
.fold[open] summary:hover .fold-icon { background: var(--white); color: var(--black); }

.fold-body { padding: 0 0 var(--pad); }
.fold-more { padding: 1.25rem var(--pad) 0; font-weight: 650; font-size: 1.125rem; }

/* Arbeiten: Datum | Titel und Medium | Links */
.works { border-top: 0; }
.work {
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr) minmax(9rem, 12rem);
  border-bottom: var(--line);
}
.work > * { padding: 1rem var(--pad); }
.work-meta { border-right: var(--line); color: var(--grey); font-size: .9375rem; }
.work-meta time { display: block; color: var(--black); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1rem; }
.work-medium { display: block; max-width: 24ch; }
.work-title { font-size: clamp(1.125rem, 1rem + .45vw, 1.4rem); font-weight: 650; line-height: 1.2; max-width: 40ch; }
.work-with { margin-top: .3rem; color: var(--grey); font-size: .9375rem; }
.work-teaser { margin-top: .5rem; max-width: 62ch; font-size: .9375rem; }
.work-links { display: flex; flex-direction: column; align-items: flex-start; padding-top: .55rem !important; }
.work-links a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }

/* Lebenslauf */
.bio { padding: var(--pad); display: grid; gap: .9rem; max-width: calc(62ch + 2 * var(--pad)); border-bottom: var(--line); }
.bio p:first-child { font-size: 1.1875rem; }
.cv li {
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr) minmax(9rem, 12rem);
  border-bottom: var(--line);
}
.cv li > * { padding: .9rem var(--pad); }
.cv-years { border-right: var(--line); font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem); line-height: 1; }
.cv-role { font-size: 1.125rem; font-weight: 650; line-height: 1.25; }
.cv-org { margin-top: .2rem; }
.cv-time { color: var(--grey); font-size: .9375rem; }

.elsewhere {
  display: flex; flex-wrap: wrap; gap: 0 1.75rem;
  padding: 1.25rem var(--pad);
  font-weight: 600;
}
.elsewhere a { display: inline-flex; align-items: center; min-height: var(--touch); }

/* ── Fuß ────────────────────────────────────── */

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding: 1.25rem var(--pad) 2rem;
  background: var(--black); color: var(--white);
}
.foot :focus-visible { outline-color: var(--white); }
.foot ul { display: flex; flex-wrap: wrap; gap: 0 1.75rem; }
.foot a { display: inline-flex; align-items: center; min-height: var(--touch); }
.foot p { display: flex; align-items: center; min-height: var(--touch); color: var(--grey-dark); }

/* ── Unterseiten ────────────────────────────── */

.bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem 1.5rem;
  padding: .75rem var(--pad);
  border-bottom: var(--line);
}
.bar-name { font-size: 1.75rem; text-decoration: none; line-height: 1; padding-block: .5rem; }
.bar-mail { font-weight: 600; min-height: var(--touch); display: inline-flex; align-items: center; }
.page-head { padding: calc(var(--pad) * 1.25) var(--pad) var(--pad); border-bottom: var(--line); }
.page-title { font-size: clamp(2.25rem, 1rem + 6vw, 7.5rem); line-height: .9; overflow-wrap: anywhere; hyphens: auto; }
.page-head p { margin-top: 1.25rem; max-width: 64ch; }
.year h2 {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.5rem var(--pad) .75rem;
  border-bottom: var(--line);
}
.year-num { font-size: clamp(2rem, 1.5rem + 2vw, 3.25rem); line-height: 1; }
.year-count { font-size: 1rem; font-weight: 400; color: var(--grey); }
.legal { padding: var(--pad); }
.legal > * { max-width: 46rem; }
.legal h2 { font-size: 1.375rem; font-weight: 700; margin: 2.25rem 0 .6rem; line-height: 1.25; }
.legal > h2:first-child, .legal > p:first-child + h2 { margin-top: 0; }
.legal p, .legal ul, .legal address { margin-bottom: .9rem; font-style: normal; }
.legal ul { list-style: square; padding-left: 1.25rem; }
.legal { overflow-wrap: break-word; }

/* ── Schmal ─────────────────────────────────── */

@media (max-width: 820px) {
  .name { white-space: normal; }
  .card { grid-template-columns: minmax(0, 1fr); }
  .contact { border-right: 0; border-bottom: var(--line); }
  .contact-more { margin-top: 1rem; padding-top: 0; }
  .fold summary { grid-template-columns: minmax(0, 1fr); padding-right: calc(var(--pad) + 3.5rem); }
  .fold-title { border-right: 0; padding-bottom: .1rem; }
  .fold-hint { padding-top: 0; font-size: .9375rem; }
  .work, .cv li { grid-template-columns: minmax(0, 1fr); }
  .work > *, .cv li > * { padding: 0 var(--pad); }
  .work > .work-meta, .cv li > .cv-years { border-right: 0; padding-top: 1rem; }
  .work-meta time { display: inline; margin-right: .5rem; }
  .work-medium { display: inline; }
  .work-main { margin-top: .25rem; }
  .work-links { flex-direction: row; gap: 1.5rem; padding-top: .25rem !important; padding-bottom: .5rem; }
  .cv li > :last-child { padding-bottom: 1rem; }
  .cv-time { margin-top: .25rem; }
  .player-bar { flex-direction: column; }
}
