/* TwoPixels Animated Hero-Backgrounds V3 — 12 individuelle Animations
   Mobile-optimiert · Lesbarkeit-priorisiert · prefers-reduced-motion compliant */

/* === BASE === */
.tp-anim-hero {
    position: relative;
    background: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
    color: #fff;
    padding: 100px 0 90px;
    overflow: hidden;
    isolation: isolate;
    min-height: 60vh;
    display: flex;
    align-items: center;
}
.tp-anim-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(15,23,42,0.4) 0%, transparent 70%);
    z-index: 5;
    pointer-events: none;
}
.tp-anim-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
}
.tp-anim-hero h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    margin: 0 auto 16px;
    max-width: 880px;
    color: #fff;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
    font-weight: 700;
    line-height: 1.15;
}
.tp-anim-hero .lead {
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 720px;
    margin: 0 auto 28px;
    color: rgba(255,255,255,0.98);
    line-height: 1.6;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.tp-hero-eyebrow {
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
}

.tp-anim-mesh {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 20% 30%, rgba(232, 93, 63, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(232, 93, 63, 0.25) 0%, transparent 50%);
    animation: tpMeshShift 20s ease-in-out infinite;
}
@keyframes tpMeshShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(3deg); }
}

/* === V1: HOME — Pixel-Cluster (TwoPixels-Brand) === */
.tp-anim-home .pixel-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 4px;
    padding: 30px;
    opacity: 0.35;
}
.tp-anim-home .pixel {
    background: linear-gradient(135deg, #E85D3F, #FFB89A);
    border-radius: 2px;
    animation: tpPixelPulse 4s ease-in-out infinite;
    aspect-ratio: 1;
}
@keyframes tpPixelPulse {
    0%, 100% { opacity: 0.1; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* === V2: BRIDGE (refined) — Datenfluss mit Labels === */
.tp-anim-bridge .tp-anim-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0.5;
}
.tp-anim-bridge .node {
    fill: #FFB89A;
    filter: drop-shadow(0 0 12px #E85D3F);
}
.tp-anim-bridge .node-1 { animation: tpNodePulse 3s ease-in-out infinite; }
.tp-anim-bridge .node-2 { animation: tpNodePulse 3s ease-in-out infinite 1s; }
.tp-anim-bridge .node-3 { animation: tpNodePulse 3s ease-in-out infinite 2s; }
.tp-anim-bridge .line {
    stroke: #E85D3F;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 8 8;
    animation: tpLineFlow 4s linear infinite;
}
.tp-anim-bridge .packet {
    fill: #fff;
    filter: drop-shadow(0 0 6px #fff);
    animation: tpPacketMove 4s linear infinite;
}
@keyframes tpNodePulse {
    0%, 100% { opacity: 0.5; r: 8; }
    50% { opacity: 1; r: 14; }
}
@keyframes tpLineFlow {
    to { stroke-dashoffset: -32; }
}
@keyframes tpPacketMove {
    0% { offset-distance: 0%; opacity: 0; }
    10%, 90% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

/* === V3: WAWI (refined) — Stock-Bars wachsen === */
.tp-anim-wawi .stock-bar {
    position: absolute;
    width: 30px;
    bottom: 0;
    background: linear-gradient(180deg, #E85D3F, #D45436);
    border-radius: 4px 4px 0 0;
    z-index: 2;
    animation: tpStockGrow 5s ease-in-out infinite;
    opacity: 0.4;
}
.tp-anim-wawi .bar-1 { left: 4%; height: 30%; animation-delay: 0s; }
.tp-anim-wawi .bar-2 { left: 9%; height: 50%; animation-delay: 0.3s; }
.tp-anim-wawi .bar-3 { left: 14%; height: 40%; animation-delay: 0.6s; }
.tp-anim-wawi .bar-4 { right: 14%; height: 45%; animation-delay: 0.9s; }
.tp-anim-wawi .bar-5 { right: 9%; height: 60%; animation-delay: 1.2s; }
.tp-anim-wawi .bar-6 { right: 4%; height: 35%; animation-delay: 1.5s; }
@keyframes tpStockGrow {
    0%, 100% { transform: scaleY(0.4); opacity: 0.3; }
    50% { transform: scaleY(1); opacity: 0.5; }
}
.tp-anim-wawi .stock-bar { transform-origin: bottom; }

/* === V4: SHOP (refined) — Produktkarten-Mosaik === */
.tp-anim-shop .product-card {
    position: absolute;
    width: 110px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 8px;
    z-index: 2;
    text-align: center;
    color: rgba(255,255,255,0.85);
    font-size: 0.7rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: tpProductFloat 8s ease-in-out infinite;
}
.tp-anim-shop .product-card::before {
    content: '';
    display: block;
    height: 50px;
    background: linear-gradient(135deg, #E85D3F, #FFB89A);
    border-radius: 8px;
    margin-bottom: 6px;
    opacity: 0.5;
}
.tp-anim-shop .product-card .price {
    display: inline-block;
    background: #E85D3F;
    color: #fff;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.7rem;
    margin-top: 3px;
}
.tp-anim-shop .p-1 { top: 10%; left: 4%; animation-delay: 0s; }
.tp-anim-shop .p-2 { top: 60%; left: 3%; animation-delay: 1.5s; }
.tp-anim-shop .p-3 { top: 14%; right: 5%; animation-delay: 3s; }
.tp-anim-shop .p-4 { top: 58%; right: 4%; animation-delay: 4.5s; }
@keyframes tpProductFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); opacity: 0.4; }
    50% { transform: translateY(-10px) rotate(2deg); opacity: 0.65; }
}

/* === V5: POS — Kassenbon scrollt aus === */
.tp-anim-pos .receipt {
    position: absolute;
    width: 200px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    color: #2D3748;
    padding: 20px 18px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.7rem;
    line-height: 1.4;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 2;
    animation: tpReceiptScroll 12s ease-in-out infinite;
    opacity: 0.3;
}
.tp-anim-pos .receipt::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0; right: 0;
    height: 12px;
    background:
        linear-gradient(135deg, transparent 33%, rgba(255,255,255,0.95) 33% 67%, transparent 67%),
        linear-gradient(45deg, transparent 33%, rgba(255,255,255,0.95) 33% 67%, transparent 67%);
    background-size: 12px 12px;
    background-position: 0 0, 6px 0;
}
.tp-anim-pos .receipt-1 { left: 12%; transform: translateX(0) rotate(-5deg); animation-delay: 0s; }
.tp-anim-pos .receipt-2 { right: 12%; left: auto; transform: translateX(0) rotate(5deg); animation-delay: 6s; }
@keyframes tpReceiptScroll {
    0% { transform: translateY(-200%); opacity: 0; }
    20% { opacity: 0.3; }
    80% { opacity: 0.3; }
    100% { transform: translateY(600%); opacity: 0; }
}

/* === V6: WMS — Lager-Gitter mit blinkenden Slots === */
.tp-anim-wms .warehouse-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 8px;
    padding: 40px;
    opacity: 0.25;
}
.tp-anim-wms .slot {
    border: 2px solid rgba(232,93,63,0.6);
    border-radius: 4px;
    background: rgba(232,93,63,0.1);
    animation: tpSlotBlink 6s ease-in-out infinite;
}
@keyframes tpSlotBlink {
    0%, 100% { background: rgba(232,93,63,0.05); border-color: rgba(232,93,63,0.3); }
    50% { background: rgba(232,93,63,0.4); border-color: rgba(232,93,63,0.9); box-shadow: 0 0 8px rgba(232,93,63,0.5); }
}

/* === V7: WEBDESIGN (refined) — Mockup-Wireframes === */
.tp-anim-webdesign .wireframe {
    position: absolute;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    z-index: 2;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: tpWireframeFloat 8s ease-in-out infinite;
}
.tp-anim-webdesign .wireframe::before {
    content: '';
    display: block;
    height: 40%;
    background: rgba(232,93,63,0.3);
    border-radius: 4px;
    margin-bottom: 8px;
}
.tp-anim-webdesign .wireframe::after {
    content: '';
    display: block;
    background:
        linear-gradient(to right, rgba(255,255,255,0.3) 70%, transparent 70%),
        linear-gradient(to right, rgba(255,255,255,0.3) 50%, transparent 50%),
        linear-gradient(to right, rgba(255,255,255,0.3) 80%, transparent 80%);
    background-size: 100% 4px;
    background-repeat: no-repeat;
    background-position: 0 0, 0 10px, 0 20px;
    height: 28px;
}
.tp-anim-webdesign .wf-1 { width: 180px; height: 130px; top: 8%; left: 3%; animation-delay: 0s; transform: rotate(-3deg); }
.tp-anim-webdesign .wf-2 { width: 140px; height: 100px; bottom: 12%; right: 5%; animation-delay: 2s; transform: rotate(2deg); }
.tp-anim-webdesign .wf-3 { width: 110px; height: 80px; top: 60%; left: 6%; animation-delay: 4s; transform: rotate(4deg); }
@keyframes tpWireframeFloat {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); opacity: 0.5; }
    50% { transform: translateY(-12px) rotate(var(--r, 0deg)); opacity: 0.7; }
}

