/* Horizont — Variante 1 */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

@property --licht {
  syntax: "<color>";
  inherits: true;
  initial-value: #d8d2dc;
}
@property --grund {
  syntax: "<color>";
  inherits: true;
  initial-value: #0b0b10;
}

:root {
  --licht: #d8d2dc;          /* kommt aus dem aktuellen Foto */
  --grund: #0b0b10;          /* untere Randfarbe des aktuellen Fotos */
  --papier: #f1ede6;
  --tinte: #0a0a0d;
  --horizont: 56vh;          /* wird per JS exakt gesetzt */
  --leiste: 64px;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: dark;
  transition: --licht 1.6s ease, --grund 1.6s ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--tinte);
  color: var(--papier);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--licht); outline-offset: 3px; border-radius: 2px; }
.nur-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sprung {
  position: fixed; left: 12px; top: -60px; z-index: 50;
  background: var(--papier); color: var(--tinte); padding: .5em .9em; border-radius: 2px;
}
.sprung:focus { top: 12px; }

/* ——— Kleinschrift: Metadaten ——— */
.klein {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 450;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ——— Die Landschaft ——— */
#buehne {
  position: fixed; inset: 0;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
#buehne.zieht { cursor: grabbing; }
#welt { position: absolute; inset: 0; }

.bild {
  position: absolute; top: 0; left: 0;
  height: 100%;
  will-change: transform;
  contain: layout paint;
  /* weiche Blende (S-Kurve statt linear), damit die Naht wie Dunst wirkt und nicht wie ein Schleier */
  --b: var(--ueber, 0px);
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.04) calc(var(--b) * .2), rgba(0,0,0,.18) calc(var(--b) * .38), rgba(0,0,0,.5) calc(var(--b) * .55), rgba(0,0,0,.84) calc(var(--b) * .74), rgba(0,0,0,.97) calc(var(--b) * .9), #000 var(--b));
          mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.04) calc(var(--b) * .2), rgba(0,0,0,.18) calc(var(--b) * .38), rgba(0,0,0,.5) calc(var(--b) * .55), rgba(0,0,0,.84) calc(var(--b) * .74), rgba(0,0,0,.97) calc(var(--b) * .9), #000 var(--b));
}
.bild picture, .bild img {
  position: absolute; left: 0;
  display: block;
  width: 100%;
}
.bild img {
  opacity: 0;
  transition: opacity .9s ease;
  -webkit-mask-image: var(--feder, none);
          mask-image: var(--feder, none);
}
.bild img.da { opacity: 1; }

/* der Faden, der alles hält */
#linie {
  position: fixed; left: 0; right: 0; top: var(--horizont);
  height: 1px;
  background: linear-gradient(to right, transparent, color-mix(in srgb, var(--licht) 55%, transparent) 18%, color-mix(in srgb, var(--licht) 55%, transparent) 82%, transparent);
  opacity: .35;
  pointer-events: none;
  z-index: 3;
}

