/* Projektakte und Über-mich-Blatt: ruhige Papier-und-Tinte-Seite unter /<slug>/ und als Blatt über dem Weg. */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: only light;
  --papier: #F2EFE9;
  --passepartout: #E6E1D7;
  --tinte: #1A1714;
  --grau: #5E574F;
  --linie: #1A171426;
  --roetel: #C8452C;
  --text: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  /* Bilder, Flächen und Knöpfe teilen sich einen Radius */
  --radius: 6px;
}

/* allein stehende Seite */
.akte-seite {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 400 16px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.akte-seite * { box-sizing: border-box; }
.akte-seite a { color: inherit; text-decoration: none; }
.akte-seite :focus-visible,
.akte-blatt :focus-visible,
.akte-lightbox :focus-visible {
  outline: 2px solid var(--roetel);
  outline-offset: 3px;
  border-radius: 2px;
}

.akte-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px clamp(20px, 3.4vw, 48px) 0;
}
.akte-kopf img { display: block; width: clamp(150px, 13vw, 200px); height: auto; }
.zurueck { font: 400 14px/1 var(--mono); color: var(--grau); padding: 8px 0; transition: color .2s; }
.zurueck:hover { color: var(--tinte); }

/* die Akte selbst: ruhige Textspur (640px) in weiterem Rahmen (920px innen) für Kopfszene und echte Screens */
.akte { max-width: 960px; margin: 0 auto; padding: clamp(20px, 4.5vh, 48px) 20px clamp(64px, 12vh, 120px); }
.akte.recht { max-width: 700px; padding-top: clamp(40px, 9vh, 96px); }
.akte * { margin: 0; }
.text-spur { max-width: 640px; margin-left: auto; margin-right: auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* vorgerenderte Dither-Kopfszene: feines 8x8-Raster (600x318) ruhig über der Textspur */
.kopf-szene { width: 100%; max-width: 720px; margin: 0 auto clamp(20px, 4vh, 36px); overflow: hidden; }
.kopf-szene img { display: block; width: 100%; height: auto; border-radius: var(--radius); image-rendering: pixelated; image-rendering: crisp-edges; }

.akte .art { font: 400 13px/1 var(--mono); color: var(--grau); letter-spacing: .02em; }
.akte h1 { margin-top: 12px; font: 600 clamp(32px, 4.2vw, 48px)/1.05 var(--text); letter-spacing: -.035em; }
.akte .text-spur > h1:first-child,
.akte .ueber-kopf h1:first-child { margin-top: 0; }
.akte .lede { margin-top: 16px; font-size: clamp(19px, 2vw, 22px); line-height: 1.45; letter-spacing: -.01em; max-width: 38ch; text-wrap: pretty; }

/* echte Screens auf ruhigem Stein-Passepartout, unverändert und ohne Geräte-Rahmen */
.tafel { margin: clamp(32px, 4.5vh, 40px) 0 0; }
.tafel.schluessel, .tafel.triptychon { margin-top: clamp(32px, 5.5vh, 48px); }
.buehne {
  background: var(--passepartout);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: clamp(16px, 2.6vw, 32px);
}
.einzel { display: grid; gap: 12px; }
.spur { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 24px); align-items: start; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 24px); align-items: start; }
.karten-duo { display: grid; grid-template-columns: 1.38fr 1fr; gap: clamp(16px, 2.4vw, 24px); align-items: end; }
.beleg-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.8vw, 32px); max-width: 680px; margin-left: auto; margin-right: auto; align-items: start; }
.bild-slot { display: grid; gap: 8px; }

