/* ===== Schriften (SIL Open Font License, siehe fonts/LIZENZ.txt) ===== */
@font-face {
  font-family: "Big Shoulders";
  font-weight: 600 900;
  font-display: swap;
  src: url("fonts/BigShoulders-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/SchibstedGrotesk-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/BodoniModa-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/BodoniModa-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexMono-400-latin.woff2") format("woff2");
}

/* ===== Farben wie auf hendrik4k.com, dazu Gold für die Momente ===== */
:root {
  color-scheme: dark;
  --raum: #050403;
  --flaeche: #0e0c0a;
  --glas: #f2ebe2;
  --glas-leise: #a0968c;
  --chrom: #c8ccd2;
  --wachs: #ff2b12;
  --glut: #ffad5c;
  --gold: #ffc978;
  --linie: rgba(242, 235, 226, 0.14);
  --leuchtlinie: linear-gradient(90deg, rgba(255, 173, 92, 0), rgba(255, 173, 92, 0.9) 50%, rgba(255, 173, 92, 0));
  --chromverlauf: linear-gradient(180deg, #ffffff 0%, #d4d8de 34%, #5f646b 50%, #eceef1 64%, #8d9299 100%);
  --goldverlauf: linear-gradient(180deg, #fff1d6 0%, #ffc978 36%, #a8541c 52%, #ffb35e 66%, #c9702c 100%);
  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --text: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --block: "Big Shoulders", "Arial Narrow", Impact, sans-serif;
  --rand: clamp(16px, 4vw, 56px);
}

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

html {
  background: var(--raum);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html.offen { overflow: hidden; }

body {
  margin: 0;
  background: var(--raum);
  color: var(--glas);
  font: 400 1.0625rem/1.6 var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--glut); outline-offset: 4px; border-radius: 2px; }

.sprung {
  position: absolute;
  left: var(--rand);
  top: -100px;
  z-index: 30;
  padding: 8px 12px;
  background: var(--raum);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.sprung:focus { top: 12px; }

/* ===== Kopf ===== */
.kopf {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: calc(24px + env(safe-area-inset-top, 0px)) var(--rand) 24px;
}
.logo {
  font: 700 1.3rem/1 var(--serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--chromverlauf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kopf-rubrik, .vorzeile, .zahlen, .inhalt, .spiel-nr, .spiel-info, .ansicht-info, .fuss {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.kopf-rubrik { font-size: 0.72rem; color: var(--glas-leise); }

/* ===== Start: Titel im Schein der Lampe ===== */
.start {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding: clamp(40px, 7vh, 80px) var(--rand) clamp(36px, 6vh, 64px);
}
.start::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -10vw;
  top: -30vh;
  width: min(90vw, 1100px);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255, 90, 30, 0.22), rgba(255, 60, 20, 0.07) 55%, rgba(255, 60, 20, 0));
  pointer-events: none;
}
.vorzeile {
  display: flex;
  align-items: center;
  gap: 0.9em;
  margin: 0 0 1.4rem;
  font-size: 0.74rem;
  color: var(--glut);
}
.punkt {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--wachs);
  box-shadow: 0 0 12px 2px rgba(255, 60, 20, 0.6);
}
.titel {
  margin: 0;
  font: 400 clamp(2.7rem, 7vw, 6.6rem)/0.92 var(--serif);
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.02em;
  background: var(--chromverlauf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}
.titel em {
  font-style: italic;
  background: var(--goldverlauf);
  -webkit-background-clip: text;
  background-clip: text;
}
.lead {
  max-width: 34ch;
  margin: 1.8rem 0 0;
  color: var(--glas-leise);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.55;
}
.zahlen {
  display: inline-block;
  margin: 2.2rem 0 0;
  padding-top: 0.9rem;
  font-size: 0.74rem;
  border-top: 1px solid var(--linie);
}

/* ===== Inhaltsverzeichnis ===== */
.inhalt {
  margin: 0 var(--rand);
  padding: 28px 0 40px;
  border-top: 1px solid var(--linie);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}
.inhalt-titel {
  margin: 0 0 18px;
  font: inherit;
  color: var(--glas-leise);
  letter-spacing: 0.22em;
}
.inhalt ol {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: spiel;
}
.inhalt li { counter-increment: spiel; }
.inhalt a {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  padding: 9px 0;
  border-bottom: 1px solid rgba(242, 235, 226, 0.07);
  text-decoration: none;
  transition: color 0.2s;
}
.inhalt a::before {
  content: counter(spiel, decimal-leading-zero);
  color: var(--glut);
}
.inhalt a span {
  margin-left: auto;
  color: var(--glas-leise);
}
.inhalt a:hover { color: var(--gold); }

/* ===== Galerie ===== */
.galerie:focus { outline: none; }

.spiel {
  padding: clamp(40px, 7vw, 88px) var(--rand) 0;
  scroll-margin-top: 8px;
  /* Lange Bildseite: Abschnitte außerhalb des Bildschirms muss der Browser nicht zeichnen. */
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}
.spiel-kopf {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 4px 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--linie);
  position: relative;
}
.spiel-kopf::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: min(220px, 40%);
  height: 1px;
  background: var(--leuchtlinie);
}
.spiel-nr {
  align-self: start;
  padding-top: 0.5em;
  font-size: 0.74rem;
  color: var(--glut);
}
.spiel h2 {
  margin: 0;
  font: 800 clamp(1.9rem, 5vw, 4.2rem)/0.95 var(--block);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.spiel-info {
  display: flex;
  gap: 1.4em;
  margin: 0;
  font-size: 0.68rem;
  color: var(--glas-leise);
  white-space: nowrap;
}

.raster {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.kachel a {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 3px;
  background: var(--flaeche);
}
.kachel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s;
}
.kachel a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(242, 235, 226, 0.08);
  transition: box-shadow 0.3s;
  pointer-events: none;
}
.kachel a:hover img, .kachel a:focus-visible img { transform: scale(1.035); }
.kachel a:hover::after, .kachel a:focus-visible::after {
  box-shadow: inset 0 0 0 1px rgba(255, 201, 120, 0.7), inset 0 0 40px rgba(255, 140, 50, 0.25);
}
.kachel a:focus-visible { outline-offset: 3px; }

/* Spannweiten setzt das Build-Skript je nach Bildanzahl, damit jede Reihe voll wird. */
@media (min-width: 600px) and (max-width: 899.98px) {
  .raster { grid-template-columns: repeat(2, 1fr); }
  .kachel.t-voll { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .raster { grid-template-columns: repeat(3, 1fr); }
  .kachel.d-gross { grid-column: span 2; grid-row: span 2; }
  .kachel.d-zwei { grid-column: span 2; }
  .kachel.d-voll { grid-column: 1 / -1; }
  /* Höhe kommt von den Nachbarn in der Reihe, das Bild füllt nur aus. */
  .kachel.d-gross a, .kachel.d-zwei a { aspect-ratio: auto; height: 100%; min-height: 160px; }
  .kachel.d-gross img, .kachel.d-zwei img { position: absolute; inset: 0; }
}

/* ===== Fuß ===== */
.fuss {
  margin: clamp(64px, 10vw, 120px) var(--rand) 0;
  padding: 28px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--linie);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--glas-leise);
}
.fuss-hinweis { margin: 0 0 16px; max-width: 60ch; text-transform: none; letter-spacing: 0.04em; line-height: 1.6; }
.fuss-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.fuss a { text-decoration: none; color: var(--glas); }
.fuss a:hover { color: var(--gold); }

