/* --- 1. Variables --- */
:root {
    --uob-red: #800020;
    --uob-dark-red: #5a0016;
    --rich-black: #2d2d2d;
    --white: #ffffff;
    --nav-height: 70px; /* Slimmer height */
    --max-width: 1200px;
}

/* --- 2. Global Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--rich-black);
    background-color: var(--white);
    overflow-x: hidden;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #ffffff 0%, #f3f3f3 45%, #e9e9e9 100%);
    color: #2d2d2d;
    transition: opacity 1s ease, visibility 1s ease;
}

.page-loader .loader-icon {
    font-size: 2.4rem;
    color: var(--uob-red);
    animation: loader-bounce 1.2s ease-in-out infinite;
}

.page-loader .loader-text {
    margin-top: 10px;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #5a5a5a;
}

body.page-loaded .page-loader {
    opacity: 0;
    visibility: hidden;
}

@keyframes loader-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

[data-barba="container"] {
    opacity: 0;
    transition: opacity 0.12s ease;
    will-change: opacity, transform;
}

[data-barba="container"].is-active {
    opacity: 1;
    transform: none;
}

.stagger-item {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.stagger-item.stagger-in {
    opacity: 1;
    transform: translateY(0);
}

a { text-decoration: none; color: inherit; transition: 0.3s ease; }
ul { list-style: none; }


.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 3. Glossy & Modern Navbar --- */
.navbar {
    height: var(--nav-height);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
}

.navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            #ffffff 0%,
            #f7f7f7 18%,
            #e6e6e6 38%,
            #fdfdfd 52%,
            #d5d5d5 70%,
            #cfcfcf 100%);
    z-index: 0;
    pointer-events: none;
}

.navbar::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0.35) 22%,
            rgba(255, 255, 255, 0) 45%,
            rgba(0, 0, 0, 0.06) 70%,
            rgba(0, 0, 0, 0.12) 100%),
        linear-gradient(125deg,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(255, 255, 255, 0.2) 30%,
            rgba(255, 255, 255, 0) 55%),
        linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(255, 255, 255, 0) 100%);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 12px 22px rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
    z-index: 0;
    pointer-events: none;
}

.nav-container,
.brand-area,
nav {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px; /* Slightly smaller logo */
    width: auto;
    display: block;
}

.uob-logo {
    height: 34px;
}

.erl-logo {
    height: 42px;
}

/* Divider between logos */
.vertical-divider {
    height: 25px;
    width: 1px;
    background-color: #bbb;
}

.nav-links {
    display: flex;
    gap: 12px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.nav-links a {
    font-weight: 600;
    font-size: 0.78rem;
    color: #444; /* Slightly softer grey text */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    padding: 8px 10px;
    border-radius: 0;
    transition: color 0.2s ease;
}

/* Animated Underline Effect for Links */
.nav-links a::after {
    content: '';
    position: absolute;
    inset: 2px 2px auto auto;
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(128, 0, 32, 0.9);
    border-right: 2px solid rgba(128, 0, 32, 0.9);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--uob-red);
}

.nav-links a::before {
    content: '';
    position: absolute;
    inset: auto auto 2px 2px;
    width: 8px;
    height: 8px;
    border-bottom: 2px solid rgba(128, 0, 32, 0.9);
    border-left: 2px solid rgba(128, 0, 32, 0.9);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after,
.nav-links a:hover::before,
.nav-links a.active::before {
    opacity: 1;
    transform: translateY(0);
}


.nav-item {
    position: relative;
}

.submenu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 140px;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.14);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1005;
}

.submenu li {
    width: 100%;
}

.submenu a {
    display: block;
    padding: 6px 10px;
    font-size: 0.78rem;
    color: #444;
    text-transform: none;
    letter-spacing: 0.2px;
}

.submenu a:hover {
    background: #f8edf1;
    color: var(--uob-red);
    border-radius: 8px;
}

.nav-item.has-submenu:hover .submenu,
.nav-item.has-submenu:focus-within .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-item.has-submenu > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-item.has-submenu > a::after {
    content: '▾';
    font-size: 0.6rem;
    color: currentColor;
    opacity: 0.6;
    transform: translateY(-1px);
}

