/* ============================================
   ACROBAT GENOMICS — Dark Minimalist Design
   Inspired by Inceptive.com aesthetics
   ============================================ */

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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-elevated: #181818;
    --bg-card: #141414;
    --text-primary: #f0f0f0;
    --text-secondary: rgba(240, 240, 240, 0.6);
    --text-tertiary: rgba(240, 240, 240, 0.35);
    --accent: #c0c0c0;
    --accent-bright: #e8e8e8;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(24px, 5vw, 64px);
}


/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 clamp(24px, 5vw, 64px);
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.scrolled {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.nav-logo img {
    height: 44px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.nav-logo:hover img {
    opacity: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.3s var(--ease-out);
}

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

.nav-social {
    display: flex;
    align-items: center;
}

.nav-social::after {
    display: none !important;
}

.nav-social svg {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.nav-social:hover svg {
    opacity: 1;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--text-primary);
    transition: transform 0.3s var(--ease-out), opacity 0.3s ease;
}

.nav-toggle.active span:first-child {
    transform: translateY(3.75px) rotate(45deg);
}

.nav-toggle.active span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
}


/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: 85%;
    max-width: 90%;
    object-fit: contain;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.8s ease;
    -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, rgba(0,0,0,1) 30%, transparent 70%);
    mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, rgba(0,0,0,1) 30%, transparent 70%);
}

.hero-video.ready {
    opacity: 0.3;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse 70% 55% at 50% 45%, transparent 20%, var(--bg-primary) 65%);
}

.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 1100px;
    padding: 0 clamp(24px, 5vw, 64px);
}

.hero-title {
    font-size: clamp(32px, 4vw, 46px);
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.hero-title-line {
    display: block;
    color: rgba(240, 240, 240, 0.6);
}

.hero-title-accent {
    color: #ffffff;
    font-weight: 400;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.15), 0 0 80px rgba(200, 210, 255, 0.08);
}

.typewriter-cursor {
    display: inline-block;
    color: #ffffff;
    font-weight: 300;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-subtitle {
    font-size: clamp(16px, 1.8vw, 20px);
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 48px auto 0;
    line-height: 1.7;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
}

.hero-scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--text-tertiary), transparent);
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}


/* --- Sections --- */
.section {
    padding: clamp(80px, 12vw, 160px) 0;
    position: relative;
}

.section-header {
    margin-bottom: clamp(48px, 8vw, 80px);
}

.section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.section-title {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.02em;
    max-width: 700px;
}


/* --- Approach Section --- */
.approach-section {
    background: var(--bg-secondary);
}

.approach-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.approach-content {
    max-width: 700px;
}

.approach-text {
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-top: 24px;
}

.approach-text em {
    font-style: normal;
    color: var(--text-primary);
    font-weight: 400;
}


/* --- Team Section --- */
.team-section {
    background: var(--bg-primary);
}

.team-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.team-group {
    margin-bottom: clamp(48px, 8vw, 80px);
}

.team-group:last-child {
    margin-bottom: 0;
}

.team-group-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 40px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.team-grid {
    display: grid;
    gap: 24px;
}

/* 6-column grid: each card spans 2 columns → 3 cards per row.
   This makes it easy to center an orphan row of 2 cards. */
.founding-grid {
    grid-template-columns: repeat(6, 1fr);
}

.founding-grid > .team-card {
    grid-column: span 2;
}

/* When the 4th card is followed by exactly one more (5 cards total),
   center the last row of 2 by offsetting the 4th card to column 2. */
.founding-grid > .team-card:nth-child(4):nth-last-child(2) {
    grid-column: 2 / span 2;
}
.founding-grid > .team-card:nth-child(5):last-child {
    grid-column: 4 / span 2;
}

.sab-grid {
    grid-template-columns: repeat(3, 1fr);
}

.advisor-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* SAB cards — clickable wrappers that open lab websites */
.sab-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.sab-affiliation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    min-height: 44px;
}

