@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset & Base ────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(ellipse at top, #f0f9ff 0%, #ffffff 50%, #ffffff 100%);
    background-attachment: fixed;
    color: #0f172a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Site Header ─────────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 50px;
    background: #f7f8fa; /* Changed from #24262c to white */
    border-bottom: 1px solid #f0f0f0; /* Optional: subtle border for separation */
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.logo-icon img {
    height: 65px;
    width: auto;
    object-fit: contain;
    display: block;

}

.logo-text {
    display: none; /* Text embedded in image in LHS */
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    color: #333333; /* Changed from white to dark grey */
    transition: opacity 0.2s;
    margin:0 15px;
}

.nav-links a:hover {
    opacity: 0.7;
}

.btn-launch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.8rem;
    background: #5a5a5a; /* Dark grey matching "AI CONSULTATION" button */
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase; /* Added uppercase */
    border: none;
    border-radius: 0; /* Changed from 50px to square corners */
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height:1;
}

.btn-launch::after {
    content: none; /* Removed the unicode right arrow */
}

/* Hide hamburger menu by default on desktop */
.menu-toggle {
    display: none;
}

/* ── Loading / Error ─────────────────────────────────────────────── */
.loading {
    text-align: center;
    padding: 5rem 1rem;
    color: #64748b;
    font-size: 1.125rem;
}

.error {
    text-align: center;
    padding: 3rem 1rem;
    color: #ef4444;
}