/* Contact Button */
.btn-contact {
    background: var(--uob-red);
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: 20px; /* Rounded pill shape for modern look */
    text-transform: capitalize !important;
    font-size: 0.9rem !important;
}
.btn-contact:hover { 
    background: var(--uob-dark-red); 
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(212, 0, 40, 0.3);
}

.hamburger { display: none; cursor: pointer; font-size: 1.4rem; color: #444; }

/* --- 4. Hero Section --- */
.hero {
    position: relative;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    background-color: #111;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transform: translateZ(0); /* Forces GPU hardware acceleration */
    will-change: transform;   /* Tells Firefox to expect movement */
    backface-visibility: hidden; /* Fixes weird flickering during scroll */
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.18), rgba(0,0,0,0.55));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 20px;
    margin-top: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: Roboto, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Single Line Title */
.director-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-transform: none;
    white-space: nowrap;
    display: inline-block;
    color: #ffffff;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18),
        0 10px 24px rgba(0, 0, 0, 0.35);
}

.director-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    font-style: italic;
    margin-bottom: 28px;
    letter-spacing: 0.6px;
    color: #f0f0f0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Caption from URL context */
.hero-caption {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #f0f0f0;
}

.hero-buttons { display: flex; gap: 15px; justify-content: center; }

.btn-primary {
    background: var(--uob-red);
    color: var(--white);
    padding: 14px 30px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-primary:hover { background: var(--uob-dark-red); }

.btn-transparent {
    border: 1px solid rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
    color: var(--white);
    padding: 14px 30px;
    border-radius: 4px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-transparent:hover { background: var(--white); color: var(--rich-black); }

/* --- 5. News Section --- */
.section-news {
    padding: 80px 0;
    background:
        radial-gradient(1200px 300px at 20% 0%, rgba(128, 0, 32, 0.08), rgba(128, 0, 32, 0)),
        linear-gradient(180deg, #f7f7f7 0%, #efefef 100%);
}

.section-heading {
    display: inline-block;
    text-align: center;
    font-size: 2.1rem;
    margin: 0 auto 20px;
    color: var(--rich-black);
    font-weight: 700;
    letter-spacing: 0.4px;
    position: relative;
    padding-bottom: 10px;
}

.section-heading::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 64px;
    height: 3px;
    background: var(--uob-red);
    transform: translateX(-50%);
    border-radius: 2px;
}

.news-carousel {
    position: relative;
    padding: 0 56px;
}

.news-track {
    --news-gap: 18px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--news-gap) * 3)) / 4);
    gap: var(--news-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 2px 12px;
}

.news-track::-webkit-scrollbar {
    height: 8px;
}

.news-track::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
}

.news-card {
    scroll-snap-align: start;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.news-preview {
    height: 140px;
    background: linear-gradient(140deg, rgba(128, 0, 32, 0.25), rgba(0, 0, 0, 0.08));
    display: block;
    overflow: hidden;
}

.news-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f2f2f2;
    display: block;
}

