/* ==========================================================================
   Portfolio Patrick Jan Miozga
   Corporate Design nach "design_handoff_bewerbung_cd" (Bewerbungsmappe/Lebenslauf)
   Schrift Archivo 400/500/600 - Tinte #111111 - Akzent #D8501E - Papier weiss
   Rastersprache: Randspalte + 8-spaltiges Inhaltsraster, Linien nur 1.5px Tinte
   ========================================================================== */

/* --- Farben und Masse ---------------------------------------------------- */
:root {
  --tinte:      #111111;   /* Text, Linien, Monogramm "JM" */
  --gedaempft:  #5A5A56;   /* Zweitzeilen: Institution, Unterzeile */
  --meta:       #6F6F6B;   /* Datum, Kleinlabels. Bildschirmwert des CD-Grau
                              #888884, minimal abgedunkelt fuer WCAG-AA-Kontrast */
  --akzent:     #D8501E;   /* Ziffern, Eyebrow, das "P" im Monogramm */
  --papier:     #FFFFFF;
  --plattform:  #F6F6F3;   /* Abbildungsfeld hinter Planzeichnungen (nur Bildschirm) */

  --rand:   140px;  /* Randspalte des Rasters */
  --luft:   26px;   /* Spaltenabstand */
  --linie:  1.5px solid var(--tinte);
  --blatt:  1320px; /* Satzbreite */

  /* Nur Archivo und normal breite Ersatzschriften. "Archivo Expanded" gehoerte
     hier nicht her: waere sie lokal installiert, liefe der Satz deutlich
     breiter als geplant, sobald die Webschrift einmal nicht laedt. */
  --schrift: "Archivo", "Helvetica Neue", Helvetica, Arial,
             system-ui, sans-serif;
}

/* --- Grundlagen ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--tinte); text-decoration: none; }
a:hover, a:focus-visible { color: var(--akzent); }

:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 3px;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }

/* Sprungmarke fuer Tastatur- und Screenreader-Nutzung */
.sprungmarke {
  position: absolute; left: -9999px; top: 0;
  background: var(--tinte); color: var(--papier);
  padding: 10px 16px; z-index: 20;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
}
.sprungmarke:focus { left: 0; color: var(--papier); }

/* --- Raster -------------------------------------------------------------- */
.blatt {
  width: 100%;
  max-width: var(--blatt);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 56px);
}

/* Ebene 1: Randspalte + Inhalt */
.raster {
  display: grid;
  grid-template-columns: var(--rand) 1fr;
  gap: 0 var(--luft);
}

/* Ebene 2: acht gleiche Spalten. Inhalt 1-6, Meta 7-8 rechts. */
.inhalt {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0 var(--luft);
  align-content: start;
}

.spanne  { grid-column: 1 / span 6; }
.voll    { grid-column: 1 / -1; }
.rechts  { grid-column: 7 / span 2; text-align: right; }

/* --- Schriftrollen ------------------------------------------------------- */
.eyebrow {
  font-size: 11px; font-weight: 500; line-height: 1.3;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--akzent);
}

.label {
  font-size: 11px; font-weight: 500; line-height: 1.3;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--tinte);
}

.meta {
  font-size: 12.5px; font-weight: 400; line-height: 1.45;
  letter-spacing: 0.02em; color: var(--meta);
}

.ziffer {
  display: block;
  font-size: 20px; font-weight: 600; line-height: 1;
  letter-spacing: 0.02em; color: var(--akzent);
}

.unter { color: var(--gedaempft); }

/* --- Kopfleiste ---------------------------------------------------------- */
.kopf { padding-top: 26px; }

.kopf-zeile {
  align-items: end;
  padding-bottom: 12px;
  border-bottom: var(--linie);
}

.monogramm {
  font-size: 22px; font-weight: 500; line-height: 1;
  letter-spacing: -0.01em; color: var(--tinte);
  white-space: nowrap;
}
.monogramm:hover, .monogramm:focus-visible { color: var(--tinte); }
.monogramm .p { color: var(--akzent); }

.kopf-inhalt { align-items: end; }

.navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.navigation a {
  font-size: 11px; font-weight: 500; line-height: 1.3;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--tinte);
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
}
.navigation a:hover { color: var(--akzent); }
.navigation a[aria-current="page"] {
  color: var(--akzent);
  border-bottom-color: var(--akzent);
}

.blattname {
  font-size: 11px; font-weight: 500; line-height: 1.3;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--meta);
  white-space: nowrap;
}

/* --- Fussleiste ---------------------------------------------------------- */
.fuss {
  margin-top: 76px;
  padding-bottom: 40px;
}
.fuss-zeile {
  padding-top: 10px;
  border-top: var(--linie);
}
.fuss-inhalt { align-items: start; }
.fuss-links  { grid-column: 1 / span 5; }
.fuss-rechts {
  grid-column: 6 / span 3; text-align: right; white-space: nowrap;
}
.fuss a { color: var(--meta); }
.fuss a:hover { color: var(--akzent); }

/* --- Abschnitte ---------------------------------------------------------- */
main { display: block; }

.abschnitt {
  margin-top: 52px;
}
.abschnitt-kopf > .label { display: block; margin-top: 3px; }

/* Titelblock einer Unterseite */
.blatttitel {
  margin-top: 44px;
}
.blatttitel h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 500; line-height: 1.06; letter-spacing: -0.014em;
  margin-top: 8px;
}
.blatttitel .untertitel {
  margin-top: 12px;
  color: var(--gedaempft);
  font-size: 17px; line-height: 1.5;
}

h2.titel {
  font-size: clamp(22px, 2.6vw, 27px);
  font-weight: 500; line-height: 1.15; letter-spacing: -0.01em;
}

h3.eintragstitel {
  font-size: 17px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3;
}

.fliess p + p { margin-top: 13px; }
.fliess { max-width: 62ch; }

.strichliste { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.strichliste li { padding-left: 16px; position: relative; }
.strichliste li::before {
  content: ""; position: absolute; left: 0; top: 0.72em;
  width: 8px; height: 1.5px; background: var(--tinte);
}

/* --- Deckblatt / Startseite ----------------------------------------------
   Das Deckblatt bekommt den ganzen ersten Bildschirm: Name und Portraet
   stehen zentriert, das erste Projekt beginnt erst nach dem Blaettern.    */
.deckblatt {
  margin-top: 0;
  /* --kopf wird per Skript auf die gemessene Hoehe der Kopfleiste gesetzt;
     67px ist der Ersatzwert ohne Skript. So endet das Deckblatt exakt am
     Blattfalz, egal ob die Navigation ein- oder zweizeilig umbricht. */
  min-height: calc(100vh - var(--kopf, 67px));
  min-height: calc(100svh - var(--kopf, 67px));
  position: relative;
  padding-bottom: 84px;
}
.deckblatt > .inhalt { align-content: center; }

/* Hinweis am Blattfuss: hier geht es weiter */
.hinunter {
  position: absolute;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta);
}
.hinunter:hover, .hinunter:focus-visible { color: var(--akzent); }
.hinunter svg { width: 10px; height: 20px; display: block; }
@media (prefers-reduced-motion: no-preference) {
  .hinunter svg { animation: nicken 2.6s ease-in-out infinite; }
}
@keyframes nicken {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

.deckblatt h1 {
  font-size: clamp(44px, 8.4vw, 86px);
  font-weight: 500; line-height: 0.98; letter-spacing: -0.022em;
  margin-top: 14px;
}
.deckblatt .rolle {
  margin-top: 22px;
  color: var(--gedaempft);
  font-size: clamp(16px, 1.9vw, 20px); line-height: 1.45;
  max-width: 36ch;
}
.deckblatt-text { grid-column: 1 / span 4; align-self: center; }
.deckblatt-bild { grid-column: 5 / span 4; align-self: center; justify-self: end; }
.deckblatt-bild img { width: 100%; max-width: 620px; }

/* --- Datenblatt (Projektangaben) ----------------------------------------- */
.datenblatt {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0 var(--luft);
  border-top: var(--linie);
  padding-top: 14px;
}
.datenblatt dt {
  grid-column: 1 / span 2;
  font-size: 11px; font-weight: 500; line-height: 1.5;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--meta);
  padding-top: 3px;
}
.datenblatt dd {
  grid-column: 3 / span 6;
  font-size: 15px; line-height: 1.5;
  padding-bottom: 9px;
}

