/*
    style.css
    Theme: AI in Medicine, Finance, and Education
    Design System: Modern
    Trend: Asymmetric Balance
    Color Scheme: Triad
    Animation Style: Scroll-dependent effects
*/

/* ---------------------------------- */
/*          CSS Variables             */
/* ---------------------------------- */

:root {
    /* Color Palette (Triad: Deep Blue, Amber, Magenta) */
    --primary-color: #0A2463; /* Deep Indigo Blue */
    --accent-color-1: #FF8811; /* Vibrant Amber */
    --accent-color-2: #D8315B; /* Rich Magenta */
    --primary-color-dark: #071a48;

    /* Typography */
    --text-color-dark: #212529;
    --text-color-light: #f8f9fa;
    --text-color-medium: #6c757d;
    --font-heading: 'Inter', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;

    /* Backgrounds */
    --background-light: #ffffff;
    --background-medium: #f8f9fa;
    --background-dark: var(--primary-color);
    
    /* UI Elements */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s ease;

    /* Spacing */
    --spacing-xs: 0.5rem;   /* 8px */
    --spacing-sm: 1rem;     /* 16px */
    --spacing-md: 1.5rem;   /* 24px */
    --spacing-lg: 3rem;     /* 48px */
    --spacing-xl: 5rem;     /* 80px */

    /* Header */
    --header-height: 80px;
}

/* ---------------------------------- */
/*          Global Styles             */
/* ---------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-color-dark);
    background-color: var(--background-light);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--accent-color-1);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-color-2);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------------------------------- */
/*        Layout & Helpers            */
/* ---------------------------------- */

.main-container {
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
}

.section {
    padding: var(--spacing-xl) 0;
}

.section.is-medium {
    padding: calc(var(--spacing-xl) * 1.5) 0;
}

.has-background-light {
    background-color: var(--background-medium);
}

.has-text-centered {
    text-align: center;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.section-title.on-dark-bg {
    color: var(--text-color-light);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Base column structure */
.columns {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--spacing-md) / 2);
}

.column {
    padding: 0 calc(var(--spacing-md) / 2);
    flex-grow: 1;
    flex-basis: 0;
}

.is-centered {
    justify-content: center;
}
.is-multiline {
    flex-wrap: wrap;
}
.is-one-third { flex: none; width: 33.333%; }
.is-two-thirds { flex: none; width: 66.667%; }

/* ---------------------------------- */
/*        UI Components               */
/* ---------------------------------- */

/* --- Buttons --- */
.button, button, input[type="submit"] {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.8rem 2rem;
    border-radius: var(--border-radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button.is-primary {
    background-color: var(--accent-color-1);
    color: var(--text-color-light);
    border-color: var(--accent-color-1);
}

.button.is-primary:hover {
    background-color: var(--accent-color-2);
    border-color: var(--accent-color-2);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(216, 49, 91, 0.4);
}

.button.is-large {
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
}

/* --- Cards --- */
.card {
    background-color: var(--background-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.card .card-image {
    width: 100%;
    height: 250px; /* Fixed height for image container */
    overflow: hidden;
}

.card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area without distortion */
    transition: transform 0.4s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card .card-content {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title, .expert-name {
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
}

.expert-title {
    color: var(--accent-color-2);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

/* --- Forms --- */
.contact-form .label {
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.contact-form .input,
.contact-form .textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.contact-form .input:focus,
.contact-form .textarea:focus {
    outline: none;
    border-color: var(--accent-color-1);
    box-shadow: 0 0 0 3px rgba(255, 136, 17, 0.25);
}

.contact-form .field {
    margin-bottom: var(--spacing-md);
}
.contact-form .button.is-fullwidth {
    width: 100%;
}


/* ---------------------------------- */
/*        Header & Navigation         */
/* ---------------------------------- */

.site-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: var(--spacing-sm) 0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-speed);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
}
.navbar-logo .logo-accent {
    color: var(--accent-color-1);
}

.navbar-menu {
    display: flex;
}

.navbar-end {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.navbar-item {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    padding: 0.5rem 0;
    position: relative;
}

.navbar-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color-1);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-speed);
}

.navbar-item:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.navbar-burger {
    display: none; /* Hidden on desktop */
    cursor: pointer;
}

/* ---------------------------------- */
/*          Section Styles            */
/* ---------------------------------- */

/* --- Hero Section --- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Parallax effect */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(10, 36, 99, 0.8), rgba(216, 49, 91, 0.6));
}

.hero-body {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    color: var(--text-color-light);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    max-width: 800px;
    margin: 0 auto var(--spacing-lg);
    font-weight: 400;
    line-height: 1.6;
}

/* --- Research (Timeline) Section --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--accent-color-1);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}
.timeline-item {
    padding: var(--spacing-sm) var(--spacing-lg);
    position: relative;
    background-color: inherit;
    width: 50%;
}
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

.timeline-marker {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--background-light);
    border: 4px solid var(--accent-color-1);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(even) .timeline-marker {
    left: -10px;
}

.timeline-content {
    padding: var(--spacing-md);
    background-color: var(--background-light);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius-md);
    position: relative;
}
.timeline-item:nth-child(odd) { text-align: right; }

/* --- Portfolio Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

/* --- Gallery Section --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: var(--spacing-sm);
}

.gallery-item {
    overflow: hidden;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Asymmetric Balance */
.gallery-item:nth-child(2) { grid-column: span 2; grid-row: span 1; }
.gallery-item:nth-child(3) { grid-row: span 2; }
.gallery-item:nth-child(4) { grid-column: span 3; }


/* --- Clientele Section --- */
.client-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}
.client-logos img {
    max-height: 50px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition-speed);
}
.client-logos img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* --- Sustainability Section --- */
.parallax-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-color-light);
}

