/*
 * Modules
 * Section-specific layouts and larger components
 */

/* ==================
   Hero Section
   ================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 100px;
    padding-bottom: var(--space-12);
    color: white;
    /* Ensure text is visible on dark bg */
}

@media (min-width: 1024px) {
    .hero {
        text-align: left;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.hero-background-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    /* Clip the scaled parallax image */
    background-color: #1b233b;
    /* Fixed dark background to prevent brightening in light mode */
    /* Subtle opacity fade at the bottom (15% height) */
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

/* Even more subtle fade in light mode to avoid an "intrusive" look */
:root[data-theme="light"] .hero-background-img {
    -webkit-mask-image: linear-gradient(to bottom, black 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 92%, transparent 100%);
}

.hero-background-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0.6;
    /* Reduced opacity for better text contrast */
    transform: scale(1.1);
    /* Provide room for parallax movement */
    transition: transform 0.1s ease-out;
    /* Smooth movement */
}

.hero-background-img::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Horizontal gradient for text legibility only */
    background: linear-gradient(to right, rgba(27, 35, 59, 0.8) 0%, rgba(27, 35, 59, 0.4) 50%, rgba(27, 35, 59, 0) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: var(--container-xl);
    margin: 0 auto;
    width: 100%;
    padding-top: 110px;
    padding-bottom: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.hero-cta {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .hero-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-12);
    }

    .hero-text {
        flex: 1;
        max-width: 800px;
    }

    .hero-cta {
        flex-shrink: 0;
        width: auto;
        max-width: none;
        margin: 0;
    }
}

.hero h1 {
    font-size: clamp(2.2rem, 4.5vw, 4rem);
    line-height: 1.1;
    margin-bottom: var(--space-6);
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero p {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto var(--space-6) auto;
}

@media (min-width: 1024px) {
    .hero p {
        margin: 0;
    }
}

.hero-visual {
    margin-top: var(--space-12);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-medium);
    overflow: hidden;
    background: var(--bg-surface-elevated);
}

/* Background blob/glow */
/* Hero Mesh Background */
.hero-mesh {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.8;
}

.hero-mesh-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float-slow 20s infinite alternate ease-in-out;
}

.hero-mesh-orb-1 {
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, hsla(var(--color-brand-deep), 0.3), transparent 70%);
    top: -40%;
    left: -20%;
    animation-duration: 25s;
}

.hero-mesh-orb-2 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, hsla(var(--color-brand-main), 0.4), transparent 70%);
    top: 10%;
    right: -20%;
    animation-duration: 18s;
    animation-delay: -5s;
}

.hero-mesh-orb-3 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, hsla(var(--color-brand-light), 0.4), transparent 70%);
    bottom: -10%;
    left: 20%;
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes float-slow {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(30px, 50px) rotate(5deg) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg) scale(0.95);
    }

    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
}

/* Floating UI Container */
.hero-floating-ui {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-6);
    perspective: 2000px;
    transform-style: preserve-3d;
}

@media (min-width: 1024px) {
    .hero-floating-ui {
        display: block;
        height: clamp(300px, 45vh, 450px);
    }
}

.floating-card {
    position: relative;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    transition: transform 0.1s var(--ease-squish);
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .floating-card {
        position: absolute;
        width: auto;
    }
}

/* Main Dashboard Card */
.card-dashboard {
    max-width: 800px;
    height: 200px;
    z-index: 2;
    background: linear-gradient(180deg, hsla(var(--gray-0), 0.8) 0%, hsla(var(--gray-0), 0.4) 100%);
    overflow: hidden;
    transform: rotateX(5deg);
    animation: float-main 8s infinite ease-in-out;
}

@media (min-width: 1024px) {
    .card-dashboard {
        position: absolute;
        left: 50%;
        width: 100%;
        transform: translate(-50%, 0) rotateX(5deg);
        height: clamp(260px, 40vh, 400px);
    }
}

/* Floating Widgets */
.card-widget-1 {
    width: 100%;
    max-width: 400px;
    height: 140px;
    z-index: 3;
    animation: float-widget-1 10s infinite ease-in-out;
    background-image: url('../assets/placeholder-apex.png');
    background-size: 80%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(255, 255, 255, 0.32);
}

@media (min-width: 1024px) {
    .card-widget-1 {
        width: 240px;
        height: 170px;
        top: 20px;
        left: -240px;
        transform: translateZ(40px) rotate(-5deg);
    }
}