.screen {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #1A171422;
  background: #0B0D0F;
  box-shadow: 0 12px 26px -16px rgba(26, 23, 20, .30);
  transition: border-color .2s;
}
.screen.hell { background: #F5F2EC; border-color: #1A171424; box-shadow: 0 10px 24px -16px rgba(26, 23, 20, .18); }
.screen[role="button"] { cursor: zoom-in; }
.screen[role="button"]:hover { border-color: var(--grau); }
.screen img { display: block; width: 100%; height: auto; }

/* 3D-Pagode Scroll- & Zieh-Bühne auf dem Passepartout */
.scrub-buehne {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #1A171422;
  background: #0B0D0F;
  box-shadow: 0 12px 26px -16px rgba(26, 23, 20, .30);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.scrub-buehne.ziehend { border-color: var(--grau); }
.scrub-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #0B0D0F;
  pointer-events: none;
}
.scrub-steuerung {
  display: flex;
  align-items: center;
  gap: 16px;
}
.scrub-regler {
  flex: 1 1 auto;
  min-width: 0;
  height: 24px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.scrub-regler::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: var(--linie);
}
.scrub-regler::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--roetel);
  border: 2px solid var(--passepartout);
  margin-top: -6px;
  transition: transform .15s ease;
}
.scrub-regler:hover::-webkit-slider-thumb,
.scrub-regler:active::-webkit-slider-thumb {
  transform: scale(1.15);
}
.scrub-regler::-moz-range-track {
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: var(--linie);
}
.scrub-regler::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--roetel);
  border: 2px solid var(--passepartout);
  transition: transform .15s ease;
}
.scrub-regler:hover::-moz-range-thumb,
.scrub-regler:active::-moz-range-thumb {
  transform: scale(1.15);
}
.scrub-status {
  flex: 0 0 auto;
  min-width: 17ch;
  text-align: right;
  font: 400 13px/1.4 var(--mono);
  color: var(--grau);
  letter-spacing: .01em;
  white-space: nowrap;
}
.index,
.screen-label {
  font: 400 13px/1.4 var(--mono);
  color: var(--grau);
  letter-spacing: .01em;
}
.tafel figcaption {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font: 400 13px/1.45 var(--mono);
  color: var(--grau);
}
.mobil-hinweis { display: none; color: var(--grau); white-space: nowrap; }

/* Abschnitte und Fließtext: Gliederung durch Größe und Abstand, ohne Trennlinien */
.akte section { margin-top: clamp(40px, 6.5vh, 56px); }
.akte h2 { font: 600 clamp(20px, 2.2vw, 23px)/1.25 var(--text); letter-spacing: -.018em; text-wrap: balance; }
.akte section p,
.akte .text-spur > p:not(.lede, .stand) { margin-top: 16px; font-size: 17px; line-height: 1.6; max-width: 62ch; text-wrap: pretty; }
.akte .text-spur > h1 ~ p:first-of-type:not(.lede, .stand) { margin-top: 24px; }
.akte .text-spur > p:first-child { margin-top: clamp(32px, 5vh, 40px); }
.akte section p + p { margin-top: 12px; }
.akte section ul:not([class]) { margin-top: 16px; padding-left: 0; list-style: none; max-width: 62ch; }
.akte section ul:not([class]) li { font-size: 17px; line-height: 1.6; text-wrap: pretty; }
.akte section ul:not([class]) li + li { margin-top: 12px; }
.akte .text-spur p:not(.stand) a,
.akte .text-spur ul:not([class]) a { text-decoration: underline 1.5px var(--roetel); text-underline-offset: 3px; transition: color .2s; }
@media (hover: hover) and (pointer: fine) {
  .akte .text-spur p a:hover,
  .akte .text-spur ul:not([class]) a:hover { color: var(--roetel); }
}
.akte .abschnitt-breit .tafel + .text-spur { margin-top: 32px; }
.akte .abschnitt-breit .text-spur + .tafel { margin-top: 24px; }
.akte .abschnitt-breit .tafel + .tafel { margin-top: 16px; }

/* Zeile zum Stand direkt unter dem Teaser, mit dem Weg zur echten Seite */
.akte .stand { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 20px; row-gap: 4px; font: 400 13.5px/1.5 var(--mono); color: var(--grau); }
.akte .stand a { color: var(--tinte); padding-block: 4px; text-decoration: underline 1.5px var(--roetel); text-underline-offset: 4px; }

