/* ============================================================
   AUTARK INNOVATIONS — PREMIUM PATTERNS LAYER
   Inspired by 21st.dev, Linear, Vercel, Railway, Nuxt
   2026-04-30 — Pierre Premium-Design-Sprint
   ------------------------------------------------------------
   Vanilla CSS, basiert auf brand-tokens.css.
   Mobile-First-Responsive, GPU-accelerated, motion-safe.
   ============================================================ */

/* ============================================================
   PATTERN 1: AURORA-GRADIENT-BG (Mesh + slow drift)
   Subtile, atmosphaerische Hintergrund-Animation fuer Heroes.
   ============================================================ */
.pp-aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  /* Konservative Default-Opacity, in Hero-Kontext per Wrapper steuerbar */
  opacity: 0.85;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
}
.pp-aurora::before,
.pp-aurora::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.pp-aurora::before {
  top: -20%;
  left: -10%;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.28), transparent 65%);
  animation: pp-aurora-drift-1 28s ease-in-out infinite alternate;
}
.pp-aurora::after {
  top: -10%;
  right: -15%;
  background: radial-gradient(circle at center, rgba(255, 193, 7, 0.18), transparent 65%);
  animation: pp-aurora-drift-2 36s ease-in-out infinite alternate;
}
.pp-aurora__accent {
  position: absolute;
  bottom: -25%;
  left: 30%;
  width: 50vw;
  height: 50vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 50%;
  filter: blur(90px);
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.18), transparent 65%);
  animation: pp-aurora-drift-3 42s ease-in-out infinite alternate;
}
@keyframes pp-aurora-drift-1 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(8%, 6%, 0) scale(1.12); }
}
@keyframes pp-aurora-drift-2 {
  0%   { transform: translate3d(0, 0, 0) scale(1.05); }
  100% { transform: translate3d(-6%, 8%, 0) scale(0.92); }
}
@keyframes pp-aurora-drift-3 {
  0%   { transform: translate3d(0, 0, 0) scale(0.95); }
  100% { transform: translate3d(-8%, -10%, 0) scale(1.15); }
}

/* ============================================================
   PATTERN 2: BENTO-GRID (asymmetric Linear/Vercel-Style)
   12-Spalten-Grid, 4 Tiles in unterschiedlichen Groessen.
   ============================================================ */
.pp-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(160px, auto);
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.pp-bento__tile {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(22, 29, 40, 0.85) 0%, rgba(17, 24, 32, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 1.75rem;
  color: var(--text-primary, #F0F6FF);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 280ms ease,
              box-shadow 280ms ease;
  will-change: transform;
  isolation: isolate;
}
.pp-bento__tile:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(56, 189, 248, 0.10);
}
.pp-bento__tile--lg { grid-column: span 7; grid-row: span 2; }
.pp-bento__tile--md { grid-column: span 5; grid-row: span 1; }
.pp-bento__tile--sm { grid-column: span 4; grid-row: span 1; }
.pp-bento__tile--wide { grid-column: span 12; grid-row: span 1; }

.pp-bento__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-cyan, #38BDF8);
  margin-bottom: 0.6rem;
}
.pp-bento__title {
  font-family: var(--font-display, "Space Grotesk", system-ui);
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--text-primary, #F0F6FF);
}
.pp-bento__title--xl {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}
.pp-bento__desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary, #A8B8C8);
  margin: 0;
}
.pp-bento__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.10);
  color: var(--accent-cyan, #38BDF8);
  margin-bottom: 0.9rem;
}
.pp-bento__visual {
  position: absolute;
  inset: auto 0 0 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(56, 189, 248, 0.06) 100%);
  pointer-events: none;
}
@media (max-width: 900px) {
  .pp-bento { grid-template-columns: repeat(6, 1fr); }
  .pp-bento__tile--lg { grid-column: span 6; grid-row: span 1; }
  .pp-bento__tile--md { grid-column: span 6; }
  .pp-bento__tile--sm { grid-column: span 3; }
  .pp-bento__tile--wide { grid-column: span 6; }
}
@media (max-width: 600px) {
  .pp-bento { grid-template-columns: 1fr; gap: 1rem; padding: 0 1rem; }
  .pp-bento__tile,
  .pp-bento__tile--lg,
  .pp-bento__tile--md,
  .pp-bento__tile--sm,
  .pp-bento__tile--wide { grid-column: span 1; grid-row: auto; }
  .pp-bento__tile { padding: 1.4rem; }
}

/* ============================================================
   PATTERN 3: MARQUEE-SCROLL (Trust-Logos endlos)
   Pure-CSS infinite scroll, fade-edges via mask.
   ============================================================ */