.sustainability-toggles {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 700;
}
.switch input { display: none; }
.slider {
    width: 60px;
    height: 34px;
    background-color: rgba(255,255,255,0.4);
    cursor: pointer;
    position: relative;
    transition: .4s;
}
.slider.round { border-radius: 34px; }
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-color-1); }
input:checked + .slider:before { transform: translateX(26px); }

/* --- External Resources Section --- */
.resource-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 800px;
    margin: 0 auto;
}
.resource-link {
    display: block;
    padding: var(--spacing-md);
    background: var(--background-medium);
    border-left: 5px solid var(--accent-color-1);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-speed);
}
.resource-link:hover {
    background: var(--background-light);
    transform: translateX(10px);
    box-shadow: var(--box-shadow);
    border-color: var(--accent-color-2);
}
.resource-title {
    display: block;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
}
.resource-desc {
    color: var(--text-color-medium);
}


/* --- FAQ (Accordion) Section --- */
.accordion {
    max-width: 800px;
    margin: 0 auto;
}
.accordion-item {
    border-bottom: 1px solid #ddd;
}
.accordion-header {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: var(--spacing-md);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
    position: relative;
    transition: background-color var(--transition-speed);
}
.accordion-header:hover {
    background-color: #f1f1f1;
}
.accordion-header::after {
    content: '+';
    font-size: 1.8rem;
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color-1);
    transition: transform var(--transition-speed);
}
.accordion-header.active::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    padding: 0 var(--spacing-md);
}
.accordion-content p {
    padding-bottom: var(--spacing-md);
}


/* ---------------------------------- */
/*              Footer                */
/* ---------------------------------- */

.site-footer {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: var(--spacing-lg) 0 0;
}
.footer-title {
    color: var(--text-color-light);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}
.site-footer p {
    color: rgba(255,255,255,0.8);
}
.site-footer ul {
    list-style: none;
}
.site-footer ul li a {
    color: rgba(255,255,255,0.8);
    transition: color var(--transition-speed);
}
.site-footer ul li a:hover {
    color: var(--accent-color-1);
}
.social-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}
.social-links a {
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}
.social-links a:hover {
    color: var(--accent-color-1);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md) 0;
    text-align: center;
}
.footer-bottom p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}


/* ---------------------------------- */
/*      Animation on Scroll           */
/* ---------------------------------- */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------------------------- */
/*        Specific Page Styles        */
/* ---------------------------------- */
.success-page, .content-page {
    padding-top: var(--header-height);
}

/* --- Success Page --- */
.success-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* --- Content Pages (Privacy, Terms) --- */
.content-page .container {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}
.content-page h1 {
    margin-bottom: var(--spacing-md);
}
.content-page h2 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

/* ---------------------------------- */
/*          Responsive Design         */
/* ---------------------------------- */

/* Tablets and below */
@media (max-width: 1024px) {
    .is-one-third, .is-two-thirds {
        width: 50%;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
    .gallery-item:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .section {
        padding: var(--spacing-lg) 0;
    }
    
    .is-one-third, .is-two-thirds {
        width: 100%;
    }
    .columns .column:not(:last-child) {
        margin-bottom: var(--spacing-lg);
    }
    
    /* Responsive Navbar */
    .navbar-burger {
        display: block;
        width: 3rem;
        height: 3rem;
        position: relative;
    }
    .navbar-burger span {
        display: block;
        position: absolute;
        height: 3px;
        width: 25px;
        background: var(--primary-color);
        border-radius: 3px;
        left: 50%;
        transform: translateX(-50%);
        transition: all .25s;
    }
    .navbar-burger span:nth-child(1) { top: 12px; }
    .navbar-burger span:nth-child(2) { top: 20px; }
    .navbar-burger span:nth-child(3) { top: 28px; }

    .navbar-burger.is-active span:nth-child(1) { transform: translateX(-50%) translateY(8px) rotate(45deg); }
    .navbar-burger.is-active span:nth-child(2) { opacity: 0; }
    .navbar-burger.is-active span:nth-child(3) { transform: translateX(-50%) translateY(-8px) rotate(-45deg); }


    .navbar-menu {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--background-light);
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    }
    .navbar-menu.is-active { display: block; }
    .navbar-end {
        flex-direction: column;
        align-items: stretch;
        padding: var(--spacing-sm) 0;
    }
    .navbar-item {
        padding: var(--spacing-sm);
        text-align: center;
        border-bottom: 1px solid #eee;
    }
    .navbar-item:last-child { border-bottom: none; }
    .navbar-item::after { display: none; }

    /* Responsive Timeline */
    .timeline::after {
        left: 31px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        left: 0 !important;
    }
    .timeline-item:nth-child(odd) { text-align: left; }
    .timeline-marker {
        left: 21px !important;
    }
}