/* =========================================================
   LASER CARD SCANNER - FOUNDATION v1.3
   - Pixel-perfect infinite loop (no flicker / no jump)
   - Dual-laser ready
   ========================================================= */

/* ⚠️ Section 1 - MAX 700px Höhe für Desktop! */
section.w-full.min-h-screen.bg-black:first-of-type {
  min-height: auto !important;
  max-height: 700px;
  height: auto;
}

/* ---------------------------------------------------------
   Shared Scanner Container
   --------------------------------------------------------- */
.scanner-container {
  position: relative;
  width: 100%;
  height: 300px;                 /* FEST! */
  overflow: hidden;
}

/* Stream mittig */
.card-stream {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  overflow: hidden;
  transform: translateY(-50%);
}

/* =========================================================
   PIXEL-PERFECT INFINITE LOOP
   .card-line moves by --track-width pixels (measured in JS)
   ========================================================= */
.card-line {
  display: flex;
  align-items: center;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
  animation: scrollTrackPx var(--duration, 40s) linear infinite;
  transform: translate3d(0,0,0);
}

/* Zwei identische Tracks */
.card-track {
  display: flex;
  align-items: center;
  gap: var(--gap, 60px);
  padding-right: var(--gap, 60px);
  white-space: nowrap;
}

/* Animate exakt um Track-A Breite (px) */
@keyframes scrollTrackPx {
  from { transform: translate3d(calc(var(--track-width, 0px) * -1), 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

/* Card Dimensions */
.card-wrapper {
  position: relative;
  width: var(--card-width, 400px);
  height: var(--card-height, 220px);
  flex-shrink: 0;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-width, 400px);
  height: var(--card-height, 220px);
  border-radius: 12px;
  overflow: hidden;
}

/* Pink / Normal Image Card */
.card-normal .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ASCII Layer (GREEN ASCII) */
.ascii-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: rgba(34, 197, 94, 0.9);
  font-family: 'Courier New', monospace;
  font-size: 9px;
  line-height: 10px;
  overflow: hidden;
  white-space: pre;
  padding: 8px;
  background: rgba(0, 0, 0, 0.35);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  animation: glitch 0.15s infinite;
}

/* Blue Card Layer */
.card-blue .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Glitch Anim - MOBILE OPTIMIZED */
@keyframes glitch {
  0%   { transform: translate(0, 0); opacity: 0.95; }
  20%  { transform: translate(0.5px, -0.5px); opacity: 0.9; }
  40%  { transform: translate(-0.5px, 0.5px); opacity: 1; }
  60%  { transform: translate(0.5px, 0.5px); opacity: 0.9; }
  80%  { transform: translate(-0.5px, -0.5px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 0.95; }
}

/* MOBILE PERFORMANCE: Disable heavy animations */
@media (max-width: 768px) {
  .ascii-content {
    animation: none !important;
  }

  .scanner-laser {
    box-shadow: none !important;
    filter: none !important;
  }

  .laser-beam {
    box-shadow: none !important;
  }
}

/* REDUCED MOTION: Respect user preference */
@media (prefers-reduced-motion: reduce) {
  .ascii-content,
  .card-line,
  .auto-track,
  .lane-track,
  .glyph-row,
  .dust-pixel {
    animation: none !important;
  }

  .scanner-laser,
  .laser-beam,
  .auto-laser {
    box-shadow: none !important;
  }
}

/* ---------------------------------------------------------
   Lasers
   --------------------------------------------------------- */

/* Default 1-Laser (Center) */
.scanner-laser {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 240px;
  pointer-events: none;
  z-index: 100;
  background: linear-gradient(to bottom,
    transparent,
    rgba(255, 255, 255, 0.8) 20%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.8) 80%,
    transparent
  );
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.8),
    0 0 40px rgba(139, 92, 246, 0.6),
    0 0 60px rgba(139, 92, 246, 0.4);
  filter: blur(2px);
}

/* Dual Laser Positions + Colors */
.scanner-container[data-scanner="dual"] .scanner-laser.laser-green {
  left: 33.333%;
  background: linear-gradient(to bottom,
    transparent,
    rgba(34, 197, 94, 0.7) 20%,
    rgba(34, 197, 94, 1) 50%,
    rgba(34, 197, 94, 0.7) 80%,
    transparent
  );
  box-shadow:
    0 0 18px rgba(34, 197, 94, 0.9),
    0 0 36px rgba(34, 197, 94, 0.7),
    0 0 54px rgba(34, 197, 94, 0.5);
}

