/* Reset and base styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --dark: #1e1b4b;
    --light: #f8fafc;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.6s ease;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--dark) 0%, #312e81 100%);
    min-height: 100vh;
    color: var(--light);
    overflow-x: hidden;
}

/* Page load animation */
.page-wrapper {
    animation: pageLoad 0.8s ease-out;
}

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    background: linear-gradient(90deg, var(--light), var(--primary), var(--secondary));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.8;
    margin-top: 1rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}

/* Cards grid */
.cards-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Card with hover transitions */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition:
        transform var(--transition-medium),
        box-shadow var(--transition-medium),
        background var(--transition-medium);
    cursor: pointer;
    opacity: 0;
    animation: cardAppear 0.5s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform var(--transition-medium);
}

.card:hover .card-icon {
    transform: rotate(10deg) scale(1.1);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-description {
    opacity: 0.7;
    line-height: 1.6;
}

/* Button with ripple effect */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

.btn:active {
    transform: scale(0.98);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Floating elements */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--secondary);
    top: 60%;
    right: 10%;
    animation-delay: -5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: var(--primary);
    bottom: 20%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(30px, -30px) rotate(90deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg);
    }
    75% {
        transform: translate(20px, 40px) rotate(270deg);
    }
}

/* Interactive demo section */
.demo-section {
    padding: 4rem 2rem;
    text-align: center;
}

.demo-box {
    width: 150px;
    height: 150px;
    margin: 2rem auto;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.demo-box:hover {
    border-radius: 50%;
    transform: rotate(180deg) scale(1.2);
}

/* Scroll reveal classes */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Modal transition */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--dark);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    transform: scale(0.8) translateY(50px);
    transition: transform var(--transition-medium);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
    float: right;
    transition: transform var(--transition-fast);
}

.modal-close:hover {
    transform: rotate(90deg);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    opacity: 0.6;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