.news-body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-meta {
    font-weight: 700;
    color: var(--uob-red);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.news-card p {
    margin: 0;
    color: #555;
    line-height: 1.5;
    font-size: 0.95rem;
}

.news-arrow {
    position: absolute;
    top: 50%;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    transform: translateY(-50%);
    z-index: 1;
}

.news-prev { left: 8px; }
.news-next { right: 8px; }

.news-arrow:hover {
    transform: translateY(-50%) translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

@media (max-width: 1100px) {
    .news-track {
        grid-auto-columns: calc((100% - (var(--news-gap) * 2)) / 3);
    }
}

@media (max-width: 900px) {
    .news-track {
        grid-auto-columns: calc((100% - var(--news-gap)) / 2);
    }
}

@media (max-width: 600px) {
    .news-carousel {
        padding: 0 44px;
    }
    .news-track {
        grid-auto-columns: 100%;
    }
}

/* --- 6. Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--uob-red);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background-color: var(--uob-dark-red);
    transform: translateY(-5px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- 7. Footer --- */
footer {
    background:
        radial-gradient(800px 220px at 15% 0%, rgba(128, 0, 32, 0.18), rgba(0, 0, 0, 0)),
        linear-gradient(180deg, #1b1b1b 0%, #111111 100%);
    color: #b9b4ac;
    padding: 52px 0 36px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    text-align: left;
}

.footer-col h3 {
    color: #f5f3ef;
    margin-bottom: 10px;
    letter-spacing: 0.4px;
}

.footer-social {
    display: flex;
    gap: 12px;
    min-height: 38px;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #f0ede8;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.footer-social .x-icon,
.footer-social .social-icon,
.footer-social .social-icon-img {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
    fill: #f0ede8;
    opacity: 1;
}

.footer-social a:hover {
    background: rgba(128, 0, 32, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.footer-bottom {
    flex-basis: 100%;
    text-align: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #9d978f;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-bottom {
        text-align: left;
    }
}

/* --- Mobile Responsive --- */
@media (max-width: 1024px) {


    .navbar { overflow: visible; }
    .brand-area { gap: 10px; }
    .logo-img { height: 34px; }
    .erl-logo { height: 36px; }
    .vertical-divider { height: 18px; }
    .director-title { font-size: 2.5rem; }
    .director-subtitle { font-size: 1.1rem; }
    .hero-caption { font-size: 1rem; }
    .brand-area { padding-right: 52px; }
    nav { position: static; }
    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--white);
        width: 100%;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        z-index: 1001;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        align-items: flex-start;
        gap: 6px;
    }
    .nav-links.nav-active { display: flex; }
    body.nav-open .nav-links { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links a { width: 100%; }
    .nav-item.has-submenu {
        display: flex;
        flex-direction: column;
    }
    .hamburger {
        display: block;
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
        pointer-events: auto;
    }
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        display: none;
        border: 0;
        box-shadow: none;
        background: transparent;
        padding: 6px 0 0 12px;
        margin: 0;
        width: 100%;
    }
    .nav-item.open .submenu { display: block; }
    .nav-item.has-submenu:hover .submenu,
    .nav-item.has-submenu:focus-within .submenu {
        display: block;
    }
}

@media (max-width: 600px) {
    .hero { height: 80vh; }
    .director-title {
        font-size: 2.1rem;
        letter-spacing: 0.5px;
        white-space: normal;
    }
    .director-subtitle { font-size: 1rem; }
    .hero-buttons { flex-wrap: wrap; }
    .project-row { gap: 20px; margin-bottom: 32px; }
    .carousel-wrapper { height: 240px; }
}

/* --- Content Layout (About Page) --- */

/* Centers text and limits width for professional readability */
.content-block {
    max-width: 800px;
    margin: 0 auto;
}

.content-block h2 {
    font-size: 1.8rem;
    color: var(--rich-black);
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 700;
}

.content-block p {
    font-size: 1.05rem;
    color: #4a4a4a;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Introduction Paragraph Style */
.lead-text {
    font-size: 1.25rem !important;
    font-weight: 300;
    color: #222 !important;
    border-left: 4px solid var(--uob-red);
    padding-left: 20px;
    margin-bottom: 40px !important;
}

.lead-quote {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #2d2d2d;
    margin: 0 0 18px;
    padding: 16px 18px;
    border-left: 4px solid var(--uob-red);
    background: #f9f9f9;
    border-radius: 6px;
    font-style: italic;
}

.center-quote {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #333;
    max-width: 780px;
    margin: 22px auto 0;
    padding: 18px 24px;
    text-align: center;
    font-style: italic;
    background: #faf8f3;
    border-radius: 8px;
    position: relative;
}

.center-quote::before,
.center-quote::after {
    content: '"';
    position: absolute;
    font-size: 2.4rem;
    color: rgba(128, 0, 32, 0.35);
    line-height: 1;
}

.center-quote::before { top: -10px; left: 10px; }
.center-quote::after { bottom: -18px; right: 10px; }


/* About: Who We Are */
.about-copy {
    max-width: 920px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-copy p {
    margin: 0;
    color: #555;
    line-height: 1.78;
    font-size: 1.02rem;
}

.about-intro {
    color: #2d2d2d;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 16px 18px;
    border-left: 4px solid var(--uob-red);
    background: #f9f9f9;
    border-radius: 6px;
}

.about-quote {
    margin: 4px 0;
    padding: 18px 22px;
    font-size: 1.08rem;
    line-height: 1.7;
    color: #2f2f2f;
    border-left: 4px solid rgba(128, 0, 32, 0.8);
    background: #faf7f2;
    border-radius: 8px;
    font-style: italic;
}

.about-close {
    margin-top: 10px;
    padding: 12px 16px;
    border-left: 4px solid var(--uob-red);
    background: #f8f1f3;
    border-radius: 6px;
    font-weight: 600;
    color: #3b1a22;
}


/* --- Matterport Responsive Wrapper --- */
.matterport-wrapper {
    position: relative;
    width: 100%;
    max-width: 780px;
    aspect-ratio: 853 / 480;
    padding-top: 0;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.matterport-wrapper.frame-3d {
    background: transparent;
    padding: 6px;
    border-radius: 12px;
    transform: perspective(1000px) rotateX(1deg) rotateY(-1.5deg);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.12),
        0 10px 24px rgba(0, 0, 0, 0.15);
}

.matterport-wrapper.frame-3d::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
        linear-gradient(315deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.matterport-wrapper.frame-3d::after {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

.matterport-section {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.1fr);
    gap: 30px;
    align-items: center;
}

#facilities.section-padding {
    padding: 10px 0 22px;
    scroll-margin-top: calc(var(--nav-height) + 20px);
    background:
        radial-gradient(900px 360px at 15% -10%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0)),
        radial-gradient(700px 260px at 85% 10%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0)),
        linear-gradient(180deg, #242424 0%, #181818 100%);
    position: relative;
}

#facilities .section-heading {
    margin-bottom: 0;
}

#facilities .matterport-section {
    margin-top: -14px;
}

#facilities .matterport-section:first-of-type .matterport-wrapper {
    margin-top: -16px;
}

#facilities .matterport-content h3 {
    margin-top: 0;
    margin-bottom: 6px;
}

