/* Leak-Motiv und Animationen. Bei "Bewegung reduzieren" bleibt ein ruhiges Standbild. */

/* ---------- Hero: Datenbank mit Riss, aus dem Datenfetzen tropfen ---------- */
.leak {
  --origin-x: 172px;
  --origin-y: 198px;
  position: relative;
  justify-self: center;
  width: 330px;
  height: 420px;
}

.leak-vault {
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
  overflow: visible;
}

.vault-body,
.vault-top {
  fill: var(--deep);
  stroke: #3a5070;
  stroke-width: 2.5;
}

.vault-top { fill: var(--raised); }

.vault-seams {
  fill: none;
  stroke: #3a5070;
  stroke-width: 2.5;
}

.vault-rows {
  fill: none;
  stroke: var(--signal);
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0.35;
  animation: rows-pulse 3s ease-in-out infinite;
}

.vault-crack {
  fill: none;
  stroke: var(--alarm);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255, 122, 107, 0.7));
  animation: crack-flicker 4s steps(1) infinite;
}

.drips span {
  position: absolute;
  top: var(--origin-y);
  left: var(--origin-x);
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(245, 184, 61, 0.12);
  color: var(--signal);
  font: 700 0.8rem/1.4 "Consolas", "SFMono-Regular", monospace;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
  animation: drip 6s linear infinite;
}

.drips span:nth-child(1) { --dx: -22px; animation-delay: 0s; }
.drips span:nth-child(2) { --dx: 30px; animation-delay: -1s; }
.drips span:nth-child(3) { --dx: -40px; animation-delay: -2s; }
.drips span:nth-child(4) { --dx: 14px; animation-delay: -3s; }
.drips span:nth-child(5) { --dx: 44px; animation-delay: -4s; }
.drips span:nth-child(6) { --dx: -8px; animation-delay: -5s; }

.puddle {
  position: absolute;
  top: 400px;
  left: var(--origin-x);
  width: 170px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 122, 107, 0.35), transparent);
  transform: translateX(-50%);
  animation: puddle 6s ease-in-out infinite;
}

@keyframes drip {
  0%   { opacity: 0; transform: translate(-50%, -6px) scale(0.6); }
  5%   { opacity: 1; transform: translate(-50%, 4px) scale(1); }
  55%  { color: var(--signal); background: rgba(245, 184, 61, 0.12); }
  75%  { opacity: 1; color: var(--alarm); background: rgba(255, 122, 107, 0.14); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), 196px) scale(0.95); color: var(--alarm); }
}

@keyframes rows-pulse {
  50% { opacity: 0.6; }
}

@keyframes crack-flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 0.55; }
  49% { opacity: 1; }
  51% { opacity: 0.7; }
}

@keyframes puddle {
  50% { transform: translateX(-50%) scaleX(1.15); opacity: 0.8; }
}

@media (max-width: 879px) {
  .hero { gap: 0; }
  .leak { transform: scale(0.55); transform-origin: top center; height: 235px; margin-top: var(--space-s); }
}

/* ---------- Postfach: Umschlag fliegt los ---------- */
.envelope {
  width: 120px;
  height: 80px;
  overflow: visible;
  animation: envelope-in 700ms cubic-bezier(0.2, 0.8, 0.2, 1.2) both;
}

.env-body {
  fill: var(--night);
  stroke: var(--signal);
  stroke-width: 3;
}

.env-flap {
  fill: none;
  stroke: var(--signal);
  stroke-width: 3;
  stroke-linejoin: round;
}

.trail {
  fill: none;
  stroke: var(--signal);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  animation: trail 900ms ease-out 250ms both;
}

@keyframes envelope-in {
  from { opacity: 0; transform: translateX(-60px) rotate(-10deg); }
  to { opacity: 1; transform: none; }
}

@keyframes trail {
  0% { opacity: 0.8; }
  100% { opacity: 0; transform: translateX(-24px); }
}

/* ---------- Ergebnis ---------- */
svg.verdict-icon {
  background: none;
  overflow: visible;
}

.shield-outline {
  fill: rgba(95, 211, 165, 0.12);
  stroke: var(--safe);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  animation: draw 700ms ease-out forwards;
}

