/* =====================================================================
   loader.css — Ladebildschirm im Blaupausenstil. Liegt über allem, bis
   loader.js Schriften und Texturen geladen hat. Ein Plotterstrahl fährt
   von oben nach unten und „zeichnet" den Inhalt (clip-path folgt --p).
   ===================================================================== */
html.loading { overflow: hidden; }

.loader {
  --p: 0;
  position: fixed; inset: 0;
  z-index: 100;
  display: grid; place-items: center;
  background: #0f2c5c;
  color: #dbe7f7;
  font-family: "JetBrains Mono", "Lucida Console", Consolas, monospace;
  transition: opacity .55s ease, transform .55s ease;
}
.loader.done { opacity: 0; transform: translateY(-1.5vh); pointer-events: none; }
.ld-sheet {
  position: relative;
  width: min(92vw, 78vh);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  box-shadow: 0 2vh 6vh rgba(0,0,0,.55);
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(255,255,255,.07) 49.85%, rgba(0,0,0,.14) 50.1%, transparent 50.4%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.055) 0 1px, transparent 1px 2vh),
    repeating-linear-gradient(180deg, rgba(255,255,255,.055) 0 1px, transparent 1px 2vh),
    repeating-linear-gradient(90deg, rgba(255,255,255,.11) 0 1px, transparent 1px 10vh),
    repeating-linear-gradient(180deg, rgba(255,255,255,.11) 0 1px, transparent 1px 10vh),
    radial-gradient(ellipse 80% 70% at 40% 35%, rgba(255,255,255,.08), transparent 70%),
    radial-gradient(ellipse 120% 100% at 50% 50%, #1d4a8c 0%, #163c78 55%, #0f2c5c 100%);
}
.ld-frame {
  position: absolute; inset: 2.2vh;
  border: 1px solid rgba(220,235,255,.75);
  outline: 1px solid rgba(220,235,255,.35);
  outline-offset: .5vh;
  pointer-events: none;
}
/* Der gezeichnete Inhalt: sichtbar nur oberhalb des Plotterstrahls */
.ld-draw {
  position: absolute; inset: 0;
  padding: 6vh 7vh;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  clip-path: inset(0 0 calc((1 - var(--p)) * 100%) 0);
}
.ld-head { display: flex; align-items: center; gap: 2.4vh; border-bottom: 1px solid rgba(220,235,255,.7); padding-bottom: 1.6vh; }
.ld-mark { display: block; padding: .8vh 1.2vh; border: 1px solid rgba(220,235,255,.55); border-radius: 1.4vh; }
.ld-mark i {
  display: block; width: 10vh; height: 5vh;
  background: #eef4ff;
  -webkit-mask: url("../assets/wf-mark.png") center / contain no-repeat;
  mask: url("../assets/wf-mark.png") center / contain no-repeat;
}
.ld-head b { display: block; font: 700 3.4vh/1 "Space Grotesk", "Segoe UI", sans-serif; letter-spacing: .06em; color: #eef4ff; }
.ld-head small { display: block; margin-top: .9vh; font-size: 1.3vh; letter-spacing: .32em; color: rgba(220,235,255,.85); }

.ld-list { list-style: none; margin: 2.4vh 0 0; padding: 0; font-size: 1.5vh; line-height: 1.9; letter-spacing: .1em; }
.ld-list li { display: flex; gap: 1.2vh; }
.ld-list li::before { content: "▸"; color: rgba(220,235,255,.6); }
.ld-list li i { flex: 1; border-bottom: 1px dotted rgba(220,235,255,.4); transform: translateY(-.55em); }
.ld-list li b { font-weight: 400; color: #ffb27a; letter-spacing: .2em; }

/* Fortschritt als Maßlinie */
.ld-dim {
  position: relative;
  margin-top: auto;
  height: 2.2vh;
  border-left: 1px solid rgba(220,235,255,.9);
  border-right: 1px solid rgba(220,235,255,.9);
}
.ld-dim::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px dashed rgba(220,235,255,.6);
}
.ld-bar {
  position: absolute; left: 0; top: 50%; height: .5vh;
  width: calc(var(--p) * 100%);
  transform: translateY(-50%);
  background: #ffb27a;
  box-shadow: 0 0 1vh rgba(255,178,122,.6);
}
.ld-pct {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 1vh;
  background: #163c78;
  font-size: 1.3vh; letter-spacing: .2em;
}
.ld-foot { display: flex; justify-content: space-between; margin-top: 1.4vh; font-size: 1.1vh; letter-spacing: .18em; color: rgba(220,235,255,.7); }

/* Plotterstrahl */
.ld-plot {
  position: absolute; left: 0; right: 0;
  top: calc(var(--p) * 100%);
  height: 2px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 0 1.2vh .3vh rgba(180,215,255,.7);
}
.ld-plot i {
  position: absolute; right: 1.6vh; top: -1.2vh;
  width: 3.2vh; height: 2.4vh;
  border: 1px solid rgba(220,235,255,.9);
  border-radius: .4vh;
  background: #0f2c5c;
}
.ld-plot i::after { content: ""; position: absolute; left: 50%; bottom: -1.1vh; width: 1px; height: 1.1vh; background: #eef4ff; }
.loader.done .ld-plot { opacity: 0; }

@media (max-width: 900px) {
  .ld-sheet { width: 92vw; aspect-ratio: 3 / 4; }
  .ld-draw { padding: 5vh 4vh; }
  .ld-head { flex-direction: column; align-items: flex-start; gap: 1.4vh; }
  .ld-head b { font-size: 3vh; }
  .ld-list { font-size: 1.35vh; }
}
@media (prefers-reduced-motion: reduce) {
  .loader { transition: none; }
}