#facilities .project-meta {
    margin-top: 0;
}


.section-facilities-dark,
.section-facilities-dark h2,
.section-facilities-dark h3 {
    color: #f2f0ed;
}

.section-facilities-dark .project-meta {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f7f3ee;
    margin-bottom: 14px;
    font-size: 0.85rem;
}

.section-facilities-dark .matterport-content p {
    color: #bfb9af;
    font-size: 1rem;
    line-height: 1.7;
}

.section-facilities-dark .matterport-content p.project-meta {
    color: #f7f3ee;
}

.section-facilities-dark hr {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.section-facilities-dark .matterport-section {
    gap: 18px;
}

.section-facilities-dark .matterport-content {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.section-facilities-dark .matterport-wrapper.frame-3d {
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#facilities .matterport-section {
    gap: 20px;
}

.matterport-content h2 {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--rich-black);
}

.matterport-content p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* New Helper: Reverse Layout for Matterport Section */
.matterport-section.reverse-layout {
    direction: rtl; /* Simple way to flip columns visually */
}
.matterport-section.reverse-layout > * {
    direction: ltr; /* Reset text direction inside children */
}

@media (max-width: 900px) {
    .matterport-section, .matterport-section.reverse-layout {
        grid-template-columns: 1fr;
        direction: ltr;
    }
    .matterport-wrapper {
        max-width: 100%;
    }
}

.matterport-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.matterport-wrapper video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Research Page Specific Styles --- */

.page-header {
    position: relative;
    padding: 50px 0 50px; /* Tall, dramatic header */
    text-align: center;
    color: #ffffff;
    background-color: #222; /* Fallback color */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
    overflow: hidden;
}

/* The Dark Overlay (Makes text readable on any image) */
.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    /* Gradient overlay: Darker at bottom for text contrast */
    background: linear-gradient(to bottom, rgba(0,0,0,0.22), rgba(0,0,0,0.55));
    z-index: -1;
}