.shield-check {
  fill: none;
  stroke: var(--safe);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw 350ms ease-out 650ms forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.drop path {
  fill: rgba(255, 122, 107, 0.18);
  stroke: var(--alarm);
  stroke-width: 3;
}

.drop {
  animation: drop-fall 900ms cubic-bezier(0.5, 0, 0.75, 0) both, drop-wobble 2.4s ease-in-out 900ms 3;
}

@keyframes drop-fall {
  from { opacity: 0; transform: translateY(-24px) scaleY(1.2); }
  to { opacity: 1; transform: none; }
}

@keyframes drop-wobble {
  50% { transform: scale(1.08, 0.94); }
}

.breaches li {
  animation: chip-in 520ms cubic-bezier(0.3, 0, 0.3, 1.4) both;
  animation-delay: calc(var(--i, 0) * 110ms + 300ms);
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Ruhiges Standbild bei reduzierter Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  .drips span { opacity: 1; }
  .drips span:nth-child(1) { transform: translate(-50%, 4px); }
  .drips span:nth-child(2) { transform: translate(calc(-50% + 20px), 56px); }
  .drips span:nth-child(3) { transform: translate(calc(-50% - 26px), 108px); color: var(--alarm); }
  .drips span:nth-child(n + 4) { display: none; }
  .shield-outline,
  .shield-check { stroke-dashoffset: 0; }
}

/* ======================================================================
   Erweiterte Effekte
   ====================================================================== */

/* ---------- Überschrift: Zensurbalken werden weggezogen ---------- */
.redact-line {
  position: relative;
  display: block;
  width: fit-content;
}

.redact-line::after {
  content: "";
  position: absolute;
  inset: 0.08em -0.08em 0.02em;
  border-radius: 4px;
  background: var(--text);
  transform-origin: right center;
  animation: unredact 700ms cubic-bezier(0.7, 0, 0.2, 1) both;
}

.redact-line:nth-child(1)::after { animation-delay: 250ms; }
.redact-line:nth-child(2)::after { animation-delay: 450ms; }
.redact-line:nth-child(3)::after { animation-delay: 650ms; }

@keyframes unredact {
  0%   { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

/* ---------- Hintergrund: feines Datenraster hinter dem Hero ---------- */
.hero { position: relative; isolation: isolate; }

.hero::before {
  content: "";
  position: absolute;
  inset: -40px 0 0;
  z-index: -1;
  background-image: radial-gradient(rgba(167, 180, 200, 0.16) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 80% at 75% 40%, #000 20%, transparent 75%);
  animation: grid-drift 24s linear infinite;
}

@keyframes grid-drift {
  to { background-position: 22px 22px; }
}

/* ---------- Scan-Linie über der Datenbank ---------- */
.scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--signal), transparent);
  box-shadow: 0 0 12px rgba(245, 184, 61, 0.8);
  opacity: 0;
  animation: scan-sweep 5s ease-in-out infinite 1.4s;
}

@keyframes scan-sweep {
  0%   { opacity: 0; transform: translateY(20px); }
  8%   { opacity: 0.9; }
  40%  { opacity: 0.9; transform: translateY(200px); }
  48%, 100% { opacity: 0; transform: translateY(200px); }
}

/* ---------- Lichtkegel, der dem Mauszeiger im Formular folgt ---------- */
@media (hover: hover) and (pointer: fine) {
  .spotlight {
    background:
      radial-gradient(420px circle at var(--mx, 50%) var(--my, -200px), rgba(245, 184, 61, 0.08), transparent 60%),
      var(--deep);
  }
}

/* ---------- Eingabefeld: Leuchten beim Fokus ---------- */
input[type="email"]:focus {
  box-shadow: 0 0 0 4px rgba(245, 184, 61, 0.18), 0 0 24px rgba(245, 184, 61, 0.12);
}

/* ---------- Button: Lichtreflex ---------- */
.button--shine {
  position: relative;
  overflow: hidden;
}

.button--shine::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: none;
}

.button--shine:hover::after,
.button--shine:focus-visible::after {
  left: 130%;
  transition: left 700ms ease;
}

.button--shine:disabled {
  animation: busy-pulse 1.2s ease-in-out infinite;
}

@keyframes busy-pulse {
  50% { filter: brightness(0.85); }
}

/* ---------- "So funktioniert's": einmalige Sequenz beim Hineinscrollen ---------- */
.has-js [data-reveal] .how-steps li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

[data-reveal].is-visible .how-steps li { opacity: 1; transform: none; }
[data-reveal].is-visible .how-steps li:nth-child(2) { transition-delay: 150ms; }
[data-reveal].is-visible .how-steps li:nth-child(3) { transition-delay: 300ms; }

.is-visible .how-caret { animation: caret-blink 1s steps(1) infinite 600ms; }
.is-visible .how-dot { animation: dot-type 1.6s ease-in-out infinite; }
.is-visible .how-dot:nth-of-type(2) { animation-delay: 200ms; }
.is-visible .how-dot:nth-of-type(3) { animation-delay: 400ms; }

@keyframes caret-blink { 50% { opacity: 0; } }
@keyframes dot-type {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.how-flap { transform-origin: 32px 19px; }
.is-visible .how-flap { animation: flap-open 2.4s ease-in-out infinite 800ms; }

@keyframes flap-open {
  0%, 70%, 100% { transform: scaleY(1); }
  35% { transform: scaleY(-1); }
}

.how-check { stroke: var(--safe); stroke-dasharray: 30; stroke-dashoffset: 30; }
.is-visible .how-check { animation: draw 600ms ease-out 900ms forwards; }

/* Ohne JavaScript bleibt alles sofort sichtbar: versteckt wird nur, wenn effects.js "has-js" gesetzt hat. */

/* ---------- Ruhiges Standbild bei reduzierter Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  .redact-line::after { display: none; }
  .scanline { display: none; }
  .has-js [data-reveal] .how-steps li { opacity: 1; transform: none; }
  .how-check { stroke-dashoffset: 0; }
}
