/* PL-FOTO — Drohnenseite: Steigflug, Sucher, Scan
   Gehört zu js/drohne-effekte.js. Nur auf drohne.html eingebunden.
   Ohne JavaScript und bei „Bewegung reduzieren“: Endzustand, keine Bewegung.
   Alle Anzeigewerte im HUD stammen aus den Bilddaten der Drohne (EXIF/XMP). */

/* ============================================================
   1 — STEIGFLUG
   Die Sektion ist höher als der Bildschirm, die Bühne klebt oben.
   --p (0…1) setzt das Skript aus der Scrollposition.
   ============================================================ */
.steigflug {
  --p: 1;
  position: relative;
  block-size: auto;
  margin-block-start: var(--space-16);
  overflow-x: clip;   /* clip statt hidden: kein Scroll-Container, sticky bleibt intakt */
}
.steigflug__buehne {
  position: relative;
  block-size: min(86svh, 62vw);
  min-block-size: 420px;
  overflow: clip;
  background: #05070c;
  isolation: isolate;
}
.steigflug__buehne picture { display: block; block-size: 100%; }
.steigflug__bild {
  position: absolute; inset: 0;
  inline-size: 100%; block-size: 100%;
  object-fit: cover;
  transform-origin: 52% 46%;
  transform: scale(calc(1 + (1 - var(--p)) * 1.9)) rotate(calc((1 - var(--p)) * (1 - var(--p)) * -24deg));
  filter: saturate(calc(.55 + var(--p) * .45)) contrast(calc(1.12 - var(--p) * .12));
  will-change: transform;
}
/* Abdunklung zum Rand: hält das HUD lesbar */
.steigflug__buehne::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 45%, rgb(5 7 12 / .55) 100%),
    linear-gradient(to bottom, rgb(5 7 12 / .55), transparent 22%, transparent 78%, rgb(5 7 12 / .6));
}

/* Mit Bewegung: lange Sektion, Bühne klebt */
.steigflug[data-aktiv] { block-size: 340vh; }
.steigflug[data-aktiv] .steigflug__buehne {
  position: sticky; inset-block-start: 0;
  block-size: 100svh; min-block-size: 0;
}

/* ---------- HUD ---------- */
.hud {
  position: absolute; z-index: 2; pointer-events: none;
  inset: 6% 4% 5%;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.05vw, 14px);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgb(255 255 255 / .92);
  text-shadow: 0 1px 3px rgb(0 0 0 / .8);
}
.steigflug[data-aktiv] .hud { inset-block-start: calc(var(--kopf-h) + 12px); }
.hud p { margin: 0; }
.hud b { font-weight: 600; color: var(--c-accent); font-variant-numeric: tabular-nums; }

.hud__ecke { position: absolute; inline-size: 34px; block-size: 34px; border: 0 solid rgb(255 255 255 / .85); }
.hud__ecke--lo { inset-block-start: 0; inset-inline-start: 0; border-block-start-width: 2px; border-inline-start-width: 2px; }
.hud__ecke--ro { inset-block-start: 0; inset-inline-end: 0; border-block-start-width: 2px; border-inline-end-width: 2px; }
.hud__ecke--lu { inset-block-end: 0; inset-inline-start: 0; border-block-end-width: 2px; border-inline-start-width: 2px; }
.hud__ecke--ru { inset-block-end: 0; inset-inline-end: 0; border-block-end-width: 2px; border-inline-end-width: 2px; }

