/* =========================================================
   GRUNDWERTE – hier lässt sich das Erscheinungsbild justieren
   ========================================================= */
:root {
  --bg: #fff;
  --fg: #000;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs: 15px;                          /* Fließtext, Header, Footer */
  --fs-head: 20px;                     /* Überschriften der Textblöcke */
  --fs-list: clamp(17px, 1.5vw, 22px); /* Projektliste */
  --pad: clamp(16px, 2vw, 28px);       /* Abstand zu den Bildschirmrändern */
  --row-h: 30vh;                       /* Zielhöhe einer Galeriezeile */
  --gap: 10px;                         /* Abstand zwischen Galerie-Elementen */
  --ease: cubic-bezier(.4, 0, .2, 1);
}
body.is-dark { --bg: #000; --fg: #fff; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--fs)/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .8s var(--ease), color .8s var(--ease);
}

a { color: inherit; text-decoration: none; transition: opacity .3s var(--ease); }
a:hover { opacity: .5; }
a:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
h1, h2, p { margin: 0; }

/* ---------- Feststehende Ecken ----------
   Weiß + "difference": erscheint auf Weiß schwarz, auf Schwarz weiß
   und bleibt auch über Bildern lesbar. */
.corner {
  position: fixed;
  left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5em;
  padding: var(--pad);
  color: #fff;
  mix-blend-mode: difference;
  font-weight: 700;
  pointer-events: none;
}
.corner a { pointer-events: auto; }
.site-header { top: 0; padding-top: calc(var(--pad) + env(safe-area-inset-top, 0px)); }
.site-footer { bottom: 0; padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px)); }
.site-footer[hidden] { display: none; }