/* ——— Zeichen am Weg ——— */
#zeichen { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.zeichen {
  position: absolute; left: 0; top: 0;
  width: 0; height: 100%;          /* volle Höhe: Schilder und Titel messen von unten */
  will-change: transform;
}
.zeichen .stab {
  position: absolute; left: 0;
  top: calc(var(--horizont) - var(--stab));
  width: 1px; height: var(--stab);
  background: linear-gradient(to top, var(--licht), color-mix(in srgb, var(--licht) 0%, transparent));
  opacity: .8;
}
.zeichen .stab::after {          /* Fußpunkt auf dem Horizont */
  content: ""; position: absolute; bottom: -3px; left: -3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--licht);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--licht) 18%, transparent);
}
.zeichen .schild {
  position: absolute; left: 0;
  bottom: calc(100% - var(--horizont) + var(--stab) - 2px);
  transform: translateX(-12px);
  pointer-events: auto;
  text-align: left;
  padding: .7em 1em .8em;
  min-width: 12em; max-width: 19em;
  background: color-mix(in srgb, var(--tinte) 42%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
          backdrop-filter: blur(14px) saturate(1.1);
  border-left: 1px solid var(--licht);
  transition: background .3s ease, transform .4s ease;
}
.zeichen .schild:hover { background: color-mix(in srgb, var(--tinte) 62%, transparent); transform: translateX(-12px) translateY(-3px); }
.schild .klein { display: block; color: var(--licht); margin-bottom: .25em; }
.schild .name { display: block; font-style: italic; font-size: 1.45rem; line-height: 1.15; font-weight: 380; }
.schild .mehr { display: block; margin-top: .45em; font-size: .9rem; opacity: .78; }

/* Sätze: stehen im Meer unter dem Horizont */
.satz {
  position: absolute; left: 0;
  top: calc(var(--horizont) + 9vh);
  transform: translateX(-50%);
  width: max-content; max-width: min(80vw, 26em);
  text-align: center;
  font-style: italic; font-weight: 330;
  font-size: clamp(1.3rem, 2.4vw, 2.1rem);
  line-height: 1.2;
  padding: .35em .7em;
  text-shadow: 0 1px 18px rgba(0,0,0,.65), 0 0 2px rgba(0,0,0,.5);
  background: radial-gradient(closest-side, rgba(0,0,0,.32), transparent);
}

/* Titel ganz am Anfang */
.titel h1 {
  position: absolute; left: 0;
  bottom: calc(100% - var(--horizont) + 2.2vh);
  transform: translateX(-50%);
  margin: 0; width: max-content;
  font-weight: 250;
  font-size: clamp(2.6rem, 8.2vw, 8.4rem);
  line-height: .92;
  letter-spacing: -.02em;
  text-align: center;
  text-shadow: 0 2px 40px rgba(0,0,0,.35);
}
.titel p {
  position: absolute; left: 0;
  top: calc(var(--horizont) + 2.4vh);
  transform: translateX(-50%);
  margin: 0; width: max-content;
  font-style: italic; font-weight: 320;
  font-size: clamp(1.15rem, 2.2vw, 1.9rem);
  text-shadow: 0 1px 20px rgba(0,0,0,.55);
}
.titel .los {
  display: block; margin-top: 1.4em;
  font-style: normal;
  font-size: 12px;
  opacity: .95;
  text-shadow: 0 1px 10px rgba(0,0,0,.8);
  animation: los 2.8s ease-in-out infinite;
}
@keyframes los { 0%,100% { transform: translateX(0); } 50% { transform: translateX(10px); } }

/* ——— Die Rückenfigur ——— */
#figur {
  position: fixed; left: 50%; top: var(--horizont);
  width: 7px; height: 17px;
  opacity: .92;
  transform: translate(-50%, -100%);
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 0 1.5px color-mix(in srgb, var(--licht) 85%, transparent));
}
#figur svg { display: block; width: 100%; height: 100%; overflow: visible; }
#figur .bein { transform-box: fill-box; transform-origin: 50% 0; }
#figur.geht .bein-a { animation: schritt .62s ease-in-out infinite; }
#figur.geht .bein-b { animation: schritt .62s ease-in-out infinite reverse; }
#figur.geht .koerper { animation: wippen .31s ease-in-out infinite alternate; }
#figur.links svg { transform: scaleX(-1); }
@keyframes schritt { 0%,100% { transform: rotate(14deg); } 50% { transform: rotate(-14deg); } }
@keyframes wippen { from { transform: translateY(0); } to { transform: translateY(-.6px); } }

/* ——— Akt-Wort ——— */
#akt {
  position: fixed; left: 50%; top: calc(var(--horizont) + 25vh);
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  color: var(--licht);
  opacity: 0;
  transition: opacity 1.2s ease;
  text-shadow: 0 1px 12px rgba(0,0,0,.6);
}
#akt.zeigt { opacity: .95; }

