/* Kinetic Type - Letter-by-letter animations */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a0f;
    --text-light: #f0f0f5;
    --accent-1: #ff6b6b;
    --accent-2: #4ecdc4;
    --accent-3: #ffe66d;
    --accent-4: #95e1d3;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title {
    font-size: clamp(3rem, 12vw, 10rem);
    font-weight: 900;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
}

.title .letter {
    display: inline-block;
    animation: heroFloat 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes heroFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(-5deg);
    }
    75% {
        transform: translateY(10px) rotate(5deg);
    }
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-3);
}

.wave-text span {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.05s);
}

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Showcase Section */
.showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 4rem 0;
}

.demo-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.demo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.demo-card h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 900;
}

.demo-card .description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Bounce Effect */
.bounce-text span {
    display: inline-block;
    color: var(--accent-1);
    animation: bounce 0.6s ease infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scaleY(1);
    }
    30% {
        transform: translateY(-30px) scaleY(1.1);
    }
    50% {
        transform: translateY(0) scaleY(0.9);
    }
    70% {
        transform: translateY(-10px) scaleY(1);
    }
}

/* Rotate Effect */
.rotate-text span {
    display: inline-block;
    color: var(--accent-2);
    animation: rotate3d 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.2s);
}

@keyframes rotate3d {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(360deg);
    }
}

/* Scale/Pulse Effect */
.scale-text span {
    display: inline-block;
    color: var(--accent-3);
    animation: pulse 1.5s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.15s);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Flip Effect */
.flip-text span {
    display: inline-block;
    color: var(--accent-4);
    animation: flip 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.25s);
    transform-style: preserve-3d;
}

@keyframes flip {
    0%, 100% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(360deg);
    }
}

/* Cascade Section */
.cascade-section {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(78, 205, 196, 0.05), transparent);
}

.cascade-title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    margin-bottom: 2rem;
}

.cascade-word span {
    display: inline-block;
    animation: cascade 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
    color: var(--accent-2);
    text-shadow:
        0 0 10px var(--accent-2),
        0 0 20px var(--accent-2),
        0 0 40px var(--accent-2);
}

@keyframes cascade {
    0% {
        transform: translateY(-100px) rotate(-20deg);
        opacity: 0;
    }
    20%, 80% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100px) rotate(20deg);
        opacity: 0;
    }
}

.cascade-subtitle {
    font-size: 1.2rem;
    letter-spacing: 0.2em;
}

.cascade-subtitle span {
    display: inline-block;
    animation: fadeSlide 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.08s);
    color: rgba(255, 255, 255, 0.7);
}

@keyframes fadeSlide {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(5px);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

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

.typewriter {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--accent-3);
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--accent-3);
    animation:
        typing 3s steps(35) infinite,
        blink 0.7s step-end infinite;
    max-width: fit-content;
    margin: 0 auto 2rem;
}

@keyframes typing {
    0%, 100% {
        width: 0;
    }
    50%, 90% {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.back-link {
    display: inline-block;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.8rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2rem;
    transition: all 0.3s;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.back-link:hover {
    background: var(--text-light);
    color: var(--bg-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 0;
        min-height: 40vh;
    }

    .title {
        letter-spacing: 0.1em;
    }

    .demo-card {
        padding: 2rem 1rem;
    }

    .demo-card h2 {
        font-size: 2rem;
    }

    .cascade-section {
        padding: 3rem 0;
    }

    .typewriter {
        white-space: normal;
        border-right: none;
        animation: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