.nav { display: flex; gap: 1.1em; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- Inhalt ---------- */
main {
  padding: calc(var(--pad) * 2 + 80px) var(--pad) calc(var(--pad) * 2 + 60px);
  min-height: 100vh;
  transition: opacity .3s var(--ease);
}
main.is-leaving { opacity: 0; }

.cols {
  display: grid;
  gap: var(--pad) calc(var(--pad) * 2);
  margin-bottom: clamp(56px, 8vw, 110px);
}
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

.block h2 { font-size: var(--fs-head); font-weight: 700; line-height: 1.2; margin-bottom: .6em; }
.block h3 { font-size: var(--fs); font-weight: 700; margin: 1.6em 0 .4em; }
.block-result p + p { margin-top: 1.1em; }
/* Zahlen in **...** werden groß und fett, der Beschreibungstext bleibt normal */
.figure {
  display: block;
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin-bottom: .1em;
}
.consent {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--pad) * 2 + 1.6em + env(safe-area-inset-bottom, 0px));
  width: min(440px, calc(100vw - 2 * var(--pad)));
  background: var(--bg); color: var(--fg); border: 1px solid var(--fg);
  padding: 16px 18px; font-size: 13px; line-height: 1.45;
  opacity: 0; transition: opacity .5s var(--ease), background-color .8s var(--ease), color .8s var(--ease);
}
.consent.is-visible { opacity: 1; }
.consent p { margin: 0 0 12px; }
.consent a { text-decoration: underline; text-underline-offset: 2px; }
.consent-options { display: none; margin: 0 0 12px; }
.consent.is-expanded .consent-options { display: block; }
.consent-options label { display: block; margin: 4px 0; cursor: pointer; }
.consent-options input { accent-color: var(--fg); margin-right: 6px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.consent-actions button {
  font: 700 13px var(--font); color: var(--fg); background: transparent;
  border: 1px solid var(--fg); padding: 7px 14px; cursor: pointer; transition: opacity .3s var(--ease);
}
.consent-actions button:hover { opacity: .5; }
.consent-actions .consent-link { border: 0; padding: 7px 4px; font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
.yt-consent {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 100%; border: 0; cursor: pointer; text-align: center; padding: 16px;
  background: color-mix(in srgb, var(--fg) 10%, var(--bg)); color: var(--fg); font: 400 12px var(--font);
}
.yt-consent .yt-play { position: relative; left: auto; top: auto; margin: 0; flex: none; }
.yt-consent:hover .yt-play { background: rgba(0,0,0,.85); }
.order-button {
  display: flex; align-items: center; justify-content: center;
  width: 7.5em; height: 7.5em; margin-top: 2.4em;
  border-radius: 50%; background: #000; color: #fff;
  font-weight: 700; text-align: center;
  transition: transform .4s var(--ease);
}
.order-button:hover { opacity: 1; transform: scale(1.05); }
.block ul { margin: .6em 0; padding-left: 1.1em; max-width: 36em; }
.block p { max-width: 36em; }
.block p + p { margin-top: .9em; }
.bio-list { margin: .9em 0; }

/* ---------- Projektliste ---------- */
.project-list { list-style: none; margin: 0; padding: 0; font-size: var(--fs-list); line-height: 1.35; }
.project-list a { display: grid; grid-template-columns: 4.6em 3.6em 1fr; align-items: start; padding: .12em 0; }
/* Logo-Feld: feste Box, damit unterschiedlich proportionierte Logos
   (Bildmarke vs. Schriftzug) die Textspalte nicht verschieben. */
.project-logo { display: block; width: 2.24em; height: .88em; margin-top: .235em; object-fit: contain; object-position: left center; }
.project-logo.is-missing { visibility: hidden; }
.project-list a:hover { opacity: 1; }
@media (hover: hover) {
  .project-list:hover a { opacity: .25; }
  .project-list a:hover { opacity: 1; }
}

/* ---------- Projektseite ---------- */
.project-title { font-size: var(--fs-list); font-weight: 700; line-height: 1.35; margin-bottom: clamp(40px, 6vw, 80px); }

/* ---------- Masonry-Galerie ("justified rows") ----------
   Jedes Element bekommt sein Seitenverhältnis als --r.
   flex-basis = Zielhöhe × Seitenverhältnis, flex-grow = Seitenverhältnis:
   Elemente einer Zeile wachsen proportional, alle bleiben gleich hoch
   und es wird nichts beschnitten. Gilt für Bilder UND Videos. */
.gallery { display: flex; flex-wrap: wrap; gap: var(--gap); }
.gallery::after { content: ""; flex-grow: 1e6; } /* verhindert, dass die letzte Zeile aufgebläht wird */
.gallery-item {
  position: relative;
  flex: var(--r) 1 calc(var(--r) * var(--row-h));
  aspect-ratio: var(--r);
  min-width: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 8%, var(--bg));
}
.yt-fallback, .yt-fallback img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.yt-fallback:hover { opacity: .8; }
.yt-play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: rgba(0,0,0,.6);
}
.yt-play::after {
  content: ""; position: absolute; left: 26px; top: 20px;
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff;
}
.gallery.is-justified::after { display: none; }
.gallery.is-justified .gallery-item { aspect-ratio: auto; }
.gallery-item:only-child { flex: 1 1 100%; } /* ein einzelnes Video füllt die volle Breite */
.gallery-item img,
.gallery-item iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.gallery-item img { object-fit: cover; opacity: 0; transition: opacity .7s var(--ease); }
.gallery-item img.is-loaded { opacity: 1; }
.placeholder-label { position: absolute; left: 10px; bottom: 8px; font-size: 12px; opacity: .45; }

/* ---------- Book / Contact / Imprint ---------- */
.page { max-width: 36em; }
.page .block + .block { margin-top: 2.4em; }

/* ---------- Responsiv ---------- */
@media (max-aspect-ratio: 1/1) { :root { --row-h: 22vh; } }

@media (max-width: 860px) {
  .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cols-2 { grid-template-columns: 1fr; }
  .nav { flex-direction: column; align-items: flex-end; gap: .1em; }
  main { padding-top: calc(var(--pad) * 2 + 120px); }
  .gallery-item { flex: 1 1 100%; }
  .project-list a { grid-template-columns: 4em 2.8em 1fr; }
  .project-logo { width: 1.76em; }
  .gallery::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