/* ——— Kopf ——— */
#kopf {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 22px;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 1px 10px rgba(0,0,0,.55);
}
#kopf > * { pointer-events: auto; }
#kopf .marke { font-style: italic; font-size: 1.05rem; font-weight: 400; text-decoration: none; }
#kopf nav { display: flex; gap: 1.2em; }
#kopf nav a { text-decoration: none; opacity: .8; }
#kopf nav a:hover, #kopf nav a:focus-visible { opacity: 1; text-decoration: underline; }

/* ——— Wegleiste ——— */
#leiste {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--leiste);
  display: grid;
  grid-template-columns: minmax(10em, 15em) 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 0 22px env(safe-area-inset-bottom);
  z-index: 10;
  background: linear-gradient(to top, color-mix(in srgb, var(--grund) 78%, black) 0%, transparent 100%);
}
#wann { line-height: 1.25; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
#wann .datum { font-size: .98rem; font-style: italic; white-space: nowrap; }
#wann .klein { color: var(--licht); }
#weg {
  position: relative; height: 36px;
  touch-action: none;
}
#weg .spur {
  position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: color-mix(in srgb, var(--papier) 35%, transparent);
}
#weg .strich {
  position: absolute; top: calc(50% - 3px); width: 1px; height: 7px;
  background: color-mix(in srgb, var(--papier) 45%, transparent);
  pointer-events: none;
}
#weg .station {
  position: absolute; top: 0; height: 36px; width: 28px;
  transform: translateX(-50%);
  display: grid; place-items: center;
}
#weg .station i {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--papier);
  background: var(--tinte);
  transition: transform .2s ease, background .2s ease;
}
#weg .station:hover i, #weg .station:focus-visible i { transform: scale(1.5); background: var(--licht); }
#weg .station .tip {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-style: italic; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
}
#weg .station:hover .tip, #weg .station:focus-visible .tip { opacity: 1; }
#weg .hier {
  position: absolute; top: calc(50% - 9px); width: 1px; height: 19px;
  background: var(--licht);
  box-shadow: 0 0 10px var(--licht);
  pointer-events: none;
}
#knoepfe { display: flex; gap: 6px; }
#knoepfe button {
  padding: .5em .85em; border-radius: 99px;
  white-space: nowrap; line-height: 1.2;
  border: 1px solid color-mix(in srgb, var(--papier) 30%, transparent);
  background: color-mix(in srgb, var(--tinte) 30%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color .2s;
}
#knoepfe button:hover { border-color: var(--licht); }
#knoepfe button[aria-pressed="true"] { border-color: var(--licht); color: var(--licht); }
#knoepfe .lampe { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: .5em; background: currentColor; opacity: .35; vertical-align: .1em; }
#knoepfe button[aria-pressed="true"] .lampe { opacity: 1; box-shadow: 0 0 8px currentColor; }

/* ——— Vorhang (Ankunft): der Horizont öffnet sich ——— */
#vorhang { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#vorhang i {
  position: absolute; left: 0; right: 0;
  background: var(--tinte);
  transition: transform 1.6s cubic-bezier(.7,0,.15,1);
}
#vorhang .oben { top: 0; height: var(--horizont); transform-origin: 50% 0; }
#vorhang .unten { top: var(--horizont); bottom: 0; transform-origin: 50% 100%; }
#vorhang::after {
  content: ""; position: absolute; left: 0; right: 0; top: var(--horizont); height: 1px;
  background: var(--papier);
  transform: scaleX(0);
  animation: faden 1.1s cubic-bezier(.6,0,.2,1) .25s forwards;
  transition: opacity 1.2s ease .5s;
}
#vorhang.auf i { transform: scaleY(0); }
#vorhang.auf::after { opacity: 0; }
@keyframes faden { to { transform: scaleX(1); } }

