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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 0px;
}


:root {
    /* Brand Color Palette */
    --bg-dark: #0a0a0a;
    --navy: #1A2B3C;
    --terracotta: #D46A43; /* From Logo */
    --cyan: #00B5CC;     /* From Logo */
    --brand-bridge: #6A8F87; /* Mid-point */
    --brand-gradient: linear-gradient(135deg, var(--terracotta) 0%, var(--cyan) 100%);
    --brand-glow: rgba(212, 106, 67, 0.4); /* Soft brand glow */
    --terracotta-glow: rgba(212, 106, 67, 0.5);
    --brand-bridge-glow: rgba(106, 143, 135, 0.5);
    --cyan-glow: rgba(0, 181, 204, 0.5);
    
    --text-main: #f0f0f0;
    --text-dim: #a0a0a0;
    --card-bg: rgba(255, 255, 255, 0.03);
    
    /* Transitions */
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    background: rgba(10, 10, 10, 0);
    border-bottom: 1px solid rgba(255, 255, 255, 0);
    transition: var(--transition-smooth);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

nav::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.8), transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    transition: var(--transition-smooth);
}

nav.scrolled {
    padding: 0.8rem 8%;
    background: rgba(10, 10, 10, 0.7); /* Restored transparency */
    backdrop-filter: blur(20px);       /* Restored blur */
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Soft fade-out below the line */
nav.scrolled::after {
    opacity: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(white, white), var(--brand-gradient);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    padding: 0.5rem;
    border-radius: 50%;
    height: 100px;
    width: 100px;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: 3px solid transparent;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px var(--brand-glow);
    z-index: 1001;
}

nav.scrolled .logo {
    height: 70px;
    width: 70px;
    padding: 0.4rem;
}

.logo:hover {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--brand-glow);
}

.logo img {
    height: 85%;
    width: 85%;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    position: relative;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition-smooth);
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-gradient);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 120px 10% 0; /* top padding accounts for fixed nav */
    gap: 4rem;
}

.hero-content {
    flex: 1;
    z-index: 10;
    max-width: 800px;
}

.hero-tagline {
    background: var(--brand-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.hero h1 {
    font-size: clamp(4rem, 8vw, 6.5rem);
    margin-bottom: 0.5rem;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.2s forwards;
    letter-spacing: 0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 500;
    color: var(--cyan);
    margin-bottom: 2.5rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.3s forwards;
    max-width: 780px;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-dim);
    margin-bottom: 3.5rem;
    max-width: 600px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s 0.4s forwards;
    line-height: 1.8;
}

.cta-button {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background: var(--brand-gradient);
    color: white;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 8px;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 181, 204, 0.3);
    filter: brightness(1.1);
}

.hero-image {
    flex: 1.2;
    position: relative;
    height: 75vh;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: fadeIn 1.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

model-viewer {
    width: 100%;
    height: 100%;
    z-index: 10;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    pointer-events: auto;
}

model-viewer.visible {
    opacity: 1;
}

.model-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--cyan);
    animation: spin 1s linear infinite;
    z-index: 6;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 20;
    opacity: 0;
    animation: scrollFadeIn 1s 1.5s forwards;
    color: var(--text-dim);
    text-decoration: none;
    transition: var(--transition-smooth);
}

@keyframes scrollFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.scroll-indicator:hover {
    color: var(--cyan);
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid currentColor;
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: currentColor;
    border-radius: 2px;
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { top: 6px; opacity: 1; }
    100% { top: 18px; opacity: 0; }
}

/* --- Sections --- */
section {
    padding: 7rem 10%;
    position: relative;
}

.section-label {
    color: var(--terracotta);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    display: block;
}

.section-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    margin-bottom: 4rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 5px;
    background: var(--brand-gradient);
    border-radius: 2px;
}

/* --- Cards / Grid --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

#news .grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 2rem; /* space for scrollbar */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--terracotta) rgba(255, 255, 255, 0.05);
}

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

#news .grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#news .grid::-webkit-scrollbar-thumb {
    background-color: var(--terracotta);
    border-radius: 4px;
}

#news .grid > * {
    flex: 0 0 350px;
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    #news .grid > * {
        flex: 0 0 85vw; /* Almost full width on mobile */
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 12px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--terracotta-glow);
    transform: translateY(-5px);
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.card p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.clickable-card {
    cursor: pointer;
    text-decoration: none;
}

.clickable-card:hover {
    border-color: var(--cyan) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px var(--cyan-glow);
    background: rgba(255, 255, 255, 0.08);
}

.clickable-card h3 {
    transition: var(--transition-smooth);
}

.clickable-card:hover h3 {
    color: var(--cyan);
}

.partner-card {
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    background: var(--card-bg);
}

.partner-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--cyan);
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px var(--cyan-glow);
}

.partner-card:nth-child(odd):hover {
    border-color: var(--terracotta);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px var(--terracotta-glow);
}

.partner-card img {
    height: 80px;
    width: auto;
    max-width: 90%;
    margin-bottom: 2rem;
    filter: grayscale(1) opacity(0.6);
    transition: var(--transition-smooth);
    object-fit: contain;
}

.partner-card:hover img {
    filter: grayscale(0) opacity(1);
    transform: scale(1.05);
}

