:root {
    --font-primary: 'Archivo Black', sans-serif;
    --font-secondary: 'Roboto', sans-serif;

    /* Neutral Color Scheme */
    --color-background: #f4f7f6; /* Light grayish green/blue */
    --color-surface: #ffffff;
    --color-text: #222222; /* Darker for strong contrast as per requirement */
    --color-text-light: #555555;
    --color-text-inverted: #ffffff;
    --color-border: #e0e0e0;

    /* Primary Color (Teal - modern, business-friendly) */
    --color-primary: #00A79D;
    --color-primary-dark: #00857B;
    --color-primary-light: #E0F2F1;

    /* Accent Color */
    --color-accent: #FFB300; /* Amber/Gold */
    --color-accent-dark: #E69500;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.08);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.2s ease-in-out;
    --transition-std: 0.3s ease-in-out;

    /* Header Height */
    --header-height: 70px;
}

/* Global Styles */
html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-top: var(--header-height); /* Account for fixed header */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6,
.title { /* Bulma .title class */
    font-family: var(--font-primary);
    color: var(--color-text);
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 1rem; /* Default, can be overridden by Bulma's spacing */
    font-weight: normal; /* Archivo Black is inherently bold */
}

/* Adaptive Typography (examples, adjust as needed) */
h1, .title.is-1 { font-size: clamp(2.4rem, 5vw, 3.2rem); }
h2, .title.is-2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3, .title.is-3 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h4, .title.is-4 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
p, .content, li, .label, input, textarea, button { font-size: clamp(0.9rem, 1.8vw, 1.05rem); }


/* Header & Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030; /* Bulma navbar is 30, so header wrapper higher */
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
    height: var(--header-height);
    transition: background-color var(--transition-std), box-shadow var(--transition-std);
}
.header.is-scrolled { /* JS should add this class on scroll */
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}
.navbar {
    height: 100%;
}
.navbar .container {
    height: 100%;
}
.navbar-brand {
    align-items: center; /* Vertically center logo and burger */
}
.site-logo .logo-text {
    font-family: var(--font-primary);
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    color: var(--color-primary);
    letter-spacing: -0.5px;
}
.navbar-item, .navbar-link {
    font-family: var(--font-secondary);
    font-weight: 500;
    color: var(--color-text);
    transition: color var(--transition-fast);
    align-items: center; /* Ensure vertical centering */
}
.navbar-item:hover, .navbar-link:hover,
.navbar-item.is-active, .navbar-link.is-active {
    background-color: transparent !important;
    color: var(--color-primary) !important;
}
.navbar-burger span {
    background-color: var(--color-primary);
    height: 2px;
    width: 20px; /* Adjust burger line width */
    left: calc(50% - 10px); /* Center burger lines */
}
.navbar-burger span:nth-child(1) { top: calc(50% - 8px); }
.navbar-burger span:nth-child(2) { top: calc(50% - 1px); }
.navbar-burger span:nth-child(3) { top: calc(50% + 6px); }

/* Hero Section */
.hero {
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
.hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.6));
    z-index: 1;
}
.hero.is-fullheight .hero-body { /* Bulma specific */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 3rem 1.5rem;
}
.hero .hero-content-overlay {
    max-width: 800px;
    text-align: center;
}
.hero .hero-title {
    color: var(--color-text-inverted);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}
.hero .hero-subtitle,
.hero .hero-description {
    color: var(--color-text-inverted);
    opacity: 0.9; /* Slightly less stark white */
}
.hero .hero-description {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}
.parallax-layer { /* For hero foreground element if used */
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 30%; /* Example size */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    z-index: 3; /* Above overlay, below text if needed, or part of background imagery */
    pointer-events: none;
}


/* General Section Styling */
.section { /* Bulma's .section class default padding is 3rem 1.5rem */
    padding: 4rem 1.5rem; /* Increased padding for more space */
}
.section-title { /* Custom class for section titles */
    text-align: center;
    margin-bottom: 1.5rem; /* Default from h1-h6, Bulma might override with .title */
}
.section-subtitle { /* Custom class */
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 3rem;
    font-family: var(--font-secondary);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}
.section-paragraph {
    font-family: var(--font-secondary);
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 800px; /* For readability in centered text blocks */
    margin-left: auto;
    margin-right: auto;
}

