/* 
   CHIRON PHASE 6 - HOMEPAGE REDESIGN (V4)
   Matching Approach and Challenge pages
*/

:root {
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BLUEPRINT DESIGN SYSTEM OVERRIDES --- */
.hero-v4-label {
    font-family: 'JetBrains Mono', monospace !important;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 13px;
    font-weight: 700;
    display: block;
    margin-bottom: 16px;
}

.section-title {
    display: inline-block;
    border-bottom: 2px solid var(--signal-red);
    padding-bottom: 4px;
}

/* --- FLAGSHIP HERO (ORIGINAL CENTERED TREATMENT) --- */
.hero.flagship-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #fbfbfd;
    color: var(--navy-primary);
    overflow: hidden;
    padding: 120px var(--space-md) 60px;
}

.hero.flagship-hero .hero-content {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
}

#hero-lattice-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.6;
    /* Increased from 0.6 */
    pointer-events: none;
    background-color: transparent;
    mask-image: radial-gradient(circle, black 40%, transparent 90%);
    -webkit-mask-image: radial-gradient(circle, black 40%, transparent 90%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1100px;
    width: 100%;
}

.hero-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--signal-red);
    letter-spacing: 3px;
    margin-bottom: 2rem;
    font-weight: 600;
}

.hero-title {
    font-size: clamp(3.5rem, 9vw, 5.5rem);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 32px;
    color: var(--navy-primary);
    letter-spacing: -0.02em;
}

.hero-title span {
    display: inline-block;
    font-style: italic;
    font-weight: 400;
    color: var(--slate-gray);
    white-space: nowrap;
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--navy-secondary);
    max-width: 640px;
    margin: 0 auto 2rem;
    opacity: 0.85;
}

.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* --- VISION SECTION (LIGHT) --- */
.vision-section {
    padding: calc(210px + 3rem) 0 0;
    background-color: #f8fafc;
    color: var(--navy-primary);
}

.vision-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 60px;
    align-items: start;
}

.vision-label {
    font-family: 'JetBrains Mono', monospace;
    color: var(--signal-red);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 12px;
}

.vision-headline {
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.5px;
    color: var(--navy-primary);
    max-width: 900px;
}

/* --- MANIFESTO SECTION (LIGHT) --- */
.manifesto-section {
    background-color: #f8fafc;
    color: var(--navy-primary);
    padding: calc(305px + 4.35rem) 0 calc(210px + 3rem);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.manifesto-section .container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 10;
    text-align: left;
}

.manifesto-content {
    max-width: 800px;
}

.manifesto-section .section-title {
    color: var(--navy-primary);
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 48px;
    border-bottom: 2px solid var(--signal-red);
    display: inline-block;
    padding-bottom: 8px;
}

.manifesto-text {
    font-size: 1.5rem;
    /* 30% smaller than previous 2.2rem */
    line-height: 1.6;
    font-weight: 400;
    opacity: 0.9;
    color: var(--navy-secondary);
}