.partner-card h4 {
    color: var(--text-main);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.partner-card p {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* --- Visual Enhancements --- */
.gradient-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.2;
}

.blob-1 { top: 20%; left: -10%; background: var(--terracotta); width: 600px; height: 600px; opacity: 0.15; }
.blob-2 { bottom: 10%; right: -10%; background: var(--cyan); width: 600px; height: 600px; opacity: 0.15; }

/* --- Animations --- */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Footer --- */
footer {
    padding: 6rem 5% 3rem;
    background: #050505;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    gap: 3rem;
}

.footer-brand h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--text-main);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer-funding-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--terracotta);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.footer-funding-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--terracotta);
    transform: translateY(-5px);
}

.footer-bottom-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.license-container {
    text-align: left;
    max-width: 500px;
}

.license-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.license-item:last-child {
    margin-bottom: 0;
}

.license-item img {
    height: 22px;
    object-fit: contain;
    justify-self: flex-start;
}

.footer-copyright {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-github-ref {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 0.8rem;
}

.platform-info {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}

/* 3D Asset Attribution */
.asset-credit {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.asset-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
    transition: var(--transition-smooth);
}

.asset-credit:hover .asset-logo {
    border-color: var(--terracotta);
    transform: scale(1.1);
}

.asset-info {
    display: flex;
    flex-direction: column;
}

.asset-link {
    display: block;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    font-size: 0.9rem !important;
    margin-bottom: 2px;
    text-decoration: none;
}

.asset-link:hover {
    color: var(--terracotta) !important;
}

.asset-license {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    white-space: nowrap;
}

/* --- Contact Links --- */
.contact-link {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.contact-link:nth-child(1) { border-bottom: 4px solid var(--terracotta); }
.contact-link:nth-child(2) { border-bottom: 4px solid var(--brand-bridge); }
.contact-link:nth-child(3) { border-bottom: 4px solid var(--cyan); }

.contact-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
}

.contact-link:nth-child(1):hover {
    border-color: var(--terracotta-glow);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px var(--terracotta-glow);
}

.contact-link:nth-child(2):hover {
    border-color: var(--brand-bridge-glow);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px var(--brand-bridge-glow);
}

.contact-link:nth-child(3):hover {
    border-color: var(--cyan-glow);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px var(--cyan-glow);
}

/* --- Side Navigation Dots --- */
.side-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    z-index: 10000;
}

.side-dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-smooth);
    position: relative;
    cursor: pointer;
}

.side-dot::before {
    content: attr(data-label);
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.side-dot:hover::before {
    opacity: 1;
    visibility: visible;
    right: 25px;
}

.side-dot:hover {
    border-color: white;
    transform: scale(1.2);
}

.side-dot.active {
    background: var(--terracotta);
    border-color: var(--terracotta);
    box-shadow: 0 0 15px var(--terracotta-glow);
}

.side-dot.active:nth-child(even) {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 15px var(--cyan-glow);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 140px 8% 80px;
        height: auto;
        min-height: 100vh;
        gap: 2rem;
    }
    .hero-content {
        flex: none;
        max-width: 100%;
        order: 1;
    }
    .hero-image {
        flex: none;
        width: 100%;
        height: 50vh;
        min-height: 400px;
        order: 2;
        margin-top: 2rem;
    }
}

@media (max-width: 992px) {
    .nav-links { display: none; }
    section {
        padding: 5rem 6%;
    }
    .logo {
        height: 70px;
        width: 70px;
    }
    nav.scrolled .logo {
        height: 50px;
        width: 50px;
        padding: 0.3rem;
        border-width: 2px;
    }
    .mobile-menu-btn {
        display: block !important;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 1100;
    }
}

@media (max-width: 768px) {
    section {
        padding: 4rem 5%;
    }
    .hero {
        padding: 140px 5% 60px;
    }
    .hero h1 { font-size: clamp(2.5rem, 8vw, 3.5rem); }
    .hero-image {
        height: 40vh;
        min-height: 300px;
    }
    .grid {
        grid-template-columns: 1fr;
    }
    .side-nav {
        display: none;
    }
}
/* --- Mobile Nav --- */

.mobile-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 250px;
    height: 100vh;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    padding: 6rem 2rem;
    gap: 2rem;
    z-index: 1050;
    transition: var(--transition-smooth);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mobile-menu-btn {
    display: none;
}

/* Researcher Links */
.researcher-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.researcher-entry:last-child {
    border-bottom: none;
}

.researcher-info {
    display: flex;
    flex-direction: column;
}

.researcher-name {
    font-weight: 600;
    color: var(--text-main);
}

.researcher-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.researcher-links {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.profile-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.profile-link.orcid {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    padding: 0;
}

.profile-link.orcid:hover {
    background: transparent;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 5px 15px rgba(166, 206, 57, 0.2);
}

.profile-link.orcid svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.profile-link.web:hover {
    background: rgba(0, 181, 204, 0.1);
    color: var(--cyan);
    border-color: rgba(0, 181, 204, 0.3);
    box-shadow: 0 0 15px rgba(0, 181, 204, 0.1);
}

.profile-link svg {
    width: 16px;
    height: 16px;
}