/* --- Abbildungen --------------------------------------------------------- */
.tafel { margin-top: 34px; }
.tafel-hinweis { margin-bottom: -12px; }

.tafel-feld {
  display: block;
  background: var(--plattform);
  padding: clamp(12px, 2.4vw, 30px);
  position: relative;
}
.tafel-feld img { width: 100%; }
.tafel-feld:hover, .tafel-feld:focus-visible { color: var(--tinte); }

.lupe {
  position: absolute; right: 12px; bottom: 12px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--papier);
  opacity: 0; transition: opacity .15s ease;
}
.tafel-feld:hover .lupe,
.tafel-feld:focus-visible .lupe { opacity: 1; }
.lupe svg { width: 15px; height: 15px; display: block; }

figcaption {
  margin-top: 10px;
  font-size: 12.5px; line-height: 1.45; letter-spacing: 0.02em;
  color: var(--meta);
}
figcaption .fig-nr {
  color: var(--akzent); font-weight: 600; letter-spacing: 0.02em;
  margin-right: 9px;
}
figcaption b { color: var(--tinte); font-weight: 500; }

/* Zwei Abbildungen nebeneinander. Die Felder werden bewusst NICHT auf gleiche
   Hoehe gezogen: liegt ein Hochformat neben einem Querformat, entstuende
   neben dem flacheren Bild sonst ein grosses totes Feld. */
.tafel-paar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--luft);
  align-items: start;
}
.tafel-paar > figure { display: flex; flex-direction: column; }
.tafel-paar > figure > .tafel-feld {
  display: grid;
  align-content: center;
  justify-items: center;
}
.tafel-paar img { max-height: 620px; width: auto; object-fit: contain; }

/* Platzhalter fuer fehlendes Bildmaterial - bewusst sichtbar und beschriftet */
.platzhalter {
  border: 1.5px dashed var(--meta);
  min-height: 210px;
  display: grid; place-content: center; justify-items: center;
  gap: 10px; padding: 30px; text-align: center;
}
.platzhalter svg { width: 26px; height: 26px; color: var(--meta); }
.platzhalter .label { color: var(--meta); }
.platzhalter p { font-size: 13px; color: var(--meta); max-width: 34ch; }

/* --- Eintragsliste (Projektuebersicht, Werdegang) ------------------------ */
.liste { display: flex; flex-direction: column; }

.eintrag {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0 var(--luft);
  padding: 26px 0;
  border-top: var(--linie);
  align-items: start;
}
.eintrag:first-child { border-top: none; padding-top: 4px; }

.eintrag-bild { grid-column: 1 / span 3; }
.eintrag-bild .tafel-feld { padding: 10px; }
.eintrag-text { grid-column: 4 / span 3; }
.eintrag-meta { grid-column: 7 / span 2; text-align: right; }
.eintrag-text .unter { margin-top: 3px; font-size: 14.5px; }
.eintrag-text p.kurz { margin-top: 10px; font-size: 15px; line-height: 1.5; }
/* Weiterführender Verweis - gilt überall, nicht nur in Eintragslisten */
.weiter {
  display: inline-block;   /* nicht inline-flex: der Pfeil soll dem letzten Wort
                              folgen, auch wenn der Text umbricht */
  margin-top: 16px;
  font-size: 11px; font-weight: 500; line-height: 1.4;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--akzent);
}
.weiter:hover, .weiter:focus-visible { color: var(--tinte); }
.weiter svg {
  width: 20px; height: 10px;
  display: inline; vertical-align: middle;
  margin-left: 8px; margin-bottom: 1px;
}
.weiter + br + .weiter { margin-top: 10px; }