.scanner-container[data-scanner="dual"] .scanner-laser.laser-yellow {
  left: 66.666%;
  background: linear-gradient(to bottom,
    transparent,
    rgba(250, 204, 21, 0.7) 20%,
    rgba(250, 204, 21, 1) 50%,
    rgba(250, 204, 21, 0.7) 80%,
    transparent
  );
  box-shadow:
    0 0 18px rgba(250, 204, 21, 0.9),
    0 0 36px rgba(250, 204, 21, 0.7),
    0 0 54px rgba(250, 204, 21, 0.5);
}

/* ---------------------------------------------------------
   Particle Canvas pro Container
   --------------------------------------------------------- */
.scanner-container .particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

/* ---------------------------------------------------------
   Responsive - Mobile
   --------------------------------------------------------- */
@media (max-width: 768px) {
  .scanner-container {
    height: 280px;
  }

  .card-wrapper,
  .card {
    width: 320px;
    height: 200px;
  }

  .card-track {
    gap: 40px;
  }

  .scanner-laser {
    width: 6px;
    height: 220px;
  }

  .ascii-content {
    font-size: 7px;
    line-height: 8px;
  }
}

/* =========================================================
   AUTO HERO (simpler marquee)
   ========================================================= */
.auto-hero {
  background: #04060b;
  color: #fff;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0; /* Reduced from 40px - 50% less */
}

/* Desktop: Keep original padding */
@media (min-width: 768px) {
  .auto-hero {
    padding: 40px 0;
  }
}

.auto-copy h1 {
  margin: 0;
}

.auto-viewport {
  position: relative;
  width: 100vw;
  max-width: 100%;
  height: 300px; /* ORIGINAL HEIGHT - 300px */
  margin: 0 auto;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(11, 15, 24, 0.9), rgba(9, 12, 20, 0.92));
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* NO BACKGROUND VERSION - For standalone use */
.auto-viewport-no-bg {
  position: relative;
  width: 100vw;
  max-width: 100%;
  height: 300px; /* FIXED 300px HEIGHT - Original Scanner Height */
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center; /* Zentriert vertikal */
  /* NO border-radius, NO background, NO shadow */
}

.auto-layer {
  position: absolute;
  inset: 0; /* FULL HEIGHT - keine Margins! */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Zentriert die Lanes vertikal */
}

.auto-lane {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--lane-height, 100px);
  top: calc(25px + (var(--lane-index, 0) * var(--lane-step, 110px)));
}

.auto-track {
  display: flex;
  width: max-content;
  gap: 0; /* NO gap between segments! They must be seamless */
  padding: 0;
  transform: translateX(0);
  will-change: transform;
}

.auto-marquee-active {
  animation: auto-marquee var(--speed, 24s) linear infinite;
}

@keyframes auto-marquee {
  from {
    transform: translateX(0);
  }
  to {
    /* Move exactly one segment to the left */
    transform: translateX(calc(-1 * var(--seg-width, 2540px)));
  }
}

.auto-segment {
  display: inline-flex; /* inline-flex for proper width measurement */
  gap: var(--gap, 120px);
  flex-shrink: 0;
  padding-right: var(--gap, 120px); /* Add gap at END for seamless loop */
}

.auto-card {
  position: relative;
  width: 120px;
  height: 150px;
  border-radius: 16px;
  overflow: hidden;
  background: #0b0f18;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transform: translateZ(0); /* GPU acceleration */
  will-change: transform;
  contain: layout style paint; /* CSS containment for better performance */
}

.auto-card-face {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #1d212c, #0f121a);
  border: 1px solid rgba(255, 255, 255, 0.12);
  clip-path: inset(0 var(--clip-right, 100%) 0 0);
  transform: translateZ(0); /* GPU acceleration */
  will-change: clip-path;
}

.auto-card-glyphs {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 18, 0.9);
  color: #63f7a1;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 10px 8px;
  line-height: 1.2;
  clip-path: inset(0 var(--clip-right, 100%) 0 var(--clip-left, 0));
  transform: translateZ(0); /* GPU acceleration */
  will-change: clip-path;
  white-space: pre-wrap;
}

.auto-card-glyphs::before {
  content: '0101 | ROUTE | STACK | 1010 | FLOW';
  opacity: 0.82;
}