/* ── Markdown Content Container (Grid Setup) ─────────────────────── */
.md-content {
    max-width: 80rem;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Force all non-card wrappers to span full width */
.md-content > *:not(.card-wrapper) {
    grid-column: 1 / -1;
}

/* ================================================================
   Heading Wrappers
   ================================================================ */
.h1_wrapper {
    text-align: center;
}

.h1_wrapper::before {
    content: "OUR INITIATIVES";
    display: block;
    color: #0284c7;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* Style H1 to force a line break and apply line-specific gradient */
.h1_wrapper h1 {
    font-size: 4rem; /* Increased size to match RHS */
    font-weight: 800;
    line-height: 1.2;
    max-width: 700px; /* Constrains width to force "Early-Stage AI" to the next line */
    margin: 0 auto;
    
    /* Apply black to the top 50% (Line 1) and blue/purple gradient to the bottom 50% (Line 2) */
    background: linear-gradient(to bottom, #0f172a 0%, #0f172a 50%, #2563eb 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    padding-bottom: 0.1em; /* Prevents descender clipping on the gradient */
}

.h2_wrapper {
    margin: 3rem 0 1rem;
}

.h2_wrapper h2 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    padding-bottom: 0.5rem;
}

.h3_wrapper {
    margin-bottom: 0.75rem;
}

.h3_wrapper h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.h4_wrapper {
    margin-bottom: 0.5rem;
}

.h4_wrapper h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

/* Used for tags/pills styling fallback in markdown */
.h5_wrapper h5, .h6_wrapper h6 {
    display: inline-block;
    background-color: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
    text-transform: none;
    letter-spacing: normal;
}

/* ================================================================
   Paragraph Wrapper & Hero Subtext
   ================================================================ */
.p_wrapper {
    margin-bottom: 1.25rem;
}

/* Target the introductory hero paragraphs */
.md-content > .p_wrapper:nth-of-type(1),
.md-content > .p_wrapper:nth-of-type(2),
.md-content > .p_wrapper:nth-of-type(3):not(.card-wrapper *) {
    text-align: center;
    max-width: 42rem;
    margin: 0 auto 2.5rem auto;
    color: #475569;
    font-size: 1.125rem;
    line-height: 1.75;
}

/* Standard paragraph inside body */
.p_wrapper p {
    font-size: 1rem;
    line-height: 1.625;
    color: #334155;
}

/* ================================================================
   Card Wrapper (Grid Layout Logic)
   ================================================================ */
/* Update Card Wrapper for flex ordering */
.card-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.card-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    border-color: #bae6fd;
}

/* Push last element (usually links/buttons) to bottom */
.card-wrapper > *:last-child {
    margin-top: auto;
}

.card-wrapper .h3_wrapper {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.card-wrapper .p_wrapper p {
    color: #475569;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ================================================================
   Image Wrapper (Handling Card Images)
   ================================================================ */
.img_wrapper {
    margin: 1.5rem 0;
}

/* Pull images flush to the edges if inside a card */
.card-wrapper .img_wrapper {
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

.card-wrapper .img_wrapper img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    border-radius: 1rem 1rem 0 0;
    border-bottom: 1px solid #f1f5f9;
    display: block;
    box-shadow: none;
}

.img_wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ================================================================
   Lists, Code, Quotes, Tables
   ================================================================ */
.code_wrapper {
    margin: 1.5rem 0;
}

.code_wrapper pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.inline-code {
    background: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 0.375rem;
    font-size: 0.875em;
    color: #db2777;
}

.list_wrapper {
    margin: 1rem 0 1.5rem;
}

.list_wrapper ul,
.list_wrapper ol {
    padding-left: 1.5rem;
    color: #475569;
}

.list_wrapper li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.625;
}

.list_wrapper ul li::marker {
    color: #94a3b8;
}

.blockquote_wrapper {
    margin: 1.5rem 0;
}

.blockquote_wrapper blockquote {
    border-left: 4px solid #0ea5e9;
    padding: 1rem 1.25rem;
    background: #f0f9ff;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #334155;
}

.table_wrapper {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.table_wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table_wrapper th,
.table_wrapper td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table_wrapper th {
    background: #f8fafc;
    font-weight: 600;
    color: #0f172a;
}

.hr_wrapper {
    margin: 3rem 0;
}

.hr_wrapper hr {
    border: none;
    height: 1px;
    background: #e2e8f0;
}

/* ================================================================
   Links & Inline Elements
   ================================================================ */
.md-content a {
    color: #0ea5e9;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.md-content a:hover {
    color: #0284c7;
}

.card-wrapper a {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
}

.md-content strong {
    font-weight: 700;
    color: #0f172a;
}

/* ================================================================
   Responsive Adjustments
   ================================================================ */
@media (max-width: 1024px) {
    .md-content {
        grid-template-columns: repeat(2, 1fr);
        padding: 3rem 1.5rem;
    }

    .h1_wrapper h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 0 1.25rem;
    }

    .nav-links {
        display: none;
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 5rem;
        left: 0;
        right: 0;
        background: #ffffff;
        padding: 1.5rem;
        border-bottom: 1px solid #e2e8f0;
        gap: 1rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .btn-launch {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .md-content {
        grid-template-columns: 1fr;
        padding: 2.5rem 1.25rem;
    }

    .h1_wrapper h1 {
        font-size: 2.25rem;
    }

    .md-content > .p_wrapper:nth-of-type(1),
    .md-content > .p_wrapper:nth-of-type(2) {
        font-size: 1rem;
    }
}



/* ================================================================
   Footer Section (Match LHS Screenshot)
   ================================================================ */

/* 1. Main Footer Wrapper: Full width, light gray background, flex column */
#content > .md-content > .section_lv2_wrapper:last-of-type {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f5f6f8; /* Light gray background */
    box-shadow: none;
    border-radius: 0;
    padding: 4rem 2rem;
    margin: 0;
}

/* 2. Hide the "Footer" title */
#content > .md-content > .section_lv2_wrapper:last-of-type > .h2_wrapper {
    display: none;
}

/* 3. Reorder elements using Flexbox */
#content > .md-content > .section_lv2_wrapper:last-of-type > .img_wrapper {
    order: 1;
    margin-bottom: 2rem;
}

#content > .md-content > .section_lv2_wrapper:last-of-type > .list_wrapper {
    order: 2;
    margin-bottom: 1.5rem;
}

#content > .md-content > .section_lv2_wrapper:last-of-type > .p_wrapper {
    order: 3;
    margin: 0;
}

/* 4. Logo Styling */
#content > .md-content > .section_lv2_wrapper:last-of-type > .img_wrapper img {
    max-width: 180px; /* Scale down to match LHS */
    height: auto;
    box-shadow: none;
    border-radius: 0;
}

/* 5. Horizontal Links List Styling */
#content > .md-content > .section_lv2_wrapper:last-of-type > .list_wrapper ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem; /* Spacing between links */
    padding: 0;
    margin: 0;
    list-style: none;
}

#content > .md-content > .section_lv2_wrapper:last-of-type > .list_wrapper ul li {
    padding: 0;
    margin: 0;
}

/* Remove inherited custom purple checkmarks/bullets */
#content > .md-content > .section_lv2_wrapper:last-of-type > .list_wrapper ul li::before {
    content: none;
}

#content > .md-content > .section_lv2_wrapper:last-of-type > .list_wrapper ul li a {
    color: #718096; /* Slate gray link color */
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}


#content > .md-content > .section_lv2_wrapper:last-of-type > .list_wrapper ul li a:hover {
    color: #2b2e36;
}