/* Typography */
.page-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.page-subtitle {
    font-size: 1.25rem;
    color: #f0f0f0;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.section-padding { padding: 50px 0; }
.section-white { background: #ffffff; }

.research-page .section-padding {
    padding-top: 20px;
}

/* --- Specific Background Images --- */

.header-research {
    background-image: url('../assets/images/research-bg.JPG');
}
.header-about {
    background-image: url('../assets/images/about-bg.jpg');
}
.header-facilities {
    background-image: url('../assets/images/facilities-bg.jpg');
}
.header-team {
    background-image: url('../assets/images/team-bg.jpg');
}

.header-publications {
    background-image: url('../assets/images/publications-bg.jpg');
}

.header-projects {
    background-image: url('../assets/images/projects-bg.jpeg');
    background-size: 100% auto;
    background-position: center 40%;
}
.header-press {
    background-image: url('../assets/images/press-bg.jpg');
    background-position: center;
}

.header-contact {
    background-image: linear-gradient(135deg, #2b2b2b 0%, #141414 100%);
}

.header-press::before {
    background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0.8));
}

/* Grid Layout for Themes */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.research-card {
    background: var(--white);
    border: 1px solid #eee;
    padding: 30px;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.research-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-top: 3px solid var(--uob-red);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--uob-red);
    margin-bottom: 20px;
}

.research-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--rich-black);
}

.research-card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Tech Tags (Pills) */
.tech-tags { display: flex; flex-wrap: wrap; gap: 10px; }

.tech-tags li {
    background: #f0f0f0;
    color: #444;
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
}

/* Featured Projects Row */
.project-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
}

.project-row.reverse { flex-direction: row-reverse; }

.project-content { flex: 1; }

.project-content h3 { font-size: 2rem; margin-bottom: 5px; color: var(--rich-black); }

.project-meta {
    display: block;
    font-size: 0.9rem;
    color: var(--uob-red);
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-image {
    flex: 1;
    height: 300px;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image.impact-image {
    height: 360px;
}

/* --- Projects Page --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.project-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #ededed;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--rich-black);
}

.project-card p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.projects-split {
    display: grid;
    grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.projects-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 20px);
    background: #f7f3ed;
    border: 1px solid #efe7dd;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
}

.projects-sidebar-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--rich-black);
}

.projects-subjects {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.projects-subjects a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #efe7dd;
    color: #444;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.projects-subjects a:hover {
    border-color: rgba(128, 0, 32, 0.3);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.projects-subjects a.active {
    border-color: rgba(128, 0, 32, 0.4);
    background: #fff6f6;
    color: #4a1f28;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.project-line {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas:
        "media meta"
        "desc desc";
    gap: 18px 22px;
    align-items: start;
    background: #f2f2f2;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}

.project-line-media {
    grid-area: media;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    background: #efefef;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.75),
        0 10px 20px rgba(0, 0, 0, 0.08);
}

.project-line:nth-child(even) {
    background: #fafafa;
    border-color: #e6e6e6;
}

/* --- Contact Page --- */
.contact-hero {
    position: relative;
    padding: 70px 0;
    min-height: calc(100vh - var(--nav-height));
    background:
        url('../assets/images/map2.png') center/cover no-repeat;
    color: #f2efe9;
    overflow: hidden;
}

.contact-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.85));
    pointer-events: none;
}

.contact-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 28px;
    align-items: start;
}

.contact-heading {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: -22px;
    margin-bottom: 64px;
}

.contact-hero .page-title {
    margin-bottom: 8px;
}

.contact-hero .page-subtitle {
    color: #d6d1c8;
}

.contact-intro h2 {
    margin: 0 0 12px;
    font-size: 1.9rem;
    letter-spacing: 0.5px;
}

.contact-intro p {
    margin: 0 0 20px;
    color: #d6d1c8;
    line-height: 1.6;
    font-size: 1.05rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.contact-card h3 {
    margin: 0 0 12px;
    color: #f7f3ee;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contact-pin {
    color: #d6d1c8;
    font-size: 1.1rem;
}

.contact-card p {
    margin: 0;
    color: #d6d1c8;
    line-height: 1.6;
}

.contact-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
}

@media (max-width: 900px) {
    .contact-hero-inner {
        grid-template-columns: 1fr;
    }
}

.project-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-line-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-line-meta {
    grid-area: meta;
}

.project-line-meta h3 {
    margin: 0 0 12px;
    font-size: 1.35rem;
    color: var(--rich-black);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 6px;
}

