/* --- FEATURES HERO --- */
.features-hero {
    /* Inherits padding and glow from your global .hero in styles.css */
}

/* --- CORE PILLARS GRID --- */
.core-pillars-section {
    padding: 2rem 0 6rem;
    position: relative;
    z-index: 10;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.pillar-card {
    background: rgba(13, 17, 22, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Flexbox magic to equalize heights */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

.pillar-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pillar-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 123, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), inset 0 0 30px rgba(0, 123, 255, 0.05);
}

.pillar-card:hover::before {
    opacity: 1;
}

.pillar-icon {
    width: 60px; height: 60px;
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--primary);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.pillar-card:hover .pillar-icon {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.pillar-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Pushes the button to the bottom */
}

.pillar-content h3 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 1rem;
}

.pillar-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Ensures text area stretches evenly across cards */
}

.pillar-content .btn-outline {
    align-self: flex-start;
    border-color: rgba(255,255,255,0.1);
    color: #fff;
    margin-top: auto; /* Docks button to the bottom */
}

.pillar-card:hover .btn-outline {
    background: var(--primary);
    border-color: var(--primary);
}

/* --- ADVANCED FEATURES BENTO GRID --- */
.advanced-features-section {
    padding: 6rem 0;
    border-top: 1px solid var(--border-color);
}

.bento-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 0 20px rgba(255,255,255,0.02);
}

.bento-icon {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 0 10px rgba(0, 123, 255, 0.3));
}

.bento-card h3 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.8rem;
}

.bento-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Specific Bento Box Layouts */
.bento-square {
    grid-column: span 1;
}

.bento-wide {
    grid-column: span 2;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    padding: 0;
}

.bento-wide .bento-text {
    flex: 1.2;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-wide .bento-visual {
    flex: 0.8;
    background: rgba(0,0,0,0.2);
    border-left: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.bento-wide.reverse {
    flex-direction: row-reverse;
}
.bento-wide.reverse .bento-visual {
    border-left: none;
    border-right: 1px solid var(--border-color);
}

.bento-full {
    grid-column: span 3;
}

.bento-flex-row {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.bento-text-half {
    flex: 1;
}

.bento-actions-half {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* Animations inside Bento Boxes */
.mock-code-snippet {
    background: #0d1116;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.var-name { color: #a855f7; font-weight: bold; }
.var-val { color: #10b981; }

.mock-sync-ring {
    font-size: 4rem;
    color: var(--primary);
    position: relative;
    display: flex; align-items: center; justify-content: center;
}
.mock-sync-ring::after {
    content: '';
    position: absolute;
    inset: -15px;
    border: 2px dashed rgba(0, 123, 255, 0.4);
    border-radius: 50%;
    animation: rotateSlow 8s linear infinite;
}

.ai-chat-bubble {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c084fc;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    border-bottom-right-radius: 4px;
    font-style: italic;
    font-size: 0.95rem;
}

@keyframes rotateSlow {
    100% { transform: rotate(360deg); }
}

/* --- INTEGRATIONS & AGNOSTIC ARCHITECTURE --- */
.engine-integrations-section {
    padding: 6rem 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-base);
}

.integration-category {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px dashed rgba(255,255,255,0.05);
}

.integration-category:first-of-type {
    border-top: none;
    margin-top: 3rem;
    padding-top: 0;
}

.category-title {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 2rem;
    
    /* UPDATED PROPERTIES */
    display: flex;            /* Change from inline-flex to flex */
    justify-content: center;   /* Centers the icon and text horizontally */
    width: 100%;               /* Ensures it spans the full width of the container */
    
    align-items: center;
    gap: 10px;
}

.category-title iconify-icon {
    color: var(--primary);
    font-size: 1.6rem;
}

.integrations-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* Because they are now <a> tags, we ensure they behave nicely */
a.int-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.4rem;
    border-radius: 12px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

a.int-item:hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.3);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

a.int-item iconify-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

a.int-item:hover iconify-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px currentColor);
}

/* --- FINAL CTA MEGA BOX --- */
.features-final-cta {
    padding: 6rem 0;
    border-top: 1px solid var(--border-color);
}

.cta-mega-box {
    background: linear-gradient(145deg, rgba(13, 17, 22, 0.8) 0%, rgba(5, 6, 8, 0.9) 100%);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 20px;
    padding: 5rem 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.cta-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(0, 123, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.cta-massive-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px var(--primary-glow));
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.1rem;
    color: #cbd5e1;
}

.justify-content-center {
    justify-content: center;
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .bento-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-wide, .bento-full {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .bento-features-grid {
        grid-template-columns: 1fr;
    }
    .bento-square, .bento-wide, .bento-full {
        grid-column: span 1;
    }
    .bento-wide, .bento-wide.reverse, .bento-flex-row {
        flex-direction: column;
    }
    .bento-wide .bento-visual, .bento-wide.reverse .bento-visual {
        border: none;
        border-top: 1px solid var(--border-color);
        padding: 2rem 1rem;
    }
    .bento-actions-half {
        justify-content: flex-start;
        margin-top: 1.5rem;
    }
    .ai-chat-bubble {
        width: 100%;
    }
}