/* ==========================================================================
   Intro „Signal Lock“ — nur Startseite
   Aktiv nur mit html.is-intro (gesetzt von intro-gate.js), Ablauf in main.js.

   Zeitleiste (voll):
     0.0s  Cursor + "> uplink lutzcorp.net"
     0.6s  CRT-Power-On (Lichtlinie)
     0.8s  Datenlinien rasten zeilenweise ein (--row, --jx, --rand aus main.js)
     1.9s  Lock-Flash (RGB-Split) + Wordmark-Flicker
     2.4s  "Signal locked · System online"
     2.9s  main.js: Logo fliegt ins Hero-Emblem (FLIP), Seite blendet auf
   Kurzversion (html.is-intro-short): Logo-Flicker → Flug, ~1 s
   ========================================================================== */

.lc-intro {
  display: none;
}

.lc-intro .lc-logo {
  filter: none;
}

html.is-intro {
  overflow: hidden;
}

html.is-intro .lc-intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--lc-bg-black);
  transition: background 700ms var(--ease-in-out);
  animation: lc-intro-failsafe 0.5s 7s forwards;
}

/* Seite wartet hinter dem Intro (Fallback: nach 7 s sichtbar, falls JS hängt) */
html.is-intro .lc-header,
html.is-intro .lc-main,
html.is-intro .lc-footer {
  opacity: 0;
  animation: lc-content-failsafe 0.5s 7s forwards;
}

html.is-intro .lc-hero__emblem {
  opacity: 0;
}

/* Aufblenden während des Logo-Flugs */
html.is-intro.is-intro-reveal {
  overflow: auto;
}

html.is-intro.is-intro-reveal .lc-intro {
  background: transparent;
  pointer-events: none;
}

html.is-intro.is-intro-reveal .lc-header,
html.is-intro.is-intro-reveal .lc-main,
html.is-intro.is-intro-reveal .lc-footer {
  opacity: 1;
  transition: opacity 700ms ease 150ms;
}

/* Bühne
   ========================================================================== */

.lc-intro__stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-l);
  width: min(78vw, 64vh * 1.43, 46rem);
}

.lc-intro__uplink {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  font-size: var(--font-size-s);
  color: var(--lc-success);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: lc-fade-out 0.2s 0.75s forwards;
}

.lc-intro__crt {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120vw;
  height: 2px;
  background: #fff;
  box-shadow:
    0 0 12px #fff,
    0 0 40px var(--lc-primary-light);
  transform: translate(-50%, -50%) scaleX(0);
  opacity: 0;
  animation: lc-crt-on 0.55s 0.6s var(--ease-in-out) forwards;
}

.lc-intro__logo {
  width: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.lc-intro__logo .lc-logo__line {
  opacity: 0;
  animation: lc-signal-lock 0.6s both;
  animation-delay: calc(800ms + var(--row, 0) * 50ms + var(--rand, 0) * 120ms);
}

.lc-intro__logo .lc-logo {
  animation: lc-lock-flash 0.6s 1.9s both;
}

.lc-intro__logo .lc-logo__wordmark {
  opacity: 0;
  animation: lc-text-flicker 0.6s 1.95s steps(1) forwards;
}

.lc-intro__status {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--font-size-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--lc-text-muted);
  opacity: 0;
  animation: lc-fade-in 0.4s 2.4s forwards;
}

.lc-intro__skip {
  position: fixed;
  right: var(--gutter);
  bottom: var(--space-l);
  padding: 0.3em 0.8em;
  font-family: var(--font-display);
  font-size: var(--font-size-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lc-text-dim);
  background: transparent;
  border: 1px solid var(--lc-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.lc-intro__skip:hover,
.lc-intro__skip:focus-visible {
  color: var(--lc-primary-light);
  border-color: var(--lc-primary-light);
}

/* Flug ins Hero-Emblem: Status & Skip weg */
.is-intro-reveal .lc-intro__status,
.is-intro-reveal .lc-intro__skip,
.is-intro-reveal .lc-intro__uplink {
  opacity: 0;
  transition: opacity 200ms ease;
  animation: none;
}

/* Kurzversion
   ========================================================================== */

.is-intro-short .lc-intro__uplink,
.is-intro-short .lc-intro__crt,
.is-intro-short .lc-intro__status {
  display: none;
}

.is-intro-short .lc-intro__logo .lc-logo__line {
  animation-duration: 0.35s;
  animation-delay: calc(var(--row, 0) * 20ms);
}

.is-intro-short .lc-intro__logo .lc-logo {
  animation-delay: 0.4s;
}

.is-intro-short .lc-intro__logo .lc-logo__wordmark {
  animation-delay: 0.3s;
  animation-duration: 0.35s;
}

/* Übersprungen: alles sofort im Endzustand */
.is-intro-skipped .lc-intro__logo .lc-logo,
.is-intro-skipped .lc-intro__logo .lc-logo__line,
.is-intro-skipped .lc-intro__logo .lc-logo__wordmark {
  opacity: 1;
  animation: none;
}

/* Keyframes
   ========================================================================== */

@keyframes lc-crt-on {
    0% { opacity: 1; transform: translate(-50%, -50%) scaleX(0) scaleY(1); }
    45% { opacity: 1; transform: translate(-50%, -50%) scaleX(1) scaleY(1); }
    70% { opacity: 0.25; transform: translate(-50%, -50%) scaleX(1) scaleY(24); }
    100% { opacity: 0; transform: translate(-50%, -50%) scaleX(1) scaleY(60); }
}

/* Evolution von lc-scanline-appear: pro Linie desynchronisiert → Lock */
@keyframes lc-signal-lock {
  0% {
    opacity: 0;
    transform: translateX(calc(var(--jx, 8px) * 6)) scaleX(0.2);
  }
  18% {
    opacity: 0.9;
  }
  30% {
    opacity: 0.15;
    transform: translateX(calc(var(--jx, 8px) * -3)) scaleX(1.25);
  }
  46% {
    opacity: 1;
    transform: translateX(calc(var(--jx, 8px) * 1.5)) scaleX(0.92);
  }
  62% {
    opacity: 0.45;
    transform: translateX(calc(var(--jx, 8px) * -0.6));
  }
  78% {
    opacity: 1;
    transform: translateX(0) scaleX(1.03);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes lc-lock-flash {
  0% {
    filter: none;
  }
  15% {
    filter: drop-shadow(-5px 0 0 rgba(255, 68, 68, 0.55))
      drop-shadow(5px 0 0 rgba(120, 231, 245, 0.75));
  }
  30% {
    filter: drop-shadow(0 0 22px rgba(120, 231, 245, 0.9));
  }
  100% {
    filter: drop-shadow(0 0 5px rgba(120, 231, 245, 0.3));
  }
}

/* Original lutzcorp.de */
@keyframes lc-text-flicker {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 0;
  }
  11% {
    opacity: 1;
  }
  15% {
    opacity: 0.1;
  }
  20% {
    opacity: 1;
  }
  25% {
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  45% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  60% {
    opacity: 0.2;
  }
  70% {
    opacity: 1;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}

@keyframes lc-fade-in {
  to {
    opacity: 1;
  }
}

@keyframes lc-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes lc-intro-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes lc-content-failsafe {
  to {
    opacity: 1;
  }
}