/* belegte Zahlen groß gesetzt: Typografie trägt die Artikel ohne Screens */
.akte .zahlen { margin-top: 32px; padding: 0; list-style: none; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 24px 32px; }
.akte .zahlen li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
.akte .zahlen b { font-size: clamp(40px, 6.4vw, 64px); font-weight: 600; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.akte .zahlen span { font-size: 17px; line-height: 1.45; color: var(--grau); max-width: 34ch; text-wrap: pretty; }

/* nachgebaute Freigabe-Karte: ein Entwurf, zwei Knöpfe, nur der Zustand auf der Seite ändert sich */
.akte .freigabe { margin-top: 24px; }
.freigabe-karte { background: var(--passepartout); border-radius: var(--radius); padding: 8px; }
.akte .freigabe-kopf { padding: 12px 16px 16px; display: grid; gap: 4px; font-size: 15px; line-height: 1.45; }
.freigabe-kopf > div { display: grid; grid-template-columns: 8ch minmax(0, 1fr); gap: 12px; }
.freigabe-kopf dt { color: var(--grau); }
.freigabe-kopf dd { font-weight: 500; }
.freigabe-text { background: var(--papier); border-radius: var(--radius); padding: 20px 16px; transition: color .2s; }
.akte .freigabe .freigabe-text p { margin: 0; font-size: 16px; line-height: 1.55; }
.akte .freigabe .freigabe-text p + p { margin-top: 12px; }
.freigabe-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 8px 4px; min-height: 60px; }
.freigabe-wahl { display: flex; gap: 8px; }
.freigabe [hidden] { display: none; }
.akte .freigabe .freigabe-status { margin: 0; font-size: 16px; font-weight: 600; }
/* leer bleibt die Zeile im Zugänglichkeitsbaum, damit der neue Zustand angesagt wird */
.akte .freigabe .freigabe-status:empty { position: absolute; }
.freigabe-zurueck { margin-left: auto !important; }
.akte .freigabe .btn { min-height: 44px; padding: 0 20px; border: 1px solid rgba(26, 23, 20, .28); border-radius: var(--radius); background: transparent; color: var(--tinte); font: 500 15px/1 var(--text); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color .16s ease, border-color .16s ease, transform .12s ease; }
.akte .freigabe .btn-prim { background: var(--tinte); border-color: var(--tinte); color: var(--papier); }
@media (hover: hover) and (pointer: fine) {
  .akte .freigabe .btn:hover { border-color: var(--tinte); background: rgba(26, 23, 20, .06); }
  .akte .freigabe .btn-prim:hover { background: var(--roetel); border-color: var(--roetel); color: #fff; }
}
.akte .freigabe .btn:active { transform: scale(.97); }
.freigabe[data-zustand="verworfen"] .freigabe-text { color: var(--grau); text-decoration: line-through; text-decoration-thickness: 1px; }
.freigabe-status { animation: freigabe-ein .2s cubic-bezier(.23, 1, .32, 1); }
@keyframes freigabe-ein { from { opacity: 0; translate: 0 4px; } }
.akte .freigabe figcaption { margin-top: 12px; font: 400 13px/1.45 var(--mono); color: var(--grau); }

/* ein hochkantes Handybild allein steht schmal in der Mitte */
.tafel.hochkant .screen { width: min(300px, 100%); justify-self: center; }

/* Über-mich-Blatt: Kopf mit optionalem gedithertem Portrait und schlichter Kanäle-Liste */
.ueber-kopf {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}
.ueber-kopf > :not(.portrait-rahmen) {
  flex: 1 1 0;
  min-width: 0;
}
.portrait-rahmen {
  position: relative;
  flex: 0 0 auto;
  width: 132px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--passepartout);
  border: 1px solid var(--linie);
  padding: 0;
}
.portrait-rahmen .portrait-bild {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--passepartout);
}
.portrait-rahmen img,
img.portrait-rahmen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}
img.portrait-rahmen { width: 132px; height: 132px; border-radius: var(--radius); }