/* Background image sections with overlay */
.has-bg-image[style*="background-image"] {
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
.has-bg-image[style*="background-image"]::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.8); /* Default light overlay */
    z-index: 0;
}
.has-bg-image[style*="background-image"] .container {
    position: relative;
    z-index: 1;
}
/* Darker overlay for light text on image */
.has-bg-image.has-dark-overlay[style*="background-image"]::before {
    background-color: rgba(0, 0, 0, 0.5);
}


/* Button Styles (Enhancing Bulma) */
.button, input[type="submit"], input[type="button"] {
    font-family: var(--font-secondary);
    font-weight: bold;
    border-radius: var(--radius-sm);
    transition: transform var(--transition-std), box-shadow var(--transition-std), background-color var(--transition-std);
    box-shadow: var(--shadow-sm);
    padding: 0.85em 1.7em;
    letter-spacing: 0.5px;
    border-width: 1px; /* Ensure border width for non-primary buttons */
}
.button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.button.is-primary {
    background-color: var(--color-primary);
    border-color: transparent;
    color: var(--color-text-inverted);
}
.button.is-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: transparent;
    color: var(--color-text-inverted);
}
.animate-button {
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.animate-button::before { /* Ripple/shine effect */
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background-color: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease-out, height 0.4s ease-out, opacity 0.4s ease-out;
    opacity: 0;
    z-index: 0; /* Behind text */
}
.animate-button:hover::before {
    width: 200%; /* Large enough to cover */
    padding-bottom: 200%; /* Keep aspect ratio */
    opacity: 1;
    transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0s; /* Fast engage, slow fade */
}
.animate-button > * { /* Ensure button content is above the pseudo-element */
    position: relative;
    z-index: 1;
}


/* Card Styles */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-std), box-shadow var(--transition-std);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%; /* For consistent height in grids/columns */
}
.card:hover {
    transform: translateY(-6px) perspective(1200px) rotateX(1.5deg) rotateY(0.5deg);
    box-shadow: var(--shadow-lg);
}
.card .card-image { /* Bulma class */
    position: relative; /* For absolute positioned children if any */
    overflow: hidden; /* To clip image transformations */
}
.card .card-image figure.image { /* Bulma figure.image.is-XbyY container */
    position: relative; /* For absolute positioned img */
    display: block;
    margin:0; /* Reset figure margin */
}
.card .card-image figure.image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smooth zoom */
    display: block;
}
.card:hover .card-image figure.image img {
    transform: scale(1.08);
}
.card .card-content {
    padding: 1.5rem;
    flex-grow: 1;
    text-align: left; /* Default, override with .has-text-centered on .card or .card-content */
}
.card .card-content .title { /* Title inside card */
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
.card .card-content .subtitle { /* Subtitle inside card */
    color: var(--color-text-light);
    margin-bottom: 1rem;
}
.card .card-content .content { /* General content text inside card */
    color: var(--color-text-light);
    line-height: 1.6;
}
.card.has-text-centered .card-content,
.card .card-content.has-text-centered {
    text-align: center;
}
.card .image-container { /* If this specific class is used as direct image wrapper */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* height: 200px; /* Example for truly fixed height */
}
.card .image-container img {
    /* object-fit: cover; width: 100%; height: 100%; */
}


/* Instructors Section */
.instructors-section .instructor-card .card-content .subtitle {
    color: var(--color-primary);
}
.instructors-section .instructor-card .card-content a {
    color: var(--color-primary);
    font-weight: bold;
    text-decoration: none;
}
.instructors-section .instructor-card .card-content a:hover {
    text-decoration: underline;
    color: var(--color-primary-dark);
}

/* Research Section - Statistical Widgets */
.research-section.has-background-light { /* Bulma utility class */
    background-color: var(--color-primary-light) !important; /* Light primary tint */
}
.statistical-widgets .widget.card {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
}
.statistical-widgets .widget .title.is-1 {
    color: var(--color-primary);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 0;
}
.statistical-widgets .widget .subtitle.is-5 { /* For the % or + sign */
    color: var(--color-primary);
    margin-top: -0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-family: var(--font-primary);
}
.statistical-widgets .widget .heading { /* Text description */
    color: var(--color-text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Projects Section - Timeline */
.timeline {
    position: relative;
    margin: 2rem auto;
    padding: 2rem 0;
    max-width: 900px;
}
.timeline::before { /* Central line */
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--color-border);
    transform: translateX(-50%);
    border-radius: 2px;
}
.timeline-item {
    position: relative;
    margin-bottom: 3.5rem; /* Increased spacing */
    width: 50%;
    padding: 0 2.5rem; /* Increased padding */
    box-sizing: border-box;
}
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}
.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}
.timeline-marker {
    position: absolute;
    top: 5px; /* Align with top of content */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-surface);
    border: 4px solid var(--color-primary);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.timeline-marker.is-image img {
    max-width: 60%; max-height: 60%; object-fit: contain;
}
.timeline-item:nth-child(odd) .timeline-marker {
    right: -20px; /* Half of marker width */
    left: auto;
    transform: translateX(50%);
}
.timeline-item:nth-child(even) .timeline-marker {
    left: -20px;
    right: auto;
    transform: translateX(-50%);
}
.timeline-content .heading {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
    font-weight: bold;
}
.timeline-content .project-card .card-content .title {
    font-size: 1.25rem;
}
@media screen and (max-width: 768px) {
    .timeline::before { left: 20px; transform: translateX(0); }
    .timeline-item, .timeline-item:nth-child(odd), .timeline-item:nth-child(even) {
        width: 100%;
        left: 0 !important;
        padding-left: 60px; /* Space for marker */
        padding-right: 15px;
        text-align: left !important;
    }
    .timeline-marker, .timeline-item:nth-child(odd) .timeline-marker, .timeline-item:nth-child(even) .timeline-marker {
        left: 0 !important; /* Marker aligns with the line shifted left */
        transform: translateX(0) !important;
    }
}