/* 6. Copyright Text Styling */
#content > .md-content > .section_lv2_wrapper:last-of-type > .p_wrapper p {
    color: #a0aec0; /* Lighter slate gray */
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
}

/* 7. Mobile Responsiveness */
@media (max-width: 768px) {
    #content > .md-content > .section_lv2_wrapper:last-of-type > .list_wrapper ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}


/** layout specific **/

/* Update Card Wrapper for flex ordering */
.card-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    margin: 0;
}



/* Target all subsequent paragraph/list elements to flow naturally */
.card-wrapper > .p_wrapper,
.card-wrapper > .list_wrapper:not(:nth-child(2)) {
    order: 4;
}

/* Ensure the link/button stays at the bottom */
.card-wrapper > .p_wrapper:last-child {
    order: 5;
    margin-top: auto; 
    margin-bottom: 0;
}

/* Hide horizontal rules in cards */
.card-wrapper > .hr_wrapper {
    display: none;
}


/*
* styling the pills tags
*/
/* Transform the first ul list in a card into a row of pill tags */
.card-wrapper > .list_wrapper:nth-child(2) ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    list-style: none; /* Remove bullets */
}

/* Base Pill Styling */
.card-wrapper > .list_wrapper:nth-child(2) ul li {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px; /* Pill shape */
    margin: 0;
}

/* Remove default list markers for pills */
.card-wrapper > .list_wrapper:nth-child(2) ul li::marker,
.card-wrapper > .list_wrapper:nth-child(2) ul li::before {
    content: none;
}


/*
* Pill coloring
*/

/* Card 1: AI Agent (Blue & Purple Pills) */
.card-wrapper:nth-child(3) > .list_wrapper:nth-child(2) ul li:nth-child(1) {
    background-color: #e0f2fe; /* Light Blue */
    color: #0369a1; /* Dark Blue */
}
.card-wrapper:nth-child(3) > .list_wrapper:nth-child(2) ul li:nth-child(2) {
    background-color: #f3e8ff; /* Light Purple */
    color: #6b21a8; /* Dark Purple */
}

/* Card 2: Emotion AI (Purple Pill) */
.card-wrapper:nth-child(4) > .list_wrapper:nth-child(2) ul li:nth-child(1) {
    background-color: #f3e8ff;
    color: #6b21a8;
}

/* Card 3: Gen-AI (Green Pill) - Note: In RHS this pill overlaps the image */
.card-wrapper:nth-child(5) > .list_wrapper:nth-child(2) ul li:nth-child(1) {
    background-color: #dcfce7;
    color: #15803d;
}

/* Card 4: Modular Phone (Yellow Pill) */
.card-wrapper:nth-child(6) > .list_wrapper:nth-child(2) ul li:nth-child(1) {
    background-color: #fef3c7;
    color: #b45309;
}

/* Card 5: Biofeedback (Red/Pink Pill) */
.card-wrapper:nth-child(7) > .list_wrapper:nth-child(2) ul li:nth-child(1) {
    background-color: #ffe4e6;
    color: #be123c;
}

/*
* card component ordering
*/

.card-wrapper > .img_wrapper {
    order: 1; /* Move image to absolute top */
    margin: -1.5rem -1.5rem 1.5rem -1.5rem; /* Pull image to edges */
}

.card-wrapper > .list_wrapper:nth-child(2) {
    order: 2; /* Pills below image */
    margin: 0 0 1rem 0;
}

.card-wrapper > .h2_wrapper {
    order: 3; /* Title below pills */
    margin: 0 0 1rem 0;
}

/*
* AI Agents buttons
*/

/* Style the bottom links of the first card to look like buttons */
.card-wrapper:nth-child(3) > .p_wrapper:last-child p {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Hide the separating pipe '|' text node if possible, or visually squash it */
.card-wrapper:nth-child(3) > .p_wrapper:last-child p {
    color: transparent; /* Hides the '|' character */
}

.card-wrapper:nth-child(3) > .p_wrapper:last-child p a {
    color: #475569;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
}

/* Make the second link (Watch Video) a prominent blue button */
.card-wrapper:nth-child(3) > .p_wrapper:last-child p a:nth-child(2) {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.card-wrapper:nth-child(3) > .p_wrapper:last-child p a:nth-child(2):hover {
    background: #0369a1;
}

/* ================================================================
   Featured Card Grid Adjustment 
   ================================================================ */

/* Make the first card (AI Agent) span 2 columns on desktop and tablet */
@media (min-width: 769px) {
    .md-content > .card-wrapper:nth-child(3) {
        grid-column: span 2;
    }
}