/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #0d2137;
    --primary-dark: #060f1a;
    --primary-light: #1a3f6b;
    --primary-mid: #122d4e;
    --accent: #c8940a;
    --accent-light: #e6b422;
    --accent-glow: rgba(200, 148, 10, 0.25);
    --bg-page: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-alt: #f8f9fb;
    --text-dark: #0d1a26;
    --text-medium: #3d4f63;
    --text-light: #6b7d93;
    --text-muted: #94a3b3;
    --border: #dde1e7;
    --border-light: #edf0f4;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.18);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1280px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "Inter",
        "Segoe UI",
        system-ui,
        -apple-system,
        sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(
        160deg,
        #040d18 0%,
        #0a1a2e 30%,
        var(--primary-dark) 60%,
        var(--primary-mid) 100%
    );
    color: #fff;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(
        circle,
        rgba(200, 148, 10, 0.08) 0%,
        transparent 70%
    );
    pointer-events: none;
}

.header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 32px 24px 20px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header-logos {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 8px;
    backdrop-filter: blur(4px);
}

.logo-iitg {
    height: 75px;
    width: auto;
    display: block;
}

.header-titles {
    text-align: left;
}

.header-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #fff;
    margin-bottom: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: #94a8c4;
    letter-spacing: 0.5px;
}

.header-banner {
    background: rgba(0, 0, 0, 0.25);
    padding: 18px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
    text-align: center;
}

.lab-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.lab-subtitle {
    font-size: 0.9rem;
    color: rgba(200, 148, 10, 0.7);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

/* ===== Navigation ===== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
}

.nav-link {
    padding: 15px 22px;
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    letter-spacing: 0.3px;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(13, 33, 55, 0.03);
}

.nav-link.active {
    color: var(--primary-dark);
    border-bottom-color: var(--accent);
    font-weight: 600;
    background: rgba(200, 148, 10, 0.04);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 48px 24px;
}

.intro-section {
    text-align: center;
    margin-bottom: 56px;
    padding: 48px 32px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.intro-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-dark), var(--accent));
}

.intro-section h2 {
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.intro-section p {
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-medium);
    font-size: 1.05rem;
    line-height: 1.75;
}

/* ===== Section Title ===== */
.section-title {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 32px;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 1px;
}

/* ===== Experiments Grid ===== */
.experiments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.experiment-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    transition: all var(--transition);
    border: 1px solid var(--border-light);
    position: relative;
}

.experiment-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-mid), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.experiment-card:hover::before {
    opacity: 1;
}

.experiment-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-number {
    background: linear-gradient(
        170deg,
        var(--primary-mid),
        var(--primary-dark)
    );
    color: var(--accent-light);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    position: relative;
}

.card-number::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid rgba(200, 148, 10, 0.15);
    border-radius: 4px;
}

.card-content {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-content h3 {
    font-size: 1.02rem;
    color: var(--primary-dark);
    line-height: 1.35;
    font-weight: 600;
}

.card-content p {
    font-size: 0.88rem;
    color: var(--text-medium);
    line-height: 1.55;
    flex: 1;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(
        135deg,
        var(--primary-mid),
        var(--primary-light)
    );
    color: #fff !important;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    transition: all var(--transition);
    align-self: flex-start;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(13, 33, 55, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(
        135deg,
        var(--primary-dark),
        var(--primary-mid)
    );
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 33, 55, 0.3);
    color: #fff !important;
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(180deg, var(--primary-dark) 0%, #040d18 100%);
    color: #8899b4;
    margin-top: auto;
    position: relative;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(200, 148, 10, 0.4),
        transparent
    );
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 36px;
    padding: 48px 24px 32px;
}

.footer-section h4 {
    color: #c0cfe0;
    font-size: 0.95rem;
    margin-bottom: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.footer-section p {
    font-size: 0.85rem;
    margin-bottom: 6px;
    opacity: 0.75;
    transition: opacity var(--transition);
}

.footer-section p:hover {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    padding: 20px 24px;
    font-size: 0.82rem;
    opacity: 0.65;
}

.footer-bottom a {
    color: var(--accent-light);
    font-weight: 600;
}

.footer-bottom a:hover {
    color: #fff;
}

/* ===== Experiment Page ===== */
.experiment-page {
    max-width: 1140px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.experiment-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-medium) !important;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.back-link:hover {
    color: var(--primary-dark) !important;
    background: var(--bg-card-alt);
    border-color: var(--accent);
}

.experiment-header h2 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.experiment-header .separator,
.experiment-header a[href="about.html"] {
    color: var(--text-light);
    font-size: 0.9rem;
}

.experiment-header a[href="about.html"] {
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.experiment-header a[href="about.html"]:hover {
    border-color: var(--accent);
    color: var(--primary-dark) !important;
}

.experiment-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.ruffle-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    background: #0a0a0a;
    min-height: 500px;
    border-bottom: 1px solid var(--border);
}

.ruffle-wrapper ruffle-player,
.ruffle-wrapper ruffle-embed {
    width: 100%;
    max-width: 960px;
}

/* ===== Ruffle Toolbar ===== */
.ruffle-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1a1a2e;
    border-bottom: 1px solid #333;
}

.btn-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-toolbar:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: var(--accent);
}