/* Gallery Section - Custom Slider */
.gallery-section.has-background-light {
    background-color: var(--color-primary-light) !important;
}
.custom-slider-container {
    position: relative;
    max-width: 800px; /* Slider max width */
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius-md); /* Optional: round slider corners */
}
.custom-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.custom-slider .slide {
    min-width: 100%;
    box-sizing: border-box;
    /* padding: 0 5px; /* Small gutter if showing multiple slides */
}
.custom-slider .slide .card { /* Cards inside slider */
    margin: 0.5rem; /* Spacing if cards are smaller than slide */
    box-shadow: var(--shadow-md); /* Ensure shadow visibility */
}
.slider-prev, .slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(0,0,0,0.4);
    color: white;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 50%; /* Round buttons */
    cursor: pointer;
    width: 44px; height: 44px; /* Fixed size */
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; line-height: 1;
}
.slider-prev:hover, .slider-next:hover {
    background-color: var(--color-primary);
    transform: translateY(-50%) scale(1.05);
}
.slider-prev { left: 15px; }
.slider-next { right: 15px; }

/* Press Section */
.press-section .press-card {
    text-align: center;
    border: 1px solid var(--color-border);
}
.press-section .press-card .card-image {
    padding: 1rem;
    background-color: #f9f9f9;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.press-section .press-card .card-image img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}
.press-section .press-card .card-content p {
    font-style: italic; font-size: 0.9rem;
}
.press-section .press-card .card-content em {
    font-weight: bold; color: var(--color-text);
}

/* External Resources Section */
.external-resources-section.has-background-light {
    background-color: var(--color-primary-light) !important;
}
.resource-card .card-content .title a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.resource-card .card-content .title a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Contact Section */
.modern-input, .modern-textarea {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.075);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    padding: 0.85em 1.1em;
    font-family: var(--font-secondary);
    color: var(--color-text);
}
.modern-input::placeholder, .modern-textarea::placeholder {
    color: #999;
}
.modern-input:focus, .modern-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.15rem var(--color-primary-light); /* Softer focus ring */
    outline: none;
}
.contact-info h3, .contact-info h4 { color: var(--color-text) !important; }
.contact-info p, .contact-info a { color: var(--color-text-light) !important; }
.contact-info strong { color: var(--color-text) !important; }
.contact-info a { color: var(--color-primary) !important; text-decoration: none; }
.contact-info a:hover { text-decoration: underline; color: var(--color-primary-dark) !important; }
.contact-info .image-container img { border-radius: var(--radius-md); object-fit: cover; }