.auto-laser {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%; /* VOLLE HÖHE der Animation */
  width: 3px;
  border-radius: 999px;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 5;
  transform: translateZ(0); /* GPU acceleration */
  will-change: transform;
}

.auto-laser.laser-green {
  left: calc(50% - 170px);
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(234, 88, 12, 0.95) 25%,
    rgba(59, 130, 246, 0.95) 55%,
    rgba(16, 185, 129, 0.95) 85%,
    transparent 100%);
}

.auto-laser.laser-white {
  left: calc(50% + 170px);
  background: linear-gradient(to bottom,
    transparent,
    rgba(255, 255, 255, 0.9) 20%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.8) 80%,
    transparent);
}

.laser-dust {
  position: absolute;
  top: 8%;
  bottom: 6%;
  width: 18px;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.65s ease-in-out;
}

.dust-left {
  left: calc(50% - 170px + 3px);
}

.dust-right {
  left: calc(50% + 170px + 3px);
}

.dust-pixel {
  position: absolute;
  left: 0;
  width: 2px;
  height: 2px;
  border-radius: 2px;
  opacity: 0;
  animation: dust-float 1.6s linear infinite;
  animation-play-state: paused;
}

.laser-dust.active {
  opacity: 1;
}

.laser-dust.active .dust-pixel {
  animation-play-state: running;
}

@keyframes dust-float {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6); }
  10% { opacity: 0.9; transform: translate3d(0, 0, 0) scale(1); }
  60% { opacity: 0.3; transform: translate3d(calc(var(--drift, 23px) * 0.6), calc(var(--dy, 0px) * 0.6), 0) scale(1.05); }
  100% { opacity: 0; transform: translate3d(var(--drift, 23px), var(--dy, 0px), 0) scale(1.2); }
}

/* =========================================================
   HERO LASER: CHAOS → MATRIX → FEATURE
   ========================================================= */
.hero-laser {
  position: relative;
  min-height: 110vh;
  background: #04060b;
  color: #fff;
  overflow: hidden;
  padding-bottom: 220px;
}

.hero-laser__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(236, 72, 153, 0.24), transparent 28%),
    radial-gradient(circle at 80% 60%, rgba(250, 204, 21, 0.18), transparent 30%),
    radial-gradient(circle at 50% 70%, rgba(59, 130, 246, 0.1), transparent 35%),
    #04060b;
  filter: blur(0px);
  z-index: 1;
}

.hero-laser__glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.25;
  z-index: 2;
}

.hero-laser__glow--left {
  left: -120px;
  top: 120px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.8), transparent 70%);
}

.hero-laser__glow--right {
  right: -140px;
  top: 180px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.8), transparent 70%);
}

.laser-stage {
  position: relative;
  width: min(1400px, 96vw);
  max-width: 1400px;
  margin: 0 auto;
  height: 320px;
  padding: 16px 20px 64px;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(11, 15, 24, 0.75), rgba(9, 12, 20, 0.92));
  box-shadow:
    0 10px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 3;
}

.laser-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), transparent 55%);
  pointer-events: none;
}

.laser-beam {
  position: absolute;
  top: 8%;
  bottom: 6%;
  width: 3px;
  border-radius: 999px;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 15;
}

.laser-beam.laser-green {
  left: calc(50% - 150px);
  background: linear-gradient(to bottom,
    transparent,
    rgba(74, 222, 128, 0.75) 20%,
    rgba(22, 163, 74, 1) 55%,
    rgba(74, 222, 128, 0.75) 80%,
    transparent);
  box-shadow:
    0 0 18px rgba(74, 222, 128, 0.9),
    0 0 36px rgba(74, 222, 128, 0.7),
    0 0 64px rgba(34, 197, 94, 0.6);
}

.laser-beam.laser-yellow {
  left: calc(50% + 150px);
  background: linear-gradient(to bottom,
    transparent,
    rgba(250, 204, 21, 0.8) 20%,
    rgba(234, 179, 8, 1) 55%,
    rgba(250, 204, 21, 0.8) 80%,
    transparent);
  box-shadow:
    0 0 18px rgba(250, 204, 21, 0.9),
    0 0 36px rgba(250, 204, 21, 0.7),
    0 0 64px rgba(202, 138, 4, 0.6);
}

.lane-stack {
  position: absolute;
  inset: 12px 18px 12px 18px;
  z-index: 10;
  overflow: hidden;
}

.lane {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--lane-height, 72px);
  top: calc(var(--lane-index, 0) * var(--lane-step, 72px));
  pointer-events: none;
}