/* ——— Blätter (Dialoge) ——— */
dialog.blatt {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: min(760px, 100%);
  max-width: 100%;
  max-height: min(84vh, 84dvh);
  padding: 0;
  border: 0;
  color: var(--papier);
  background: color-mix(in srgb, var(--grund) 55%, #08080b);
  border-top: 1px solid var(--licht);
  box-shadow: 0 -30px 80px rgba(0,0,0,.45);
  overflow: hidden;
  display: none;
}
dialog.blatt[open] { display: flex; flex-direction: column; animation: steigt .7s cubic-bezier(.2,.8,.2,1); }
dialog.blatt::backdrop { background: rgba(4,4,8,.38); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: dunkel .5s ease; }
@keyframes steigt { from { transform: translateY(40px); opacity: 0; clip-path: inset(100% 0 0 0); } to { transform: none; opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes dunkel { from { opacity: 0; } }
.blatt .kopfzeile {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--papier) 12%, transparent);
}
.blatt .kopfzeile .klein { color: var(--licht); }
.blatt .zu { font-style: italic; font-size: .98rem; opacity: .85; padding: .3em 0; }
.blatt .zu:hover { opacity: 1; text-decoration: underline; }
.blatt .inhalt { overflow-y: auto; padding: 26px 22px 40px; overscroll-behavior: contain; }
.blatt h2 { font-weight: 300; font-style: italic; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.02; margin: .1em 0 .4em; letter-spacing: -.01em; }
.blatt h3 { font-weight: 500; font-size: 1.02rem; margin: 1.8em 0 .4em; }
.blatt p { margin: 0 0 1em; }
.lesen { max-width: 34em; font-size: 1.12rem; line-height: 1.62; }
.lesen p { hyphens: auto; -webkit-hyphens: auto; }

/* Mix */
.mixkopf { display: grid; grid-template-columns: 148px 1fr; gap: 22px; align-items: end; margin-bottom: 1.4em; }
.mixkopf img { width: 148px; height: 148px; object-fit: cover; display: block; }
.mixkopf .meta { color: var(--licht); }
.verlauf { position: relative; height: 34px; margin: 1.6em 0 .6em; }
.verlauf::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: color-mix(in srgb, var(--papier) 35%, transparent); }
.verlauf span {
  position: absolute; top: 50%; width: 1px; height: 14px; transform: translateY(-50%);
  background: var(--licht);
}
.verlauf span:nth-child(odd) { height: 22px; }
.verlauf-legende { display: flex; justify-content: space-between; opacity: .6; }
ol.tracks { list-style: none; padding: 0; margin: 1.4em 0 0; columns: 2 18em; column-gap: 2.4em; }
ol.tracks li { break-inside: avoid; display: grid; grid-template-columns: 4.2em 1fr; gap: .4em; padding: .28em 0; border-bottom: 1px solid color-mix(in srgb, var(--papier) 8%, transparent); font-size: .98rem; line-height: 1.35; }
ol.tracks .t { color: var(--licht); font-variant-numeric: tabular-nums; font-size: .86rem; padding-top: .12em; }
.anhoeren { margin: 1.6em 0 .4em; padding: 1em 1.1em; border: 1px solid color-mix(in srgb, var(--papier) 18%, transparent); }
.anhoeren .knopf, .knopf {
  display: inline-block; padding: .55em 1.1em; border: 1px solid var(--licht); border-radius: 99px; color: var(--licht); text-decoration: none; margin: .3em .6em .3em 0;
}
.anhoeren .knopf:hover, .knopf:hover { background: color-mix(in srgb, var(--licht) 14%, transparent); }
.anhoeren iframe { width: 100%; height: 120px; border: 0; display: block; margin-top: .6em; }
.hinweis { font-size: .92rem; opacity: .78; }

/* Notizen */
.notiz { padding-bottom: 2.4em; margin-bottom: 2.4em; border-bottom: 1px solid color-mix(in srgb, var(--papier) 12%, transparent); }
.notiz:last-child { border-bottom: 0; }
.notiz time { color: var(--licht); }
.notiz h3 { font-weight: 300; font-style: italic; font-size: 2rem; margin: .2em 0 .5em; }
.notizbilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 1.4em 0 0; max-width: 40em; }
.notizbilder img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.notizbilder figure { margin: 0; }
.notizbilder figure:first-child:last-child { grid-column: 1 / -1; }
.notizbilder figure:first-child:last-child img { aspect-ratio: auto; max-height: 60vh; object-fit: contain; width: auto; }

