/* Variable Fonts - Animated font axis showcase */

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

:root {
    --bg: #fafafa;
    --text: #1a1a1a;
    --accent: #6c5ce7;
    --accent-2: #00cec9;
    --gray: #636e72;
}

body {
    font-family: 'Recursive', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Hero */
.hero {
    text-align: center;
    padding: 6rem 0;
}

.title {
    font-size: clamp(4rem, 15vw, 12rem);
    line-height: 1;
    margin-bottom: 1rem;
}

.morph-weight {
    display: inline-block;
    font-weight: 300;
    animation: weight-morph 4s ease-in-out infinite;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes weight-morph {
    0%, 100% {
        font-weight: 300;
        letter-spacing: 0.2em;
    }
    50% {
        font-weight: 1000;
        letter-spacing: -0.02em;
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    font-weight: 400;
    font-variation-settings: 'CASL' 0.5;
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--gray);
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Weight Axis Demo */
.axis-demo {
    padding: 4rem 0;
}

.weight-spectrum {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.weight-sample {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: var(--weight);
    transition: transform 0.3s;
}

.weight-sample:hover {
    transform: scale(1.1);
    color: var(--accent);
}

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

.anim-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.anim-card:hover {
    transform: translateY(-5px);
}

.anim-card h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.card-desc {
    color: var(--gray);
    font-size: 0.9rem;
    font-variation-settings: 'CASL' 0.5;
}

/* Breathing Text */
.breathing-text {
    animation: breathe 3s ease-in-out infinite;
    color: var(--accent);
}

@keyframes breathe {
    0%, 100% {
        font-weight: 300;
        opacity: 0.7;
    }
    50% {
        font-weight: 900;
        opacity: 1;
    }
}

/* Wave Weight */
.wave-weight {
    display: inline-flex;
    color: var(--accent-2);
}

.wave-weight {
    animation: wave-letters 2s ease-in-out infinite;
}

@keyframes wave-letters {
    0%, 100% {
        font-weight: 300;
        transform: translateY(0);
    }
    25% {
        font-weight: 700;
        transform: translateY(-5px);
    }
    50% {
        font-weight: 300;
        transform: translateY(0);
    }
    75% {
        font-weight: 700;
        transform: translateY(5px);
    }
}

/* Casual Morph */
.casual-morph {
    animation: casual-shift 4s ease-in-out infinite;
}

@keyframes casual-shift {
    0%, 100% {
        font-variation-settings: 'CASL' 0, 'wght' 400;
    }
    50% {
        font-variation-settings: 'CASL' 1, 'wght' 700;
    }
}

/* Mono Shift */
.mono-shift {
    animation: mono-change 3s ease-in-out infinite;
    font-family: 'Recursive', monospace;
}

@keyframes mono-change {
    0%, 100% {
        font-variation-settings: 'MONO' 1, 'wght' 400;
        letter-spacing: 0;
    }
    50% {
        font-variation-settings: 'MONO' 0, 'wght' 600;
        letter-spacing: 0.05em;
    }
}

/* Interactive Section */
.interactive {
    padding: 4rem 0;
}

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

.hover-card {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    padding: 4rem 2rem;
    border-radius: 1rem;
    text-align: center;
}

.hover-card span {
    font-size: 2rem;
    color: white;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-heavy {
    font-weight: 300;
}

.hover-card:hover .hover-heavy {
    font-weight: 1000;
}

.hover-light {
    font-weight: 900;
}

.hover-card:hover .hover-light {
    font-weight: 300;
    letter-spacing: 0.2em;
}

.hover-stretch {
    font-weight: 500;
    letter-spacing: 0;
}

.hover-card:hover .hover-stretch {
    font-weight: 300;
    letter-spacing: 0.5em;
}

/* Text Block */
.text-block {
    padding: 4rem 0;
}

.animated-paragraph {
    font-size: 1.3rem;
    line-height: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    animation: paragraph-breathe 8s ease-in-out infinite;
}

@keyframes paragraph-breathe {
    0%, 100% {
        font-weight: 400;
        font-variation-settings: 'CASL' 0;
    }
    50% {
        font-weight: 500;
        font-variation-settings: 'CASL' 0.3;
    }
}

/* Large Showcase */
.showcase-large {
    padding: 4rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.large-text-container {
    overflow: hidden;
}

.large-morph-text {
    display: block;
    font-size: clamp(4rem, 20vw, 15rem);
    font-weight: 900;
    line-height: 0.9;
    animation: large-morph 6s ease-in-out infinite;
    background: linear-gradient(90deg, var(--text) 0%, var(--accent) 50%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
}

.large-morph-text.delay-1 {
    animation-delay: -2s;
}

.large-morph-text.delay-2 {
    animation-delay: -4s;
}

@keyframes large-morph {
    0%, 100% {
        font-weight: 300;
        background-position: 0% 50%;
    }
    50% {
        font-weight: 1000;
        background-position: 100% 50%;
    }
}

/* Spectrum Section */
.spectrum-section {
    padding: 4rem 0;
}

.spectrum-text {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    font-size: clamp(1.5rem, 4vw, 3rem);
}

.spectrum-text span {
    display: inline-block;
    animation: spectrum-weight 3s ease-in-out infinite;
    animation-delay: calc(var(--pos) * 0.1s);
}

@keyframes spectrum-weight {
    0%, 100% {
        font-weight: 300;
        color: var(--accent);
    }
    50% {
        font-weight: 900;
        color: var(--accent-2);
    }
}

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

.footer-text {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
    animation: footer-breathe 4s ease-in-out infinite;
}

@keyframes footer-breathe {
    0%, 100% { font-weight: 300; }
    50% { font-weight: 600; }
}

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

.back-link:hover {
    background: var(--text);
    color: white;
    font-weight: 700;
}

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

    .hero {
        padding: 3rem 0;
    }

    .weight-spectrum {
        justify-content: center;
    }

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

    .anim-card h3 {
        font-size: 1.8rem;
    }

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

    .animated-paragraph {
        font-size: 1.1rem;
    }
}

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