/* Flightmetric · Immersive Drohnenvermessung
   Schriften lokal gehostet (SIL OFL) – keine Verbindung zu Drittservern. */

@font-face { font-family: "Space Grotesk"; font-weight: 400; font-display: swap; src: url("../fonts/space-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --ink: #0a0f14;
  --ink-2: #121a22;
  --paper: #f3f5f7;
  --line: rgba(243, 245, 247, .16);
  --muted: #9aa6b2;
  --accent: #ff5b12;
  --accent-2: #ff8a4d;
  --glass: rgba(10, 15, 20, .66);
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4.2vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
b { font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: #fff; padding: 10px 16px; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }

/* ── Szene ─────────────────────────────────────────── */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: pan-y; cursor: grab; background: var(--ink); }
#scene.dragging { cursor: grabbing; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background:
  radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(10, 15, 20, .72) 100%),
  linear-gradient(90deg, rgba(10, 15, 20, .72) 0%, rgba(10, 15, 20, 0) 46%); }
.labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.dim-label {
  position: absolute; left: 0; top: 0; will-change: transform, opacity; opacity: 0;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .04em; white-space: nowrap;
  padding: 5px 9px; background: rgba(10, 15, 20, .82); border: 1px solid rgba(255, 91, 18, .7); color: var(--paper);
  transition: opacity .35s;
}
.dim-label small { display: block; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }

.pov-reticle { position: fixed; z-index: 2; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s; }
.pov-reticle.on { opacity: 1; }
.pov-reticle i { position: absolute; width: 38px; height: 38px; border: 2px solid rgba(255, 91, 18, .9); }
.pov-reticle i:nth-child(1) { left: 14vw; top: 16vh; border-right: 0; border-bottom: 0; }
.pov-reticle i:nth-child(2) { right: 14vw; top: 16vh; border-left: 0; border-bottom: 0; }
.pov-reticle i:nth-child(3) { left: 14vw; bottom: 16vh; border-right: 0; border-top: 0; }
.pov-reticle i:nth-child(4) { right: 14vw; bottom: 16vh; border-left: 0; border-top: 0; }