/* Werdegang: Eintraege ohne Bild */
.werdegang-eintrag { grid-column: 1 / span 6; padding-bottom: 20px; }
.werdegang-eintrag:last-child { padding-bottom: 0; }
.werdegang-datum { grid-column: 7 / span 2; text-align: right; }

/* Kompetenzzeile: fette Kategorie, danach Aufzaehlung */
.kompetenz { grid-column: 1 / span 6; padding-bottom: 11px; font-size: 15px; }
.kompetenz b { font-weight: 600; margin-right: 14px; }

/* --- Kacheln (digitale Arbeiten) ----------------------------------------- */
.kacheln {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--luft);
}
.kachel {
  border-top: var(--linie);
  padding-top: 14px;
}
/* Bildschirmfoto einer Referenzseite: gerahmt wie ein Beleg, nicht wie eine
   Zeichnung - deshalb duenne Tintenlinie statt Plattform-Feld */
.kachel .schaubild {
  display: block;
  margin-bottom: 14px;
  border: 1.5px solid var(--tinte);
  overflow: hidden;
}
.kachel .schaubild img {
  display: block; width: 100%; height: auto;
  transition: transform .55s cubic-bezier(.2,.6,.2,1);
}
.kachel .schaubild:hover img,
.kachel .schaubild:focus-visible img { transform: scale(1.015); }
.kachel .domain {
  display: block;
  font-size: clamp(19px, 2.3vw, 25px); font-weight: 500;
  letter-spacing: -0.01em; line-height: 1.2;
}
.kachel p { margin-top: 8px; font-size: 14.5px; color: var(--gedaempft); }
.kachel .rolle-zeile { margin-top: 12px; }

/* --- Kontaktblock -------------------------------------------------------- */
.kontaktblock { display: flex; flex-direction: column; gap: 4px; font-size: 17px; }
.kontaktblock .zeile-gross { font-size: clamp(20px, 2.4vw, 26px); font-weight: 500; letter-spacing: -0.01em; }

/* --- Rechtstexte --------------------------------------------------------- */
.rechtstext { max-width: 68ch; }
.rechtstext h2 {
  font-size: 17px; font-weight: 600; letter-spacing: -0.005em;
  margin-top: 30px;
}
.rechtstext h2:first-of-type { margin-top: 0; }
.rechtstext h3 { font-size: 15px; font-weight: 600; margin-top: 20px; }
.rechtstext p  { margin-top: 9px; font-size: 15px; line-height: 1.6; }
.rechtstext ul { margin-top: 9px; display: flex; flex-direction: column; gap: 4px; }
.rechtstext li { font-size: 15px; padding-left: 16px; position: relative; }
.rechtstext li::before {
  content: ""; position: absolute; left: 0; top: 0.75em;
  width: 8px; height: 1.5px; background: var(--tinte);
}

/* --- Bildblatt: eine Zeichnung ueber die volle Fensterbreite -------------
   Der Auftritt eines Portfolios lebt davon, dass die Zeichnung gross genug
   ist, um gelesen zu werden. Das Blatt bricht dafuer bewusst aus der
   Satzbreite aus; die Legende bleibt im Raster.                            */
.bildblatt {
  margin-top: 56px;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  background: var(--plattform);
  padding: clamp(22px, 4vw, 60px) clamp(20px, 5vw, 56px);
}
.bildblatt-innen {
  max-width: var(--blatt);
  margin-inline: auto;
}
.bildblatt img {
  width: 100%;
  max-height: min(74vh, 780px);
  object-fit: contain;
  object-position: center;
}
.bildblatt figcaption { margin-top: 16px; }

/* Auch das Eroeffnungsblatt laesst sich vergroessern */
.bildblatt-verweis { display: block; position: relative; cursor: zoom-in; }
.bildblatt-verweis:hover, .bildblatt-verweis:focus-visible { color: var(--tinte); }
.bildblatt-verweis .lupe { right: 0; bottom: 0; }
.bildblatt-verweis:hover .lupe,
.bildblatt-verweis:focus-visible .lupe { opacity: 1; }

/* --- Projektblatt: grosses Vorschaublatt der Projektuebersicht ------------ */
.blaetter { display: flex; flex-direction: column; gap: 64px; }