.akte .brucke {
  margin-top: clamp(56px, 9vh, 88px);
  display: grid;
  gap: 24px;
}
.akte .brucke.text-spur > p:not(.lede, .stand) { margin-top: 0; font-size: clamp(19px, 2vw, 22px); line-height: 1.45; letter-spacing: -.01em; max-width: 34ch; }
.akte .weiter { display: inline-grid; gap: 4px; justify-self: start; }
.akte .weiter span { font: 400 13px/1 var(--mono); color: var(--grau); }
.akte .weiter b { font-weight: 500; font-size: 19px; letter-spacing: -.015em; text-decoration: underline 1.5px var(--linie); text-underline-offset: 5px; transition: text-decoration-color .2s; }
.akte .weiter:hover b { text-decoration-color: var(--roetel); }
.akte .alle-notizen { justify-self: start; padding-block: 10px; font: 400 14px/1.4 var(--mono); text-decoration: underline 1.5px var(--roetel); text-underline-offset: 4px; }

/* Notiz: Datum in Geist Mono, eine ruhige Textspur */
.akte .notiz-datum { font: 400 13.5px/1.4 var(--mono); color: var(--grau); font-variant-numeric: tabular-nums; }
.akte h1 + .notiz-datum { margin-top: 12px; }
.akte.notiz { padding-top: clamp(32px, 8vh, 88px); }
.akte.notiz .text-spur { max-width: 560px; }
.akte.notiz h1 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.12; text-wrap: balance; }
.akte.notiz .text-spur:first-of-type + .text-spur > p:first-child { margin-top: 32px; }
.akte.notiz .text-spur > p { line-height: 1.65; }

/* Übersicht aller Notizen */
.akte .notiz-liste { margin-top: clamp(32px, 5vh, 48px); padding: 0; list-style: none; border-top: 1px solid var(--linie); }
.notiz-liste li { border-bottom: 1px solid var(--linie); }
.akte .notiz-liste a { display: grid; grid-template-columns: 11ch minmax(0, 1fr); align-items: baseline; column-gap: 16px; row-gap: 4px; padding-block: 20px; }
.notiz-liste time { grid-row: span 2; font: 400 13px/1.4 var(--mono); color: var(--grau); font-variant-numeric: tabular-nums; }
.notiz-liste b { justify-self: start; font-weight: 500; font-size: 18px; line-height: 1.35; letter-spacing: -.012em; text-decoration: underline 1.5px transparent; text-underline-offset: 5px; transition: text-decoration-color .2s; }
.notiz-liste a:hover b { text-decoration-color: var(--roetel); }
.notiz-liste span { color: var(--grau); text-wrap: pretty; }

/* auf der Startseite: das Blatt steigt über die Landschaft, oben franst es im Pixelraster aus */
.akte-blatt {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #1A171400;
  transition: background .55s ease;
}
.akte-blatt.auf { background: #1A171433; }
.akte-blatt .innen {
  position: relative;
  margin-top: clamp(72px, 14vh, 140px);
  min-height: calc(100% - clamp(72px, 14vh, 140px));
  background: var(--papier);
  border-top: 1px solid var(--linie);
  box-shadow: 0 -16px 40px -24px rgba(26, 23, 20, .24);
  translate: 0 100vh;
  transition: translate .55s cubic-bezier(.2, .8, .2, 1);
  overflow-x: clip;
}
.akte-blatt.auf .innen { translate: 0 0; }
.akte-blatt .zu {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  width: 100%;
  padding: 16px clamp(20px, 3.4vw, 48px) 12px;
  border: 0;
  background: var(--papier);
  text-align: left;
  font: 400 14px/1 var(--mono);
  color: var(--grau);
  cursor: pointer;
}
.akte-blatt .zu:hover { color: var(--tinte); }
.akte-blatt .akte { padding-top: clamp(8px, 2vh, 24px); }
.akte h1:focus { outline: none; }
html.akte-offen,
html.lightbox-offen { overflow: hidden; }

/* ruhige Passepartout-Lightbox für .screen img */
.akte-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(242, 239, 233, .96);
  color: var(--tinte);
  opacity: 0;
  transition: opacity .2s ease;
}
.akte-lightbox.offen { opacity: 1; }
.akte-lightbox-rahmen {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 40px 0 16px;
}
.akte-lightbox-zu {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--papier);
  color: var(--grau);
  font: 400 22px/1 var(--mono);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.akte-lightbox-zu:hover { color: var(--tinte); border-color: var(--grau); }