/* ===== Großansicht ===== */
.ansicht {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(5, 4, 3, 0.97);
  color: var(--glas);
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
}
.ansicht::backdrop { background: rgba(5, 4, 3, 0.9); }
.ansicht[open] { display: grid; place-items: center; }

.ansicht-bild {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 0;
  padding: calc(64px + env(safe-area-inset-top, 0px)) 84px 24px;
  width: 100%;
}
.ansicht-bild img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  max-height: calc(100svh - 170px);
  border-radius: 3px;
  box-shadow: 0 30px 120px rgba(255, 90, 30, 0.12);
  transition: opacity 0.25s;
  user-select: none;
  -webkit-user-drag: none;
}
.ansicht-bild img.laedt { opacity: 0.25; }
.ansicht figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 24px;
  width: 100%;
  max-width: 1600px;
}
.ansicht-spiel {
  font: 800 clamp(1.3rem, 2.6vw, 2rem)/1 var(--block);
  text-transform: uppercase;
}
.ansicht-info { display: flex; gap: 1.6em; font-size: 0.68rem; color: var(--glas-leise); }
.ansicht-zaehler { color: var(--glut); }

.knopf {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(200, 204, 210, 0.35);
  border-radius: 50%;
  background: rgba(14, 12, 10, 0.8);
  color: var(--chrom);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.knopf svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.knopf:hover { border-color: var(--gold); color: var(--gold); }
.knopf:focus-visible { outline-offset: 3px; }
.zurueck { left: 18px; top: 50%; translate: 0 -50%; }
.weiter { right: 18px; top: 50%; translate: 0 -50%; }
.schliessen { right: 18px; top: calc(14px + env(safe-area-inset-top, 0px)); width: 44px; height: 44px; }

@media (max-width: 700px) {
  .spiel-kopf { grid-template-columns: auto 1fr; }
  .spiel-info { grid-column: 2; }
  .ansicht-bild { padding: calc(64px + env(safe-area-inset-top, 0px)) 12px 96px; }
  .ansicht-bild img { max-height: calc(100svh - 230px); }
  .zurueck, .weiter { top: auto; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); translate: none; }
  .zurueck { left: calc(50% - 64px); }
  .weiter { right: calc(50% - 64px); }
}

/* ===== Weniger Bewegung ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .kachel a:hover img, .kachel a:focus-visible img { transform: none; }
  /* Die ruhige Bühne blendet weiter sanft und langsam über, ohne Bewegung. */
  .buehne-ersatz img { transition: opacity 2.4s ease !important; }
}

