/* ==========================================================================
   MilDex – Motion Layer: Lenis, Scroll-Progress, Hero-Tilt, Lusion-Sheen, Bento
   ========================================================================== */

/* --- Lenis: natives Smooth-Scroll deaktivieren, sobald Lenis aktiv ist --- */
html.lenis,
html.lenis body {
  height: auto;
}
html.lenis {
  scroll-behavior: auto !important;
}

/* --- Header Scroll-Progress-Bar (2px, Gold → Smaragdgrün) --- */
.header {
  position: sticky;
}
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
  overflow: hidden;
}
.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #F5E6B3 0%, #D4AF37 38%, #3FBF8F 78%, #1F9D6E 100%);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.55);
  will-change: transform;
}

/* --- Hero: 3D-Perspektive, die sich beim Scrollen aufrichtet --- */
.phone-mockup-wrapper {
  perspective: 1400px;
}
.phone-mockup.is-tilt-driven {
  transform: rotateY(var(--tilt-y, -6deg)) rotateX(var(--tilt-x, 12deg));
  transition: transform 0.25s ease-out, box-shadow 0.4s ease;
  will-change: transform;
}
.phone-mockup.is-tilt-driven:hover {
  transform: rotateY(0deg) rotateX(0deg) scale(1.02);
}

/* --- Lusion Metallic Specular Highlight --- */
.lusion-sheen {
  position: absolute;
  inset: -10% -60%;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.22) 48%,
    rgba(212, 175, 55, 0.35) 50%,
    transparent 65%);
  mix-blend-mode: overlay;
  transform: translateX(-130%);
  will-change: transform;
}

/* --- Linear-Style Bento Cards --- */
.bento-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 40%),
    rgba(14, 18, 15, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
    rgba(212, 175, 55, 0.12), rgba(63, 191, 143, 0.05) 40%, transparent 70%);
  opacity: 0.55;
  transition: opacity 0.35s ease;
}
.bento-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(212, 175, 55, 0.55), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.bento-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.bento-card:hover::before { opacity: 1; }
.bento-card:hover::after { opacity: 1; }

.bento-card .feature-icon-box {
  border-color: rgba(255, 255, 255, 0.12);
}

/* --- Phaleristik-Tag-Pills --- */
.ref-tag-list li.ref-pill-key {
  border-color: rgba(212, 175, 55, 0.38);
  color: #EBD9A0;
  background: rgba(212, 175, 55, 0.08);
}
.ref-tag-list li.is-pulse {
  animation: pillPulse 1.1s cubic-bezier(0.16, 1, 0.3, 1) 1;
}
.ref-tag-list li.ref-pill-key.is-pulse {
  animation: pillPulseKey 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1;
}
@keyframes pillPulse {
  0% { box-shadow: 0 0 0 0 rgba(139, 155, 105, 0); }
  35% { box-shadow: 0 0 0 3px rgba(139, 155, 105, 0.28), 0 0 18px rgba(139, 155, 105, 0.25); border-color: rgba(176, 184, 142, 0.6); }
  100% { box-shadow: 0 0 0 0 rgba(139, 155, 105, 0); }
}
@keyframes pillPulseKey {
  0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
  35% { box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3), 0 0 22px rgba(212, 175, 55, 0.35); border-color: rgba(212, 175, 55, 0.85); color: #fff; }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .lusion-sheen { display: none; }
  .ref-tag-list li.is-pulse { animation: none; }
}
