/* ============================================
   FreeITSM - Home Page Styles
   ============================================ */

/* --- Hero Section --- */
.hero {
    padding: var(--space-4xl) 0;
    background: linear-gradient(160deg, var(--color-bg) 0%, #e8f5e9 50%, var(--color-bg) 100%);
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-content h1 {
    font-size: var(--text-5xl);
    font-weight: 300;
    line-height: 1.15;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

.hero-content h1 strong {
    font-weight: 700;
    color: var(--color-primary);
}

.hero-content .subtitle {
    font-size: var(--text-lg);
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 520px;
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hero module grid illustration */
.hero-module-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 440px;
    transform: perspective(800px) rotateY(-8deg) rotateX(4deg);
    transition: transform 0.6s ease;
}

.hero-module-grid:hover {
    transform: perspective(800px) rotateY(-2deg) rotateX(1deg);
}

.hero-module-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px 8px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 2px solid transparent;
}

.hero-module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hero-module-card .icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.hero-module-card .icon-wrap svg {
    width: 20px;
    height: 20px;
    color: white;
}

.hero-module-card .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: var(--text-4xl);
    }

    .hero-content .subtitle {
        margin: 0 auto var(--space-xl);
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-module-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        transform: none;
        max-width: 360px;
        margin: 0 auto;
    }

    .hero-module-card {
        width: calc(25% - 9px);
    }

    .hero-module-grid:hover {
        transform: none;
    }
}

/* --- What Is Section --- */
.what-is {
    padding: var(--space-4xl) 0;
}

.features-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.feature-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card .icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: rgba(45, 106, 79, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    color: var(--color-primary);
}

.feature-card .icon svg {
    width: 28px;
    height: 28px;
}

.feature-card h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
}

.feature-card p {
    font-size: var(--text-sm);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .features-row {
        grid-template-columns: 1fr;
    }
}

/* --- Module Strip --- */
.module-strip {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-alt);
}

.modules-grid-home {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-lg);
}

.module-card-home {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.module-card-home:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    color: var(--color-text);
}

.module-card-home .module-icon-sm {
    margin: 0 auto var(--space-md);
}

.module-card-home h4 {
    font-size: var(--text-sm);
    margin-bottom: var(--space-xs);
}

.module-card-home p {
    font-size: var(--text-xs);
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.5;
}

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

@media (max-width: 576px) {
    .modules-grid-home {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Module Card Fly-in Animation --- */
.module-card-home {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.module-card-home.fly-from-top    { transform: translateY(-120px) scale(0.5); }
.module-card-home.fly-from-bottom { transform: translateY(120px) scale(0.5); }
.module-card-home.fly-from-left   { transform: translateX(-120px) scale(0.5); }
.module-card-home.fly-from-right  { transform: translateX(120px) scale(0.5); }
.module-card-home.fly-from-top-left    { transform: translate(-100px, -100px) scale(0.5); }
.module-card-home.fly-from-top-right   { transform: translate(100px, -100px) scale(0.5); }
.module-card-home.fly-from-bottom-left { transform: translate(-100px, 100px) scale(0.5); }
.module-card-home.fly-from-bottom-right{ transform: translate(100px, 100px) scale(0.5); }

.module-card-home.fly-in {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Restore hover after animation */
.module-card-home.fly-in:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* Staggered delay per card */
.module-card-home:nth-child(1)  { transition-delay: 0s; }
.module-card-home:nth-child(2)  { transition-delay: 0.07s; }
.module-card-home:nth-child(3)  { transition-delay: 0.14s; }
.module-card-home:nth-child(4)  { transition-delay: 0.21s; }
.module-card-home:nth-child(5)  { transition-delay: 0.28s; }
.module-card-home:nth-child(6)  { transition-delay: 0.35s; }
.module-card-home:nth-child(7)  { transition-delay: 0.42s; }
.module-card-home:nth-child(8)  { transition-delay: 0.49s; }
.module-card-home:nth-child(9)  { transition-delay: 0.56s; }
.module-card-home:nth-child(10) { transition-delay: 0.63s; }
.module-card-home:nth-child(11) { transition-delay: 0.7s; }
.module-card-home:nth-child(12) { transition-delay: 0.77s; }
.module-card-home:nth-child(13) { transition-delay: 0.84s; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .module-card-home {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --- Tech Stack --- */
.tech-stack {
    padding: var(--space-4xl) 0;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
}

.tech-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: var(--transition);
}

.tech-item:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* --- Why Free Teaser --- */
.why-free-teaser {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-alt);
}

.teaser-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl);
    text-align: center;
    border-left: 4px solid var(--color-accent);
    box-shadow: var(--shadow-md);
}

.teaser-card blockquote {
    font-size: var(--text-xl);
    font-style: italic;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

.teaser-card .read-more {
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    font-size: var(--text-base);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.teaser-card .read-more:hover {
    color: var(--color-accent-light);
}

/* --- Final CTA --- */
.final-cta {
    padding: var(--space-4xl) 0;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    text-align: center;
    color: white;
}

.final-cta h2 {
    color: white;
    margin-bottom: var(--space-md);
}

.final-cta p {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-lg);
    margin-bottom: var(--space-xl);
}

.final-cta .subtext {
    margin-top: var(--space-lg);
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
}