/* === V8: WEBSHOP — Cart-Animation === */
.tp-anim-webshop .cart-item {
    position: absolute;
    background: rgba(232,93,63,0.85);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 2;
    animation: tpCartItem 6s ease-in-out infinite;
    box-shadow: 0 6px 16px rgba(232,93,63,0.35);
    opacity: 0;
}
.tp-anim-webshop .cart-1 { top: 14%; left: 6%; animation-delay: 0s; }
.tp-anim-webshop .cart-2 { top: 16%; right: 8%; animation-delay: 1.5s; }
.tp-anim-webshop .cart-3 { bottom: 18%; left: 10%; animation-delay: 3s; }
.tp-anim-webshop .cart-4 { bottom: 14%; right: 6%; animation-delay: 4.5s; }
@keyframes tpCartItem {
    0%, 100% { transform: translate(0, 0) scale(0.8); opacity: 0; }
    10% { opacity: 1; transform: translate(0, 0) scale(1); }
    50% { transform: translate(0, -10px) scale(1.05); }
    90% { opacity: 1; }
}

/* === V9: SECURITY (refined) — Schild + Code-Rain === */
.tp-anim-security .scan-line {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #E85D3F, transparent);
    box-shadow: 0 0 12px #E85D3F;
    z-index: 2;
    animation: tpScan 4s ease-in-out infinite;
    opacity: 0.6;
}
.tp-anim-security .scan-line:nth-child(2) { animation-delay: 1.3s; }
.tp-anim-security .scan-line:nth-child(3) { animation-delay: 2.6s; }
@keyframes tpScan {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(60vh); opacity: 0; }
}
.tp-anim-security .shield {
    position: absolute;
    right: 6%; top: 50%;
    transform: translateY(-50%);
    font-size: 6rem;
    opacity: 0.15;
    z-index: 2;
    animation: tpShieldPulse 3s ease-in-out infinite;
}
.tp-anim-security .code-col {
    position: absolute;
    top: 0;
    color: rgba(232,93,63,0.4);
    font-family: monospace;
    font-size: 0.75rem;
    z-index: 2;
    line-height: 1.4;
    animation: tpCodeRain 8s linear infinite;
    text-shadow: 0 0 8px rgba(232,93,63,0.6);
}
.tp-anim-security .code-1 { left: 8%; animation-delay: 0s; }
.tp-anim-security .code-2 { right: 28%; animation-delay: 2s; }
.tp-anim-security .code-3 { left: 18%; animation-delay: 4s; }
@keyframes tpCodeRain {
    0% { transform: translateY(-30vh); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(80vh); opacity: 0; }
}
@keyframes tpShieldPulse {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.15; }
    50% { transform: translateY(-50%) scale(1.08); opacity: 0.25; }
}