.projektblatt { display: block; }

.projektblatt-bild { display: block; }
.projektblatt-bild .tafel-feld { padding: clamp(12px, 1.8vw, 24px); }
.projektblatt-bild img {
  width: 100%;
  max-height: 640px;
  object-fit: contain;
}

.projektblatt-fuss {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0 var(--luft);
  margin-top: 18px;
  padding-top: 14px;
  border-top: var(--linie);
  align-items: start;
}
.projektblatt-fuss .text { grid-column: 1 / span 6; }
.projektblatt-fuss .meta-rechts { grid-column: 7 / span 2; text-align: right; }
.projektblatt h3.eintragstitel { font-size: clamp(19px, 2.1vw, 24px); }
.projektblatt .unter { margin-top: 4px; font-size: 15px; }
.projektblatt p.kurz { margin-top: 11px; font-size: 16px; line-height: 1.5; max-width: 62ch; }

/* --- Grundriss-Raster: eine Serie gleichwertiger Zeichnungen --------------
   Alle Felder gleich hoch, die Zeichnung wird eingepasst. Dadurch liest
   sich die Serie als Katalog, obwohl die Blattausschnitte unterschiedlich
   breit sind.                                                              */
.grundriss-raster {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--luft);
}
.grundriss-raster figure { display: flex; flex-direction: column; margin: 0; }
.grundriss-raster .tafel-feld {
  flex: 1;
  padding: 10px;
  display: grid; place-items: center;
}
.grundriss-raster img {
  width: auto; max-width: 100%;
  height: 200px;
  object-fit: contain;
}
.grundriss-raster figcaption {
  margin-top: 7px;
  font-size: 11.5px; line-height: 1.4;
}

/* --- Lupe: Hinweis, dass sich eine Zeichnung vergroessern laesst ---------- */
.tafel-feld[data-gross] { cursor: zoom-in; }

/* --- Bildschau (Lightbox) -------------------------------------------------
   Ohne JavaScript bleibt jede Zeichnung ueber ihren normalen Verweis in
   voller Groesse erreichbar; das hier ist nur die bequemere Variante.       */
.schau {
  position: fixed; inset: 0; z-index: 50;
  background: #111111;   /* deckend - die Seite darunter darf nicht durchscheinen */
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 20px clamp(16px, 3vw, 34px) 22px;
}
.schau[hidden] { display: none; }
.schau-kopf, .schau-fuss {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  max-width: 1600px; width: 100%; margin-inline: auto;
}
.schau-kopf .label, .schau-fuss .meta { color: #F4F4F1; }
.schau-fuss .meta { font-size: 12.5px; }
/* Flexbox, nicht Grid: nur hier loest die prozentuale Hoehenbegrenzung
   zuverlaessig gegen die Containerhoehe auf. Im Grid richtet sich die
   Zeile sonst nach dem Bild - die Zeichnung lief unten aus dem Bild.    */
.schau-bild {
  min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
}
.schau-bild img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  flex: 0 0 auto;
  cursor: zoom-in;
}
.schau-bild img.gezoomt {
  max-width: none; max-height: none;
  width: 190%; height: auto;
  margin: auto;
  cursor: zoom-out;
}
.schau-zu {
  background: none; border: none; padding: 6px;
  color: #F4F4F1; cursor: pointer;
  font-family: inherit;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 9px;
}
.schau-zu:hover { color: var(--akzent); }
.schau-zu svg { width: 13px; height: 13px; }
body.schau-offen { overflow: hidden; }

/* ==========================================================================
   Bewegung
   Alles hier folgt derselben Idee: die Seite verhaelt sich wie ein Plansatz,
   der gezeichnet wird - Linien laufen, Blaetter werden aufgedeckt, nichts
   huepft. Nur aktiv mit JavaScript (html.js) und ohne Bewegungsreduktion.
   ========================================================================== */

