/* ================================================
   EMULIANCE — Apple Glass Style Enhancements
   3D Effects • Parallax • Premium Glassmorphism
   ================================================ */

/* Enhanced Glass Variables */
:root {
    /* Apple-style glass backgrounds */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-strong: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-light: rgba(255, 255, 255, 0.08);
    --glass-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);

    /* 3D perspective */
    --perspective: 1200px;
    --tilt-amount: 8deg;
}

/* -------------------------
   Apple-Style Glass Cards
   ------------------------- */
.problem-card,
.pipeline-step,
.explain-card,
.feature-card,
.trend-card,
.proof-quote,
.comparison-item {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.problem-card::before,
.pipeline-step::before,
.explain-card::before,
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0.5;
}

/* 3D Hover Tilt Effect */
.problem-card:hover,
.feature-card:hover,
.explain-card:hover {
    transform: translateY(-8px) rotateX(2deg) rotateY(-2deg);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(168, 85, 247, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* -------------------------
   Enhanced Dashboard Preview
   ------------------------- */
.dashboard-preview {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(168, 85, 247, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    transform: perspective(var(--perspective)) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.dashboard-preview:hover {
    transform: perspective(var(--perspective)) rotateY(0deg) rotateX(0deg) scale(1.02);
}

/* Glass reflection effect */
.dashboard-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 16px 16px 0 0;
}

/* -------------------------
   Floating Animation Enhancements
   ------------------------- */
@keyframes float-3d {

    0%,
    100% {
        transform: perspective(var(--perspective)) rotateY(-5deg) rotateX(5deg) translateY(0);
    }

    50% {
        transform: perspective(var(--perspective)) rotateY(-3deg) rotateX(3deg) translateY(-15px);
    }
}

.dashboard-preview {
    animation: float-3d 8s ease-in-out infinite;
}

.dashboard-preview:hover {
    animation-play-state: paused;
}

/* -------------------------
   Glowing Border Effect
   ------------------------- */
.feature-card.large,
.problem-bridge,
.comparison-item.emuliance {
    position: relative;
}

.feature-card.large::after,
.problem-bridge::after,
.comparison-item.emuliance::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.3), rgba(168, 85, 247, 0.1), rgba(139, 92, 246, 0.3));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card.large:hover::after,
.problem-bridge:hover::after,
.comparison-item.emuliance:hover::after {
    opacity: 1;
}

/* -------------------------
   Parallax Container
   ------------------------- */
[data-parallax] {
    transition: transform 0.1s ease-out;
}

/* -------------------------
   Enhanced Buttons
   ------------------------- */
.btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #d946ef 0%, #a855f7 50%, #8b5cf6 100%);
    box-shadow:
        0 4px 20px rgba(168, 85, 247, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 40px rgba(168, 85, 247, 0.5),
        0 0 60px rgba(217, 70, 239, 0.3);
}

/* -------------------------
   Stats Counter Animation
   ------------------------- */
.stat-value,
.proof-value {
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat:hover .stat-value,
.proof-stat:hover .proof-value {
    transform: scale(1.1);
}

/* -------------------------
   Scroll Reveal Animations
   ------------------------- */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Staggered children */
.stagger-children>* {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.stagger-children.revealed>*:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-children.revealed>*:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-children.revealed>*:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-children.revealed>*:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-children.revealed>*:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-children.revealed>*:nth-child(6) {
    transition-delay: 0.6s;
}

.stagger-children.revealed>* {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------
   Enhanced Chart Bars
   ------------------------- */
.chart-bar {
    position: relative;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.chart-bar:hover {
    filter: brightness(1.2);
    transform: scaleY(1.05);
    transform-origin: bottom;
}

.chart-bar.outlier {
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(168, 85, 247, 0.6), 0 0 60px rgba(217, 70, 239, 0.3);
    }
}

/* -------------------------
   Pipeline Steps Enhancement
   ------------------------- */
.pipeline-step {
    transform-style: preserve-3d;
}

.pipeline-step:hover {
    transform: translateX(10px) rotateY(2deg);
    background: var(--glass-bg-strong);
}

.pipeline-connector {
    position: relative;
    overflow: visible;
}

.pipeline-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 78px;
    width: 6px;
    height: 6px;
    background: var(--accent-purple);
    border-radius: 50%;
    animation: connector-pulse 1.5s ease-in-out infinite;
}

@keyframes connector-pulse {

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

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

/* -------------------------
   Footer Logo Fix
   ------------------------- */
.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* -------------------------
   Ambient Orbs Enhancement
   ------------------------- */
.gradient-orb {
    mix-blend-mode: screen;
}

.orb-1 {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(168, 85, 247, 0.1) 30%, transparent 70%);
}

.orb-2 {
    background: radial-gradient(circle, rgba(217, 70, 239, 0.2) 0%, rgba(217, 70, 239, 0.08) 30%, transparent 70%);
}

.orb-3 {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.08) 30%, transparent 70%);
}

/* -------------------------
   Cursor Glow Effect
   ------------------------- */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

/* -------------------------
   Noise Texture Overlay
   ------------------------- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 1000;
}

/* -------------------------
   Section Transitions
   ------------------------- */
section {
    position: relative;
}

section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.3), transparent);
}

/* -------------------------
   Hero Visual Enhancements
   ------------------------- */
.hero-visual::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, rgba(168, 85, 247, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* -------------------------
   Smooth Scrollbar (Webkit)
   ------------------------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}