/* Fadenkreuz: Kreis mit vier Strichen, die mit der Höhe zusammenrücken */
.hud__kreuz {
  --g: calc(18px + (1 - var(--p)) * 26px);
  position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
  inline-size: 46px; block-size: 46px; translate: -50% -50%;
  border: 1.5px solid rgb(var(--neon-y-rgb, 213 234 4) / .9); border-radius: 50%;
  box-shadow: 0 0 12px rgb(var(--neon-y-rgb, 213 234 4) / .35);
}
.hud__kreuz::before, .hud__kreuz::after {
  content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
  background: rgb(var(--neon-y-rgb, 213 234 4) / .9);
}
.hud__kreuz::before { inline-size: calc(46px + var(--g) * 2); block-size: 1.5px; translate: -50% -50%;
  -webkit-mask: linear-gradient(90deg, #000 0 var(--g), transparent var(--g) calc(100% - var(--g)), #000 calc(100% - var(--g)));
          mask: linear-gradient(90deg, #000 0 var(--g), transparent var(--g) calc(100% - var(--g)), #000 calc(100% - var(--g))); }
.hud__kreuz::after { block-size: calc(46px + var(--g) * 2); inline-size: 1.5px; translate: -50% -50%;
  -webkit-mask: linear-gradient(180deg, #000 0 var(--g), transparent var(--g) calc(100% - var(--g)), #000 calc(100% - var(--g)));
          mask: linear-gradient(180deg, #000 0 var(--g), transparent var(--g) calc(100% - var(--g)), #000 calc(100% - var(--g))); }

.hud__zeile { position: absolute; inset-inline: 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4em 1.6em; }
.hud__zeile--oben { inset-block-start: 6px; }
.hud__zeile--unten { inset-block-end: 6px; }
.hud__rec { display: inline-flex; align-items: center; gap: .5em; }
.hud__rec::before {
  content: ""; inline-size: .7em; block-size: .7em; border-radius: 50%;
  background: #ff3b30; box-shadow: 0 0 8px #ff3b30;
  animation: hud-rec 1.2s steps(2, jump-none) infinite;
}
@keyframes hud-rec { 50% { opacity: .15; } }

/* Höhenband rechts: Skala läuft mit, Wert steht */
.hud__hoehe {
  position: absolute; inset-inline-end: 0; inset-block-start: 50%; translate: 0 -50%;
  display: grid; align-items: center; justify-items: end;
  block-size: min(46%, 300px); inline-size: 7.5em;
}
.hud__skala {
  position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: 18px;
  background:
    repeating-linear-gradient(to bottom, rgb(255 255 255 / .8) 0 1.5px, transparent 1.5px 12px) right / 18px 100%,
    repeating-linear-gradient(to bottom, rgb(255 255 255 / .55) 0 1px, transparent 1px 4px) right / 9px 100%;
  background-repeat: no-repeat repeat-y, no-repeat repeat-y;
  background-position: right calc(var(--p) * 480px), right calc(var(--p) * 480px);
  -webkit-mask: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
          mask: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}
.hud__hoehe p {
  position: relative; margin-inline-end: 26px;
  display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: .3em;
  padding: .35em .6em; background: rgb(5 7 12 / .55); border: 1px solid rgb(var(--neon-y-rgb, 213 234 4) / .7);
}
.hud__hoehe small { grid-column: 1 / -1; font-size: .78em; color: rgb(255 255 255 / .7); }
.hud__hoehe small:last-child { grid-column: auto; font-size: 1em; color: rgb(255 255 255 / .9); }
.hud__hoehe b { font-size: 2.1em; line-height: 1; }

/* ---------- Texte: Start blendet aus, Ende blendet ein ---------- */
.steigflug__text {
  position: absolute; z-index: 3;
  inset-inline-start: max(var(--gutter, 20px), 7%); inset-block-end: 14%;
  max-inline-size: min(34rem, 80%);
  padding: var(--space-6);
  background: rgb(11 14 24 / .62);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgb(255 255 255 / .1);
  box-shadow: var(--glass-rim, none);
}
.steigflug__text h2 { margin: 0 0 var(--space-3); font-size: clamp(1.5rem, 3.2vw, 2.6rem); }
.steigflug__text p:last-child { margin: 0; color: var(--c-text-muted); }
.steigflug__text .kicker { margin: 0 0 var(--space-2); }
.steigflug__text--start { opacity: 0; }
.steigflug__text--ende  { opacity: 1; }
.steigflug[data-aktiv] .steigflug__text--start {
  opacity: clamp(0, calc(1 - (var(--p) - .12) * 5), 1);
  translate: 0 calc(var(--p) * -60px);
}
.steigflug[data-aktiv] .steigflug__text--ende {
  opacity: clamp(0, calc((var(--p) - .82) * 6), 1);
  translate: 0 calc((1 - var(--p)) * 40px);
}

@media (max-width: 700px) {
  .hud__zeile { inset-inline: 40px; font-size: 10px; }
  .hud__zeile--unten span:last-child { display: none; }
  .hud__hoehe { inline-size: 6em; }
  .steigflug__text { inset-inline: 16px; max-inline-size: none; inset-block-end: 15%; padding: var(--space-4); }
}


/* ============================================================
   2 — SUCHER AUF DEN KACHELN
   Rahmenecken rasten ein, Fadenkreuz erscheint, Aufnahmedaten laufen ein.
   Maus: beim Überfahren. Touch: die Kachel in Bildschirmmitte (data-fokus).
   ============================================================ */
.sucher { position: absolute; inset: 0; z-index: 1; pointer-events: none; font-family: var(--font-mono); }
.sucher__ecke {
  position: absolute; inline-size: 22px; block-size: 22px;
  border: 0 solid var(--c-accent);
  filter: drop-shadow(0 0 4px rgb(var(--neon-y-rgb, 213 234 4) / .6));
  opacity: 0;
  transition: inset .45s cubic-bezier(.2, .9, .25, 1.15), opacity .2s ease-out;
}
.sucher__ecke:nth-child(1) { inset-block-start: -14px; inset-inline-start: -14px; border-block-start-width: 2px; border-inline-start-width: 2px; }
.sucher__ecke:nth-child(2) { inset-block-start: -14px; inset-inline-end: -14px;   border-block-start-width: 2px; border-inline-end-width: 2px; }
.sucher__ecke:nth-child(3) { inset-block-end: -14px;   inset-inline-start: -14px; border-block-end-width: 2px;   border-inline-start-width: 2px; }
.sucher__ecke:nth-child(4) { inset-block-end: -14px;   inset-inline-end: -14px;   border-block-end-width: 2px;   border-inline-end-width: 2px; }

.sucher__kreuz {
  position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
  inline-size: 28px; block-size: 28px; translate: -50% -50%;
  border: 1.5px solid rgb(255 255 255 / .85); border-radius: 50%;
  scale: 1.8; opacity: 0;
  transition: scale .45s cubic-bezier(.2, .9, .25, 1.15) .08s, opacity .2s ease-out .08s;
}
.sucher__kreuz::after {
  content: ""; position: absolute; inset: 50% auto auto 50%; inline-size: 4px; block-size: 4px;
  translate: -50% -50%; border-radius: 50%; background: var(--c-accent);
}

.sucher__daten {
  position: absolute; inset-inline-start: 14px; inset-block-start: 12px;
  display: flex; gap: .5em; align-items: center;
  padding: .3em .55em;
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: #fff; background: rgb(5 7 12 / .62);
  clip-path: inset(0 100% 0 0);
  transition: clip-path .55s steps(22, end) .15s;
}
.sucher__daten::before {
  content: ""; inline-size: 7px; block-size: 7px; border-radius: 50%;
  background: #ff3b30; box-shadow: 0 0 6px #ff3b30;
}
.sucher__daten b { color: var(--c-accent); font-weight: 600; }

.gallery__btn:is(:hover, :focus-visible, [data-fokus]) .sucher__ecke { opacity: 1; }
.gallery__btn:is(:hover, :focus-visible, [data-fokus]) .sucher__ecke:nth-child(1) { inset-block-start: 12px; inset-inline-start: 12px; }
.gallery__btn:is(:hover, :focus-visible, [data-fokus]) .sucher__ecke:nth-child(2) { inset-block-start: 12px; inset-inline-end: 12px; }
.gallery__btn:is(:hover, :focus-visible, [data-fokus]) .sucher__ecke:nth-child(3) { inset-block-end: 12px;   inset-inline-start: 12px; }
.gallery__btn:is(:hover, :focus-visible, [data-fokus]) .sucher__ecke:nth-child(4) { inset-block-end: 12px;   inset-inline-end: 12px; }
.gallery__btn:is(:hover, :focus-visible, [data-fokus]) .sucher__kreuz { scale: 1; opacity: 1; }
.gallery__btn:is(:hover, :focus-visible, [data-fokus]) .sucher__daten { clip-path: inset(0 0 0 0); }
/* Daten oben links statt Lupenmarke unten rechts: beides darf stehen */


/* ============================================================
   3 — SCAN BEIM ERSTEN ERSCHEINEN
   Eine Leuchtlinie fährt von oben nach unten, darunter wird das Bild sichtbar.
   ============================================================ */
.gallery__btn[data-scan="bereit"] img { clip-path: inset(0 0 100% 0); }
.gallery__btn[data-scan="laeuft"] img { animation: d-scan-bild 1.15s cubic-bezier(.55, .05, .25, 1) forwards; }
@keyframes d-scan-bild { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

.sucher__scan {
  position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 2px;
  background: var(--c-accent);
  box-shadow: 0 0 10px 2px rgb(var(--neon-y-rgb, 213 234 4) / .75), 0 -26px 40px rgb(var(--neon-y-rgb, 213 234 4) / .18);
  opacity: 0;
}
.gallery__btn[data-scan="laeuft"] .sucher__scan { animation: d-scan-linie 1.15s cubic-bezier(.55, .05, .25, 1) forwards; }
@keyframes d-scan-linie {
  0%   { inset-block-start: 0;    opacity: 1; }
  92%  { inset-block-start: 100%; opacity: 1; }
  100% { inset-block-start: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hud__rec::before { animation: none; }
  .gallery__btn[data-scan] img { clip-path: none; animation: none; }
  .sucher__scan { display: none; }
  .sucher__ecke, .sucher__kreuz, .sucher__daten { transition: none; }
}


/* ============================================================
   4 — DIGITALZOOM (nur Maus)
   Runde Lupe folgt dem Zeiger, zeigt die 1600-px-Fassung dreifach.
   ============================================================ */
.lupe {
  position: absolute; z-index: 3; inset-block-start: 0; inset-inline-start: 0;
  inline-size: clamp(150px, 30%, 220px); aspect-ratio: 1;
  margin: calc(clamp(150px, 30%, 220px) / -2) 0 0 calc(clamp(150px, 30%, 220px) / -2);
  border-radius: 50%;
  background-color: #05070c; background-repeat: no-repeat;
  border: 2px solid var(--c-accent);
  box-shadow: 0 0 0 1px rgb(0 0 0 / .5), 0 10px 30px rgb(0 0 0 / .55), 0 0 22px rgb(var(--neon-y-rgb, 213 234 4) / .35);
  pointer-events: none;
  opacity: 0; scale: .6;
  transition: opacity .18s ease-out, scale .25s cubic-bezier(.2, .9, .25, 1.2);
}
/* Fadenkreuz in der Lupe */
.lupe::before, .lupe::after {
  content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: 50%; translate: -50% -50%;
  background: rgb(255 255 255 / .75);
}
.lupe::before { inline-size: 26px; block-size: 1px; }
.lupe::after  { inline-size: 1px; block-size: 26px; }
.lupe b {
  position: absolute; inset-block-end: 10%; inset-inline-start: 50%; translate: -50% 0;
  padding: .1em .45em; font: 600 11px/1.4 var(--font-mono); letter-spacing: .06em;
  color: #05070c; background: var(--c-accent);
}
.gallery__btn[data-lupe] .lupe { opacity: 1; scale: 1; }
.gallery__btn[data-lupe] { cursor: crosshair; }
.gallery__btn[data-lupe]:hover img { transform: none; }      /* kein Zoom des ganzen Bildes, die Lupe zoomt */
.gallery__btn[data-lupe] .sucher__kreuz { opacity: 0; }      /* nur ein Fadenkreuz gleichzeitig */
.gallery__btn[data-lupe]::after { opacity: 0; }              /* Lupenmarke unten rechts ausblenden */


/* ============================================================
   5 — FLUGROUTE
   SVG über der Galerie, Pfad läuft durch die Fugen. Drohne folgt dem Scroll.
   ============================================================ */
[data-gallery="drohne"] { position: relative; }
.flugroute {
  position: absolute; inset-block-start: 0; inset-inline-start: 0; z-index: 4;
  overflow: visible; pointer-events: none;
}
.flugroute path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.flugroute__plan { stroke: rgb(255 255 255 / .16); stroke-width: 1.5; stroke-dasharray: 2 7; }
.flugroute__spur {
  stroke: rgb(var(--neon-y-rgb, 213 234 4) / .85); stroke-width: 1.5; stroke-dasharray: none;
  filter: drop-shadow(0 0 3px rgb(var(--neon-y-rgb, 213 234 4) / .6));
}
.flugdrohne {
  position: absolute; inset-block-start: 0; inset-inline-start: 0; z-index: 5;
  inline-size: 38px; block-size: 38px; margin: -19px 0 0 -19px;
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgb(0 0 0 / .55));
  transition: rotate .25s ease-out;
}
.flugdrohne svg { inline-size: 100%; block-size: 100%; overflow: visible; }
.flugdrohne__arm { stroke: #1b2030; stroke-width: 3.2; stroke-linecap: round; }
.flugdrohne__koerper { fill: #232a3d; stroke: var(--c-accent); stroke-width: 1.2; }
.flugdrohne__led { fill: #ff3b30; }
.flugdrohne__rotor circle { fill: rgb(255 255 255 / .12); stroke: rgb(255 255 255 / .55); stroke-width: .8; }
.flugdrohne__rotor path { stroke: rgb(255 255 255 / .9); stroke-width: 1.4; stroke-linecap: round; }
.flugdrohne__rotor { animation: d-rotor .14s linear infinite; }
.flugdrohne__rotor:nth-of-type(2n) { animation-direction: reverse; }
.flugdrohne[data-gelandet] .flugdrohne__rotor { animation-duration: 1.2s; }
@keyframes d-rotor { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .flugdrohne__rotor { animation: none; }
}