/* === V10: MARKETING (refined) — Social-Icons mit Notifications === */
.tp-anim-marketing .social-bubble {
    position: absolute;
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    z-index: 2;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    animation: tpSocialFloat 8s ease-in-out infinite;
}
.tp-anim-marketing .social-bubble::after {
    content: attr(data-count);
    position: absolute;
    top: -4px; right: -4px;
    width: 22px; height: 22px;
    background: #E85D3F;
    color: #fff;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(232,93,63,0.5);
}
.tp-anim-marketing .s-1 { top: 10%; left: 5%; background: linear-gradient(135deg, #833AB4, #FD1D1D); animation-delay: 0s; }
.tp-anim-marketing .s-2 { top: 14%; right: 6%; background: linear-gradient(135deg, #1877F2, #00C6FF); animation-delay: 1s; }
.tp-anim-marketing .s-3 { bottom: 18%; left: 7%; background: linear-gradient(135deg, #000, #25F4EE); animation-delay: 2s; }
.tp-anim-marketing .s-4 { bottom: 14%; right: 8%; background: linear-gradient(135deg, #25D366, #128C7E); animation-delay: 3s; }
@keyframes tpSocialFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* === V11: APP — Phone-Mockup mit App-Screens === */
.tp-anim-app .phone {
    position: absolute;
    width: 130px;
    height: 240px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 10px;
    z-index: 2;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: tpPhoneFloat 7s ease-in-out infinite;
}
.tp-anim-app .phone::before {
    content: '';
    display: block;
    height: 100%;
    background:
        linear-gradient(180deg, rgba(232,93,63,0.4) 0%, transparent 30%),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.1) 0 12px, transparent 12px 20px);
    border-radius: 14px;
}
.tp-anim-app .phone-1 { top: 8%; left: 4%; transform: rotate(-8deg); animation-delay: 0s; }
.tp-anim-app .phone-2 { bottom: 8%; right: 4%; transform: rotate(8deg); animation-delay: 2s; }
.tp-anim-app .phone-3 { top: 30%; right: 6%; transform: rotate(-5deg); animation-delay: 4s; width: 100px; height: 180px; }
@keyframes tpPhoneFloat {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50% { transform: translateY(-15px) rotate(var(--r, 0deg)); }
}

/* === V12: AI-CONTENT — Neuron-Network === */
.tp-anim-ai-content .neuron {
    position: absolute;
    width: 16px; height: 16px;
    background: radial-gradient(circle, #FFB89A, #E85D3F);
    border-radius: 50%;
    box-shadow: 0 0 24px #E85D3F, 0 0 8px #FFB89A;
    z-index: 2;
    animation: tpNeuronPulse 3s ease-in-out infinite;
}
.tp-anim-ai-content .n-1 { top: 15%; left: 8%; animation-delay: 0s; }
.tp-anim-ai-content .n-2 { top: 25%; left: 30%; animation-delay: 0.5s; }
.tp-anim-ai-content .n-3 { top: 70%; left: 18%; animation-delay: 1s; }
.tp-anim-ai-content .n-4 { top: 20%; right: 12%; animation-delay: 1.5s; }
.tp-anim-ai-content .n-5 { top: 65%; right: 28%; animation-delay: 2s; }
.tp-anim-ai-content .n-6 { bottom: 14%; right: 8%; animation-delay: 2.5s; }
@keyframes tpNeuronPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}
.tp-anim-ai-content .synapse {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    width: 100%; height: 100%;
    top: 0; left: 0;
    opacity: 0.4;
}
.tp-anim-ai-content .synapse line {
    stroke: #E85D3F;
    stroke-width: 1;
    stroke-dasharray: 4 4;
    animation: tpSynapseFlow 3s linear infinite;
}
@keyframes tpSynapseFlow {
    to { stroke-dashoffset: -16; }
}

/* === MOBILE OPTIMIZATION === */
@media (max-width: 768px) {
    .tp-anim-hero {
        padding: 70px 0 60px;
        min-height: 50vh;
    }
    .tp-anim-hero h1 { font-size: 1.55rem; }
    .tp-anim-hero .lead { font-size: 0.95rem; }
    .tp-anim-hero::after {
        background: radial-gradient(ellipse at center, rgba(15,23,42,0.65) 0%, rgba(15,23,42,0.25) 70%);
    }

    /* Mobile: alle Floating-Elemente ausblenden außer Hintergrund + 1-2 deko Elementen */
    .tp-anim-home .pixel-grid { opacity: 0.18; padding: 14px; }
    .tp-anim-bridge .tp-anim-svg { opacity: 0.3; }
    .tp-anim-wawi .stock-bar:not(.bar-1):not(.bar-6) { display: none; }
    .tp-anim-wawi .stock-bar { width: 18px; opacity: 0.25; }
    .tp-anim-shop .product-card:not(.p-1):not(.p-4) { display: none; }
    .tp-anim-shop .product-card { width: 70px; font-size: 0.6rem; opacity: 0.4; }
    .tp-anim-pos .receipt { transform: scale(0.6) translateX(-50%); opacity: 0.15 !important; }
    .tp-anim-pos .receipt-2 { display: none; }
    .tp-anim-wms .warehouse-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(4, 1fr);
        opacity: 0.15;
        padding: 20px;
    }
    .tp-anim-webdesign .wireframe:not(.wf-1) { display: none; }
    .tp-anim-webdesign .wireframe { width: 80px !important; height: 60px !important; opacity: 0.3; }
    .tp-anim-webshop .cart-item { font-size: 0.7rem; padding: 6px 10px; opacity: 0.5; }
    .tp-anim-webshop .cart-3, .tp-anim-webshop .cart-4 { display: none; }
    .tp-anim-security .shield { font-size: 4rem; opacity: 0.08; }
    .tp-anim-security .code-col { font-size: 0.6rem; opacity: 0.3; }
    .tp-anim-marketing .social-bubble { width: 42px; height: 42px; font-size: 1.2rem; }
    .tp-anim-marketing .s-3, .tp-anim-marketing .s-4 { display: none; }
    .tp-anim-app .phone:not(.phone-1) { display: none; }
    .tp-anim-app .phone-1 { width: 80px; height: 150px; opacity: 0.4; }
    .tp-anim-ai-content .neuron:not(.n-1):not(.n-4) { display: none; }
}

@media (max-width: 480px) {
    .tp-anim-hero { padding: 60px 0 50px; min-height: 45vh; }
    .tp-anim-hero h1 { font-size: 1.35rem; }
    /* Ultra-mobile: nur Mesh + Backdrop */
    .tp-anim-hero > *:not(.tp-anim-mesh):not(.tp-anim-hero-content):not(.tp-anim-hero::after) {
        opacity: 0.2 !important;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .tp-anim-hero *, .tp-anim-mesh { animation: none !important; }
}