.project-line-meta h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 3px;
    background: var(--uob-red);
    border-radius: 2px;
}

.project-title-link {
    color: inherit;
    text-decoration: none;
}

.project-title-link:hover {
    color: var(--uob-red);
}

.project-meta-list {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.project-meta-list li {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.92rem;
    color: #555;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.project-meta-list li:last-child {
    border-bottom: 0;
}

.project-meta-list span {
    text-transform: uppercase;
    letter-spacing: 0.9px;
    font-size: 0.72rem;
    color: #8a8a8a;
}

.project-meta-list strong {
    color: #444;
    font-weight: 500;
}

.project-funder-logo {
    margin-top: 12px;
    width: 120px;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.project-line-desc {
    grid-area: desc;
    margin: 8px 0 0;
    color: #666;
    line-height: 1.6;
    font-size: 0.96rem;
}

@media (max-width: 900px) {
    .projects-split {
        grid-template-columns: 1fr;
    }
    .projects-sidebar {
        position: static;
    }
}

@media (max-width: 700px) {
    .project-line {
        grid-template-columns: 1fr;
    }
    .project-line-media {
        aspect-ratio: 16 / 9;
    }
}

/* --- Publications Page --- */
.publications {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.publications-layout {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
}

.pub-years {
    position: sticky;
    top: calc(var(--nav-height) + 20px);
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pub-years a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: #555;
    background: #f4f4f4;
    font-weight: 600;
}

.pub-years a:hover {
    color: var(--uob-red);
    background: #f8e9ed;
}

.pub-year h2 {
    margin: 0 0 12px;
    color: var(--uob-red);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.pub-year {
    scroll-margin-top: calc(var(--nav-height) + 24px);
}

.pub-list {
    margin: 0;
    padding-left: 18px;
    color: #555;
    line-height: 1.7;
}

.pub-list li {
    margin-bottom: 10px;
}

.pub-list span {
    display: block;
    color: #777;
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .publications-layout {
        grid-template-columns: 1fr;
    }
    .pub-years {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* --- Press Page --- */
.press-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.press-item {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 55%),
        linear-gradient(155deg, #ffffff 0%, #f4f1ee 45%, #e6e1dc 100%);
    border: 1px solid rgba(128, 0, 32, 0.18);
    border-radius: 16px;
    padding: 18px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -10px 22px rgba(0, 0, 0, 0.08),
        0 22px 46px rgba(0, 0, 0, 0.14),
        0 3px 0 rgba(255, 255, 255, 0.75);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.press-item:nth-child(even) {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 55%),
        linear-gradient(155deg, #343434 0%, #242424 50%, #1a1a1a 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -8px 18px rgba(0, 0, 0, 0.5),
        0 18px 36px rgba(0, 0, 0, 0.28),
        0 2px 0 rgba(255, 255, 255, 0.08);
}

.press-item::after {
    content: '';
    position: absolute;
    inset: -30% -20% auto -20%;
    height: 120%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 52%);
    pointer-events: none;
    opacity: 0.75;
}

.press-item:nth-child(even)::after {
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 52%);
    opacity: 0.45;
}

.press-item:nth-child(even) h3,
.press-item:nth-child(even) p {
    color: #f1f1f1;
}

.press-item:nth-child(even) .press-meta {
    color: #d6d6d6;
}

.press-item:hover {
    transform: translateY(-4px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -12px 26px rgba(0, 0, 0, 0.1),
        0 26px 54px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.35);
}

.press-item-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.press-item h3 {
    margin: 0;
    color: var(--rich-black);
    font-size: 1.15rem;
    font-weight: 700;
}

.press-meta {
    margin: 0;
    color: #777;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.press-item-content p:not(.press-meta) {
    font-size: 0.9rem;
    color: #5f5f5f;
}

.press-preview {
    order: -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid #e3e3e3;
    background: linear-gradient(135deg, #f4f4f4, #ffffff);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    color: var(--rich-black);
    min-height: 150px;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.press-preview-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
}

.press-preview-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(128, 0, 32, 0.08);
    color: var(--uob-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.press-preview-title {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
}

.press-preview-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.85rem;
}

.press-favicon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.press-preview-cta {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--uob-red);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.press-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(128, 0, 32, 0.3);
}

@media (max-width: 1000px) {
    .press-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .press-list {
        grid-template-columns: 1fr;
    }
    .press-preview {
        min-height: auto;
    }
}

/* --- Team Page --- */
.team-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.team-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #ededed;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.team-photo {
    width: 140px;
    height: 180px;
    border-radius: 10px;
    background: #f0f0f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9a9a9a;
    font-size: 2rem;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-photo img.photo-shift-down {
    object-position: center 65%;
}

.placeholder-photo {
    background: linear-gradient(135deg, #f2f2f2, #e6e6e6);
}

.team-details h3 {
    margin: 0 0 6px;
    color: var(--rich-black);
    font-size: 1.16rem;
}

.team-lead {
    font-weight: 700;
    font-style: italic;
}

.team-role {
    margin: 0;
    color: #666;
    line-height: 1.5;
    font-size: 0.95rem;
}

.team-row.compact .team-photo {
    width: 110px;
    height: 110px;
}

.team-section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 28px 0;
}

.team-section .section-heading,
.team-section .team-list {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.team-section .section-heading {
    display: block;
    width: 100%;
    text-align: left;
}

.team-section .section-heading::after {
    left: 20px;
    transform: none;
}

.team-section-senior { background: #f6f6f6; }
.team-section-phd { background: #f1ece4; }
.team-section-assoc { background: #ffffff; }
.team-section-alumni { background: #f3f3f3; }

.team-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 0.88rem;
    color: #777;
}

.team-links a {
    color: #777;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.team-links a:hover {
    color: var(--uob-red);
}

.team-links i {
    font-size: 0.9rem;
}

@media (max-width: 700px) {
    .team-list {
        grid-template-columns: 1fr;
    }
    .team-row {
        grid-template-columns: 1fr;
    }
    .team-photo {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 5;
        max-height: 260px;
    }
    .team-row.compact .team-photo {
        height: auto;
        aspect-ratio: 1 / 1;
        max-height: 200px;
    }
}

/* Add this to style.css */
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This crops the image to fill the box without distorting it */
    display: block;
}

.frame-3d {
    background: transparent;
    padding: 6px;
    border-radius: 12px;
    position: relative;
    transform: perspective(1000px) rotateX(1deg) rotateY(-1.5deg);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.14),
        0 16px 36px rgba(0, 0, 0, 0.18);
}

.frame-3d::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
        linear-gradient(315deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.frame-3d .frame-img {
    object-fit: contain;
    background: transparent;
    border-radius: 8px;
}

.wrap-image {
    float: right;
    width: 56%;
    max-width: 550px;
    margin: 0 0 12px 24px;
}

.wrap-image.impact-image {
    width: 52%;
    max-width: 520px;
}

.wrap-image .frame-img {
    width: 100%;
    height: auto;
}

.impact-media {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    margin-top: -18px;
}

.impact-placeholder .img-placeholder {
    width: 100%;
    height: 100%;
    font-size: 3rem;
    color: #c4c4c4;
    background: #efefef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .impact-media {
        margin-top: 0;
        align-items: stretch;
    }
}

@media (max-width: 900px) {
    .wrap-image {
        float: none;
        width: 100%;
        max-width: none;
        margin: 0 0 16px 0;
    }
}

.img-placeholder {
    font-size: 4rem;
    color: #bbb;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .project-row, .project-row.reverse { flex-direction: column; }
    .project-image { width: 100%; height: 250px; }
}

.section-light {
    background: #f8f6f2;
}

/* --- NEW STYLES: Quotes & Carousel --- */

/* Quote Box for Section 1 */
.erl-quote-box {
    background: #fdfdfd;
    border-left: 4px solid var(--uob-red);
    padding: 20px;
    border-radius: 4px;
    font-style: italic;
    color: #444;
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Carousel / Image Gallery Container */
.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
}

.carousel-slide {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.6s ease, opacity 0.6s ease;
}
.carousel-slide.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}

.carousel-slide.exit-left {
    opacity: 0;
    transform: translateX(-100%);
    z-index: 1;
}

.carousel-slide.exit-right {
    opacity: 0;
    transform: translateX(100%);
    z-index: 1;
}

.carousel-slide.enter-left { transform: translateX(-100%); }
.carousel-slide.enter-right { transform: translateX(100%); }

.carousel-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    color: #888;
}

.carousel-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Carousel Buttons */
.carousel-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
}

.carousel-controls button {
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.carousel-controls button:hover {
    background: var(--uob-red);
}

.carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-dot.active {
    background: var(--uob-red);
    border-color: var(--uob-red);
    transform: scale(1.15);
}

.carousel-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
/* --- New Research Gallery (Dyson Style) --- */

.research-gallery {
    display: grid;
    /* This creates a responsive grid automatically (3 items per row on desktop) */
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    margin-top: 20px;
}

.research-item {
    display: flex;
    flex-direction: column;
    text-align: left;
}

/* The Image Container */
.research-thumb {
    width: 100%;
    height: 240px; /* Fixed height for clean alignment */
    background: #e0e0e0;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 4px; /* Optional: Slight rounding */
}

/* Placeholder styling (Remove when you add real images) */
.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #ccc;
    font-size: 3rem;
}

/* Text Styling */
.research-item h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--rich-black);
}

.research-item p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .research-gallery {
        grid-template-columns: 1fr; /* Stack vertically on mobile */
    }
}

/* --- Research Sections Layout --- */
.research-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.research-section {
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    padding: 12px 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.research-section:nth-child(even) {
    background: #f8f6f2;
}

.research-section:first-child {
    padding-top: 6px;
}

.research-section .research-header,
.research-section .research-works {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.research-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
    margin-bottom: 16px;
}

.research-header h3 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--rich-black);
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.research-header h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 3px;
    background: var(--uob-red);
    transform: none;
    border-radius: 2px;
}