.pp-marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 1.5rem 0;
  /* Reserve height to avoid CLS during JS-cloning */
  min-height: 64px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.pp-marquee__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: pp-marquee-scroll 32s linear infinite;
  will-change: transform;
}
.pp-marquee:hover .pp-marquee__track { animation-play-state: paused; }
.pp-marquee__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #F0F6FF);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: border-color 240ms ease, background 240ms ease;
}
.pp-marquee__item:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.06);
}
.pp-marquee__item-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan, #38BDF8);
  flex-shrink: 0;
}
.pp-marquee__sep {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.20);
  flex: 0 0 auto;
  align-self: center;
}
@keyframes pp-marquee-scroll {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
@media (max-width: 768px) {
  .pp-marquee__track { animation-duration: 50s; gap: 2rem; }
  .pp-marquee__item { padding: 0.5rem 1.05rem; font-size: 0.85rem; }
}

/* ============================================================
   PATTERN 4: SPOTLIGHT-HOVER (Mouse-Light-Follow Cards)
   Reagiert auf --x/--y CSS-Vars (gesetzt via JS).
   Fallback ohne JS: subtle radial-gradient on hover.
   ============================================================ */
.pp-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.pp-spotlight {
  --pp-x: 50%;
  --pp-y: 0%;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 1.75rem;
  background: linear-gradient(160deg, rgba(22, 29, 40, 0.92) 0%, rgba(17, 24, 32, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  isolation: isolate;
  transition: border-color 280ms ease, transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.pp-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    600px circle at var(--pp-x) var(--pp-y),
    rgba(56, 189, 248, 0.18),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
}
.pp-spotlight:hover {
  border-color: rgba(56, 189, 248, 0.22);
  transform: translateY(-2px);
}
.pp-spotlight:hover::before {
  opacity: 1;
}
.pp-spotlight__title {
  font-family: var(--font-display, "Space Grotesk", system-ui);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text-primary, #F0F6FF);
}
.pp-spotlight__desc {
  font-size: 0.95rem;
  color: var(--text-secondary, #A8B8C8);
  line-height: 1.55;
  margin: 0;
}
.pp-spotlight__icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.10);
  color: var(--accent-cyan, #38BDF8);
  margin-bottom: 1rem;
}

/* Disable spotlight on touch devices (kein Cursor) */
@media (hover: none), (pointer: coarse) {
  .pp-spotlight::before { display: none; }
  .pp-spotlight:hover { transform: none; }
}

/* ============================================================
   PATTERN 5: NUMBER-TICKER + SKELETON-REVEAL
   data-pp-count="2847392" — animiert via JS, Skeleton bis fertig.
   ============================================================ */
.pp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.pp-stat {
  text-align: center;
  padding: 1.4rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.pp-stat__num {
  display: block;
  font-family: var(--font-display, "Space Grotesk", system-ui);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  /* Reserve vertical space to avoid CLS while ticker animates */
  min-height: 1.1em;
  background: linear-gradient(135deg, #38BDF8 0%, #FFC107 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.pp-stat__suffix {
  background: linear-gradient(135deg, #38BDF8 0%, #FFC107 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.pp-stat__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #A8B8C8);
  letter-spacing: 0.4px;
}
/* Skeleton-Shimmer waehrend Counter laedt */
.pp-stat__num.is-loading {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: pp-shimmer 1.4s linear infinite;
}
@keyframes pp-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   GLOBAL: Reduced Motion + Mobile Performance
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .pp-aurora::before,
  .pp-aurora::after,
  .pp-aurora__accent { animation: none !important; }
  .pp-marquee__track { animation: none !important; }
  .pp-stat__num.is-loading { animation: none !important; }
  .pp-bento__tile,
  .pp-spotlight { transition: none !important; }
}
@media (max-width: 768px) {
  /* Aurora: Performance-Reduktion */
  .pp-aurora { opacity: 0.55; }
  .pp-aurora::before,
  .pp-aurora::after,
  .pp-aurora__accent { filter: blur(60px); }
  /* Stats: kompaktere Padding */
  .pp-stats { gap: 0.9rem; padding: 1.5rem 1rem; }
  .pp-stat { padding: 1.1rem 0.8rem; }
}

/* ============================================================
   UTILITY: Section-Wrapper mit Aurora als Background
   Einfach <section class="pp-aurora-section">…</section>
   ============================================================ */
.pp-aurora-section {
  position: relative;
  isolation: isolate;
}
.pp-aurora-section > .pp-aurora { z-index: 0; }
.pp-aurora-section > *:not(.pp-aurora) { position: relative; z-index: 1; }

/* ============================================================
   PHASE A3 — MOBILE ANIMATIONS DIET (Aurora-Drift pausieren)
   2026-04-30 — Mobile-CPU schonen
   ============================================================ */
@media (max-width: 768px) {
  .pp-aurora::before,
  .pp-aurora::after,
  .pp-aurora__accent {
    animation-play-state: paused !important;
  }
  /* Marquee bereits auf 50s mobile (siehe oben), zusätzlich: */
  .pp-marquee__track { animation-duration: 50s !important; }
}