.manifesto-text strong {
    color: var(--signal-red);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

/* Background visual on the right/center shifted */
.manifesto-visual {
    position: absolute;
    right: -15%;
    top: -150px;
    width: 1200px;
    height: 1200px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
    /* Combined mask: Top linear fade + Center radial fade */
    mask-image: linear-gradient(to bottom, transparent, black 15%), radial-gradient(circle at 60% 50%, black 10%, transparent 85%);
    -webkit-mask-image: -webkit-linear-gradient(top, transparent, black 15%), -webkit-radial-gradient(60% 50%, circle, black 10%, transparent 85%);
    mask-composite: intersect;
    -webkit-mask-composite: source-in;
}

/* --- THE CHALLENGE PREVIEW (NAVY) --- */
.challenge-preview-v4 {
    padding: 140px 0;
    background-color: var(--navy-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.challenge-preview-v4 .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    z-index: 10;
    min-height: 500px;
}

.challenge-content {
    text-align: left;
    max-width: 600px;
}

.challenge-preview-v4 .section-header {
    text-align: left;
    margin-bottom: 15px;
    /* Reduced by 15% to move body up */
}

.challenge-preview-v4 .section-title {
    font-family: 'Cormorant', serif;
    font-size: 4rem;
    /* Increased by 15% to 4rem */
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
    border-bottom: 2px solid var(--signal-red);
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: 24px;
}

.challenge-preview-v4 .section-subtitle {
    font-family: 'Inter', sans-serif;
    color: var(--signal-red);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 16px;
    font-weight: 800;
    display: block;
    line-height: 1.4;
    margin-bottom: 38px;
    /* Reduced by 20% to move group closer to body copy */
}

/* Gap Visual Interactivity */
.gap-blueprint-svg {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.gap-visual-container:hover .gap-blueprint-svg {
    transform: scale(1.02);
}

.svg-hud-group {
    transition: all 0.4s ease;
}

.gap-visual-container:hover .policy-group {
    transform: translateY(-8px);
    opacity: 1;
}

.gap-visual-container:hover .tech-group {
    transform: translateY(8px);
    opacity: 1;
}

.gap-line {
    transition: all 0.6s ease;
}

.gap-visual-container:hover .gap-line {
    stroke-dashoffset: 10;
    opacity: 0.8;
}

.gap-core-group {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gap-visual-container:hover .gap-core-group {
    transform: scale(1.1);
}

.gap-core-outer {
    transition: all 0.4s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.2;
    }

    100% {
        transform: scale(1);
        opacity: 0.1;
    }
}

.gap-visual-container:hover .gap-core-outer {
    opacity: 0.3;
    fill: #ff3b44;
}

.hud-fill {
    transition: width 0.8s ease;
}

.gap-visual-container:hover .policy-group .hud-fill {
    width: 120px;
}

.gap-visual-container:hover .tech-group .hud-fill {
    width: 40px;
    /* Swapped state for dynamic feel */
}

.challenge-description {
    font-size: 1.5rem;
    /* Reverted from 1.75rem */
    line-height: 1.6;
    font-weight: 400;
    color: white;
    margin-bottom: 30px;
    /* Reduced from 38px/48px to pull button up */
    max-width: 800px;
    letter-spacing: -0.1px;
    opacity: 0.9;
}

.challenge-preview-v4 .btn-secondary {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    background-color: transparent !important;
    /* Reverted padding and font size to standard */
}

.challenge-preview-v4 .btn-secondary:hover {
    border-color: white !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.challenge-visual-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    opacity: 0.8;
    transform: scale(1.1);
    pointer-events: none;
}

.challenge-visual-bg canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- PRACTICE SECTION (ACCENT SECTION) --- */
.practice-section {
    background-color: var(--navy-primary);
    color: white;
    padding: 225px 0 220px;
    /* Reduced by another 10% */
    position: relative;
    transition: padding 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.practice-section .section-title {
    font-family: 'Cormorant', serif;
    font-size: 4rem;
    /* Increased by 15% to 4rem */
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--signal-red);
    display: inline-block;
    padding-bottom: 8px;
    color: white;
}

.practice-section .section-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 80px;
    max-width: 800px;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    align-items: flex-start;
}

.stack-item {
    position: relative;
    background-color: rgba(255, 255, 255, 0.03);
    /* Subtle dark card */
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 40px 40px;
    min-height: 340px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    color: white;
    will-change: min-height, transform;
}

.stack-item:hover {
    transform: translateY(-8px);
    background-color: rgba(255, 255, 255, 0.07);
    min-height: 400px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.stack-item.active {
    min-height: 520px;
    background-color: var(--navy-primary);
    color: white;
}

.stack-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    transition: all 0.5s ease;
    filter: grayscale(1);
    pointer-events: none;
}

.stack-item.active .stack-bg {
    opacity: 0.15;
    filter: none;
}

.stack-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.stack-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--signal-red);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 24px;
    display: block;
    font-weight: 700;
}

.stack-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: inherit;
    transition: margin-top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 50px;
    min-height: 2.4em;
    /* Ensures alignment across 1 and 2 line titles */
}

/* Title stays in place during hover, moves to top only when active */
.stack-item:hover .stack-title {
    margin-top: 50px;
}

.stack-item.active .stack-title {
    margin-top: 0;
    color: white;
}

.stack-hidden-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.15rem;
    line-height: 1.7;
}

.stack-item.active .stack-hidden-content {
    max-height: 500px;
    opacity: 1;
    margin-top: 20px;
    margin-bottom: 40px;
}

.stack-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Better alignment */
    gap: 10px;
    padding: 14px 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    color: white;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    transition: all 0.3s ease;
    width: fit-content;
    text-decoration: none;
}

.stack-item.active .stack-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.stack-btn:hover {
    background: var(--navy-primary);
    color: white;
}

.stack-item.active .stack-btn:hover {
    background: white;
    color: var(--navy-primary);
}

/* --- BUTTONS --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--signal-red);
    color: white !important;
    padding: 18px 45px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #d11a21;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(237, 32, 39, 0.2);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--navy-primary) !important;
    padding: 18px 45px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 1px solid rgba(26, 40, 69, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: var(--navy-primary);
    transform: translateY(-2px);
}

.hero-v4-ctas .btn-secondary {
    border-color: rgba(255, 255, 255, 0.3);
    color: white !important;
}

.hero-v4-ctas .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Global Dark Mode Button Overrides */
[data-theme="dark"] .btn-secondary {
    color: var(--white-pure) !important;
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--white-pure);
}

