/* =============================================================
   Bewegte Elemente: Karte, Zahlen, Bildaufzüge, Trennlinien.
   Alles läuft beim Hereinscrollen genau einmal und hält bei
   „Bewegung reduzieren“ still.
   ============================================================= */

/* ------------------------------------------------- Karte der Amerikas */
.hp-karte {
  margin: 0;
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
@media (min-width: 900px) {
  .hp-karte { grid-template-columns: 1.05fr .95fr; }
  .hp-karte__text { padding-right: clamp(0px, 2vw, 32px); }
}

.hp-karte__bild { position: relative; }
.hp-karte__svg {
  width: 100%; height: auto; display: block;
  font-family: var(--in-sans, sans-serif);
  overflow: visible;
}

.hp-karte__land path {
  fill: #ddd7cd;
  stroke: var(--in-bg, #F2EEE9);
  stroke-width: 1.6;
  transition: fill .8s ease;
}
.hp-karte.ist-sichtbar .hp-karte__land path { fill: #d2cbc0; }

/* Verbindungen zeichnen sich von Panama aus */
.hp-karte__route {
  stroke: #5b6b71;
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: .62;
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
}
.hp-karte.ist-sichtbar .hp-karte__route {
  animation: hpZeichnen 1.5s cubic-bezier(.33,.8,.3,1) forwards;
  animation-delay: calc(.35s + var(--nr) * .11s);
}
@keyframes hpZeichnen { to { stroke-dashoffset: 0; } }

/* Zielpunkte erscheinen, wenn ihre Linie angekommen ist */
.hp-karte__ziel {
  fill: #445257;
  opacity: 0;
  transform: scale(.3);
  transform-origin: center;
  transform-box: fill-box;
}
.hp-karte.ist-sichtbar .hp-karte__ziel {
  animation: hpAufpoppen .5s cubic-bezier(.2,1.4,.4,1) forwards;
  animation-delay: calc(1.35s + var(--nr) * .11s);
}
@keyframes hpAufpoppen { to { opacity: 1; transform: scale(1); } }

.hp-karte__name {
  font-size: 19px;
  letter-spacing: .04em;
  fill: #3f4c50;
  opacity: 0;
}
.hp-karte.ist-sichtbar .hp-karte__name {
  animation: hpEinblenden .6s ease forwards;
  animation-delay: calc(1.5s + var(--nr) * .11s);
}
@keyframes hpEinblenden { to { opacity: 1; } }

/* Wanderndes Licht auf der Strecke */
.hp-karte__licht { fill: #0f1416; opacity: 0; offset-distance: 0%; }
@supports (offset-path: path("M0,0L1,1")) {
  .hp-karte.ist-sichtbar .hp-karte__licht {
    animation: hpWandern 5.2s cubic-bezier(.5,0,.5,1) infinite;
    animation-delay: calc(2.4s + var(--nr) * .42s);
  }
}
@keyframes hpWandern {
  0%   { offset-distance: 0%;   opacity: 0; }
  12%  { opacity: .85; }
  70%  { opacity: .85; }
  82%  { offset-distance: 100%; opacity: 0; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* Panama als Knotenpunkt */
.hp-karte__kern { fill: #0f1416; }
.hp-karte__welle {
  fill: none; stroke: #0f1416; stroke-width: 2;
  transform-origin: center; transform-box: fill-box;
  opacity: 0;
}
.hp-karte.ist-sichtbar .hp-karte__welle {
  animation: hpWelle 3.4s cubic-bezier(.2,.7,.3,1) infinite;
  animation-delay: 1.1s;
}
.hp-karte.ist-sichtbar .hp-karte__welle--spaet { animation-delay: 2.8s; }
@keyframes hpWelle {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { opacity: 0; }
  100% { transform: scale(4.2); opacity: 0; }
}
.hp-karte__panama {
  font-size: 27px; fill: #0f1416; letter-spacing: .02em; font-weight: 400;
}

.hp-karte__text h2 { margin-bottom: 20px; }
.hp-karte__werte {
  list-style: none; margin: 26px 0 0; padding: 0;
  display: grid; gap: 0;
}
.hp-karte__werte > li {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 18px;
  padding: 13px 0; border-top: 1px solid var(--in-linie-weich, rgba(8,8,8,.08));
  font-size: 15px; line-height: 1.5;
}
.hp-karte__werte b {
  font-family: var(--in-serif, serif); font-weight: 400;
  font-size: clamp(20px, 2.4vw, 27px); line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- Zählende Zahlen */
.in-leiste b { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- Bildaufzug */
.hp-aufzug { overflow: hidden; }
.hp-aufzug img {
  transform: scale(1.1);
  clip-path: inset(0 0 100% 0);
}
.hp-aufzug.ist-sichtbar img {
  transform: scale(1);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.05s cubic-bezier(.22,.68,.3,1),
              transform 1.5s cubic-bezier(.22,.68,.3,1);
}

/* ------------------------------------------------------- Trennlinien */
hr.in-linie {
  transform: scaleX(0); transform-origin: left;
}
hr.in-linie.ist-sichtbar {
  transform: scaleX(1);
  transition: transform 1.1s cubic-bezier(.22,.68,.3,1);
}

/* ------------------------------------------------------- Bildband */
.hp-band {
  display: grid; gap: 2px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 760px) { .hp-band { grid-template-columns: repeat(4, 1fr); } }
.hp-band figure { margin: 0; position: relative; overflow: hidden; }
.hp-band img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4;
  transition: transform 1.1s cubic-bezier(.22,.68,.3,1);
}
.hp-band figure:hover img { transform: scale(1.055); }
.hp-band figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #fff;
  background: linear-gradient(to top, rgba(10,12,13,.72), rgba(10,12,13,0));
}

/* ------------------------------------------------------- Karten mit Bild */
.in-karte--bild { position: relative; }
.in-karte--bild img { transition: transform 1s cubic-bezier(.22,.68,.3,1); }
.in-karte--bild:hover img { transform: scale(1.04); }

/* ------------------------------------------------------- Hero-Parallaxe */
.hp-hero__bild { will-change: transform; }
.hp-hero__bild img { transform: translate3d(0, var(--hp-versatz, 0px), 0) scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  .hp-karte__route { stroke-dashoffset: 0; }
  .hp-karte__ziel { opacity: 1; transform: none; }
  .hp-karte__name { opacity: 1; }
  .hp-karte .hp-karte__welle,
  .hp-karte .hp-karte__licht { display: none; }
  .hp-karte.ist-sichtbar .hp-karte__route,
  .hp-karte.ist-sichtbar .hp-karte__ziel,
  .hp-karte.ist-sichtbar .hp-karte__name { animation: none; }
  .hp-aufzug img { transform: none; clip-path: none; }
  hr.in-linie { transform: none; }
  .hp-hero__bild img { transform: none; }
  .hp-band img, .in-karte--bild img { transition: none; }
}

/* ------------------------------------------------------- Breitbild */
.in-breitbild { margin: 0; position: relative; }
.in-breitbild img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 3 / 2; object-fit: cover;
  background: rgba(8,8,8,.05);
}
@media (min-width: 760px) { .in-breitbild img { aspect-ratio: 21 / 9; } }
.in-breitbild figcaption {
  font-size: 13px; line-height: 1.5; color: #55646a;
  padding: 12px var(--in-rand, 20px) 0;
  max-width: 1180px; margin-inline: auto;
}

/* =============================================================
   Zweite Bewegungsschicht: Die Seite soll sich aufbauen, nicht
   nur erscheinen. Überschriften kommen Wort für Wort, Listen
   Punkt für Punkt, Fotos driften beim Scrollen leicht gegen die
   Seite, und ein Bildstreifen läuft von selbst.
   ============================================================= */

/* ------------------------------------------------------- Wortaufbau */
.in-blende .hp-wort {
  display: inline-block;
  opacity: 0;
  transform: translateY(.5em);
}
.in-blende.in-sichtbar .hp-wort {
  opacity: 1;
  transform: none;
  transition: opacity .55s cubic-bezier(.22,.61,.36,1),
              transform .75s cubic-bezier(.22,.61,.36,1);
  transition-delay: calc(.1s + var(--i, 0) * 60ms);
}

/* ------------------------------------------------------- Gestaffelt */
.in-blende :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > * {
  opacity: 0;
  transform: translateY(18px);
}
.in-blende.in-sichtbar :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > * {
  opacity: 1;
  transform: none;
  transition: opacity .65s cubic-bezier(.22,.61,.36,1),
              transform .65s cubic-bezier(.22,.61,.36,1);
}
.in-blende.in-sichtbar :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > :nth-child(2) { transition-delay: .09s; }
.in-blende.in-sichtbar :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > :nth-child(3) { transition-delay: .18s; }
.in-blende.in-sichtbar :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > :nth-child(4) { transition-delay: .27s; }
.in-blende.in-sichtbar :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > :nth-child(5) { transition-delay: .36s; }
.in-blende.in-sichtbar :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > :nth-child(6) { transition-delay: .45s; }
.in-blende.in-sichtbar :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > :nth-child(7) { transition-delay: .54s; }
.in-blende.in-sichtbar :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > :nth-child(n+8) { transition-delay: .63s; }

/* ------------------------------------------------------- Kicker-Linie */
.in-kicker::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 0; height: 1px;
  margin-right: 0;
  background: currentColor;
  transition: width .9s cubic-bezier(.22,.68,.3,1) .15s,
              margin-right .9s cubic-bezier(.22,.68,.3,1) .15s;
}
.in-sichtbar .in-kicker::before,
.hp-ruhig .in-kicker::before { width: 26px; margin-right: 12px; }

/* ------------------------------------------------------- Drift */
/* Fotos laufen beim Scrollen ein wenig langsamer als der Text. Der Wert
   kommt aus hp.js und bleibt klein: höchstens ein paar Dutzend Pixel. */
/* `translate` statt `transform`, damit sich die Drift mit dem Aufzug und
   dem Zoom beim Zeigen verträgt, die beide `transform` belegen. */
.hp-drift { translate: 0 var(--hp-drift, 0px); will-change: translate; }

/* ------------------------------------------------------- Breitbild 3:2 */
/* Für Menschen im Bild: 21:9 schneidet Köpfe ab. */
@media (min-width: 760px) {
  .in-breitbild--32 img { aspect-ratio: 3 / 2; max-height: 82vh; }
}

/* ------------------------------------------------------- Bildstreifen */
.hp-streifen { position: relative; overflow: hidden; }
.hp-streifen__spur {
  display: flex; gap: 8px;
  width: max-content;
  will-change: transform;
}
.hp-streifen figure {
  margin: 0; flex: 0 0 auto;
  position: relative; overflow: hidden;
  height: clamp(170px, 26vw, 330px);
  background: rgba(8,8,8,.05);
}
.hp-streifen img {
  height: 100%; width: auto; display: block;
  transform: scale(1.02);
  transition: transform 1.2s cubic-bezier(.22,.68,.3,1);
}
.hp-streifen figure:hover img { transform: scale(1.07); }
.hp-streifen figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #fff;
  background: linear-gradient(to top, rgba(10,12,13,.62), rgba(10,12,13,0));
  opacity: 0; transform: translateY(6px);
  transition: opacity .5s ease, transform .5s ease;
}
.hp-streifen figure:hover figcaption { opacity: 1; transform: none; }
@media (hover: none) { .hp-streifen figcaption { opacity: 1; transform: none; } }
/* Ohne Skript oder bei reduzierter Bewegung: von Hand schiebbar. */
.hp-streifen:not(.hp-streifen--laeuft) {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hp-streifen:not(.hp-streifen--laeuft)::-webkit-scrollbar { display: none; }
.hp-streifen:not(.hp-streifen--laeuft) .hp-streifen__spur { padding-inline: var(--in-rand, 20px); }

/* ------------------------------------------------------- Mosaik */
.hp-mosaik {
  display: grid; column-gap: 10px; row-gap: 34px;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  margin: clamp(28px, 4vw, 48px) 0 0;
}
.hp-mosaik > figure {
  margin: 0; position: relative;
  grid-column: var(--sm, span 1);
}
.hp-mosaik > figure > span { display: block; overflow: hidden; background: rgba(8,8,8,.05); }
.hp-mosaik img {
  width: 100%; height: auto; display: block;
  transition: transform 1.1s cubic-bezier(.22,.68,.3,1);
}
.hp-mosaik > figure:hover img { transform: scale(1.04); }
.hp-mosaik figcaption {
  font-size: 13px; line-height: 1.5; color: #55646a;
  padding-top: 10px;
}
.hp-mosaik figcaption b {
  display: block; font-weight: 400;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--in-akzent, #5b6b71); margin-bottom: 3px;
}
@media (min-width: 760px) {
  .hp-mosaik { grid-template-columns: repeat(12, 1fr); column-gap: 18px; row-gap: 44px; }
  .hp-mosaik > figure { grid-column: var(--sp, span 4); }
  .hp-mosaik > figure[style*="--ab"] { margin-top: var(--ab); }
}

/* ------------------------------------------------------- Bildpaar */
.in-paarbild {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  max-width: 1180px; margin: 0 auto; padding-inline: var(--in-rand, 20px);
  align-items: start;
}
.in-paarbild figure { margin: 0; }
.in-paarbild figure > span { display: block; overflow: hidden; background: rgba(8,8,8,.05); }
.in-paarbild img { width: 100%; height: auto; display: block; transition: transform 1.1s cubic-bezier(.22,.68,.3,1); }
.in-paarbild figure:hover img { transform: scale(1.04); }
.in-paarbild figcaption { font-size: 13px; line-height: 1.5; color: #55646a; padding-top: 10px; }
@media (min-width: 760px) {
  .in-paarbild { gap: 18px; }
  .in-paarbild figure:nth-child(2) { margin-top: clamp(36px, 7vw, 110px); }
}

@media (prefers-reduced-motion: reduce) {
  .in-blende .hp-wort,
  .in-blende :is(.in-liste, .in-memo, .in-faq, .in-raster, .in-leiste) > * { opacity: 1; transform: none; transition: none; }
  .in-kicker::before { width: 26px; margin-right: 12px; transition: none; }
  .hp-drift { translate: none; }
  .hp-streifen img, .hp-mosaik img, .in-paarbild img { transition: none; }
}

/* Glut auf der Karte und im Mosaik: Panama als Knoten glüht, die
   Rubriken über den Bildunterschriften tragen dieselbe Farbe. */
.hp-karte__kern, .hp-karte__licht { fill: var(--in-glut, #B9472E); }
.hp-karte__welle { stroke: var(--in-glut, #B9472E); }
.hp-karte__panama { fill: var(--in-glut, #B9472E); }
.hp-mosaik figcaption b { color: var(--in-glut, #B9472E); }

/* Karte auf Ozean: Land eine Stufe heller als der Grund, Routen und
   Ziele im Papierton, Panama in Koralle. */
#drehkreuz-der-amerikas .hp-karte__land path { fill: #2A5C69; stroke: var(--in-ozean, #1B4651); }
#drehkreuz-der-amerikas .hp-karte.ist-sichtbar .hp-karte__land path { fill: #336A78; }
#drehkreuz-der-amerikas .hp-karte__route { stroke: #F2EEE9; opacity: .55; }
#drehkreuz-der-amerikas .hp-karte__ziel { fill: #F2EEE9; }
#drehkreuz-der-amerikas .hp-karte__name { fill: rgba(242,238,233,.82); }
#drehkreuz-der-amerikas .hp-karte__kern,
#drehkreuz-der-amerikas .hp-karte__licht,
#drehkreuz-der-amerikas .hp-karte__panama { fill: #E8775A; }
#drehkreuz-der-amerikas .hp-karte__welle { stroke: #E8775A; }
#drehkreuz-der-amerikas .hp-karte__werte > li { border-top-color: rgba(242,238,233,.18); }

/* =============================================================
   Verspielter Text. Überschriften kippen und werden scharf, Kicker
   ziehen sich zusammen, Vorspanntexte leuchten beim Scrollen Wort
   für Wort auf, Knopfbuchstaben hüpfen, Zahlen poppen, und ein
   Laufband trägt Panamas Orte in Serifen über die Seite.
   ============================================================= */

/* ---- Überschriften: aus der Tiefe, leicht gekippt, unscharf → scharf */
.in-blende .hp-wort {
  transform: translateY(.55em) rotate(3deg); filter: blur(6px);
  transform-origin: left bottom;
}
.in-blende.in-sichtbar .hp-wort {
  filter: blur(0);
  transition: opacity .6s cubic-bezier(.22,.61,.36,1),
              transform .9s cubic-bezier(.2,1.15,.3,1),
              filter .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: calc(.1s + var(--i, 0) * 60ms);
}

/* ---- Kicker: weit gesperrt, zieht sich zusammen */
.in-blende .in-innen > .in-kicker,
.in-blende .hp-karte__text > .in-kicker { letter-spacing: .5em; opacity: 0; }
.in-blende.in-sichtbar .in-innen > .in-kicker,
.in-blende.in-sichtbar .hp-karte__text > .in-kicker {
  letter-spacing: .22em; opacity: 1;
  transition: letter-spacing 1.1s cubic-bezier(.2,.8,.2,1), opacity .6s ease;
}

/* ---- Vorspann: Wörter leuchten beim Scrollen auf (Wert aus hp.js) */
.hp-licht { --hp-lit: 0; }
.hp-licht .hp-lw {
  opacity: clamp(.22, calc(var(--hp-lit) - var(--i, 0)), 1);
  transition: opacity .45s ease;
}

/* ---- Knöpfe: Buchstaben hüpfen unter dem Zeiger */
.hp-b { display: inline-block; }
.hp-wobbel { display: inline; }
.in-knopf:hover .hp-b, .in-weiter:hover .hp-b, .hp-knopf:hover .hp-b, .hp-mini:hover .hp-b {
  animation: hpHuepf .5s cubic-bezier(.3,1.6,.4,1) calc(var(--i, 0) * 22ms);
}
@keyframes hpHuepf { 35% { transform: translateY(-.28em); } 100% { transform: none; } }

/* ---- Zahlen: kurzer Pop, wenn das Zählen endet */
.in-leiste b.ist-fertig { animation: hpPop .55s cubic-bezier(.3,1.5,.4,1); display: inline-block; }
@keyframes hpPop { 40% { transform: scale(1.12) rotate(-2deg); } 100% { transform: none; } }

/* ---- Inline-Links: die Linie zeichnet sich */
.in a.inline {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 100% 1px;
  transition: background-size .4s cubic-bezier(.2,.8,.2,1);
}
.in a.inline:hover { background-size: 0 1px; background-position: 100% 100%; }

/* ---- Laufband */
.hp-laufband {
  overflow: hidden; padding: clamp(10px, 1.6vw, 22px) 0;
  font-family: var(--in-serif, serif); font-weight: 400;
  font-size: clamp(30px, 5.2vw, 68px); line-height: 1.1;
  color: var(--in-glut, #B9472E);
  -webkit-user-select: none; user-select: none;
}
.hp-laufband__spur {
  display: inline-flex; align-items: center; gap: .55em;
  white-space: nowrap; will-change: transform;
  padding-right: .55em;
  animation: hpLaufen 48s linear infinite;
}
.hp-laufband:hover .hp-laufband__spur { animation-play-state: paused; }
.hp-laufband__spur i {
  display: inline-block; width: .22em; height: .22em; border-radius: 50%;
  background: currentColor; opacity: .55; flex: 0 0 auto;
}
.hp-laufband__spur em { font-style: italic; opacity: .75; }
@keyframes hpLaufen { to { transform: translate3d(-50%, 0, 0); } }

@media (prefers-reduced-motion: reduce) {
  .in-blende .hp-wort { filter: none; transform: none; }
  .in-blende .in-innen > .in-kicker, .in-blende .hp-karte__text > .in-kicker { letter-spacing: .22em; opacity: 1; transition: none; }
  .hp-licht .hp-lw { opacity: 1; transition: none; }
  .in-knopf:hover .hp-b, .in-weiter:hover .hp-b, .hp-knopf:hover .hp-b, .hp-mini:hover .hp-b { animation: none; }
  .in-leiste b.ist-fertig { animation: none; }
  .hp-laufband__spur { animation: none; }
}