/* --- Seitenuebergaenge (Cross-Document View Transitions) ------------------ */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: blatt-raus .22s ease both; }
  ::view-transition-new(root) { animation: blatt-rein .34s ease both; }
}
@keyframes blatt-raus { to   { opacity: 0; transform: translateY(-10px); } }
@keyframes blatt-rein { from { opacity: 0; transform: translateY(12px); } }

/* --- Deckblatt-Eroeffnung: Zeilen steigen, das Portraet wird geplottet ---- */
@media (prefers-reduced-motion: no-preference) {
  .deckblatt .eyebrow {
    animation: auftauchen .6s .1s ease both;
  }
  .deckblatt h1 .zeile { display: block; overflow: hidden; }
  .deckblatt h1 .zeile > span {
    display: block;
    animation: zeile-hoch .85s cubic-bezier(.2,.65,.2,1) both;
  }
  .deckblatt h1 .zeile:nth-child(2) > span { animation-delay: .14s; }
  .deckblatt .rolle { animation: auftauchen .7s .5s ease both; }

  .deckblatt-bild { position: relative; }
  .deckblatt-bild img {
    animation: wischen 1.15s .4s cubic-bezier(.65,.05,.25,1) both;
  }
  /* die Zeichenkante: eine Akzentlinie fegt einmal ueber das Portraet */
  .deckblatt-bild::after {
    content: "";
    position: absolute; top: 0; bottom: 0; left: 0;
    width: 1.5px; background: var(--akzent);
    animation: kante 1.15s .4s cubic-bezier(.65,.05,.25,1) both;
  }
}
@keyframes auftauchen { from { opacity: 0; transform: translateY(10px); } }
@keyframes zeile-hoch { from { transform: translateY(108%); } }
@keyframes wischen { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes kante {
  from { left: 0; opacity: 1; }
  92%  { opacity: 1; }
  to   { left: 100%; opacity: 0; }
}

/* --- Ruhiges Einblenden beim Blaettern ------------------------------------
   Ohne Skript steht alles sofort sichtbar da. Deckblatt und Blatttitel
   bleiben absichtlich statisch - der Einstieg gehoert der Eroeffnung oben. */
html.js .bildblatt,
html.js .projektblatt,
html.js .abschnitt,
html.js figure.tafel {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
html.js .bildblatt.da,
html.js .projektblatt.da,
html.js .abschnitt.da,
html.js figure.tafel.da {
  opacity: 1;
  transform: none;
}

/* Zeichnungen entstehen von oben nach unten, wie vom Plotter gezogen */
html.js figure.tafel .tafel-feld img {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s cubic-bezier(.2,.6,.2,1) .18s;
}
html.js figure.tafel.da .tafel-feld img {
  clip-path: inset(0 0 0% 0);
}

/* Das grosse Eroeffnungsblatt haengt direkt an der Scrollbewegung: die
   Zeichnung wird gezogen, solange man blaettert, und zieht sich beim
   Zurueckblaettern wieder zusammen. Den Fortschritt setzt bild.js als
   Inline-clip-path - das laeuft in jedem Browser gleich. Ohne Skript
   oder mit Bewegungsreduktion bleibt die Zeichnung einfach sichtbar.    */

/* Kartenreihen treppeln nacheinander herein */
html.js .projektkarten .projektkarte {
  opacity: 0; transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
html.js .abschnitt.da .projektkarte { opacity: 1; transform: none; }
html.js .projektkarten .projektkarte:nth-child(2) { transition-delay: .12s; }
html.js .projektkarten .projektkarte:nth-child(3) { transition-delay: .24s; }

/* --- Naeher herantreten: Zeichnungen reagieren auf die Hand ---------------
   Bewusst NICHT auf dem grossen Eroeffnungsblatt: dort schiebt das Parallax
   die Zeichnung per Transform, eine Transition wuerde es verzoegern.       */
.tafel-feld { overflow: hidden; }
.tafel-feld img {
  transition: transform .55s cubic-bezier(.2,.6,.2,1);
}
a.tafel-feld:hover img, a.tafel-feld:focus-visible img {
  transform: scale(1.016);
}

/* Verweise: die Linie zeichnet sich unter dem Wort */
.weiter, .fuss a, .kachel .domain {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .3s ease, color .15s ease;
}
.weiter:hover, .weiter:focus-visible,
.fuss a:hover, .kachel .domain:hover {
  background-size: 100% 1.5px;
}

/* --- Projektkarten: drei Projekte in einer Reihe -------------------------- */
.projektkarten {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--luft);
}
.projektkarte { display: block; }
.projektkarte .tafel-feld {
  height: 250px;
  padding: 16px;
  display: block;
}
/* Bild fuellt das Feld und wird per object-fit eingepasst - die robuste
   Variante: prozentuale max-height versagt bei hohen Formaten im Grid. */
.projektkarte img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.projektkarte h3 {
  margin-top: 13px;
  font-size: 16.5px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3;
}
.projektkarte .unter { margin-top: 3px; font-size: 14px; }

/* --- Geschoss-Aufzug (Hochhaus): links zaehlt das Geschoss mit ------------ */
.aufzug {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0 44px;
  align-items: start;
}
.aufzug-links {
  position: sticky; top: 88px;
  padding-top: 4px;
}
.aufzug-nr {
  display: block;
  font-size: 104px; font-weight: 600; line-height: 1;
  letter-spacing: -0.02em; color: var(--akzent);
  font-variant-numeric: tabular-nums;
}
.aufzug-name {
  display: block;
  margin-top: 12px;
  font-size: 15px; line-height: 1.45;
  min-height: 2.9em;
}
.aufzug-leiter {
  display: flex; flex-direction: column-reverse; gap: 7px;
  margin-top: 24px;
}
.aufzug-leiter span {
  display: block; width: 26px; height: 1.5px;
  background: #D9D9D4;
  transition: background .25s ease, width .25s ease;
}
.aufzug-leiter span.aktiv { background: var(--akzent); width: 46px; }
.aufzug-rechts {
  min-width: 0;
  display: flex; flex-direction: column; gap: 44px;
}
.aufzug-rechts .tafel { margin-top: 0; }
.aufzug-rechts .tafel-feld {
  display: grid; place-items: center;
  padding: clamp(14px, 2vw, 26px);
}
.aufzug-rechts img {
  max-height: 540px; max-width: 100%;
  width: auto; height: auto;
  object-fit: contain;
}

/* ==========================================================================
   Tablet - Randspalte wird schmaler, Inhaltsraster bleibt achtspaltig
   ========================================================================== */
@media (max-width: 1000px) {
  :root { --rand: 104px; --luft: 20px; }
  .eintrag-bild { grid-column: 1 / span 3; }
  .eintrag-text { grid-column: 4 / span 4; }
  .eintrag-meta { grid-column: 1 / -1; text-align: left; margin-top: 12px; order: 3; }
}

/* ==========================================================================
   Schmale Tablets / grosse Handys - Randspalte klappt ueber den Inhalt
   ========================================================================== */
@media (max-width: 820px) {
  :root { --rand: 0px; }

  .raster { grid-template-columns: 1fr; gap: 0; }

  /* Label-Spalte wird zur Zeile ueber dem Inhalt */
  .abschnitt-kopf {
    display: flex; align-items: baseline; gap: 12px;
    margin-bottom: 14px;
  }
  .abschnitt-kopf .ziffer { font-size: 15px; }
  .abschnitt-kopf > .label { margin-top: 0; }

  .kopf-zeile {
    display: flex; flex-wrap: wrap; align-items: baseline;
    justify-content: space-between; gap: 10px 16px;
  }
  .kopf-inhalt {
    display: flex; flex-wrap: wrap; align-items: baseline;
    justify-content: space-between; gap: 10px 16px;
    width: 100%;
  }
  .navigation { gap: 4px 18px; }
  .blattname { display: none; }

  .fuss-inhalt { display: flex; flex-direction: column; gap: 8px; }
  .fuss-rechts { text-align: left; white-space: normal; }

  .deckblatt-text { grid-column: 1 / -1; }
  .deckblatt-bild {
    grid-column: 1 / -1;
    margin-top: 30px; max-width: 340px;
    justify-self: start;
  }
  /* Ersatzwert ohne Skript: Kopfleiste ist auf schmalen Schirmen zweizeilig */
  .deckblatt {
    min-height: calc(100vh - var(--kopf, 112px));
    min-height: calc(100svh - var(--kopf, 112px));
  }

  .datenblatt dt { grid-column: 1 / -1; padding-top: 10px; }
  .datenblatt dd { grid-column: 1 / -1; padding-bottom: 0; margin-top: 2px; }

  .eintrag { grid-template-columns: 1fr; gap: 0; }
  .eintrag-bild, .eintrag-text, .eintrag-meta { grid-column: 1 / -1; }
  .eintrag-text { margin-top: 16px; }
  .eintrag-meta { margin-top: 10px; text-align: left; order: 0; }

  .werdegang-eintrag, .werdegang-datum, .kompetenz { grid-column: 1 / -1; }
  .werdegang-datum { text-align: left; margin-bottom: 4px; }

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

  .projektblatt-fuss { grid-template-columns: 1fr; gap: 0; }
  .projektblatt-fuss .text,
  .projektblatt-fuss .meta-rechts { grid-column: 1 / -1; }
  .projektblatt-fuss .meta-rechts { text-align: left; order: -1; margin-bottom: 8px; }
  .blaetter { gap: 48px; }

  .grundriss-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Aufzug: die Mitzaehl-Spalte weicht, jede Zeichnung traegt ihre eigene
     Beschriftung ohnehin selbst */
  .aufzug { display: block; }
  .aufzug-links { display: none; }
  .aufzug-rechts { gap: 34px; }

  .projektkarten { grid-template-columns: 1fr; gap: 30px; }
  .projektkarte .tafel-feld { height: 220px; }
}

/* ==========================================================================
   Handy
   ========================================================================== */
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .inhalt { grid-template-columns: 1fr; }
  .spanne, .rechts, .voll { grid-column: 1 / -1; }
  .rechts { text-align: left; }
  .tafel-paar { grid-template-columns: 1fr; }
  .tafel { margin-top: 26px; }
  .abschnitt { margin-top: 40px; }
  .lupe { opacity: 1; }
  .kopf { padding-top: 20px; }

  .bildblatt { margin-top: 38px; }
  .bildblatt img { max-height: 62vh; }
  .projektblatt-bild img { max-height: 380px; }
  .blaetter { gap: 40px; }

  .grundriss-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .grundriss-raster img { height: 150px; }
}

/* ==========================================================================
   Druck - schwarze Tinte auf weissem Papier, wie die Mappe
   ========================================================================== */
@media print {
  :root { --plattform: #FFFFFF; }
  body { font-size: 10.5pt; }
  .navigation, .lupe, .sprungmarke, .schau { display: none !important; }
  .tafel-feld { padding: 0; }
  .abschnitt, .tafel, .eintrag, .projektblatt { break-inside: avoid; }
  a { color: #111111 !important; }
  /* Bildblatt zurueck in den Satzspiegel, Zeichnungen auf Blatthoehe */
  .bildblatt {
    width: auto; margin-inline: 0; padding: 0; background: none;
  }
  .bildblatt img, .projektblatt-bild img { max-height: none; }
  html.js .bildblatt, html.js .projektblatt,
  html.js .abschnitt, html.js figure.tafel,
  html.js .projektkarten .projektkarte {
    opacity: 1 !important; transform: none !important;
  }
  html.js figure.tafel .tafel-feld img { clip-path: none !important; }
  html.js .bildblatt .bildblatt-verweis img {
    clip-path: none !important; animation: none !important;
  }
  .aufzug { display: block; }
  .aufzug-links { display: none; }
  .hinunter { display: none; }
  .deckblatt { min-height: 0; }
  @page { margin: 16mm 20mm; }
}

/* Bewegungsreduktion respektieren */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html.js .bildblatt, html.js .projektblatt,
  html.js .abschnitt, html.js figure.tafel,
  html.js .projektkarten .projektkarte {
    opacity: 1; transform: none;
  }
  html.js figure.tafel .tafel-feld img { clip-path: none; }
}