/* Footer */
.footer {
    background-color: #222222;
    color: #cccccc;
    padding: 4rem 1.5rem 2.5rem;
    flex-shrink: 0; /* Prevent shrinking if body content is short */
}
.footer .title { color: var(--color-text-inverted) !important; }
.footer p, .footer li { font-size: 0.9rem; color: #bbbbbb; }
.footer ul { list-style: none; padding-left: 0; margin-left:0;}
.footer li { margin-bottom: 0.5rem; }
.footer a { color: #e0e0e0; text-decoration: none; transition: color var(--transition-fast); }
.footer a:hover { color: var(--color-primary); text-decoration: underline; }
.footer .content p { /* Copyright */ color: #999999; font-size: 0.85rem; }

/* Specific Page Styles */
/* success.html */
body.success-page main { /* Assuming success.html has <body class="success-page"> */
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
body.success-page main .container { max-width: 600px; }
body.success-page main .title { color: var(--color-primary); }

/* privacy.html, terms.html */
/* For these pages, ensure enough top padding for the first content section */
main > section.privacy-content,
main > section.terms-content {
    padding-top: 3rem; /* Extra padding for first section, body already has header padding */
    padding-bottom: 3rem;
}
main > section.privacy-content .container,
main > section.terms-content .container { max-width: 900px; }

main > section.privacy-content h1, main > section.terms-content h1,
main > section.privacy-content h2, main > section.terms-content h2,
main > section.privacy-content h3, main > section.terms-content h3 {
    margin-top: 2rem; margin-bottom: 1rem;
}
main > section.privacy-content p, main > section.terms-content p,
main > section.privacy-content li, main > section.terms-content li {
    line-height: 1.8; margin-bottom: 1.2rem;
}
main > section.privacy-content ul, main > section.terms-content ul {
    list-style-position: outside; padding-left: 1.5rem;
}
main > section.privacy-content a, main > section.terms-content a {
    color: var(--color-primary); text-decoration: underline;
}
main > section.privacy-content a:hover, main > section.terms-content a:hover {
    color: var(--color-primary-dark);
}


/* Cookie Consent Popup (Overrides inline if any) */
#cookieConsentPopup {
    background-color: rgba(30, 30, 30, 0.95) !important;
    color: #f0f0f0 !important;
    padding: 20px 25px !important;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.25) !important;
    font-family: var(--font-secondary);
    font-size: 0.95rem !important;
}
#cookieConsentPopup p { margin: 0 0 18px 0 !important; line-height: 1.65; }
#cookieConsentPopup #acceptCookieButton {
    background-color: var(--color-primary) !important;
    color: var(--color-text-inverted) !important;
    padding: 10px 22px !important;
    font-size: 0.9rem !important;
    font-weight: bold;
}
#cookieConsentPopup #acceptCookieButton:hover { background-color: var(--color-primary-dark) !important; }

/* Scroll Animations Placeholder */
[data-anime] {
    opacity: 0;
    transform: translateY(25px) scale(0.98);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}
[data-anime].is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Read More Link Style */
.read-more-link {
    display: inline-block;
    font-family: var(--font-secondary);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
    padding: 0.2em 0;
    position: relative;
    transition: color var(--transition-fast);
}
.read-more-link::after {
    content: '→';
    margin-left: 0.4em;
    transition: transform 0.2s ease-out;
    display: inline-block;
}
.read-more-link:hover { color: var(--color-primary-dark); }
.read-more-link:hover::after { transform: translateX(4px); }

/* Responsive Adjustments for Bulma columns if needed */
@media screen and (max-width: 768px) {
    .section { padding: 3rem 1rem; } /* Reduce padding on mobile */
    h1, .title.is-1 { font-size: clamp(2rem, 7vw, 2.5rem); }
    h2, .title.is-2 { font-size: clamp(1.7rem, 6vw, 2.2rem); }
    .navbar-menu {
        background-color: var(--color-surface); /* Ensure background for mobile menu */
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        padding: 0.5rem 0;
    }
    .navbar-item {
        padding: 0.75rem 1.5rem; /* Adjust padding for mobile nav items */
    }
}