/* --- FOOTER REFINEMENTS --- */
.site-footer {
    background-color: var(--navy-primary);
    color: white;
    padding: 100px 0 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

.footer-nav-column a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav-column a:hover {
    color: var(--signal-red) !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .homepage-hero-v4 .container {
        grid-template-columns: 1fr;
        padding-top: 60px;
    }

    .hero-v4-visual {
        order: -1;
        margin-bottom: 40px;
    }

    #hero-lattice-container {
        width: 300px;
        height: 300px;
    }

    .vision-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .manifesto-text,
    .vision-headline,
    .row-title {
        font-size: 1.75rem;
    }

    .manifesto-section .section-title,
    .challenge-preview-v4 .section-title,
    .practice-section .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero.flagship-hero {
        padding: 120px var(--space-md) 60px;
        min-height: auto;
    }

    .hero.flagship-hero .hero-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 var(--space-sm);
    }

    .hero-label {
        font-size: 11px;
        letter-spacing: 2px;
        margin-bottom: 24px;
        width: 100%;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 24px;
        line-height: 1.2;
    }

    .hero-title br {
        display: none;
    }

    .hero-title span {
        white-space: normal;
        display: block;
        margin-top: 8px;
    }

    .hero-description {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
        max-width: 100%;
    }

    .hero-ctas {
        flex-direction: column;
        width: 100%;
        gap: 12px;
        padding: 0 20px;
    }

    .hero-ctas .btn-primary,
    .hero-ctas .btn-secondary {
        width: 100%;
        padding: 16px;
    }

    #hero-lattice-container {
        width: 100%;
        height: 60vh;
        opacity: 0.4;
    }

    .vision-section {
        padding: 112px 0 94px;
    }





    .vision-headline {
        font-size: 1.5rem;
        line-height: 1.5;
    }

    .manifesto-section {
        padding: 94px 0 112px;
    }





    .manifesto-section .container {
        grid-template-columns: 1fr;
        gap: 0;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 var(--space-md);
    }


    .manifesto-section .section-title {
        font-size: 2.2rem;
        margin-bottom: 24px;
    }

    .manifesto-text {
        font-size: 1.2rem;
        position: relative;
        z-index: 10;
    }


    .manifesto-visual {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 400px;
        height: 400px;
        opacity: 0.15;
        z-index: 1;
        pointer-events: none;
        mask-image: radial-gradient(circle, black 30%, transparent 80%);
        -webkit-mask-image: radial-gradient(circle, black 30%, transparent 80%);
    }


    .challenge-preview-v4 {
        padding: 112px 0;
    }


    .challenge-preview-v4 .container {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .challenge-preview-v4 .section-title {
        font-size: 2.875rem;
    }

    .challenge-description {
        font-size: 1.2rem;
    }



    .challenge-preview-v4 .section-subtitle {
        white-space: normal;
    }

    .gap-visual-container svg {
        max-width: 300px;
    }

    .practice-section {
        padding: 112px 0;
    }


    .practice-section .section-title {
        font-size: 2.53rem;
        margin-bottom: 20px;
    }

    .practice-section .section-subtitle {
        font-size: 1.2rem;
    }



    .stack-item {
        padding: 30px 24px;
        min-height: auto !important;
    }

    .stack-label {
        margin-bottom: 12px;
    }

    .stack-title {
        font-size: 2.53rem !important;
        margin-top: 10px !important;
        margin-bottom: 15px !important;
        line-height: 1.1;
    }

    .stack-item:hover .stack-title {
        margin-top: 10px !important;
    }

    .stack-hidden-content {
        margin-top: 10px !important;
        margin-bottom: 20px !important;
    }

    .stack-item.active .stack-hidden-content {
        margin-top: 10px !important;
        margin-bottom: 20px !important;
    }

    .use-case-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }


    /* Responsive CTA */
    .approach-cta .container>div {
        grid-template-columns: 1fr !important;
        gap: 48px !important;
    }

    .approach-cta .section-title {
        font-size: 3.2rem !important;
    }

    .cta-actions-content {
        padding: 40px !important;
    }

    /* Footer Mobile Refinements */
    .site-footer {
        padding: 30px 0 40px;
    }


    .footer-description {
        text-align: center !important;
        margin-top: 20px;
        margin-bottom: 30px !important;
        /* Total gap below text to divider */
    }

    .footer-primary {
        margin-bottom: 0 !important;
        gap: 30px !important;
        /* Balanced gap matching top padding */
    }




    .footer-brand {
        display: flex;
        justify-content: center;
    }

    .footer-links-grid {
        margin-top: 0 !important;
        margin-bottom: 40px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 40px;
    }


    .footer-nav-column h4 {
        font-size: 1.15rem;
        /* Upscaled */
        margin-bottom: 12px;
        color: var(--signal-red);
    }

}


/* --- TACTICAL SUBSTRATE SYSTEM (PHASE 26) --- */
.substrate {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.substrate-dark {
    background-image:
        linear-gradient(rgba(0, 80, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 80, 255, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: top center;
}

.substrate-light {
    background-image:
        linear-gradient(rgba(10, 20, 40, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 20, 40, 0.015) 1px, transparent 1px);
    background-size: 45px 45px;
    background-position: top center;
}