/* Index */
.stationen { list-style: none; padding: 0; margin: 0; }
.stationen li { border-bottom: 1px solid color-mix(in srgb, var(--papier) 10%, transparent); }
.stationen button, .stationen a { display: grid; grid-template-columns: 10.5em 1fr auto; gap: 1em; width: 100%; text-align: left; padding: .8em 0; text-decoration: none; align-items: baseline; }
.stationen .name { font-style: italic; font-size: 1.3rem; line-height: 1.2; }
.stationen .klein { color: var(--licht); }
.stationen button:hover .name, .stationen button:focus-visible .name { text-decoration: underline; }

/* Foto allein */
dialog.foto {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: #050506; color: var(--papier);
  display: none;
}
dialog.foto[open] { display: grid; grid-template-rows: 1fr auto; animation: dunkel .5s ease; }
dialog.foto::backdrop { background: #050506; }
dialog.foto .rahmen { display: grid; place-items: center; min-height: 0; padding: 4vh 4vw 0; }
dialog.foto img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
dialog.foto .unter { display: flex; gap: 1.4em; justify-content: space-between; align-items: baseline; padding: 14px 22px 18px; flex-wrap: wrap; }
dialog.foto .unter p { margin: 0; max-width: 46em; font-style: italic; }
dialog.foto .unter .klein { color: var(--licht); }
dialog.foto .steuer { display: flex; gap: 1em; }
dialog.foto .steuer button { font-style: italic; opacity: .85; }
dialog.foto .steuer button:hover { opacity: 1; text-decoration: underline; }

/* Rechtstexte (Dialog und statische Seiten) */
.recht h3:first-child { margin-top: 0; }
.recht p { font-size: 1rem; }

/* ——— Telefon ——— */
@media (max-width: 700px) {
  :root { --leiste: 58px; }
  body { font-size: 16px; }
  #kopf { padding: 14px 16px; }
  #kopf nav { gap: .9em; font-size: .9rem; }
  #leiste { grid-template-columns: 1fr auto; gap: 10px; padding: 0 16px env(safe-area-inset-bottom); }
  #weg { position: absolute; left: 16px; right: 16px; top: -26px; height: 28px; }
  #weg .station { height: 28px; width: 26px; }
  #weg .station .tip { display: none; }
  #wann .datum { font-size: .9rem; }
  #knoepfe button { padding: .45em .7em; font-size: .95rem; }
  .zeichen .schild { min-width: 10em; max-width: 15em; }
  .schild .name { font-size: 1.25rem; }
  .mixkopf { grid-template-columns: 96px 1fr; gap: 14px; }
  .mixkopf img { width: 96px; height: 96px; }
  dialog.blatt { max-height: 88dvh; }
  .blatt .inhalt { padding: 22px 16px 36px; }
  .blatt .kopfzeile { padding: 12px 16px 10px; }
  .stationen button, .stationen a { grid-template-columns: 1fr; gap: .15em; }
  .stationen .pfeil { display: none; }
}

/* ——— Ruhe ——— */
@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  .bild img { transition: none; }
  #vorhang { display: none; }
  #figur.geht .bein, #figur.geht .koerper, .titel .los { animation: none; }
  dialog.blatt[open], dialog.blatt::backdrop, dialog.foto[open] { animation: none; }
  #akt { transition: none; }
}

/* ——— Druck ——— */
#druck { display: none; }
@media print {
  body { overflow: visible; background: #fff; color: #000; font-size: 11pt; }
  #buehne, #linie, #figur, #akt, #kopf, #leiste, #vorhang, dialog, .sprung { display: none !important; }
  #druck { display: block; padding: 0 1cm; }
  #druck h1 { font-weight: 300; font-size: 32pt; margin: 0 0 .2em; }
  #druck h2 { font-style: italic; font-weight: 400; margin: 1.4em 0 .3em; break-after: avoid; }
  #druck ol { columns: 2; font-size: 9pt; }
  #druck section { break-inside: avoid-page; }
}