/* ===== Bühne der Momente ===== */
.buehne {
  position: relative;
  height: 94vh;
  height: 94svh;
  min-height: 560px;
  max-height: 1100px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(60% 55% at 72% 34%, rgba(255, 90, 30, 0.16), rgba(255, 60, 20, 0) 70%),
    radial-gradient(45% 45% at 18% 78%, rgba(255, 173, 92, 0.07), rgba(255, 173, 92, 0) 70%),
    var(--raum);
}
.buehne:focus { outline: none; }
.buehne-flaeche, .buehne-ersatz, .buehne-schleier {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.buehne-flaeche { display: block; z-index: 0; touch-action: pan-y; }
.buehne-flaeche[hidden] { display: none; }
.buehne-flaeche.zeigt { cursor: pointer; }
.buehne-schleier {
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 4, 3, 0.8) 0%, rgba(5, 4, 3, 0) 17%, rgba(5, 4, 3, 0) 52%,
    rgba(5, 4, 3, 0.74) 80%, rgba(5, 4, 3, 0.93) 100%);
}

/* Spielname beim großen Bild, zugleich Knopf zur Großansicht. */
.buehne-marke {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  max-width: min(76vw, 420px);
  padding: 7px 13px 7px 10px;
  border: 1px solid rgba(255, 201, 120, 0.4);
  border-radius: 999px;
  background: rgba(5, 4, 3, 0.64);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--glas);
  font: 400 0.64rem/1.2 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s, color 0.2s, border-color 0.2s;
}
.buehne-marke::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px 1px rgba(255, 173, 92, 0.7);
}
.buehne-marke-spiel { overflow: hidden; text-overflow: ellipsis; }
.buehne-marke:hover { color: var(--gold); border-color: rgba(255, 201, 120, 0.85); }
.buehne-marke.weg { opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0s 0.35s; }

/* Titel, Szenen-Knöpfe und Pause unten auf der Bühne. */
.buehne-unten {
  position: absolute;
  z-index: 3;
  left: var(--rand);
  right: var(--rand);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "text szenen pause";
  align-items: end;
  gap: 14px 10px;
  pointer-events: none;
}
.buehne-titelblock { grid-area: text; min-width: 0; }
.buehne-titelblock .vorzeile { margin-bottom: 0.9rem; }
.buehne-szenen { grid-area: szenen; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.buehne-szenen[hidden], .buehne-pause[hidden] { display: none; }
.buehne-szenen button, .buehne-pause {
  border: 1px solid rgba(200, 204, 210, 0.3);
  border-radius: 999px;
  background: rgba(5, 4, 3, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--glas);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.buehne-szenen button {
  padding: 10px 14px;
  font: 400 0.66rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.buehne-szenen button[aria-pressed="true"] {
  border-color: rgba(255, 201, 120, 0.75);
  background: rgba(255, 173, 92, 0.14);
  color: var(--gold);
}
.buehne-szenen button:hover, .buehne-pause:hover { border-color: rgba(255, 201, 120, 0.6); color: var(--gold); }
.buehne-szenen button:focus-visible, .buehne-pause:focus-visible, .buehne-marke:focus-visible { outline-offset: 3px; }
.buehne-pause {
  grid-area: pause;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  pointer-events: auto;
}
.buehne-pause svg { width: 13px; height: 13px; fill: currentColor; }
.buehne-pause .spielen, .buehne-pause[aria-pressed="true"] .anhalten { display: none; }
.buehne-pause[aria-pressed="true"] .spielen { display: block; }
.buehne-pause[aria-pressed="true"] { border-color: rgba(255, 201, 120, 0.75); color: var(--gold); }

.buehne-fortschritt {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(242, 235, 226, 0.08);
}
.buehne-fortschritt span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--wachs), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
}
.buehne:not(.webgl) .buehne-fortschritt, .buehne.pausiert .buehne-fortschritt span { opacity: 0.35; }

/* Ersatz ohne WebGL oder bei weniger Bewegung: ruhiges Raster mit Überblendungen. */
.buehne-ersatz {
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
}
.buehne-ersatz[hidden] { display: none; }
.ersatz-zelle {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--flaeche);
  cursor: pointer;
}
.ersatz-zelle:first-child { grid-column: span 2; grid-row: span 2; }
.ersatz-zelle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.ersatz-zelle img.an { opacity: 1; }
.buehne-ersatz.bewegt img.an { animation: fahrt 11s ease-in-out infinite alternate; }
@keyframes fahrt {
  from { transform: scale(1.03); }
  to { transform: scale(1.12) translate(-1.5%, -1%); }
}

@media (max-width: 1100px) {
  .buehne-unten {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "text pause" "szenen szenen";
  }
}
@media (max-width: 700px) {
  .buehne { height: 88vh; height: 88svh; min-height: 520px; }
  .buehne-szenen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .buehne-szenen button { padding: 10px 2px; font-size: 0.56rem; letter-spacing: 0.05em; text-align: center; }
  .buehne-ersatz { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
  .ersatz-zelle:first-child { grid-row: span 1; }
}