.lane-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: var(--card-gap, 120px) !important;
  will-change: transform;
  animation: none;
  transform: translate3d(calc(var(--track-width, 0px) * -1), 0, 0);
  padding-right: var(--card-gap, 120px) !important;
}

.lane-track.ready {
  animation: laneScroll var(--lane-duration, 36s) linear infinite;
}

.track-segment {
  display: flex;
  align-items: center;
  gap: var(--card-gap, 140px);
  padding-right: var(--card-gap, 140px);
}

@keyframes laneScroll {
  from { transform: translate3d(calc(var(--track-width, 0px) * -1), 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

.card-shell {
  position: relative;
  width: 200px !important;
  height: calc(var(--lane-height, 72px) - 8px) !important;
  flex-shrink: 0;
  z-index: var(--z, 1);
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.65));
  animation: none;
  transform-origin: center;
  transform: rotate(var(--tilt, 0deg)) translateY(var(--lane-drift, 0px));
}


@keyframes wobble {
  0%   { transform: rotate(calc(var(--tilt, 0deg) - 0.4deg)) translateY(calc(var(--lane-drift, 0px) - 1px)); }
  50%  { transform: rotate(calc(var(--tilt, 0deg) + 0.4deg)) translateY(calc(var(--lane-drift, 0px) + 1px)); }
  100% { transform: rotate(calc(var(--tilt, 0deg) - 0.2deg)) translateY(calc(var(--lane-drift, 0px) - 1px)); }
}

.card-layer {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  transition: clip-path 0.08s linear;
}

.card-face {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg,
    hsl(var(--tone, 330) 90% 68%),
    hsl(calc(var(--tone, 330) + 12) 90% 45%));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 30px rgba(236, 72, 153, 0.35);
  clip-path: inset(0 0 0 0);
}

.card-face .card-pill {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-face .card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.card-glyphs {
  background: linear-gradient(180deg, rgba(7, 11, 18, 0.9), rgba(5, 8, 14, 0.9));
  color: #74f1b0;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
}

.glyph-row {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
  font-size: 12px;
  opacity: 0.92;
  animation: glyphFlow 5s linear infinite;
}

.glyph-row + .glyph-row {
  margin-top: 6px;
  opacity: 0.7;
  animation-duration: 6.4s;
  animation-delay: -2.4s;
}

@keyframes glyphFlow {
  from { transform: translateX(-30%); }
  to   { transform: translateX(30%); }
}

.card-processed {
  background: linear-gradient(135deg, rgba(8, 12, 20, 0.95), rgba(16, 22, 36, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 34px rgba(234, 179, 8, 0.45),
    inset 0 0 0 1px rgba(250, 204, 21, 0.3);
  clip-path: inset(0 0 0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-processed .feature-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 12px;
}

.card-processed .feature-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047, #22c55e);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.9);
}

@media (max-width: 1024px) {
  .laser-stage {
    height: 460px;
  }

  .lane-stack {
    inset: 50px 12px 50px 12px;
  }

  .lane {
    height: var(--lane-height, 92px);
    top: calc(var(--lane-index, 0) * var(--lane-step, 92px));
  }

  .lane-track {
    left: -20px;
    gap: 120px;
  }

  .card-shell {
    width: var(--card-w, 180px);
    height: var(--card-h, 112px);
  }
}

@media (max-width: 768px) {
  .hero-laser {
    min-height: 760px;
  }

  .laser-stage {
    height: 420px;
    padding: 16px 14px 36px;
  }

  .lane-stack {
    inset: 52px 10px 46px 10px;
  }

  .lane {
    height: var(--lane-height, 88px);
    top: calc(var(--lane-index, 0) * var(--lane-step, 88px));
  }

  .laser-beam.laser-green { left: 22%; }
  .laser-beam.laser-yellow { left: 72%; }

  .card-shell {
    width: var(--card-w, 168px);
    height: var(--card-h, 104px);
  }

  .card-face .card-title {
    font-size: 18px;
  }
}


.auto-card-output {
  position: absolute;
  inset: 0;
  background: #0b0f18;
  border: 1px solid var(--out-border, #fbbf24);
  border-radius: inherit;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--out-border, #fbbf24) 70%, transparent), 0 12px 24px color-mix(in srgb, var(--out-border, #fbbf24) 40%, transparent);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.08s linear;
  color: #fefce8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: center;
  padding: 10px;
}