.akte-lightbox-figur {
  margin: 0;
  max-width: min(1160px, 100%);
  display: grid;
  gap: 16px;
  justify-items: center;
}
.akte-lightbox-bild {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #1A171422;
  background: #0B0D0F;
  box-shadow: 0 20px 48px -24px rgba(26, 23, 20, .32);
}
.akte-lightbox-bild.hell {
  background: #F5F2EC;
  border-color: #1A171424;
  box-shadow: 0 16px 40px -24px rgba(26, 23, 20, .20);
}
.akte-lightbox-bild img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 128px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.akte-lightbox-text {
  font: 400 13px/1.45 var(--mono);
  color: var(--grau);
  text-align: center;
  max-width: 64ch;
}

@media (prefers-reduced-motion: reduce) {
  .akte-blatt,
  .akte-blatt .innen,
  .akte-lightbox,
  .portrait-rahmen img.orig-peek,
  .akte .freigabe .btn,
  .freigabe-text,
  .scrub-regler::-webkit-slider-thumb { transition: none; }
  /* eigene Regel: ein unbekannter Pseudo-Selektor würde sonst die ganze Liste ungültig machen */
  .scrub-regler::-moz-range-thumb { transition: none; }
  .freigabe-status { animation: none; }
  .akte .freigabe .btn:active { transform: none; }
}

@media (max-width: 720px) {
  .akte { padding-left: 16px; padding-right: 16px; }
  .akte section p,
  .akte .text-spur > p:not(.lede, .stand),
  .akte section ul:not([class]) li { font-size: 16px; }
  .akte .zahlen { grid-template-columns: minmax(0, 1fr); }
  .akte .zahlen li { row-gap: 8px; }
  .akte .zahlen b { font-size: 48px; }
  .akte .zahlen span { font-size: 16px; }
  .akte .notiz-liste a { grid-template-columns: minmax(0, 1fr); padding-block: 16px; }
  .notiz-liste time { grid-row: auto; }
  .buehne { padding: 16px; }
  .triptychon .buehne, .wischbar .buehne { padding: 12px 0; }
  .spur, .wischbar .beleg-duo {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .spur::-webkit-scrollbar, .wischbar .beleg-duo::-webkit-scrollbar { display: none; }
  .spur .bild-slot, .wischbar .beleg-duo .bild-slot { flex: 0 0 76%; scroll-snap-align: center; }
  .triptychon .mobil-hinweis, .wischbar .mobil-hinweis { display: inline; }
  .karten-duo, .duo, .beleg-duo { grid-template-columns: 1fr; gap: 16px; }
  .ueber-kopf { flex-direction: column; gap: 20px; }
  .portrait-rahmen, img.portrait-rahmen { width: 120px; }
  .akte-blatt .innen { margin-top: 68px; min-height: calc(100% - 68px); }
  .akte-blatt .akte { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .akte-lightbox { padding: 16px; }
  .akte-lightbox-bild img { max-height: calc(100dvh - 112px); }
  .scrub-steuerung { gap: 12px; }
  .scrub-status { min-width: 0; }
}