.research-header p {
    margin: 0;
    color: #666;
}

.research-right {
    margin: 0;
    padding-left: 18px;
    color: #555;
    line-height: 1.6;
}

.research-works {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.work-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 1 calc(20% - 16px);
    max-width: calc(20% - 16px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

[data-barba-namespace="software"] .research-works {
    flex-direction: column;
    justify-content: flex-start;
}

[data-barba-namespace="software"] .work-card {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
}

[data-barba-namespace="software"] .work-media {
    flex: 0 0 460px;
    width: 460px;
    height: 170px;
    aspect-ratio: auto;
}

[data-barba-namespace="software"] .software-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

[data-barba-namespace="software"] .work-card h4 {
    margin: 0;
}

[data-barba-namespace="software"] .work-card p {
    margin: 0;
}

[data-barba-namespace="software"] .work-image {
    object-fit: contain;
    background: #f2f2f2;
}

[data-barba-namespace="software"] .software-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--uob-red);
    font-weight: 600;
    text-decoration: none;
}

[data-barba-namespace="software"] .software-link:hover {
    color: var(--uob-dark-red);
}

@media (max-width: 900px) {
    [data-barba-namespace="software"] .work-card {
        flex-direction: column;
        align-items: flex-start;
        flex-basis: 100%;
        max-width: 100%;
    }
    [data-barba-namespace="software"] .work-media {
        width: 100%;
        flex: 0 0 auto;
    }
}

[data-barba-namespace="software"] .work-card {
    flex-basis: 100%;
    max-width: 100%;
}

.research-section:nth-child(odd) .work-card {
    background: #f5f3ef;
}

.research-section:nth-child(even) .work-card {
    background: #ffffff;
}

.work-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    background: #e6e6e6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.work-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.work-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    width: min(92vw, 960px);
    max-height: 86vh;
    background: #111;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
    width: 100%;
    height: 100%;
    max-height: 84vh;
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
}

.work-card h4 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--rich-black);
}

.work-card p {
    margin: 0;
    color: #666;
    font-size: 0.88rem;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .research-section {
        padding: 18px;
    }
    .research-works {
        justify-content: center;
    }
    .work-card {
        flex-basis: calc(50% - 16px);
        max-width: calc(50% - 16px);
    }
}

@media (max-width: 600px) {
    .research-works {
        justify-content: center;
    }
    .work-card {
        flex-basis: 100%;
        max-width: 100%;
    }
}