.sab-affiliation img {
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sab-link-arrow {
    color: var(--text-tertiary);
    font-size: 14px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
}

.sab-card:hover .sab-affiliation img {
    opacity: 1;
}

.sab-card:hover .sab-link-arrow {
    opacity: 0.6;
    transform: translateX(0);
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.4s ease, transform 0.4s var(--ease-out);
}

.team-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.team-card-image {
    aspect-ratio: 1;
    max-width: 120px;
    margin: 20px auto 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-elevated);
    /* Force compositing layer to fix Safari border-radius clipping bug with transformed children */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.team-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.6s ease, transform 0.6s var(--ease-out);
}

.team-card:hover .team-card-image img {
    filter: grayscale(30%);
    transform: scale(1.03);
}

.team-card-info {
    padding: 20px;
    text-align: center;
}

.team-card-info h4 {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.team-role {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 300;
}

.team-institutions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 0;
    padding-top: 0;
    flex-wrap: wrap;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s var(--ease-out), opacity 0.3s ease, margin-top 0.4s var(--ease-out), padding-top 0.4s var(--ease-out);
}

.team-card.expanded .team-institutions {
    max-height: 120px;
    opacity: 1;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.team-institutions-label {
    width: 100%;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.team-institutions img {
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    opacity: 0.7;
}

/* LinkedIn icon link on team cards */
.team-linkedin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 16px auto 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-tertiary);
    opacity: 0.5;
    transition: opacity 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.team-linkedin:hover {
    opacity: 1;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.team-linkedin svg {
    display: block;
}

/* For cards with icon-heavy (small/square) logos, render larger for visual balance */
.team-institutions--prominent img {
    height: 36px;
    max-width: 160px;
}

.team-card {
    cursor: pointer;
}


/* --- Supporters Section --- */
.supporters-section {
    background: var(--bg-secondary);
    overflow: hidden;
}

.supporters-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.supporters-marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.supporters-track {
    display: flex;
    align-items: center;
    gap: 80px;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.supporter-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 16px 24px;
}

.supporter-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 16px 24px;
    width: 180px;
    height: 80px;
}

.supporter-logo-item img {
    max-height: 50px;
    max-width: 130px;
    width: auto;
    object-fit: contain;
    opacity: 0.75;
    transition: opacity 0.4s ease;
}

.supporter-logo-item:hover img {
    opacity: 1;
}

.supporter-logo-large {
    width: 200px;
}

.supporter-logo-large img {
    max-height: 60px;
}


/* --- Contact Section --- */
.contact-section {
    background: var(--bg-primary);
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 8vw, 120px);
    align-items: start;
}

.contact-left .section-label {
    margin-bottom: 20px;
}

.contact-left .section-title {
    max-width: 400px;
}

.contact-right {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-top: 8px;
}

.contact-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.contact-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.contact-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.contact-value {
    font-size: 17px;
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1.5;
    transition: color 0.3s ease;
}

a.contact-value:hover {
    color: var(--accent-bright);
}

.contact-link {
    display: inline-block;
}


/* --- Footer --- */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

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

.footer-logo img {
    height: 24px;
    width: auto;
    opacity: 0.4;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 300;
}


/* --- Scroll Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }
.fade-in-delay-5 { transition-delay: 0.5s; }
.fade-in-delay-6 { transition-delay: 0.6s; }


/* --- Responsive --- */
@media (max-width: 968px) {
    .founding-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Reset 6-column overrides for smaller screens */
    .founding-grid > .team-card,
    .founding-grid > .team-card:nth-child(4):nth-last-child(2),
    .founding-grid > .team-card:nth-child(5):last-child {
        grid-column: auto;
    }

    .sab-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: -webkit-fill-available;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px;
        gap: 32px;
        background: #0a0a0a;
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.4s var(--ease-out);
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 18px;
    }

    .hero-title {
        font-size: clamp(32px, 8vw, 56px);
    }

    .hero-video {
        display: none;
    }

    .hero-gradient {
        background:
            radial-gradient(ellipse 60% 40% at 50% 45%, rgba(80, 100, 120, 0.15) 0%, transparent 70%),
            radial-gradient(ellipse 40% 30% at 55% 50%, rgba(60, 90, 80, 0.1) 0%, transparent 60%),
            var(--bg-primary);
    }

    .founding-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .founding-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .sab-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }


    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