.card-widget-2 {
    width: 100%;
    max-width: 400px;
    height: 200px;
    z-index: 3;
    animation: float-widget-2 12s infinite ease-in-out;
    background-image: url('../assets/4Schritte.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(255, 255, 255, 0.32);
}

@media (min-width: 1024px) {
    .card-widget-2 {
        width: 280px;
        height: 360px;
        bottom: 20px;
        right: -280px;
        transform: translateZ(60px) rotate(3deg);
    }
}

@keyframes float-main {

    0%,
    100% {
        transform: translate(-50%, 0) rotateX(5deg) translateY(0);
    }

    50% {
        transform: translate(-50%, 0) rotateX(5deg) translateY(-8px);
    }
}

/* Fallback for mobile where translate(-50%) is not used */
@media (max-width: 1023px) {
    @keyframes float-main {

        0%,
        100% {
            transform: rotateX(5deg) translateY(0);
        }

        50% {
            transform: rotateX(5deg) translateY(-8px);
        }
    }
}

@keyframes float-widget-1 {

    0%,
    100% {
        transform: translateZ(40px) rotate(-5deg) translateY(0);
    }

    50% {
        transform: translateZ(40px) rotate(-5deg) translateY(-10px);
    }
}

@keyframes float-widget-2 {

    0%,
    100% {
        transform: translateZ(60px) rotate(3deg) translateY(0);
    }

    50% {
        transform: translateZ(60px) rotate(3deg) translateY(-12px);
    }
}

/* ==================
   Logo Ticker (Social Proof)
   ================== */
.logo-ticker {
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    overflow: hidden;
    display: flex;
    max-width: 100%;
    width: 100%;
}

.logo-track {
    display: flex;
    gap: var(--space-16);
    animation: scroll 30s linear infinite;
    white-space: nowrap;
    padding: var(--space-4) 0;
}

.logo-item {
    font-weight: 600;
    color: var(--text-tertiary);
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* Ensure track is duplicated */
}

/* ==================
   Feature Grid (Bento)
   ================== */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(280px, auto);
    }

    .bento-span-2 {
        grid-column: span 2;
    }

    .bento-row-span-2 {
        grid-row: span 2;
    }
}

@media (min-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bento-span-2 {
        grid-column: span 2;
    }

    .bento-span-3 {
        grid-column: span 3;
    }
}

.bento-item {
    position: relative;
    padding: var(--space-8);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) var(--ease-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-medium);
    z-index: 5;
}

.bento-item-glass {
    background: linear-gradient(135deg, var(--bg-surface-glass) 0%, hsla(var(--gray-0), 0.5) 100%);
    backdrop-filter: blur(10px);
}


/* ==================
   Process Section
   ================== */
.process-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    align-items: center;
}

@media (min-width: 1024px) {
    .process-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
        gap: 0;
    }
}

.process-step {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.process-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-brand);
    padding: var(--space-4) 0;
    transition: opacity var(--duration-long) var(--ease-smooth), transform var(--duration-long) var(--ease-smooth);
}

@media (min-width: 1024px) {
    .process-arrow {
        flex: 0 0 60px;
        padding: 0;
    }

    .process-arrow svg {
        transform: scale(1.5);
    }
}

@media (max-width: 1023px) {
    .process-arrow svg {
        transform: rotate(90deg) scale(1.2);
    }
}

/* Slide-in Animation */
.reveal-slide-in {
    opacity: 0;
    transform: translateX(-50px);
    transition:
        opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-slide-in.reveal-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered Delays for 4 steps + 3 arrows */
.process-step:nth-of-type(1).reveal-slide-in {
    transition-delay: 0.1s;
}

.process-arrow:nth-of-type(2).reveal-slide-in {
    transition-delay: 0.2s;
}

.process-step:nth-of-type(3).reveal-slide-in {
    transition-delay: 0.3s;
}

.process-arrow:nth-of-type(4).reveal-slide-in {
    transition-delay: 0.4s;
}

.process-step:nth-of-type(5).reveal-slide-in {
    transition-delay: 0.5s;
}

.process-arrow:nth-of-type(6).reveal-slide-in {
    transition-delay: 0.6s;
}

.process-step:nth-of-type(7).reveal-slide-in {
    transition-delay: 0.7s;
}

/* ==================
   Pricing
   ================== */
.pricing-card-highlight {
    position: relative;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 1px var(--primary-500), var(--shadow-lg);
}

.pricing-feature-list {
    list-style: none;
    padding: 0;
    margin: var(--space-6) 0;
}

.pricing-feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.check-icon {
    color: var(--primary-600);
    flex-shrink: 0;
}

/* ==================
   Footer
   ================== */
.footer {
    border-top: 1px solid var(--border-light);
    padding-top: var(--space-16);
    padding-bottom: var(--space-8);
    font-size: var(--text-sm);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.footer-col h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: var(--space-2);
}

.footer-col a {
    color: var(--text-secondary);
}

.footer-col a:hover {
    color: var(--text-primary);
}

/* ==================
   Preloader
   ================== */
#preloader {
    position: fixed;
    inset: 0;
    background: #1d2c4c;
    /* Site brand deep blue */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.8s;
}

#preloader.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-8);
}

.preloader-logo {
    width: 120px;
    height: auto;
    animation: preloader-pulse 2s infinite ease-in-out;
}

.preloader-logo img {
    width: 100%;
    filter: brightness(0) invert(1);
    /* Ensure logo is white on dark background */
}



@keyframes preloader-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}