/* ── Loader ────────────────────────────────────────── */
.loader { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--ink); transition: opacity .7s, visibility .7s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader-inner { width: min(320px, 70vw); }
.loader-bar { height: 2px; background: var(--line); margin-top: 14px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
html.no-js .loader, html.nowebgl-mode .loader { display: none; }

/* ── Kopfzeile ─────────────────────────────────────── */
.bar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 28px; padding: 18px var(--gutter); background: linear-gradient(180deg, rgba(10, 15, 20, .85), rgba(10, 15, 20, 0)); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--accent); }
.brand-mark { width: 24px; height: 28px; }
.brand-text { font-weight: 700; letter-spacing: .24em; font-size: 15px; color: var(--paper); }
.brand-text b { color: var(--accent); }
.bar-nav { margin-left: auto; display: flex; gap: 30px; }
.bar-nav a { text-decoration: none; font-size: 14px; font-weight: 500; opacity: .85; }
.bar-nav a:hover { opacity: 1; color: var(--accent-2); }
.pill { white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; padding: 10px 18px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 500; font-size: 14px; text-decoration: none; transition: background .2s, color .2s; }
.pill:hover { background: var(--accent); color: #fff; }

/* ── Kapitel-Rail & Telemetrie ─────────────────────── */
.rail { position: fixed; z-index: 15; right: var(--gutter); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.rail a { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 6px 0; }
.rail a::after { content: ""; width: 10px; height: 10px; border: 1.5px solid var(--muted); border-radius: 50%; transition: all .3s; }
.rail a span { opacity: 0; transform: translateX(6px); transition: all .3s; }
.rail a:hover span, .rail a.active span, .rail a:focus-visible span { opacity: 1; transform: none; }
.rail a.active { color: var(--paper); }
.rail a.active::after { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(255, 91, 18, .22); }

.telemetry { position: fixed; z-index: 15; left: var(--gutter); bottom: 22px; display: flex; gap: 22px; padding: 10px 16px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-family: var(--mono); }
.telemetry div { display: flex; flex-direction: column; min-width: 58px; }
.telemetry span { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.telemetry b { font-size: 13px; font-weight: 500; color: var(--paper); font-variant-numeric: tabular-nums; }

/* ── Inhalt ────────────────────────────────────────── */
.track { position: relative; z-index: 10; pointer-events: none; outline: 0; }
.chapter { position: relative; min-height: 100vh; padding: 0 var(--gutter); }
.js .chapter { min-height: calc(var(--w, 1) * 100vh); }
.panel { pointer-events: auto; position: sticky; top: 17vh; width: min(480px, 100%); padding: 28px 30px 30px; background: var(--glass); border: 1px solid var(--line); border-left: 3px solid var(--accent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chapter:first-child .panel { margin-top: 14vh; top: 14vh; }
.panel > *:first-child { margin-top: 0; }
.panel > *:last-child { margin-bottom: 0; }
.panel-hero { width: min(640px, 100%); background: transparent; border: 0; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.panel-result { width: min(560px, 100%); top: 11vh; max-height: calc(100vh - 11vh - 96px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.panel-result .results th, .panel-result .results td { padding: 5px 0; }
.panel-result .cta-row { margin-top: 16px; }
.chapter-last { padding-bottom: 12vh; }
html:not(.js) .chapter { padding-top: 90px; padding-bottom: 40px; }
html:not(.js) .panel { position: relative; top: 0; margin-top: 0; }
html:not(.js) #scene, html:not(.js) .telemetry, html:not(.js) .rail { display: none; }

.eyebrow { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.eyebrow b { color: var(--accent); font-weight: 500; }
h1, h2 { font-weight: 700; letter-spacing: -.02em; line-height: 1.04; margin: 0 0 18px; }
h1 { font-size: clamp(42px, 7.4vw, 92px); }
h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 1.5px var(--paper); }
h2 { font-size: clamp(28px, 3.6vw, 44px); }
.panel p { margin: 0 0 16px; color: #d8dee4; }
.lead { font-size: clamp(17px, 1.5vw, 20px); max-width: 52ch; }
.note { font-family: var(--mono); font-size: 11px !important; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) !important; margin-top: 18px !important; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding: 9px 0 9px 26px; border-top: 1px solid var(--line); font-size: 15px; color: #d8dee4; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 9px; height: 9px; border: 1.5px solid var(--accent); transform: rotate(45deg); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; font-family: var(--sans); font-weight: 500; font-size: 15px; text-decoration: none; border: 1px solid var(--paper); color: var(--paper); background: transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--paper); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #ff7a3d; border-color: #ff7a3d; color: #fff; }

.meter { height: 6px; background: rgba(243, 245, 247, .12); margin-top: 6px; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.panel .meter-label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; margin-top: 10px; color: var(--muted); }
.meter-label span { color: var(--paper); }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 20px; }
.tg { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; padding: 9px 12px; border: 1px solid var(--line); background: rgba(243, 245, 247, .04); color: var(--muted); cursor: pointer; transition: all .2s; }
.tg[aria-pressed="true"] { border-color: var(--accent); color: var(--paper); background: rgba(255, 91, 18, .16); }
.tg:hover { color: var(--paper); border-color: var(--paper); }
.tg-reset { border-style: dashed; }

.results { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 4px; }
.results caption { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding-bottom: 8px; }
.results th, .results td { text-align: left; padding: 7px 0; border-top: 1px solid var(--line); font-weight: 400; }
.results td { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--paper); }
.results th { color: #c3ccd5; }

.scroll-hint { position: absolute; left: var(--gutter); bottom: 74px; pointer-events: auto; display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.scroll-hint i { display: block; width: 1px; height: 46px; background: linear-gradient(var(--accent), transparent); animation: hint 2s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0%, 100% { transform: scaleY(.35); opacity: .5; } 50% { transform: scaleY(1); opacity: 1; } }

/* ── Drohnen-Detailansicht ─────────────────────────── */
.fab { position: fixed; z-index: 16; right: var(--gutter); bottom: 22px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; padding: 11px 16px; border: 1px solid var(--accent); background: rgba(10, 15, 20, .78); color: var(--paper); cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s, color .2s; }
.fab:hover, .fab[aria-pressed="true"] { background: var(--accent); color: #fff; }
.drone-caption { position: fixed; z-index: 16; left: 50%; bottom: 76px; transform: translateX(-50%); margin: 0; max-width: min(560px, 90vw); text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity .4s; }
.drone-caption.on { opacity: 1; }
.dim-label.hot { border-color: rgba(255, 138, 77, .9); background: rgba(10, 15, 20, .9); }
.labels .leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* ── Footer ────────────────────────────────────────── */
.foot { position: relative; z-index: 12; background: var(--ink); border-top: 1px solid var(--line); padding: 56px var(--gutter) 28px; }
.foot-grid { display: grid; grid-template-columns: 1.1fr 1.6fr .8fr; gap: 40px; max-width: 1200px; }
.foot p { color: #c3ccd5; font-size: 14.5px; margin: 0 0 8px; }
.foot a { color: #e6ebf0; text-underline-offset: 3px; font-size: 14.5px; }
.foot a:hover { color: var(--accent-2); }
.copy { margin-top: 36px !important; font-family: var(--mono); font-size: 11px !important; letter-spacing: .12em; color: var(--muted) !important; }

.noscript, .nowebgl { position: relative; z-index: 30; margin: 90px var(--gutter) 0; padding: 14px 18px; border: 1px solid var(--accent); background: var(--ink-2); font-size: 14px; }

/* ── Rechtstexte ───────────────────────────────────── */
.legal { max-width: 780px; margin: 0 auto; padding: 120px var(--gutter) 80px; }
.legal h1 { font-size: clamp(34px, 5vw, 54px); }
.legal h2 { font-size: 24px; margin-top: 40px; }
.legal h3 { font-size: 18px; margin: 24px 0 6px; }
.legal p, .legal li { color: #d8dee4; }
.legal .todo { background: rgba(255, 91, 18, .14); border-left: 3px solid var(--accent); padding: 2px 8px; }
.legal-body { background: var(--ink); }

/* ── Responsiv ─────────────────────────────────────── */
@media (max-width: 1080px) {
  .bar-nav { display: none; }
  .bar { justify-content: space-between; }
  .pill { margin-left: auto; }
}
@media (max-width: 820px) {
  body { font-size: 16px; }
  .rail { display: none; }
  .fab { right: 14px; bottom: 74px; padding: 9px 12px; }
  .drone-caption { bottom: 118px; }
  .pill { padding: 8px 14px; font-size: 13px; }
  .brand-text { font-size: 13px; letter-spacing: .18em; }
  .telemetry { left: 0; right: 0; bottom: 0; gap: 8px; justify-content: space-between; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); border-width: 1px 0 0; }
  .telemetry div { min-width: 0; }
  .telemetry div:nth-child(n+4) { display: none; }
  .panel { top: 12vh; padding: 22px 20px 24px; background: rgba(10, 15, 20, .78); }
  .chapter:first-child .panel { margin-top: 12vh; }
  .panel-hero { background: transparent; }
  .scroll-hint { bottom: 80px; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .pov-reticle i { width: 26px; height: 26px; }
  .vignette { background: radial-gradient(120% 90% at 50% 45%, transparent 50%, rgba(10, 15, 20, .8) 100%), linear-gradient(180deg, rgba(10, 15, 20, .55), rgba(10, 15, 20, 0) 40%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint i { animation: none; }
  .loader, .loader-bar i, .rail a span, .dim-label { transition: none; }
}

/* Logo (Original-Dateien der Hauptseite) */
.brand { gap: 12px; }
.brand-sym { height: 36px; width: auto; display: block; }
.brand-txt { height: 15px; width: auto; display: block; }
@media (max-width: 820px) { .brand-sym { height: 30px; } .brand-txt { height: 13px; } }


/* ── Mobile-Feinschliff (nur <=820px; Desktop unveraendert) ──
   tx-d = Desktop-Langtext, tx-m = Handy-Kurztext */
.tx-m { display: none; }

@media (max-width: 820px) {
  .tx-d { display: none; }
  .tx-m { display: inline; }

  /* Kopfzeile: Notch-Safe */
  .bar { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 10px; }

  /* Kapitel etwas kuerzer -> zackigeres Scroll-Tempo */
  .js .chapter { min-height: calc(var(--w, 1) * 92vh); }

  /* Panels: kompakt, deckkraftstark, ragen nie ueber HUD/FAB */
  .panel { top: 10vh; padding: 18px 16px 20px; border-radius: 14px; background: rgba(10, 15, 20, .9); }
  .panel-hero { background: transparent; padding: 0; }
  .chapter:first-child .panel { margin-top: 9vh; }
  .panel:not(.panel-hero) { max-height: calc(100vh - 10vh - 132px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

  /* Typografie kompakter */
  h1 { font-size: clamp(32px, 9vw, 42px); }
  h1 em { -webkit-text-stroke-width: 1.2px; }
  h2 { font-size: clamp(23px, 6vw, 30px); }
  .lead { font-size: 16px; }
  .eyebrow { font-size: 10.5px; letter-spacing: .16em; }
  .panel p { margin: 0 0 12px; }

  /* Listen, Buttons, Schalter */
  .ticks li { padding: 7px 0 7px 22px; font-size: 14px; }
  .cta-row { gap: 10px; }
  .cta-row .btn { flex: 1 1 100%; justify-content: center; }
  .toggles .tg { flex: 1 1 auto; text-align: center; padding: 10px 8px; }

  /* Ergebnistabelle kompakt */
  .results { font-size: 13px; }
  .results caption { font-size: 10px; }
  .results th, .results td { padding: 4px 0; }
  .panel-result { top: 10vh; max-height: calc(100vh - 10vh - 132px); }

  /* Telemetrie: 4 Werte, dunkler ueber der Szene */
  .telemetry { background: rgba(10, 15, 20, .88); gap: 6px; padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); }
  .telemetry b { font-size: 12px; }
  .telemetry span { font-size: 8.5px; }
  .telemetry div:nth-child(4) { display: flex; }
  .telemetry div:nth-child(n+5) { display: none; }

  /* Labels in der Szene kleiner */
  .dim-label { font-size: 10.5px; padding: 4px 7px; }
  .dim-label small { font-size: 8.5px; }

  /* FAB, Hinweise, Meter */
  .fab { right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); }
  .drone-caption { bottom: calc(108px + env(safe-area-inset-bottom)); font-size: 10px; }
  .scroll-hint { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .meter { height: 5px; }
  .note { font-size: 10px; }
  .foot { padding-top: 40px; }
  .legal { padding-top: 96px; }
}
