/**
 * Homepage Styles - Production Grade
 * Scroll storyboard: Hero → Capabilities → Featured Work → Credibility → CTA
 */

/* ========================================
   VIEWPORT 0-100%: HERO
   ======================================== */

.hero-home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--bg-primary);
    color: var(--text-inverse);
    padding: var(--space-xl) 0;
    overflow: hidden;
}

.hero-content {
    max-width: 900px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-headline {
    font-size: var(--text-h1);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-inverse);
    margin-bottom: var(--space-lg);
}

.hero-subheading {
    font-size: var(--text-body-lg);
    line-height: var(--line-height-relaxed);
    color: rgba(248, 250, 252, 0.85);
    margin-bottom: var(--space-xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

/* Background grid subtly visible */
.hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(44, 109, 242, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44, 109, 242, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.3;
    z-index: 1;
}

/* Sequential fade-in - SCROLL SAFE
   Content is ALWAYS visible. Animation is purely cosmetic enhancement. */
.fade-in-sequence {
    /* Content visible by default */
    opacity: 1;
    transform: none;
}

/* Cosmetic animation only - runs on load, does NOT start from hidden */
@keyframes fadeInEnhance {
    from {
        opacity: 0.8;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Apply subtle animation only if user doesn't prefer reduced motion */
@media (prefers-reduced-motion: no-preference) {
    .fade-in-sequence {
        animation: fadeInEnhance 0.5s ease-out;
    }

    .fade-in-sequence[data-delay="1"] {
        animation-delay: 0.1s;
    }

    .fade-in-sequence[data-delay="2"] {
        animation-delay: 0.2s;
    }
}

/* ========================================
   VIEWPORT 100-200%: CAPABILITIES
   ======================================== */

.capabilities-section {
    background-color: var(--bg-white);
    padding: var(--space-2xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Vertical rhythm, no cards */
.capabilities-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.capability-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-lg);
    align-items: start;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.capability-item:last-child {
    border-bottom: none;
}

.capability-content h3 {
    font-size: var(--text-h3);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.capability-content p {
    font-size: var(--text-body-md);
    line-height: var(--line-height-relaxed);
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Icons appear AFTER text */
.capability-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    /* Prevent shrinking */
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-light);
    border-radius: var(--radius-soft);
    color: var(--accent-main);
    flex-shrink: 0;
}

.capability-icon svg {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.capability-icon[data-delay="1"] {
    transition-delay: calc(var(--delay-stagger) * 2);
}

/* ========================================
   VIEWPORT 200-350%: FEATURED WORK
   ======================================== */

.featured-work-section {
    background-color: var(--bg-soft);
    padding: var(--space-2xl) 0;
}

.featured-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* Left: text stays fixed */
.featured-text {
    position: sticky;
    top: var(--space-xl);
}

.featured-text h2 {
    font-size: var(--text-h2);
    margin-bottom: var(--space-md);
}

.featured-stories {
    margin: var(--space-xl) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.story-item {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.story-item:last-child {
    border-bottom: none;
}

.story-item h3 {
    font-size: var(--text-h3);
    margin-bottom: var(--space-sm);
}

.story-item p {
    margin-bottom: var(--space-md);
}

.story-metrics {
    display: flex;
    gap: var(--space-lg);
    font-size: var(--text-body-sm);
    color: var(--text-tertiary);
}

.story-metrics .metric strong {
    color: var(--accent-main);
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-body-lg);
    display: block;
}

/* Right: image/diagram swaps */
.featured-images {
    position: relative;
    min-height: 600px;
}

.image-container {
    position: sticky;
    top: var(--space-xl);
    width: 100%;
    height: 500px;
    max-width: 600px;
    /* Constrain max width */
}

.featured-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-soft);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Maintain aspect ratio, cover container */
    object-position: center;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-white);
}

.image-placeholder svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

/* ========================================
   VIEWPORT 350-450%: CREDIBILITY
   ======================================== */

.credibility-section {
    background-color: var(--bg-white);
    padding: var(--space-xl) 0;
}

.credibility-section h2 {
    margin-bottom: var(--space-xl);
    font-size: var(--text-h2);
}

/* Logos fade in horizontally */
.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    max-width: 1000px;
    margin: 0 auto;
}

.logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    min-height: 120px;
    /* Consistent height */
}

.logo-item img {
    max-width: 180px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-item[data-delay="1"] {
    transition-delay: calc(var(--delay-stagger) * 1);
}

.logo-item[data-delay="2"] {
    transition-delay: calc(var(--delay-stagger) * 2);
}

.logo-item[data-delay="3"] {
    transition-delay: calc(var(--delay-stagger) * 3);
}

.logo-placeholder {
    padding: var(--space-lg) var(--space-xl);
    background-color: var(--bg-soft);
    border-radius: var(--radius-soft);
    color: var(--text-tertiary);
    font-size: var(--text-body-sm);
    text-align: center;
    min-width: 150px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   VIEWPORT 450-520%: CLOSING CTA
   ======================================== */

.closing-cta-section {
    background-color: var(--bg-soft);
    padding: var(--space-2xl) 0;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.cta-content h2 {
    font-size: var(--text-h2);
    margin-bottom: var(--space-md);
}

.cta-content .lead {
    margin-bottom: var(--space-xl);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .hero-home {
        min-height: 90vh;
        padding: var(--space-lg) 0;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .capability-item {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .capability-icon {
        width: 48px;
        height: 48px;
    }

    .featured-layout {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .featured-text {
        position: static;
    }

    .featured-images {
        min-height: 400px;
    }

    .image-container {
        height: 400px;
        max-width: 100%;
        /* Full width on mobile */
    }

    .logos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .logo-item {
        min-height: 100px;
    }

    .logo-item img {
        max-width: 140px;
        max-height: 60px;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .fade-in-sequence {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .hero-grid {
        animation: none;
    }
}