@font-face {
  font-family: "Archivo";
  src: url(archivo.woff2) format("woff2");
  font-weight: 400 800;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --ground: #0a0a0a;
  --surface: #161616;
  --ink: #f1f0ed;
  --dim: #8f8b84;
  --pad: clamp(16px, 2.2vw, 32px);
  --gap: clamp(4px, .5vw, 8px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Kopf */
.head, .wrap, .foot { max-width: 1760px; margin-inline: auto; }
.head { padding: calc(var(--pad) * 1.6) var(--pad) clamp(24px, 3vw, 40px); }

.name {
  font-size: clamp(2.25rem, 4.2vw, 4.5rem);
  font-weight: 760;
  font-stretch: 66%;
  line-height: .86;
  letter-spacing: -.02em;
  text-transform: uppercase;
  margin-left: -.03em;
}

/* Bühnenlicht: Maus über dem Namen = Saal dunkler, ein warmer Spot folgt dem Zeiger (Farben als @property, damit sie weich überblenden) */
@property --base { syntax: "<color>"; inherits: true; initial-value: #f1f0ed; }
@property --spot { syntax: "<color>"; inherits: true; initial-value: #f1f0ed; }
@property --warm { syntax: "<color>"; inherits: true; initial-value: #f1f0ed; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .name a {
    display: inline-block;
    --base: var(--ink); --spot: var(--ink); --warm: var(--ink);
    background: radial-gradient(circle 2.4em at var(--mx, 50%) var(--my, 50%), var(--spot), var(--warm) 35%, var(--base) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: --base .5s ease, --spot .3s ease, --warm .4s ease;
  }
  .name a.lit { --base: #4a4844; --spot: #fff; --warm: #ffe2b0; }
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 40px;
  margin-top: clamp(12px, 1.4vw, 20px);
  font-size: 17px;
}


.tabs { display: flex; gap: 28px; }
.tabs a { color: var(--dim); transition: color .2s; }
.tabs a span { font-size: 13px; font-variant-numeric: tabular-nums; vertical-align: super; margin-left: 2px; }
.tabs a:hover, .tabs a[aria-current] { color: var(--ink); }

.ig { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; transition: opacity .2s; }
.ig svg { width: 20px; height: 20px; fill: currentColor; }
.ig:hover { opacity: .7; }

/* Raster: Zeilenhöhe = 3/4 der Spaltenbreite. Desktop: feste Positionen aus dem Dashboard (--c/--r), sonst Lese-Reihenfolge */
.wrap { padding: 0 var(--pad); container-type: inline-size; }

.grid {
  --cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols) * .75);
  grid-auto-flow: dense;
  gap: var(--gap);
}

.tile { grid-column: var(--c, auto / span var(--gw)); grid-row: var(--r, auto / span var(--gh)); }

.tile {
  position: relative;
  overflow: hidden;
  background: var(--surface) var(--lq) center / cover no-repeat;
  cursor: zoom-in;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--fx) var(--fy);
  transform-origin: var(--fx) var(--fy);
  transform: scale(var(--z));
  transition: transform 1.2s var(--ease), opacity .7s var(--ease);
}

.js .tile img { opacity: 0; }
.js .tile img.in { opacity: 1; }

.cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 48px 16px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  font-size: 15px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  pointer-events: none;
}

@media (hover: hover) {
  .tile:hover img { transform: scale(calc(var(--z) * 1.035)); }
  .tile:hover .cap, .tile:focus-visible .cap { opacity: 1; transform: none; }
}

.empty { padding: 20vh 0; color: var(--dim); font-size: 20px; }
.empty a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1000px) {
  .grid { --cols: 2; }
  .tile { grid-column: span var(--tw); grid-row: span var(--gh); }
}
@media (max-width: 600px) {
  .grid { --cols: 1; }
  .tile { grid-column: span 1; grid-row: span var(--pr); }
  .ig { margin-left: 0; }
}

/* Fuß */
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: clamp(64px, 10vw, 140px) var(--pad) calc(var(--pad) * 1.4);
  color: var(--dim);
}

/* Lightbox */
.lb {
  width: 100%; height: 100%;
  max-width: none; max-height: none;
  padding: 0;
  border: 0;
  background: #000;
  color: var(--ink);
  overscroll-behavior: contain;
  --strip: 0px; /* Höhe des Filmstreifens unten, falls vorhanden */
  --chrome: 72px; /* Abstand oben + Bildunterschrift */
}
.lb:has(.lb-strip) { --strip: 84px; }
.lb::backdrop { background: #000; }
.lb[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; animation: fade .3s var(--ease); }

.lb figure:focus { outline: none; }
.lb figure {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 16px clamp(16px, 6vw, 96px) 0;
}

/* Größe fest aus Seitenverhältnis (--ar) und Platz, nicht aus der geladenen Datei: Safari zeigt sonst beim Blättern
   manchmal die kleine, schon geladene Rasterversion in deren Größe an */
.lb figure img {
  width: min(100%, calc((100dvh - var(--chrome) - var(--strip)) * var(--ar, 1)));
  height: auto;
  aspect-ratio: var(--ar, auto);
  max-width: 100%;
  max-height: calc(100dvh - var(--chrome) - var(--strip));
  object-fit: contain;
  transition: opacity .3s var(--ease);
  user-select: none;
  -webkit-user-drag: none;
}
.lb img.loading { opacity: .25; }

.lb figcaption {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 20px;
  font-size: 15px;
}
.lb-count { color: var(--dim); font-variant-numeric: tabular-nums; }

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s, transform .2s var(--ease);
}
.lb-btn:hover, .lb-btn:focus-visible { opacity: 1; }
.lb-btn:active { transform: scale(.9); }
.lb-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lb-prev { left: 8px; top: calc(50% - 28px - var(--strip) / 2); }
.lb-next { right: 8px; top: calc(50% - 28px - var(--strip) / 2); }
.lb-close { right: 8px; top: 8px; }

/* Filmstreifen: alle Bilder der Kategorie, aktuelles hell */
.lb-strip {
  display: flex;
  justify-content: safe center;
  gap: 6px;
  padding: 12px clamp(16px, 6vw, 96px) 16px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.lb-strip::-webkit-scrollbar { display: none; }
.lb-strip button {
  flex: none;
  height: calc(var(--strip) - 28px);
  padding: 0;
  border: 0;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  opacity: .35;
  transition: opacity .25s var(--ease);
}
.lb-strip img { display: block; height: 100%; width: auto; }
.lb-strip button:hover { opacity: .75; }
.lb-strip button[aria-current] { opacity: 1; }
.lb-strip button[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px; background: var(--ink); }

@media (max-width: 600px) {
  .lb { --chrome: 112px; }
  .lb:has(.lb-strip) { --strip: 68px; }
  .lb-prev, .lb-next { display: none; }
  .lb figure { padding: 56px 0 0; }
  .lb figcaption { padding: 14px 16px 20px; }
  .lb-strip { padding-inline: 16px; gap: 4px; }
}

@keyframes fade { from { opacity: 0; } }

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