.btn-toolbar svg {
    flex-shrink: 0;
}

/* ===== Experiment Info ===== */
.experiment-info {
    padding: 24px 28px;
    background: var(--bg-card-alt);
}

.experiment-info h3 {
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.experiment-info p {
    color: var(--text-medium);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* ===== Theory Section ===== */
.theory-section {
    padding: 28px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
}

.theory-section h3 {
    color: var(--primary-dark);
    margin-bottom: 16px;
    font-size: 1.05rem;
    font-weight: 600;
}

.theory-content h3 {
    color: var(--primary-mid);
    font-size: 1rem;
    margin: 18px 0 8px;
}

.theory-content h4 {
    color: var(--primary-mid);
    font-size: 0.95rem;
    margin: 14px 0 6px;
}

.theory-content p {
    color: var(--text-medium);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.theory-content ul {
    margin: 8px 0 16px 20px;
    color: var(--text-medium);
    font-size: 0.9rem;
    line-height: 1.8;
}

.theory-content ul li::marker {
    color: var(--accent);
}

.theory-content strong {
    color: var(--primary-dark);
}

.experiment-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
    gap: 12px;
}

.btn-nav {
    padding: 9px 20px;
    background: var(--bg-card);
    color: var(--primary-mid);
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: all var(--transition);
    letter-spacing: 0.2px;
}

.btn-nav:hover {
    background: var(--primary-mid);
    color: #fff;
    border-color: var(--primary-mid);
    box-shadow: 0 4px 12px rgba(13, 33, 55, 0.2);
}

.btn-nav:disabled,
.btn-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.experiment-select {
    padding: 9px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    color: var(--text-dark);
    background: var(--bg-card);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    font-family: inherit;
}

.experiment-select:hover {
    border-color: var(--primary-light);
}
.experiment-select:focus {
    border-color: var(--accent);
}

/* ===== About Page ===== */
.about-section {
    margin-bottom: 48px;
}

.about-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-mid), var(--accent));
    opacity: 0.5;
}

.about-card p {
    color: var(--text-medium);
    font-size: 1.02rem;
    line-height: 1.8;
}

.features-list {
    margin-top: 18px;
    padding-left: 24px;
    color: var(--text-medium);
    line-height: 2.2;
    font-size: 0.98rem;
    list-style: none;
}

.features-list li {
    position: relative;
    padding-left: 20px;
}

.features-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* ===== People Grid ===== */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.person-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 28px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.person-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-mid), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.person-card:hover::before {
    opacity: 1;
}
.person-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.person-photo-wrapper {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1;
    margin: 0 auto 18px;
}

.person-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 16px rgba(13, 33, 55, 0.2);
    border: 3px solid var(--border-light);
    transition: all var(--transition);
}

.person-card:hover .person-photo {
    border-color: var(--accent);
    box-shadow: 0 6px 24px rgba(200, 148, 10, 0.3);
}

.person-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--primary-mid),
        var(--primary-light)
    );
    color: var(--accent-light);
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 4px 16px rgba(13, 33, 55, 0.2);
    letter-spacing: 1px;
}

.person-card h3 {
    font-size: 1.08rem;
    color: var(--primary-dark);
    margin-bottom: 6px;
    font-weight: 600;
}

.person-dept {
    font-size: 0.88rem;
    color: var(--text-medium);
    margin-bottom: 2px;
}

.person-inst {
    font-size: 0.88rem;
    color: var(--text-medium);
    margin-bottom: 10px;
    font-weight: 500;
}

.person-contact,
.person-email {
    font-size: 0.84rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

/* ===== Contact Section ===== */
.contact-card {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-medium);
    font-size: 1.02rem;
    padding: 12px 24px;
    background: var(--bg-card-alt);
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}

.contact-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.contact-icon {
    font-size: 1.2rem;
    color: var(--accent);
}

/* ===== Footer Credit ===== */
.footer-credit {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.55;
}

.footer-credit a {
    color: var(--accent-light);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 24px 16px 16px;
    }

    .header-titles {
        text-align: center;
    }

    .header-title {
        font-size: 1.1rem;
    }
    .lab-title {
        font-size: 1.25rem;
    }

    .experiments-grid {
        grid-template-columns: 1fr;
    }
    .experiment-card {
        flex-direction: column;
    }

    .card-number {
        min-width: 100%;
        padding: 14px 0;
        font-size: 1.3rem;
    }

    .nav-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-link {
        padding: 12px 14px;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .experiment-nav {
        flex-direction: column;
        gap: 10px;
    }

    .people-grid {
        grid-template-columns: 1fr;
    }

    .intro-section {
        padding: 32px 20px;
    }
    .intro-section h2 {
        font-size: 1.35rem;
    }
}
